KirovBvulgaru / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Need a way to find the live point in a live HLS stream #134

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When using the MediaPlayer library with a live HLS stream, there's no good way 
to find the live point.

By digging through the object tree, I was able to find a way to get that 
information, but I imagine those obfuscated names are generated by Closure 
Compiler and subject to change.

mediaPlayer.Gb.g.la.L.reduce(function( prev, curr ){
  return ( typeof prev === 'number' ? prev : prev.duration ) + curr.duration;
});

Being able to find the live point is critical, because without it there's no 
way to know what's seekable.

Original issue reported on code.google.com by kenni...@gmail.com on 11 Feb 2014 at 3:57

GoogleCodeExporter commented 8 years ago

Original comment by anad...@google.com on 11 Feb 2014 at 4:01

GoogleCodeExporter commented 8 years ago
Thinking about this a bit more, I think the preferred resolution would be to 
periodically update the MediaSource's duration as the m3u8 is updated.

That way, you could just look at the video element's duration attribute and 
know what's seekable.

Original comment by kenni...@gmail.com on 11 Feb 2014 at 5:28

GoogleCodeExporter commented 8 years ago
Tell us what information you need to be exposed.  Is it the available time 
range covered by the segments in the the currently loaded playlist?

Original comment by anad...@google.com on 11 Feb 2014 at 7:08

GoogleCodeExporter commented 8 years ago
Yeah, that's exactly it. Thanks.

Original comment by kenni...@gmail.com on 11 Feb 2014 at 7:33

GoogleCodeExporter commented 8 years ago
We currently have an internal task in the queue to expose the information that 
I had mentioned. Hopefully we will get to that soon but I can't commit to any 
date yet. I'll keep this issue open so I can update you when it is implemented.

Original comment by anad...@google.com on 12 Feb 2014 at 7:20

GoogleCodeExporter commented 8 years ago
I just wanted to add an observation from the way that iOS and airplay have 
developed with live streams. Please do not assume that because a playlist 
doesn't have an #EXT-X-ENDLIST then it should be treated as live.

This is a common case where a movie is being converted, or a conference 
streamed,  so the playlist isn't complete yet. Early versions of iOS assumed it 
was live, and skipped to the end segments (Android does the same). In many 
cases, the user wants to be able to start at the beginning and have seek 
enabled for the full playlist.

providing the current duration seems like a good solution so that the player 
can skip to the end if appropriate.

Original comment by rob.jon...@gmail.com on 28 Feb 2014 at 5:38

GoogleCodeExporter commented 8 years ago
The next update to media player library will provide the ability to start 
playback at a live point (within 3 segment durations from the end per HLS 
specification) by passing in Infinity as initialTime to player.load.  Please 
stay tuned.

Original comment by vadi...@google.com on 8 Mar 2014 at 1:37

GoogleCodeExporter commented 8 years ago
This change is now live at

http://www.gstatic.com/cast/sdk/libs/mediaplayer/0.3.0/media_player.js

Original comment by vadi...@google.com on 12 Mar 2014 at 5:06

GoogleCodeExporter commented 8 years ago

Original comment by anad...@google.com on 1 Aug 2014 at 10:53