video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.86k stars 2.58k forks source link

"bufferStalledError" error occurs not consistent during the playback when toggle network on / off #6672

Open Ensaphelon opened 2 months ago

Ensaphelon commented 2 months ago

What version of Hls.js are you using?

1.5.14

What browser (including version) are you using?

Chrome 127.0.6533.120

What OS (including version) are you using?

macOS Sonoma 14.5

Test stream

https://codesandbox.io/s/pedantic-greider-t7sqrs?file=/index.html:699-717

Configuration

{
    debug: true,
    fragLoadingMaxRetry: Infinity,
    appendErrorMaxRetry: Infinity
}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Visit provided sandbox link
  2. Wait for the video start to play
  3. During the playback toggle the network inside the Chrome dev tools on and off
  4. When the video stops playing pay attention to the counter incrementing on "bufferStalledError" error, I set up its output to the console in the sandbox example

Expected behaviour

During the playback when the video stops the counter should always increment.

What actually happened?

During the playback when the video stops the counter not always incrementing.

Console output

[log] > [level-controller]: manifest loaded, 5 level(s) found, first bitrate: 2149280 
[log] > setting initial bwe to 2149280 
[log] > [buffer-controller] 1 bufferCodec event(s) expected 
[log] > startLoad(-1) 
[log] > [abr] picked start tier {"codecSet":"avc1,mp4a","videoRanges":["SDR"],"preferHDR":false,"minFramerate":0,"minBitrate":246440} 
[info] > [abr] switch candidate:3->3 adjustedbw(2149280)-bitrate=0 ttfb:0.1 avgDuration:0.0 maxFetchDuration:4.0 fetchDuration:0.1 firstSelection:true codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:-1 
[log] > [level-controller]: Switching to level 3 (720p SDR avc1,mp4a @2149280) from level -1 
[log] > [level-controller]: Loading level index 3 with https://test-streams.mux.dev/x36xhzz/url_0/193039199_mp4_h264_aac_hd_7.m3u8 
[log] > [stream-controller]: STOPPED->IDLE 
[log] > [subtitle-stream-controller]: STOPPED->IDLE 
[log] > [stream-controller]: Level 3 loaded [0,63][part-63--1], cc [0, 0] duration:634.584 
[log] > [buffer-controller] Updating Media Source duration to 634.584 
[log] > [stream-controller]: Loading fragment 0 cc: 0 of [0-63] level: 3, target: 0 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > injecting Web Worker for "main" 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 3 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 0
        initSegmentChange: true 
[log] > [stream-controller]: Loaded fragment 0 of level 3 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.2, ADTS type:2, samplingIndex:4 
[log] > parsed codec:mp4a.40.5, rate:44100, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.2/mp4a.40.2/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.64001f/avc1.64001f] 
[log] > [buffer-controller] 0 bufferCodec event(s) expected audio,video 
[log] > [buffer-controller] creating sourceBuffer(audio/mp4;codecs=mp4a.40.2) 
[log] > [buffer-controller] creating sourceBuffer(video/mp4;codecs=avc1.64001f) 
[log] > [audio-stream-controller]: InitPTS for cc: 0 found from main: 900909 
[log] > [transmuxer.ts]: Flushed fragment 0 of level 3 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 0 of level 3 (frag:[0.000-10.023] > buffer:[0.023-10.008]) 
[log] > [stream-controller]: PARSED->IDLE 
[info] > [abr] switch candidate:3->2 adjustedbw(2179279)-bitrate=1342999 ttfb:0.7 avgDuration:10.0 maxFetchDuration:10.0 fetchDuration:4.7 firstSelection:false codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:3 
[log] > [stream-controller]: Adapting to level 2 from level 3 
[log] > [level-controller]: Switching to level 2 (480p SDR avc1,mp4a @836280) from level 3 
[log] > [level-controller]: Loading level index 2 with https://test-streams.mux.dev/x36xhzz/url_6/193039199_mp4_h264_aac_hq_7.m3u8 
[log] > [stream-controller]: IDLE->WAITING_LEVEL 
[log] > [stream-controller]: Level 2 loaded [0,63][part-63--1], cc [0, 0] duration:634.6 
[log] > [stream-controller]: WAITING_LEVEL->IDLE 
[log] > [stream-controller]: Loading fragment 1 cc: 0 of [0-63] level: 2, target: 10.008 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [buffer-controller] Updating Media Source duration to 634.600 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 1 p: -1 level: 2 id: 1
        discontinuity: false
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 10
        initSegmentChange: false 
