How to Chromecast from a Mac to a TV
A Mac has no Cast button. This video shows a native player, written in Osprey, that finds every Chromecast and Google TV on the network and plays a local MP3 on one with full controls.
The full write-up, with the code and its limits, is How to Chromecast from a Mac to a TV.
Osprey is actively evolving.
Transcript
- A Mac has no Cast button. Chrome casts a browser tab, but it won't play an MP3 from your Mac on the TV with proper controls. This native player does.
- It finds every Chromecast and Google TV on your network by name. Open an MP3, pick a TV, and press play.
- Pause, seek, volume and speed all work, and the controls show what the TV reports. With ffmpeg installed, the TV shows a moving spectrum of the music.
- A Chromecast never receives your file directly.
- The player finds TVs, opens a TLS session, and launches the default media receiver. Then it serves the file over HTTP from your Mac, and tells the TV where to fetch it.
- Discovery uses the dns-sd tool that macOS already ships. Nothing extra to install.
- The whole interface is one data file of state machines and skins. The only code is this adapter, which answers each request with the Chromecast package.
- An unknown request becomes an error on screen, never a silent no-op.
- Every byte goes through one algebraic effect. In the tests, a handler plays the TV, so four whole journeys run with no window and no network.
- All four pass.
- What to know first. It plays MP3 files only, it runs on macOS, and it does not verify the TV's certificate.
- Build Osprey, then open the player. Osprey is actively evolving. Try it on your projects, and tell us what breaks.