Casty
Casty copied to clipboard
Play .m3u8 / HLS protocol on chromecast
Hi!
I'm following the tutorial for your library. I could connect to the chromecast successfully, if I play an mp4 video it works fine, but when i switch to an .m3u8 content it doesn't play it and no error is shown.
I wanted to ask you if HLS is supported in this project.
This is my code for playing a video. This is a sample video and not the real one since it's copyrighted. CORS is enabled with all the required headers, i'm pretty sure about it.
String testUrl = "http://cdn-fms.rbs.com.br/vod/hls_sample1_manifest.m3u8";
MediaData mediaData = new MediaData.Builder(testUrl)
.setStreamType(MediaData.STREAM_TYPE_BUFFERED) //required
.setContentType("application/x-mpegURL")
.setMediaType(MediaData.MEDIA_TYPE_GENERIC)
.setTitle(video.getName())
.setSubtitle(video.getDescription())
.addPhotoUrl(video.getThumbnail())
.build();
casty.getPlayer().loadMediaAndPlay(mediaData);
Thank you very much!
Still have no answer about this query ?
Try changing "application/x-mpegURL" to "application/x-mpegurl"
Ignore the above, the solution to mine: use https (ssl enabled url) and stream must not have invalid CORS.
Hey! Thanks for your info.
Unfortunately I'm not working on that project any more. I recall it was a CORS issue from the server but I'm not sure