[log] > [stream-controller]: Loaded fragment 1 of level 2 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.2, ADTS type:2, samplingIndex:4 
[log] > parsed codec:mp4a.40.5, rate:44100, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.2/mp4a.40.2/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.64001f/avc1.64001f] 
[log] > [buffer-controller] changing audio sourceBuffer type to audio/mp4;codecs=mp4a.40.5 
[log] > [buffer-controller] switching codec mp4a.40.2 to mp4a.40.5 
[log] > [transmuxer.ts]: Flushed fragment 1 of level 2 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 1 of level 2 (frag:[10.008-20.023] > buffer:[0.023-19.992]) 
[log] > [stream-controller]: PARSED->IDLE 
[info] > [abr] switch candidate:2->3 adjustedbw(2337385)-bitrate=188105 ttfb:0.3 avgDuration:9.9 maxFetchDuration:18.3 fetchDuration:9.5 firstSelection:false codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:2 
[log] > [stream-controller]: Adapting to level 3 from level 2 
[log] > [level-controller]: Switching to level 3 (720p SDR avc1,mp4a @2149280) from level 2 
[log] > [stream-controller]: Loading fragment 1 cc: 0 of [0-63] level: 3, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 1 p: -1 level: 3 id: 1
        discontinuity: false
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 10.007800453514703
        initSegmentChange: false 
[log] > [stream-controller]: Loaded fragment 1 of level 3 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.2, ADTS type:2, samplingIndex:4 
[log] > parsed codec:mp4a.40.5, rate:44100, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.2/mp4a.40.2/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.64001f/avc1.64001f] 
[log] > [transmuxer.ts]: Flushed fragment 1 of level 3 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 1 of level 3 (frag:[10.008-20.023] > buffer:[0.023-19.992]) 
[log] > [stream-controller]: PARSED->IDLE 
[log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-63] level: 3, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_0/url_464/193039199_mp4_h264_aac_hd_7.ts
[warn] > [stream-controller]: Fragment 2 of main 3 errored with fragLoadError, retrying loading 1/Infinity in 1000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-63] level: 3, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_0/url_464/193039199_mp4_h264_aac_hd_7.ts
[warn] > [stream-controller]: Fragment 2 of main 3 errored with fragLoadError, retrying loading 2/Infinity in 2000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_0/url_464/193039199_mp4_h264_aac_hd_7.ts
[warn] > [stream-controller]: Fragment 2 of main 3 errored with fragLoadError, retrying loading 3/Infinity in 4000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-63] level: 3, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-63] level: 3, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_0/url_464/193039199_mp4_h264_aac_hd_7.ts
[warn] > [stream-controller]: Fragment 2 of main 3 errored with fragLoadError, retrying loading 4/Infinity in 8000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [level-controller]: Switching to level 2 (480p SDR avc1,mp4a @836280) from level 3 
[log] > setting initial bwe to 836280 
[warn] > [abr] Fragment 2 of level 3 is loading too slowly;
      Time to underbuffer: 3.402 s
      Estimated load time for current fragment: 3.431 s
      Estimated load time for down switch fragment: 1.490 s
      TTFB estimate: 4 ms
      Current BW estimate: 6765273 bps
      New BW estimate: 836280 bps
      Switching to level 2 @ 836280 bps 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_6/url_848/193039199_mp4_h264_aac_hq_7.ts
[warn] > [stream-controller]: Fragment 2 of main 2 errored with fragLoadError, retrying loading 5/Infinity in 8000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-63] level: 2, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[warn] > Playback stalling at @19.92554 due to low buffer ({"len":0.0668169999999968,"start":0.023222,"end":19.992357}) 
1
[log] > [level-controller]: Switching to level 0 (184p SDR avc1,mp4a @246440) from level 2 
[log] > [level-controller]: Loading level index 0 with https://test-streams.mux.dev/x36xhzz/url_2/193039199_mp4_h264_aac_ld_7.m3u8 
[log] > setting initial bwe to 246440 
[warn] > [abr] Fragment 2 of level 2 is loading too slowly;
      Time to underbuffer: 0.067 s
      Estimated load time for current fragment: 10.100 s
      Estimated load time for down switch fragment: 5.694 s
      TTFB estimate: 3 ms
      Current BW estimate: 836280 bps
      New BW estimate: 246440 bps
      Switching to level 0 @ 246440 bps 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[log] > [level-controller]: Switching to level 0 (184p SDR avc1,mp4a @246440) from level 0 
[log] > [level-controller]: Loading level index 0 with https://test-streams.mux.dev/x36xhzz/url_2/193039199_mp4_h264_aac_ld_7.m3u8 
[log] > [stream-controller]: IDLE->WAITING_LEVEL 
[log] > [stream-controller]: Level 0 loaded [0,63][part-63--1], cc [0, 0] duration:634.634 
[log] > [stream-controller]: WAITING_LEVEL->IDLE 
[log] > [stream-controller]: Loading fragment 1 cc: 0 of [0-63] level: 0, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [buffer-controller] Updating Media Source duration to 634.634 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 1 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 10
        initSegmentChange: false 
[log] > [stream-controller]: Loaded fragment 1 of level 0 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.5, ADTS type:2, samplingIndex:7 
[log] > parsed codec:mp4a.40.5, rate:22050, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.5/mp4a.40.5/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.42000d/avc1.42c00d] 
[log] > [transmuxer.ts]: Flushed fragment 1 of level 0 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 1 of level 0 (frag:[9.990-20.005] > buffer:[0.023-19.990]) 
[log] > [stream-controller]: PARSED->IDLE 
[info] > [abr] switch candidate:0->4 adjustedbw(19029403)-bitrate=12807803 ttfb:0.1 avgDuration:10.0 maxFetchDuration:4.1 fetchDuration:3.5 firstSelection:false codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:0 
[info] > [abr] rebuffering expected, optimal quality level 4 
[log] > [stream-controller]: Adapting to level 4 from level 0 
[log] > [level-controller]: Switching to level 4 (1080p SDR avc1,mp4a @6221600) from level 0 
[log] > [level-controller]: Loading level index 4 with https://test-streams.mux.dev/x36xhzz/url_8/193039199_mp4_h264_aac_fhd_7.m3u8 
[log] > [stream-controller]: IDLE->WAITING_LEVEL 
[info] > [abr] rebuffering expected, optimal quality level 4 
[log] > [stream-controller]: Level 4 loaded [0,63][part-63--1], cc [0, 0] duration:634.567 
[log] > [stream-controller]: WAITING_LEVEL->IDLE 
[info] > [abr] rebuffering expected, optimal quality level 4 
[log] > [stream-controller]: Loading fragment 1 cc: 0 of [0-63] level: 4, target: 19.99 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 1 p: -1 level: 4 id: 1
        discontinuity: false
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 10
        initSegmentChange: false 
