Friday, November 18, 2016

Gotcha of the Day: Elegantly Casting YouTube to Chromecast Audio

I'm really enjoying our kitchen audio setup. We've now got 4 of these speakers, each hooked up to its own Chromecast Audio, spread throughout the first floor of our house. Using both iHeartRadio and TuneIn, I can effortlessly blast the tunes and here them wherever I happen to be.

One of the only disappointments in the setup is that by default, you can't cast YouTube to an Chromecast Audio device. If you've got the upgraded version of YouTube, it's possible, but I'm not ready to commit to $9.99 per month just so I can stream audio from YouTube. Thing is, when I want to hear a specific song, YouTube is usually the place to find it.

The standard work-around for this is to cast your device's audio and then hit play on YouTube. This isn't ideal, as it means that you're streaming audio from your device, rather than having Chromecasts pull down the data directly from YouTube.

Fortunately, I've found a far more elegant way to handle this. The solution: Tasker, of course. Specifically AutoCast, which is a Tasker plugin that allows you to take programmatic control of your Chromecast devices.

Turns out, as I had hoped, the limitation on streaming YouTube from a Chromecast Audio devices lies in the YouTube app, not the Chromecast device itself. I essentially followed the tutorials here and worked up an AutoShare + AutoCast rule that sends the YouTube video URL to my Chromecast Audio. Yes, you read that right: I'm sending a video URL to a device that only streams audio. Still, it *Just Works*.

Here's some screenshots of the recipe:

So I now have the ability to hit the Share button on YouTube, select AutoShare Command and the song will start playing on the speaker of my choice.

However, there are some limitations with this setup:

You need the beta version of AutoCast to access Chromecast Audio devices. Luckily, signing up for beta access is easy.

Occasionally playback doesn't start when I try casting a song. The fix I've used so far is to prime the Chromecast device by casting to it from a standard app (say, TuneIn), and then casting to it from my AutoCast hack.

I can only broadcast to a single speaker, not a group.

This last point is a real pain, as the magic of Chromecast audio is when you hear your tunes emanating from multiple locations at the same time. However, the AutoCast community is active, so perhaps this issue will be addressed.

Still, next time I'm itching to rock out to a specific song, I now have a quick and easily way to do so.