Remove All Ads from XDA
Win Honor 9 Lite

How can I play the last segment (.ts) of m3u8 on Chromecast?

15 posts
Thanks Meter: 2
By hulak_aleksandr, Junior Member on 13th May 2017, 10:45 AM
Post Reply Email Thread
I develop an Android app that plays live TV streams (HLS). So I have a link to .m3u8 file, that contains three links to another m3u8 files (for different BANDWIDTH), that have a list of chunks (.ts). Each chunk is a part of last 10 minutes of recorded TV stream.

Here is my code in sender app:

MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
movieMetadata.putString("mediaType", "video");
movieMetadata.putString(MediaMetadata.KEY_TITLE, "some title");
movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, "some subtitle");

MediaInfo mediaInfo = new MediaInfo.Builder("myurl.m3u8")

remoteMediaClient.load(mediaInfo, true);
The problem is that Default Receiver plays FIRST chunk, but has to play the LAST one as it is LIVE stream. This results in a 10-minute delay. I tried to set a specific position in method load(...) and use STREAM_TYPE_BUFFERED, but there is no effect. Any suggestions?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes