Search code examples
androidaudiochromecastgoogle-castandroid-mediasession

Android Chromecast: Casting local audio file fails


I'm trying to cast a local device audio file to the Chromecast device. I have a URI, for example content://settings/system/alarm_alert and when casting it to Chromecast it simply does not work - RemoteMediaPlayer returns result of 2100, which means FAILED. The same approach but with files from the server, for example http://storage.googleapis.com/automotive-media/Awakening.mp3 returns SUCCESS.

Audio playback is implemented the same way as in UAMP sample. Is there any way to cast local audio files? I've heard the way with setting up local Android server however this sounds a bit complicated. Any ideas?


Solution

  • Using a local embedded server for streaming local content is the only way.