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

Playback stalls when seeking near the end of a period with a gap #3713

Closed
5 tasks done
lkinasiewicz opened this issue Jul 23, 2021 · 11 comments
Closed
5 tasks done

Playback stalls when seeking near the end of a period with a gap #3713

lkinasiewicz opened this issue Jul 23, 2021 · 11 comments
Assignees
Labels
Milestone

Comments

@lkinasiewicz
Copy link
Contributor

lkinasiewicz commented Jul 23, 2021

Environment
  • Dash.js version: 4.0.0
  • Browser name/version: Chrome 92.0.4515.107
  • OS name/version: MacOS Big Sur
Steps to reproduce
  1. Start playback of a static, multi-period manifest.
  2. Seek near the end of the period that has a gap in the end. E.g. when audio representation ends in 1798.000974 and video representation ends in 1798.055724, seek to 1798.
Observed behavior

Playback stalls, no more data is being buffered. In the logs we can see that the player downloaded the last segment of the representation and does not switch to the next period. It keeps trying to generate a request for the next segment. Looks like the problem is in DashHandler - isMediaFinished keeps returning false in this case.

Maybe instead of this logic:

if (lastSegment.presentationStartTime + lastSegment.duration > bufferingTime) {
return false;
}

it should check if there are more segments in current representation when streaming static manifest? I think it would be more obvious thing to do, but maybe there are some edge cases that I am not aware of?

