HTML5 video - Safari (Mac) - live HLS stream - seek in live buffer

Posted by bsnote on Stack Overflow See other posts from Stack Overflow or by bsnote
Published on 2012-07-04T09:12:32Z Indexed on 2012/07/04 9:15 UTC
Read the original article Hit count: 476

Filed under:
|
|
|
|

I have the following HTML:

<head>
</head>
<body>
<button type="button" onclick="onSeek();">Seek</button>
<video id="video" src="http://<host>/somevideo.m3u8" autoplay controls>
</video>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>    
  function onSeek() {
    var video = $('#video')[0];
    video.currentTime = -300;
  }
</script>
</body>

When I open the page, the m3u8 playlist has already about 100 media segments (5 min). Since it's a live video it starts playing from one of the last media segments and video.currentTime is set to 0. video.seekable.start(i) and video.seekable.end(i) shows the seekable range which is 0..currentTime. How can I seek to the previous media segments, say 5 min back? video.currentTime = -300 doesn't work. It resets currentTime to 0.

© Stack Overflow or respective owner

Related posts about html5

Related posts about video