[log] > [stream-controller]: Loaded fragment 1 of level 4 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.2, ADTS type:2, samplingIndex:4 
[log] > parsed codec:mp4a.40.5, rate:44100, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.2/mp4a.40.2/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.640028/avc1.640028] 
[log] > [transmuxer.ts]: Flushed fragment 1 of level 4 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 1 of level 4 (frag:[10.008-20.023] > buffer:[0.023-19.992]) 
[log] > [stream-controller]: PARSED->IDLE 
[info] > [abr] rebuffering expected, optimal quality level 4 
[log] > [stream-controller]: Loading fragment 2 cc: 0 of [0-63] level: 4, target: 19.992 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [stream-controller]: Loaded fragment 2 of level 4 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [transmuxer.ts]: Flushed fragment 2 of level 4 
[log] > [stream-controller]: PARSING->PARSED 
[warn] > playback not stuck anymore @19.981208, after 6764ms 
[log] > [stream-controller]: Buffered main sn: 2 of level 4 (frag:[19.992-30.023] > buffer:[0.023-30.000]) 
[log] > [stream-controller]: PARSED->IDLE 
[log] > [stream-controller]: Loading fragment 3 cc: 0 of [0-63] level: 4, target: 30 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [stream-controller]: Loaded fragment 3 of level 4 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [transmuxer.ts]: Flushed fragment 3 of level 4 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 3 of level 4 (frag:[30.000-40.023] > buffer:[0.023-40.008]) 
[log] > [stream-controller]: PARSED->IDLE 
[log] > [stream-controller]: Loading fragment 4 cc: 0 of [0-63] level: 4, target: 40.008 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_8/url_594/193039199_mp4_h264_aac_fhd_7.ts
[warn] > [stream-controller]: Fragment 4 of main 4 errored with fragLoadError, retrying loading 6/Infinity in 8000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[log] > [stream-controller]: Loading fragment 4 cc: 0 of [0-63] level: 4, target: 40.008 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_8/url_594/193039199_mp4_h264_aac_fhd_7.ts
[warn] > [stream-controller]: Fragment 4 of main 4 errored with fragLoadError, retrying loading 7/Infinity in 8000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [level-controller]: Switching to level 3 (720p SDR avc1,mp4a @2149280) from level 4 
[log] > setting initial bwe to 2149280 
[warn] > [abr] Fragment 4 of level 4 is loading too slowly;
      Time to underbuffer: 1.928 s
      Estimated load time for current fragment: 1.989 s
      Estimated load time for down switch fragment: 0.749 s
      TTFB estimate: 5 ms
      Current BW estimate: 32834828 bps
      New BW estimate: 2149280 bps
      Switching to level 3 @ 2149280 bps 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[error] > 0 while loading https://test-streams.mux.dev/x36xhzz/url_0/url_466/193039199_mp4_h264_aac_hd_7.ts
[warn] > [stream-controller]: Fragment 4 of main 3 errored with fragLoadError, retrying loading 8/Infinity in 8000ms 
[log] > [stream-controller]: FRAG_LOADING->FRAG_LOADING_WAITING_RETRY 
[log] > [stream-controller]: Loading fragment 4 cc: 0 of [0-63] level: 3, target: 40.008 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[warn] > Playback stalling at @39.949127 due to low buffer ({"len":0.05883100000000496,"start":0.023222,"end":40.007958}) 
2
[log] > [level-controller]: Switching to level 0 (184p SDR avc1,mp4a @246440) from level 3 
[log] > setting initial bwe to 246440 
[warn] > [abr] Fragment 4 of level 3 is loading too slowly;
      Time to underbuffer: 0.059 s
      Estimated load time for current fragment: 10.100 s
      Estimated load time for down switch fragment: 2.327 s
      TTFB estimate: 2 ms
      Current BW estimate: 2149280 bps
      New BW estimate: 246440 bps
      Switching to level 0 @ 246440 bps 
[log] > [stream-controller]: FRAG_LOADING_WAITING_RETRY->IDLE 
[log] > [stream-controller]: Loading fragment 4 cc: 0 of [0-63] level: 0, target: 40.008 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 4 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 39.98991111111111
        initSegmentChange: false 