Console output
[119312][StreamController] Switch to stream 5/1. Seektime is 3996, current playback time is 3996. Seamless period switch is set to true 
[119314][Stream] No text data. 
[119314][Stream] No muxed data. 
[119314][Stream] No image data. 
[119314][SourceBufferSink][video] Updated append window for video. Set start to 3995.897376905 and end to 4026.204209561 
[119314][SourceBufferSink][video] Set MSE timestamp offset to 3995.997376905 
[119315][SourceBufferSink][audio] Updated append window for audio. Set start to 3995.897376905 and end to 4026.204209561 
[119315][SourceBufferSink][audio] Set MSE timestamp offset to 3995.997376905 
[119315][AbrController] Stream ID: 5/1 [video] switch from 0 to 6/6 (buffer: 0) . 
[119316][StreamProcessor][video] Preparing quality switch for type video 
[119316][FragmentModel][video] abort requests 
[119322][ScheduleController][video] Quality has changed, get init request for representationid = 6 
[119323][ScheduleController][audio] Quality has changed, get init request for representationid = 0 
[119406][BufferController][video] Waiting for more buffer before starting playback 
[119407][BufferController][audio] Waiting for more buffer before starting playback 
[119994][PlaybackController] Requesting seek to time: 1798 
[119995][PlaybackController] Seeking to: 1798 
[119995][FragmentModel][video] abort requests 
[119995][StreamProcessor][video] onFragmentLoadingAbandoned request: https://.../mvp/ads/2731706/dash/mpeg4_1080p_high/init.mp4 has been aborted 
[119996][FragmentModel][audio] abort requests 
[119996][StreamProcessor][audio] onFragmentLoadingAbandoned request: https://.../mvp/ads/2731706/dash/mpeg4_audio/init.mp4 has been aborted 
[119996][FragmentModel][video] abort requests 
[119996][FragmentModel][audio] abort requests 
[119996][StreamController] Switch to stream 2/5. Seektime is 1798, current playback time is 1798. Seamless period switch is set to true 
[119998][Stream] No text data. 
[119998][Stream] No muxed data. 
[119998][Stream] No image data. 
[119998][SourceBufferSink][video] Updated append window for video. Set start to 1767.84230842 and end to 1798.065725091 
[119999][SourceBufferSink][video] Set MSE timestamp offset to 1767.94230842 
[119999][SourceBufferSink][audio] Updated append window for audio. Set start to 1767.84230842 and end to 1798.065725091 
[119999][SourceBufferSink][audio] Set MSE timestamp offset to 1767.94230842 
[120001][ScheduleController][video] Quality has changed, get init request for representationid = 5 
[120003][ScheduleController][audio] Quality has changed, get init request for representationid = 1 
[120749][BufferController][video] Append Init fragment video  with representationId: 5  and quality: 6 , data size: 865 
[120750][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: https://.../mvp/ads/3355016/dash/mpeg4_1080p_high/init.mp4  
[120751][BufferController][video] Waiting for more buffer before starting playback 
[120751][ScheduleController][video] Appended bytes for video and stream id 2/5 
[120752][ScheduleController][video] [video] lastInitializedRepresentationInfo changed to 6 
[120753][ScheduleController][video] Top quality video index has changed from NaN to 6 
[120753][ScheduleController][video] Media segment needed for video and stream id 2/5 
[120753][DashHandler][video] Getting the request for time : 1798 
[120753][DashHandler][video] Index for time 1798 is 5 
[120754][StreamProcessor][video] Next fragment request url for stream id 2/5 and media type video is https://.../mvp/ads/3355016/dash/mpeg4_1080p_high/6.m4s 
[120807][BufferController][audio] Waiting for more buffer before starting playback 
[120811][BufferController][audio] Append Init fragment audio  with representationId: 1  and quality: 0 , data size: 822 
[120811][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: https://.../mvp/ads/3355016/dash/mpeg4_audio/init.mp4  
[120811][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[120812][ScheduleController][audio] [audio] lastInitializedRepresentationInfo changed to 0 
[120813][ScheduleController][audio] Top quality audio index has changed from NaN to 0 
[120813][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[120813][DashHandler][audio] Getting the request for time : 1798 
[120813][DashHandler][audio] Index for time 1798 is 5 
[120813][StreamProcessor][audio] Next fragment request url for stream id 2/5 and media type audio is https://.../mvp/ads/3355016/dash/mpeg4_audio/6.m4s 
[121709][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: https://.../mvp/ads/3355016/dash/mpeg4_audio/6.m4s  
[121710][BufferController][audio] Buffered range: 1797.958308 - 1798.000974, currentTime =  1798 
[121710][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[121711][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[121794][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: https://.../mvp/ads/3355016/dash/mpeg4_1080p_high/6.m4s  
[121794][BufferController][video] Buffered range: 1797.972308 - 1798.055724, currentTime =  1798 
[121795][ScheduleController][video] Appended bytes for video and stream id 2/5 
[121796][ScheduleController][video] Media segment needed for video and stream id 2/5 
[121796][StreamProcessor][video] Segment requesting for stream 2/5 has finished 
[121797][Stream] onBufferingCompleted - One streamProcessor has finished but audio one is not buffering completed 
[121797][BufferController][video] checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id 2/5 and type video 
[121856][BufferController][video] Got enough buffer to start 
[122212][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[122713][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[123214][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[123714][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[124215][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[124716][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[125218][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[125719][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[126220][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[126722][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[127223][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
Expected behavior

After seeking, the player keeps buffering and playing.

@lkinasiewicz
Copy link
Contributor Author

@dsilhavy, do you remember the reason for changing these lines?
a66913f#diff-f749d53584e1f92eb9e80d75635551a1b76d6e94d1bf7690b739e6bef8446ac3L252-L256

@dsilhavy
Copy link
Collaborator

I don't remember the exact reasons, I think there were some problems with track switches and/or invalid values fror availableSegmentsNumber . However, I also wanted to optimize this part of the code. We need a better logic to determine if there is a gap or if there are still segments to be downloaded. Can you share your stream with me in private so I can check this? Also, did the GapController jump over this gap at some point?

@lkinasiewicz
Copy link
Contributor Author

Thanks for quick response! Sure. From my debugging I can see that the previously used value - availableSegmentsNumber is updated according to the number of downloaded segments - this is not a static value taken from the manifest. Maybe that caused some issues? I have already done some simple changes in DashHandler to simplify logic, I will share it soon.
I am trying to fix this ticket, but I am not that familiar with the codebase as you are, so if you have any thoughts that might help or would like to review the changes when I manage to prepare a PR, I will be really thankful.

@dsilhavy
Copy link
Collaborator

@lkinasiewicz Thank you, happy to review your PR once it is done. As this is a critical part of the code we should carefully validate all changes. I think a PR from your side is a good start

@dsilhavy
Copy link
Collaborator

The seeking problem should be fixed in #3772. Note that it needs to be enabled in the settings:

player.updateSettings({
streaming: {
  buffer: {
    seekGapFix: {
     enabled: true 
   }
  }
}
})

@lkinasiewicz Can you please confirm that #3772 solves your issue.

@dsilhavy dsilhavy added this to the 4.1.0 milestone Sep 20, 2021
@dsilhavy dsilhavy self-assigned this Sep 20, 2021
@lkinasiewicz
Copy link
Contributor Author

Unfortunately, this does not fix the problem. Probably because the segment request can be generated, but playback cannot start because seek position is too close to the gap. GapController does not detect the gap when player is in seeking state. Please notice that the bug occurs when seeking near the gap, not to the gap.

Logs from reproduction after changes from #3772:

player.seek(105.4)
[15032][PlaybackController] Requesting seek to time: 105.4 
[15033][PlaybackController] Seeking to: 105.4 
[15034][FragmentModel][video] abort requests 
[15034][FragmentModel][audio] abort requests 
[15035][BufferController][video] video: Removing buffer from: 0 to 30.613416 
[15035][BufferController][audio] audio: Removing buffer from: 0 to 30.558666 
[15035][PlaybackController] Native video element event: waiting 
[15036][BufferController][video] onRemoved buffer from: 0 to 30.613416 
[15037][AbrController] [video] switching from buffer occupancy to throughput ABR rule (buffer: 0.000). 
[15037][BufferController][video] Waiting for more buffer before starting playback 
[15037][BufferController][audio] onRemoved buffer from: 0 to 30.558666 
[15038][AbrController] [audio] switching from buffer occupancy to throughput ABR rule (buffer: 0.000). 
[15038][BufferController][audio] Waiting for more buffer before starting playback 
[15039][FragmentModel][video] abort requests 
[15039][FragmentModel][audio] abort requests 
[15040][StreamController] Switch to stream 2/5. Seektime is 105.4, current playback time is 105.4. Seamless period switch is set to true 
[15048][Stream] No text data. 
[15048][Stream] No muxed data. 
[15048][Stream] No image data. 
[15049][SourceBufferSink][video] Updated append window for video. Set start to 75.31357000000001 and end to 105.53698667100001 
[15049][SourceBufferSink][video] Set MSE timestamp offset to 75.41357 
[15050][SourceBufferSink][audio] Updated append window for audio. Set start to 75.31357000000001 and end to 105.53698667100001 
[15050][SourceBufferSink][audio] Set MSE timestamp offset to 75.41357 
[15051][AbrController] Stream ID: 2/5 [video] switch from 0 to 6/6 (buffer: 0) . 
[15051][StreamProcessor][video] Preparing quality switch for type video 
[15054][FragmentModel][video] abort requests 
[15059][ScheduleController][video] Quality has changed, get init request for representationid = 5 
[15060][ScheduleController][audio] Quality has changed, get init request for representationid = 1 
[15238][BufferController][video] Waiting for more buffer before starting playback 
[15239][BufferController][audio] Waiting for more buffer before starting playback 
[15491][BufferController][audio] Append Init fragment audio  with representationId: 1  and quality: 0 , data size: 822 
[15491][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: [...]/ads/3355016/dash/mpeg4_audio/init.mp4  
[15492][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[15492][ScheduleController][audio] [audio] lastInitializedRepresentationInfo changed to 0 
[15494][ScheduleController][audio] Top quality audio index has changed from NaN to 0 
[15494][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[15494][DashHandler][audio] Index for time 105.4 is 4 
[15494][StreamProcessor][audio] Next fragment request url for stream id 2/5 and media type audio is [...]/ads/3355016/dash/mpeg4_audio/5.m4s 
[15570][BufferController][video] Append Init fragment video  with representationId: 5  and quality: 6 , data size: 865 
[15570][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: [...]/ads/3355016/dash/mpeg4_1080p_high/init.mp4  
[15571][ScheduleController][video] Appended bytes for video and stream id 2/5 
[15571][ScheduleController][video] [video] lastInitializedRepresentationInfo changed to 6 
[15573][ScheduleController][video] Top quality video index has changed from NaN to 6 
[15573][ScheduleController][video] Media segment needed for video and stream id 2/5 
[15573][DashHandler][video] Index for time 105.4 is 4 
[15573][StreamProcessor][video] Next fragment request url for stream id 2/5 and media type video is [...]/ads/3355016/dash/mpeg4_1080p_high/5.m4s 
[16078][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: [...]/ads/3355016/dash/mpeg4_audio/5.m4s  
[16079][BufferController][audio] Buffered range: 99.41357 - 105.429569, currentTime =  105.4 
[16079][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[16081][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[16081][StreamProcessor][audio] Next fragment request url for stream id 2/5 and media type audio is [...]/ads/3355016/dash/mpeg4_audio/6.m4s 
[16638][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: [...]/ads/3355016/dash/mpeg4_1080p_high/5.m4s  
[16648][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: [...]/ads/3355016/dash/mpeg4_audio/6.m4s  
[16649][BufferController][audio] Buffered range: 99.41357 - 105.472236, currentTime =  105.4 
[16649][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[16651][InsufficientBufferRule] [audio] Switch to index 0; buffer is empty. 
[16651][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[16651][StreamProcessor][audio] Segment requesting for stream 2/5 has finished 
[16651][Stream] onBufferingCompleted - One streamProcessor has finished but video one is not buffering completed 
[16651][BufferController][audio] checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id 2/5 and type audio 
[16657][BufferController][video] Buffered range: 99.43757 - 105.443569, currentTime =  105.4 
[16657][ScheduleController][video] Appended bytes for video and stream id 2/5 
[16659][ScheduleController][video] Media segment needed for video and stream id 2/5 
[16659][StreamProcessor][video] Next fragment request url for stream id 2/5 and media type video is [...]/ads/3355016/dash/mpeg4_1080p_high/6.m4s 
[16990][BufferController][audio] Got enough buffer to start 
[17136][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: [...]/ads/3355016/dash/mpeg4_1080p_high/6.m4s  
[17137][BufferController][video] Buffered range: 99.43757 - 105.526986, currentTime =  105.4 
[17137][ScheduleController][video] Appended bytes for video and stream id 2/5 
[17139][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. 
[17139][AbrController] Stream ID: 2/5 [video] switch from 6 to 0/6 (buffer: 0.127) "InsufficientBufferRule: Buffer is empty" 
[17139][StreamProcessor][video] Preparing quality switch for type video 
[17143][FragmentModel][video] abort requests 
[17145][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. 
[17145][ScheduleController][video] Quality has changed, get init request for representationid = 3 
[17590][BufferController][video] Append Init fragment video  with representationId: 3  and quality: 0 , data size: 822 
[17590][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: [...]/ads/3355016/dash/mpeg4_234p_baseline/init.mp4  
[17591][ScheduleController][video] Appended bytes for video and stream id 2/5 
[17591][ScheduleController][video] [video] lastInitializedRepresentationInfo changed to 0 
[17592][ScheduleController][video] Media segment needed for video and stream id 2/5 
[17593][StreamProcessor][video] Segment requesting for stream 2/5 has finished 
[17593][Stream] onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED 
[17593][StreamController] Stream with id 2/5 finished buffering 
[17593][Stream] [startPreloading] Preloading next stream with id 2/6 
[17596][Stream] No text data. 
[17596][Stream] No muxed data. 
[17597][Stream] No image data. 
[17597][SourceBufferSink][video] Updated append window for video. Set start to 105.42699 and end to 135.633723093 
[17598][SourceBufferSink][video] Set MSE timestamp offset to 105.52699 
[17598][SourceBufferSink][audio] Updated append window for audio. Set start to 105.42699 and end to 135.633723093 
[17599][SourceBufferSink][audio] Set MSE timestamp offset to 105.52699 
[17599][BufferController][video] checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id 2/5 and type video 
[17600][AbrController] Stream ID: 2/6 [video] switch from 0 to 6/6 (buffer: 0.127) . 
[17600][StreamProcessor][video] Preparing quality switch for type video 
[17603][FragmentModel][video] abort requests 
[17605][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. 
[17606][AbrController] Stream ID: 2/6 [video] switch from 6 to 0/6 (buffer: 0.127) "InsufficientBufferRule: Buffer is empty" 
[17606][StreamProcessor][video] Preparing quality switch for type video 
[17610][FragmentModel][video] abort requests 
[17611][ScheduleController][audio] Quality has changed, get init request for representationid = 3 
[17613][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. 
[17613][ScheduleController][video] Quality has changed, get init request for representationid = 0 
[17687][BufferController][video] Got enough buffer to start 
[17687][BufferController][video] Waiting for more buffer before starting playback 
[17687][BufferController][audio] Waiting for more buffer before starting playback 
[17870][BufferController][audio] Append Init fragment audio  with representationId: 3  and quality: 0 , data size: 822 
[17870][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/6 and media type audio - Url: [...]/ads/3359113/dash/mpeg4_audio/init.mp4  
[17871][ScheduleController][audio] Appended bytes for audio and stream id 2/6 
[17871][ScheduleController][audio] [audio] lastInitializedRepresentationInfo changed to 0 
[17872][ScheduleController][audio] Top quality audio index has changed from NaN to 0 
[17872][ScheduleController][audio] Media segment needed for audio and stream id 2/6 
[17873][DashHandler][audio] Index for time 105.52699 is 0 
[17873][StreamProcessor][audio] Next fragment request url for stream id 2/6 and media type audio is [...]/ads/3359113/dash/mpeg4_audio/1.m4s 
[18020][BufferController][video] Append Init fragment video  with representationId: 0  and quality: 0 , data size: 822 
[18021][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_234p_baseline/init.mp4  
[18021][ScheduleController][video] Appended bytes for video and stream id 2/6 
[18021][ScheduleController][video] [video] lastInitializedRepresentationInfo changed to 0 
[18023][ScheduleController][video] Top quality video index has changed from NaN to 6 
[18023][ScheduleController][video] Media segment needed for video and stream id 2/6 
[18023][DashHandler][video] Index for time 105.52699 is 0 
[18023][StreamProcessor][video] Next fragment request url for stream id 2/6 and media type video is [...]/ads/3359113/dash/mpeg4_234p_baseline/1.m4s 
[18468][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/6 and media type audio - Url: [...]/ads/3359113/dash/mpeg4_audio/1.m4s  
[18470][BufferController][audio] Got enough buffer to start 
[18470][BufferController][audio] Buffered range: 99.41357 - 105.472236, currentTime =  105.4 
[18470][BufferController][audio] Buffered range: 105.505657 - 111.542989, currentTime =  105.4 
[18470][ScheduleController][audio] Appended bytes for audio and stream id 2/6 
[18620][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_234p_baseline/1.m4s  
[18621][BufferController][video] Got enough buffer to start 
[18621][BufferController][video] Buffered range: 99.43757 - 111.532989, currentTime =  105.4 
[18622][ScheduleController][video] Appended bytes for video and stream id 2/6 
[18623][AbrController] Stream ID: 2/6 [video] switch from 0 to 6/6 (buffer: 6.133) {"throughput":26041.1,"latency":456.75} 
[18623][StreamProcessor][video] Preparing quality switch for type video 
[18626][FragmentModel][video] abort requests 
[18628][ScheduleController][video] Quality has changed, get init request for representationid = 7 
[18974][ScheduleController][audio] Media segment needed for audio and stream id 2/6 
[18975][StreamProcessor][audio] Next fragment request url for stream id 2/6 and media type audio is [...]/ads/3359113/dash/mpeg4_audio/2.m4s 
[19071][BufferController][video] Append Init fragment video  with representationId: 7  and quality: 6 , data size: 865 
[19071][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_1080p_high/init.mp4  
[19072][ScheduleController][video] Appended bytes for video and stream id 2/6 
[19072][ScheduleController][video] [video] lastInitializedRepresentationInfo changed to 6 
[19073][ScheduleController][video] Media segment needed for video and stream id 2/6 
[19073][DashHandler][video] Index for time 106.9 is 0 
[19073][StreamProcessor][video] Next fragment request url for stream id 2/6 and media type video is [...]/ads/3359113/dash/mpeg4_1080p_high/1.m4s 
[19526][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/6 and media type audio - Url: [...]/ads/3359113/dash/mpeg4_audio/2.m4s  
[19528][AbrController] [audio] switching from throughput to buffer occupancy ABR rule (buffer: 12.138). 
[19528][BufferController][audio] Buffered range: 99.41357 - 105.472236, currentTime =  105.4 
[19528][BufferController][audio] Buffered range: 105.505657 - 117.537656, currentTime =  105.4 
[19528][ScheduleController][audio] Appended bytes for audio and stream id 2/6 
[20124][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_1080p_high/1.m4s  
[20140][BufferController][video] Buffered range: 99.43757 - 111.532989, currentTime =  105.4 
[20140][ScheduleController][video] Appended bytes for video and stream id 2/6 
[20142][ScheduleController][video] Media segment needed for video and stream id 2/6 
[20142][StreamProcessor][video] Next fragment request url for stream id 2/6 and media type video is [...]/ads/3359113/dash/mpeg4_1080p_high/2.m4s 
[21276][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_1080p_high/2.m4s  
[21292][AbrController] [video] switching from throughput to buffer occupancy ABR rule (buffer: 12.139). 
[21293][BufferController][video] Buffered range: 99.43757 - 117.538989, currentTime =  105.4 
[21293][ScheduleController][video] Appended bytes for video and stream id 2/6 
[21294][ScheduleController][video] Media segment needed for video and stream id 2/6 
[21294][StreamProcessor][video] Next fragment request url for stream id 2/6 and media type video is [...]/ads/3359113/dash/mpeg4_1080p_high/3.m4s 
[21532][ScheduleController][audio] Media segment needed for audio and stream id 2/6 
[21532][StreamProcessor][audio] Next fragment request url for stream id 2/6 and media type audio is [...]/ads/3359113/dash/mpeg4_audio/3.m4s 
[22128][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/6 and media type audio - Url: [...]/ads/3359113/dash/mpeg4_audio/3.m4s  
[22129][BufferController][audio] Buffered range: 99.41357 - 105.472236, currentTime =  105.4 
[22129][BufferController][audio] Buffered range: 105.505657 - 123.532323, currentTime =  105.4 
[22129][ScheduleController][audio] Appended bytes for audio and stream id 2/6 
[22439][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_1080p_high/3.m4s  
[22456][BufferController][video] Buffered range: 99.43757 - 123.544989, currentTime =  105.4 
[22456][ScheduleController][video] Appended bytes for video and stream id 2/6 
[22458][ScheduleController][video] Media segment needed for video and stream id 2/6 
[22458][StreamProcessor][video] Next fragment request url for stream id 2/6 and media type video is [...]/ads/3359113/dash/mpeg4_1080p_high/4.m4s 
[22631][ScheduleController][audio] Media segment needed for audio and stream id 2/6 
[22631][StreamProcessor][audio] Next fragment request url for stream id 2/6 and media type audio is [...]/ads/3359113/dash/mpeg4_audio/4.m4s 
[23185][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/6 and media type audio - Url: [...]/ads/3359113/dash/mpeg4_audio/4.m4s  
[23186][BufferController][audio] Buffered range: 99.41357 - 105.472236, currentTime =  105.4 
[23187][BufferController][audio] Buffered range: 105.505657 - 129.526989, currentTime =  105.4 
[23187][ScheduleController][audio] Appended bytes for audio and stream id 2/6 
[23475][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/6 and media type video - Url: [...]/ads/3359113/dash/mpeg4_1080p_high/4.m4s  
[23489][BufferController][video] Buffered range: 99.43757 - 129.550989, currentTime =  105.4 
[23489][ScheduleController][video] Appended bytes for video and stream id 2/6 
[23490][SwitchHistoryRule] Switch history rule index: 5 samples: 6 drops: 1 
[23490][AbrController] Stream ID: 2/6 [video] switch from 6 to 5/6 (buffer: 24.151) {"index":5,"drops":1,"noDrops":5,"dropSize":6} 
[23491][StreamProcessor][video] Preparing quality switch for type video 
[23494][FragmentModel][video] abort requests 
[23689][ScheduleController][audio] Media segment needed for audio and stream id 2/6 
[23689][StreamProcessor][audio] Next fragment request url for stream id 2/6 and media type audio is [...]/ads/3359113/dash/mpeg4_audio/5.m4s 
[24269][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/6 and media type audio - Url: [...]/ads/3359113/dash/mpeg4_audio/5.m4s  
[24271][BufferController][audio] Buffered range: 99.41357 - 105.472236, currentTime =  105.4 
[24271][BufferController][audio] Buffered range: 105.505657 - 135.542989, currentTime =  105.4 
[24271][ScheduleController][audio] Appended bytes for audio and stream id 2/6 

@dsilhavy
Copy link
Collaborator

@lkinasiewicz Thanks for checking this. You are right, the previous PR solved the issue when seeking into a gap but no the case in which the user seeks very close to a gap. I tried solving this in #3775. Can you please check the PR. Please note that you have to enable the fix via settings:

player.updateSettings({
streaming: {
 gaps: {
    enableSeekFix: true
  }
}})

Based on your feedback also in the upcoming weeks we can consider enabling this by default.

@dsilhavy
Copy link
Collaborator

This was fixed in version 4.1.0. Please comment if you encounter any issues.

@lkinasiewicz
Copy link
Contributor Author

@dsilhavy please reopen. On development branch, with changes from #3775, when enableSeekFix is true, exceptions are being thrown during playback and the problem still occurs.

Uncaught TypeError: (activeStream.getStartTime(...).toFixed(...) + activeStream.getDuration(...)).toFixed is not a function
    at _shouldIgnoreSeekingState (GapController.js:214)
    at _shouldCheckForGaps (GapController.js:201)
    at _onWallclockTimeUpdated (GapController.js:174)
    at EventBus.js:124
    at Array.forEach (<anonymous>)
    at Object.trigger (EventBus.js:124)
    at _onWallclockTime (PlaybackController.js:587)
    at tick (PlaybackController.js:429)

@dsilhavy dsilhavy reopened this Oct 4, 2021
@dsilhavy
Copy link
Collaborator

dsilhavy commented Oct 4, 2021

@lkinasiewicz Thanks for testing, there was a mess up with the parenthesis in the function, sorry for that. It should be fixed with a2b9623

@dsilhavy dsilhavy modified the milestones: 4.1.0, 4.1.1 Oct 4, 2021
@lkinasiewicz
Copy link
Contributor Author

This fixed the issue. Thanks! 🎉 We can close this ticket.

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

No branches or pull requests

2 participants