Comments (9)
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.
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.
@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.
@mangui - confirming 2nd scenario - seeking to 'unbuffered' positions on replay - as fixed. Great!
from hls.js.
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.
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.
@blacktrash scenario 2 should be fixed now, could you plz confirm that it is also working on your side ?
thanks
from hls.js.
@mangui works like a charm! 👍
from hls.js.
great. closing
from hls.js.
Related Issues (20)
- audio SourceBuffer error. MediaSource readyState: ended HOT 10
- initial segments are missing audio causes video playback stuck HOT 2
- Low Latency playback - recovering after stalls HOT 4
- AV1 change level freeze image until next segment HOT 8
- HLS.js playlist could not be loaded and the video doesn't work on my web site HOT 1
- Documentation error on "stream-controller.ts" in "design.md" under "docs" folder
- Stop Loading Video Stream HOT 6
- LG C2 OLED Dolby Vision HOT 4
- The video stops for a moment, but the audio continues to play. HOT 10
- does hls.js support data uri for playback? HOT 1
- Allow getting the current URL HOT 4
- CHUNK_DEMUXER_ERROR_APPEND_FAILED when playing HEVC video stream HOT 2
- fragParsingError Demux HOT 1
- HLS fails to stream video with name containing U+3000 character. HOT 2
- Adding HLS subtitles separately HOT 2
- When I start my server and stream from OBS, the video loads ~10 sec backwards. HOT 9
- CMCD "nor" and "d" should return part details during Low-Latency HLS streaming
- The problem of drawing frame images on the canvas HOT 7
- Duplicate Captions for MP4 Content HOT 12
- Can I work with frames or merge fragments before play? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hls.js.