Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chemoish opened this issue Apr 29, 2016 · 10 comments
Milestone

Comments

@chemoish
Copy link

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—requires 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.

@chemoish
Copy link
Author

chemoish commented May 2, 2016

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.

@dsparacio
Copy link
Contributor

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.

@davemevans
Copy link
Contributor

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?

@davemevans
Copy link
Contributor

@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;
        }
    }

@chemoish
Copy link
Author

chemoish commented May 5, 2016

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

Thanks!

davemevans added a commit to davemevans/dash.js that referenced this issue May 9, 2016
@chemoish
Copy link
Author

chemoish commented May 11, 2016

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

No error is surfaced up to videojs—just 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—it no longer prevents all interaction with the player, which otherwise showed nothing, but the control bar on the screen anymore 👍 )

LloydW93 pushed a commit that referenced this issue May 31, 2016
Fixes #1372 - catch pending play request exceptions
@dsparacio dsparacio added this to the 2.2.0 milestone Jul 5, 2016
@jayku4u
Copy link

jayku4u commented Jul 25, 2016

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

@LloydW93
Copy link
Member

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.

@beaufortfrancois
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants