Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.16k stars 1.68k forks source link

PLAYBACK_SEEKING_ABORTED event #4414

Closed JPDelprat closed 7 months ago

JPDelprat commented 8 months ago

There are currently two media player events related to seeking:

With such events, when a PLAYBACK_SEEKING occurs, I would like to wait for PLAYBACK_SEEKED event, before calling 'seek()' again. This ensures that video 'picture' is updated in case of continuous seek() calls (when moving a seeking slider for instance).

However, I suppose there are some cases I can get the PLAYBACK_SEEKING event without having the corresponding PLAYBACK_SEEKED event (probably when attaching a new source and probably in other cases such as failures...).

Is it possible to have a new 'PLAYBACK_SEEKING_ABORTED' event, which would guarantees that in case of PLAYBACK_SEEKING, I get either PLAYBACK_SEEKED or PLAYBACK_SEEKING_ABORTED event ?

If it's not possible, could you tell me in which cases I won't get PLAYBACK_SEEKED event after a PLAYBACK_SEEKING event (which events will indicate that PLAYBACK_SEEKED won't be called) ?

Thanks in advance

dsilhavy commented 8 months ago

PLAYBACK_SEEKING and PLAYBACK_SEEKED are events that are dispatched by dash.js based on native events thrown by the HTML video element. Essentially, we are just passing them through:

videoModel.addEventListener('seeking', _onPlaybackSeeking);
videoModel.addEventListener('seeked', _onPlaybackSeeked);

I don't want to maintain the state for aborted seeks as I expect a lot of drawbacks when trying to figure out if a seek was aborted or not. Some platforms might not even throw a seeked event or the event is not thrown consistently in certain situations (thinking about SmartTVs and Set-Top boxes).

That being said I think you can expect the seeked event to be triggered unless you attach a new MPD while a seek is still in progress.

JPDelprat commented 8 months ago

I understand and completely agree. Thank you very much for your very clear answer.