Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Play .m3u8 / HLS protocol on chromecast #7

Open
agusvazquez opened this issue Jan 18, 2018 · 4 comments
Open

Play .m3u8 / HLS protocol on chromecast #7

agusvazquez opened this issue Jan 18, 2018 · 4 comments
Labels

Comments

@agusvazquez
Copy link

agusvazquez commented Jan 18, 2018

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!

@salmanashraf
Copy link

Still have no answer about this query ?

@mokoshalb
Copy link

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

@mokoshalb
Copy link

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

@agusvazquez
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants