Bug 256639 - ManagedMediaSource emits stream start and end events during live playback with short forward buffer
Summary: ManagedMediaSource emits stream start and end events during live playback wit...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
: 253637 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-11 03:41 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-09-29 23:57 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-05-11 03:41:35 PDT
ManagedMediaSource emits stream start and end events during live playback with short forward buffer.

OS: macOS Ventura 13.3 (22E243)
Browser: Safari Technology Preview Release 169 (Safari 16.4, WebKit 18616.1.12.2)

Steps:
1. Navigate to hls.js demo page with support for ManagedMediaSource https://imgdry.apple.com/users/rwalch/hlsjs-oss/v/1.4.1-pre.1.mms/demo/?src=https%3A%2F%2Fcdn-vos-ppp-01.vos360.video%2FContent%2FHLS_HLSCLEAR%2FLive%2Fchannel(PPP-LL-2HLS)%2Findex.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF0dGFjaE1lZGlhT25TdGFydCI6dHJ1ZSwiYXV0b1JlY292ZXJFcnJvciI6ZmFsc2UsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
2. Observe Live playback with “Status: “ log lines
3. If playback does not start automatically, mute the player and reload the page so that playback remains at the live edge with low buffer (as long as the muted element remains visible within the viewport)

Actual results:
- Page may become unresponsive within a few seconds
- Page shows ManagedMediaSource “startstreaming” and “endstreaming” events firing very frequently:

73.694 | ManagedMediaSource "endstreaming" event
77.999 | ManagedMediaSource "startstreaming" event
79.379 | ManagedMediaSource "endstreaming" event

Expected:
“endstreaming” does not fire when forward buffer remains below certain threshold (like under 20 seconds, or in this example under 6). Instead I would expect the browser to eject media from the buffer behind the playhead.


When playing a live stream the forward buffer remains below a certain threshold; under 5 seconds for low-latency playback, and typically under 30 for standard HLS assets. It is disruptive for MMS to emit these events .
Comment 1 Jean-Yves Avenard [:jya] 2023-05-11 03:41:50 PDT
rdar://108914679
Comment 2 Jean-Yves Avenard [:jya] 2023-05-11 04:18:01 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13755
Comment 3 EWS 2023-05-11 14:49:18 PDT
Committed 263984@main (252b97f1b34b): <https://commits.webkit.org/263984@main>

Reviewed commits have been landed. Closing PR #13755 and removing active labels.
Comment 4 Jean-Yves Avenard [:jya] 2023-09-29 23:57:59 PDT
*** Bug 253637 has been marked as a duplicate of this bug. ***