Casty icon indicating copy to clipboard operation
Casty copied to clipboard

Play .m3u8 / HLS protocol on chromecast

Open agusvazquez opened this issue 7 years ago • 4 comments

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!

agusvazquez avatar Jan 18 '18 18:01 agusvazquez

Still have no answer about this query ?

salmanashraf avatar Oct 18 '18 12:10 salmanashraf

Try changing "application/x-mpegURL" to "application/x-mpegurl"

mokoshalb avatar Oct 04 '19 08:10 mokoshalb

Ignore the above, the solution to mine: use https (ssl enabled url) and stream must not have invalid CORS.

mokoshalb avatar Oct 06 '19 00:10 mokoshalb

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

agusvazquez avatar Oct 06 '19 04:10 agusvazquez