Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playbackEnded not fired on set top box #4404

Open
4 of 5 tasks
bitboxer opened this issue Mar 5, 2024 · 3 comments
Open
4 of 5 tasks

playbackEnded not fired on set top box #4404

bitboxer opened this issue Mar 5, 2024 · 3 comments

Comments

@bitboxer
Copy link
Contributor

bitboxer commented Mar 5, 2024

Environment
Steps to reproduce
  1. We used this example code: https://gist.github.com/bitboxer/ac86da9e80e57efaa338739f1ae373de
  2. Open the page on a set top box of a big telecommunication provider
  3. Wait till the video is at the end.
Observed behavior

As seen in the log output, the playbackEnded is never fired, instead you see that the GapController tries to seek to a position close to the end and then tries to play from there. Somehow this set top box does not like that.

Console output
at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackTimeUpdated
at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackProgress
at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackTimeUpdated
at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackProgress
4at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackTimeUpdated
[25913][PlaybackController] Native video element event: waiting 
at https://cdn.dashjs.org/latest/dash.all.min.js [27178][GapController] Jumping to end of stream because of gap from 634.197311 to 634.566. Gap duration: 0.3686890000000176 
at https://cdn.dashjs.org/latest/dash.all.min.js [27180][PlaybackController] Requesting seek to time: 634.566 
[27182][PlaybackController] Seeking to: 634.566 
at https://cdn.dashjs.org/latest/dash.all.min.js [27188][Stream] onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED 
at https://cdn.dashjs.org/latest/dash.all.min.js [27190][StreamController] Stream with id defaultId_0 finished buffering 
at https://cdn.dashjs.org/latest/dash.all.min.js [27190][StreamController] [onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController. 
at https://cdn.dashjs.org/latest/dash.all.min.js [27191][FragmentModel][audio] abort requests 
at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackSeeking
at https://tunnel4.player-dev.tvnow.de/?CH=1 {seekTime: 634.566, streamId: 'defaultId_0', type: 'playbackSeeking'}
at https://cdn.dashjs.org/latest/dash.all.min.js [27199][BufferController][audio] audio: Removing buffer from: 609.621333 to 614.566 
at https://cdn.dashjs.org/latest/dash.all.min.js [27219][BufferController][audio] onRemoved buffer from: 609.621333 to 614.566 
at https://cdn.dashjs.org/latest/dash.all.min.js [27221][BufferController][audio] Buffered range: 614.570666 - 634.35475, currentTime =  634.566 
at https://cdn.dashjs.org/latest/dash.all.min.js [27224][BufferController][audio] Waiting for more buffer before starting playback 
at https://cdn.dashjs.org/latest/dash.all.min.js [27227][SourceBufferSink][audio] Updated append window for audio. Set start to 0 and end to 634.576 
[27237][ScheduleController][audio] Quality has changed, get init request for representationid = bbb_a64k 
at https://cdn.dashjs.org/latest/dash.all.min.js [27265][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id defaultId_0 and media type audio - Url: https://dash.akamaized.net/akamai/bbb_30fps/bbb_a64k/bbb_a64k_0.m4a  
at https://cdn.dashjs.org/latest/dash.all.min.js [27267][BufferController][audio] Append Init fragment audio  with representationId: bbb_a64k  and quality: 0 , data size: 633 
at https://cdn.dashjs.org/latest/dash.all.min.js [27273][StreamProcessor][audio] Appended bytes for audio and stream id defaultId_0 
at https://cdn.dashjs.org/latest/dash.all.min.js [27274][StreamProcessor][audio] [audio] lastInitializedRepresentationInfo changed to 0 
[27276][ScheduleController][audio] Media segment needed for audio and stream id defaultId_0 
at https://cdn.dashjs.org/latest/dash.all.min.js [27277][DashHandler][audio] Index for time 634.566 is 158 
at https://cdn.dashjs.org/latest/dash.all.min.js [27278][StreamProcessor][audio] Next fragment request url for stream id defaultId_0 and media type audio is https://dash.akamaized.net/akamai/bbb_30fps/bbb_a64k/bbb_a64k_159.m4a 
at https://cdn.dashjs.org/latest/dash.all.min.js [27298][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id defaultId_0 and media type audio - Url: https://dash.akamaized.net/akamai/bbb_30fps/bbb_a64k/bbb_a64k_159.m4a  
at https://cdn.dashjs.org/latest/dash.all.min.js [27301][Stream] onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED 
at https://cdn.dashjs.org/latest/dash.all.min.js [27302][StreamController] Stream with id defaultId_0 finished buffering 
at https://cdn.dashjs.org/latest/dash.all.min.js [27303][StreamController] [onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController. 
at https://cdn.dashjs.org/latest/dash.all.min.js [27303][MediaSourceController] call to mediaSource endOfStream 
at https://cdn.dashjs.org/latest/dash.all.min.js [27304][BufferController][audio] checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id defaultId_0 and type audio 
at https://cdn.dashjs.org/latest/dash.all.min.js [27304][BufferController][audio] Buffered range: 614.570666 - 634.35475, currentTime =  634.566 
[27305][BufferController][audio] Got enough buffer to start 
at https://cdn.dashjs.org/latest/dash.all.min.js [27306][StreamProcessor][audio] Appended bytes for audio and stream id defaultId_0 
at https://tunnel4.player-dev.tvnow.de/?CH=1 DashJS playbackProgress
Expected behavior

The player fires a playbackEnded-Event.

I can help to debug this issue, but currently I am not sure what the role of the GapController is in here.

@bitboxer bitboxer added the Bug label Mar 5, 2024
@bitboxer
Copy link
Contributor Author

bitboxer commented Mar 5, 2024

Sadly I cannot open the reference page because it's a set-top-box

@bitboxer
Copy link
Contributor Author

@dsilhavy would love to get a hint how I could debug this or figure out a bugfix for this.

@dsilhavy
Copy link
Collaborator

It looks like the buffer is not fully filled until the very end. What values do you get when you pause playback shortly before the end and query the buffer level?

var vid = document.querySelector('video')
vid.buffered.start(0)
625.664
vid.buffered.end(0)
634.566666

For further debugging also try to disable gap jumping and check if the ended event is fired then or if the player stays in waiting state: https://cdn.dashjs.org/latest/jsdoc/module-Settings.html#~Gaps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants