RESOLVED DUPLICATE of bug 250741 250548
Excessive 'timeupdate' events triggered by video element with HLS streams carrying in-band EMSG metadata
https://bugs.webkit.org/show_bug.cgi?id=250548
Summary Excessive 'timeupdate' events triggered by video element with HLS streams car...
jameson.steiner
Reported 2023-01-13 00:19:29 PST
Created attachment 464479 [details] HTML page loading an HLS stream carrying EMSG metadata into a video element and enabling the metadata track. Logging out 'timeupdate' events during playback to observe the issue. When playing HLS streams carrying EMSG in-band metadata, excessive/duplicate 'timeupdate' events would be fired by the video element if the respective metadata track is enabled. Observations: 1. If the metadata track's 'mode' property is set to 'disabled' (default) the browser does not process the track at all as per the API spec and 'timeupdate' events from the video element are observed in normal 250ms intervals. 2. Once the track is enabled by setting its mode to 'hidden', excessive 'timeupdate' events are triggered by the video element. Looking at the timing of the events it looks like some of them are triggered at the exact same time, i.e. are duplicates. This causes event handlers on the 'timeupdate' event to be called more often and thereby also causes more load on the device. In the attached reproduction case, around twice as many events are fired if the metadata track is enabled. Furthermore, with a stream of one of our customers that also carries a lot of EMSG metadata (but we cannot share publically), we are seeing around 750 'timeupdate' events within a 10-second period of playback if the metadata track is enabled vs. 40 events if the track is disabled. Additionally, with that stream, we are seeing CPU utilization and memory consumption steadily rising during playback up to a point (after around 1 hr) that Safari shows a banner saying "This web page is using significant memory. Closing it may improve the responsiveness of your Mac." and the page becomes very unresponsive. This is also only observed if the metadata track is enabled. Reproduction case: Attached is a simple HTML page loading an HLS stream that carries EMSG metadata into a video element and enabling the metadata track. Start playback and observe logged 'timeupdate' events in the browser console during playback. After 15 seconds playback is finished and the total count of received 'timeupdate' events is logged out. Different behavior can be observed depending on whether the metadata track is enabled or not.
Attachments
HTML page loading an HLS stream carrying EMSG metadata into a video element and enabling the metadata track. Logging out 'timeupdate' events during playback to observe the issue. (1.11 KB, text/html)
2023-01-13 00:19 PST, jameson.steiner
no flags
Ahmad Saleem
Comment 1 2023-01-17 17:34:06 PST
Marking this as duplicate to bug 250741, where I will fix it after discussing this with Eric. *** This bug has been marked as a duplicate of bug 250741 ***
Ahmad Saleem
Comment 2 2023-01-20 09:40:23 PST
Just to confirm, I built WebKit from Trunk (today - so the patch has already landed) and run the testcase in mini browser and observed via Console and there is no duplicate event and there were 60 total time update event in Console. https://bug-250548-attachments.webkit.org/attachment.cgi?id=464479:22:17: CONSOLE WARN 2023-01-20T17:37:57.947Z - ended fired, got 60 timeupdate events in total So I think the duplicate issue seems to be fixed now after bug bug 250741. Thanks!
Note You need to log in before you can comment on or make changes to this bug.