WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
213 stars 139 forks source link

Progress event not being dispatched on MSE content #1146

Closed alkis-gkouzias-obs closed 1 year ago

alkis-gkouzias-obs commented 1 year ago

Hello,

we have being running some tests that demand mse playback and in our implementation we are relying on the HTMLMediaElement "progress" event to be dispatched. We have noticed that, in a scenario where mse content is requested to play, the progress event is never dispatched. We have also checked this scenario in Chromium browser, and it seems to work.

The version of WebKit we are using is wpe-2.28.

We have created a simple web page to replicate that. We are also using dash.js v4.7.1 as a player to test. You can find the code of the test page below:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>DASH-PLAYER</title>
        <script type="text/javascript" src="dash.js">
        </script>

        <script type="text/javascript">

            function handleEvent(event) {
                console.log(event);
            }
            window.onload = function(){
                let video = document.getElementById("dash-video");
                video.addEventListener("loadstart", handleEvent);
                video.addEventListener("progress", handleEvent);
                video.addEventListener("canplay", handleEvent);

                video.addEventListener("canplaythrough", handleEvent);
            }
        </script>

    </head>
    <body>
        <div>
            <video id="dash-video" autoplay="" preload="none" controls="true" style="width:1280px; height:720px">
                <source src="https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd" type="application/dash+xml">
            </video>
        </div>
    </body>
</html>

Also attaching the dash.js source: dash.all.min.js.txt

jacek-skiba-red commented 1 year ago

Progress event notification was removed from MSE path in upstream here: https://bugs.webkit.org/show_bug.cgi?id=226882 Here is the change for 2.28: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/925

From media-source specification (https://w3c.github.io/media-source/#h-note-25):

An attached MediaSource does not use the remote mode steps in the [resource fetch algorithm] (https://html.spec.whatwg.org/multipage/media.html#concept-media-load-resource), so the media element will not fire "suspend" events. Though future versions of this specification will likely remove "progress" and "stalled" events from a media element with an attached MediaSource, user agents conforming to this version of the specification may still fire these two events as these [HTML] references changed after implementations of this specification stabilized.

calvaris commented 1 year ago

I'm closing this as per last comment.