Giter Site home page Giter Site logo

VOD replay problems about hls.js HOT 9 CLOSED

video-dev avatar video-dev commented on August 19, 2024
VOD replay problems

from hls.js.

Comments (9)

mangui avatar mangui commented on August 19, 2024

thanks for reporting @blacktrash,
video ended event is indeed indirectly triggered by hls.js :
it is fired when stream type is VoD and currentPosition is near stream duration (less than 200ms from stream duration)
see here : https://github.com/dailymotion/hls.js/blob/master/src/controller/buffer-controller.js#L533-L539

the thing is that there might be some drift between playlist duration and end of buffer position.
I checked video stats with this playlist : http://dailymotion.github.io/hls.js/demo/?src=http%3A%2Fx%2Fwww.streambox.fr%2Fplaylists%2Fx36xhzz%2Fx36xhzz.m3u8

duration : 634.583955
seekable : [0,634.583955]
played : [0,634.173929]
=> playback is stopping 400ms before duration => video Ended is not fired.

the algorithm needs to be reviewed : for example, if the playhead is not moving although video is not paused and playhead is located in last buffered VoD fragment, consider that video is ended.

from hls.js.

phloxic avatar phloxic commented on August 19, 2024

Yes, that's the case when video.ended is not fired.

However, the 2nd case, at http://dailymotion.github.io/hls.js/demo/?src=http%3A%2F%2Fwww.streambox.fr%2Fplaylists%2Fx212fsj%2Fx212fsj.m3u8 it is fired, but there is some buffer management problem on replay: If you seek to a previously unbuffered position the behaviour is like with progressive download: wait until everything from 0 to seek position is buffered. It's strange, because if you just seek to 0 this does not happen.

from hls.js.

mangui avatar mangui commented on August 19, 2024

@blacktrash plz recheck your second scenario with hls.js/master, it should work now.
i will think about a solution for case 1.

from hls.js.

phloxic avatar phloxic commented on August 19, 2024

@mangui - confirming 2nd scenario - seeking to 'unbuffered' positions on replay - as fixed. Great!

from hls.js.

phloxic avatar phloxic commented on August 19, 2024

case 1 involves a problem with end of video detection, which manifests itself for instance with playlists where some items get stuck, especially when you don't seek previously, but just play through.
Here's a (temporary) demo: http://flowplayer.blacktrash.org/fp6/showreels.html - just run the first player, and at some point the player is stuck at the end of a video.

from hls.js.

mangui avatar mangui commented on August 19, 2024

thanks @blacktrash i know how to fix this, I will try to find some time soon to trigger video ended properly, even if playback head does not come close to video duration.

from hls.js.

mangui avatar mangui commented on August 19, 2024

@blacktrash scenario 2 should be fixed now, could you plz confirm that it is also working on your side ?
thanks

from hls.js.

phloxic avatar phloxic commented on August 19, 2024

@mangui works like a charm! 👍

from hls.js.

mangui avatar mangui commented on August 19, 2024

great. closing

from hls.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.