In the Chromecast Android docs, the argument to MediaInfo.Builder is called contentId
. In every example I've seen, contentId
is passed a URL. Must contentId
be a URL, or are there other ways to address content?
Asked
Active
Viewed 1,236 times
2

plátano plomo
- 1,672
- 1
- 18
- 26
1 Answers
1
It should be the URL of the stream; note that the media needs to reside on some web server so there is no other generic way of addressing that for a cast device.

Ali Naddaf
- 16,951
- 2
- 21
- 28
-
Is it possible to put the media stream on a webserver hosted on the Android device and set `contentId` to the IP address of that webserver? – plátano plomo Sep 01 '16 at 13:50
-
1Yes, in fact that is the only way you can cast local content. Note that (1) You need to use IP address and no named url for your media served from your device, (2) You cannot serve adaptive content (or even closed caption) this way since they would need https (i.e. valid certificates) which won't work in this scenario. However, casting/serving mp4/mp3/images work fine but be aware of the power consumption on your phone and that it has to stay up for the whole duration/ – Ali Naddaf Sep 01 '16 at 16:48