-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
What version of Hls.js are you using?
1.6.14
What browser (including version) are you using?
Chromium Version 142.0.7444.162 (Official Build) stable (64-bit)
What OS (including version) are you using?
Linux OpenSuse Tumbleweed
Test stream
No response
Configuration
const config = {
debug: true
};Additional player setup steps
const player = new Hls(config);
player.attachMedia(videoElement);
Checklist
- The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
- The issue occurs in the stable client (latest release) on https://hlsjs.video-dev.org/demo and not just on my page
- The issue occurs in the latest client (main branch) on https://hlsjs-dev.video-dev.org/demo and not just on my page
- The stream has correct Access-Control-Allow-Origin headers (CORS)
- There are no network errors such as 404s in the browser console when trying to play the stream
Steps to reproduce
- Add an event listener to the video element for "ended", e.g:
videoElement.addEventListener("ended", (ev) => { console.log("**** ENDED"); }); - Play a stream that has HLS Interstitial ads (VOD or live) and wait for a an interstitial break to finish with the stream still playing
- Check the log to see whether "ended" has been signalled with the stream still playing
Expected behaviour
ended should not be signalled at the end of an interstitial break if the stream is still playing. Presumably, because the interstitial player is attached to the video element, it signals ended once it has no more data. However, this does not conform to the spec.
The HTML5 spec states that ended should be sent when playback has ended, which is defined as "The current playback position is the end of the media resource":
https://html.spec.whatwg.org/multipage/media.html#ended-playback
Media resource is defined here:
"The term media resource is used to refer to the complete set of media data, e.g. the complete video file, or complete audio file"
An interstitial ad break does not meet the definition of a media resource.
What actually happened?
The ended event gets called after the interstitial break when the stream is still playing.
Console output
Not applicable.