[log] > [stream-controller]: Loaded fragment 4 of level 0 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.5, ADTS type:2, samplingIndex:7 
[log] > parsed codec:mp4a.40.5, rate:22050, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.5/mp4a.40.5/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.42000d/avc1.42c00d] 
[log] > [transmuxer.ts]: Flushed fragment 4 of level 0 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 4 of level 0 (frag:[39.990-49.993] > buffer:[0.023-49.990]) 
[log] > [stream-controller]: PARSED->IDLE 
[info] > [abr] switch candidate:0->1 adjustedbw(5657997)-bitrate=5197437 ttfb:0.2 avgDuration:10.0 maxFetchDuration:10.0 fetchDuration:1.1 firstSelection:false codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:0 
[log] > [stream-controller]: Adapting to level 1 from level 0 
[log] > [level-controller]: Switching to level 1 (288p SDR avc1,mp4a @460560) from level 0 
[log] > [level-controller]: Loading level index 1 with https://test-streams.mux.dev/x36xhzz/url_4/193039199_mp4_h264_aac_7.m3u8 
[log] > [stream-controller]: IDLE->WAITING_LEVEL 
[warn] > Trying to nudge playhead over buffer-hole 
[warn] > Nudging 'currentTime' from 39.949127 to 40.049127 
[log] > [stream-controller]: media seeking to 40.049, state: WAITING_LEVEL 
[log] > [audio-stream-controller]: media seeking to 40.049, state: STOPPED 
[log] > [subtitle-stream-controller]: media seeking to 40.049, state: IDLE 
[log] > [stream-controller]: Media seeked to 40.049 
[log] > [stream-controller]: Level 1 loaded [0,63][part-63--1], cc [0, 0] duration:634.634 
[log] > [stream-controller]: WAITING_LEVEL->IDLE 
[log] > [stream-controller]: Loading fragment 5 cc: 0 of [0-63] level: 1, target: 50 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[log] > [transmuxer-interface, main]: Starting new transmux session for sn: 5 p: -1 level: 1 id: 1
        discontinuity: false
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 50
        initSegmentChange: false 
[log] > [stream-controller]: Loaded fragment 5 of level 1 
[log] > [mp4-remuxer]: ISGenerated flag reset 
[log] > [mp4-remuxer]: initPTS & initDTS reset 
[log] > [mp4-remuxer]: reset next timestamp 
[log] > manifest codec:mp4a.40.5, ADTS type:2, samplingIndex:7 
[log] > parsed codec:mp4a.40.5, rate:22050, channels:2 
[log] > [stream-controller]: FRAG_LOADING->PARSING 
[log] > [stream-controller]: Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[mp4a.40.5/mp4a.40.5/mp4a.40.5] 
[log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.420016/avc1.42c016] 
[log] > [transmuxer.ts]: Flushed fragment 5 of level 1 
[log] > [stream-controller]: PARSING->PARSED 
[log] > [stream-controller]: Buffered main sn: 5 of level 1 (frag:[49.990-59.990] > buffer:[0.023-59.977]) 
[log] > [stream-controller]: PARSED->IDLE 
[log] > [stream-controller]: Loading fragment 6 cc: 0 of [0-63] level: 1, target: 59.977 
[log] > [stream-controller]: IDLE->FRAG_LOADING 
[error] > 0 while loading https://test-stream

Chrome media internals output

No response

robwalch commented 2 months ago

What counter exactly? Is this a documented API feature?

For context, please include what you want to do with the buffer stall event data.

robwalch commented 2 months ago

Sorry, Is the issue that you expect there to be a one to one relationship between cutting off the network and the number of playback stalls?

robwalch commented 2 months ago

According to the logs, two stalls were detected and reported: the first at 19s and the second at 39. It doesn't matter whether or not you did something to cause them.