Dash.js: Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

Created on 29 Apr 2016  路  10Comments  路  Source: Dash-Industry-Forum/dash.js

Dash#2.2.0
OSX#10.10.5
Chrome#50.0.2661

Source:

{
    "name": "My Test",
    "submenu": [{
        "name": "Widevine",
        "url": "http://html5.cablelabs.com:8100/cenc/wv/dash.mpd", // reuse MPD
        "browsers": "",
        "protData": {
            "com.widevine.alpha": {
                "serverURL": "..."
            }
        }
    }]
},
  1. Add new source to samples/dash-if-reference-player/app/sources.js
  2. serverURL MUST throw a 500 on license acquisition.
  3. Load source from http://localhost:3000/samples/dash-if-reference-player/eme.html
  4. See uncaught error occur

screen shot 2016-04-29 at 1 56 21 pm

This uncaught exception breaks integration with video.js (my use case which is unrecoverable鈥攔equires a hard refresh).

I don't know how to trace the exception given the screenshot, but if I comment out PlaybackController.js:130:

function pause() {
    if (!element) return;
    // element.pause();
    element.autoplay = false;
}

The exception no longer fires (but now you cannot pause).

Potential reference material:

Thanks.

Most helpful comment

For info, I've just published an article about this exact issue at https://developers.google.com/web/updates/2017/06/play-request-was-interrupted that tells you exactly what is happening and how to fix it.

All 10 comments

Waking my computer, after loading a video and doing the handshake on Friday, also seemed to leave the video in the same state and caused the same issue.

So this is a guess ..... Since I saw this with clearkeys that failed to auth.
That is thrown from Navigator during the CDM key exchange since it fails to get license, the browsers is calling pause on video element while the play is still in promise mode. Not too sure if Dash.js can do anything about this error.

Noticed this last week with unprotected content but cant remember exact circumstances.

I haven't read up on the new spec but suspect we could probably check the return type of relevant methods (play, pause, load etc) and, if it's a Promise, just stick an empty .catch on the end?

@chemoish does changing PlaybackController.play as below solve your issue?

    function play() {
        if (element) {
            element.autoplay = true;
            const p = element.play();
            if (p && (typeof Promise !== 'undefined') && (p instanceof Promise)) {
                p.catch(e => log(e));
            }
        } else {
            playOnceInitialized = true;
        }
    }

I am out of town, but I will check when I get back.

Thanks!

Error still exists, in the console, when toggling the play/pause.

No error is surfaced up to videojs鈥攋ust black screen.

screen shot 2016-05-10 at 7 59 36 pm

npm i videojs-contrib-dash
npm i -g grunt-cli
vi package.json // "dashjs": "git://github.com/bbcrddave/dash.js.git#PromisesPromises",
npm i
cd node_modules/dashjs
npm i
cd ../..
grunt build
serve
http://localhost:3000/example.html

Maybe I am doing something wrong?

(At least something changed between video.js, videojs-contrib-dash, and dash.js鈥攊t no longer prevents all interaction with the player, which otherwise showed nothing, but the control bar on the screen anymore 馃憤 )

I still this issue with v2.2.0. Is this not addressed as part of the 2.2?

I can see the fix in https://github.com/Dash-Industry-Forum/dash.js/blob/master/src/streaming/controllers/PlaybackController.js#L118, so it was addressed. We'll need more information on how you're seeing it if you believe you still are.

For info, I've just published an article about this exact issue at https://developers.google.com/web/updates/2017/06/play-request-was-interrupted that tells you exactly what is happening and how to fix it.

Was this page helpful?
0 / 5 - 0 ratings