question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue playing *some* YouTube videos - DOMException: The play() request was interrupted by a new load request.

See original GitHub issue

nwjs builds:

nwjs 0.14.2 nwjs 0.13.4 nwjs 0.12.3 nwjs 0.11.6

All nwjs builds are x64 and ran on Windows 10

I’m seeing an issue with nwjs playing some YouTube videos where as Chrome and Electron have no issues playing the same videos using the YouTube embed iframe or the YouTube iframe API.

Something is causing the following error which seems to occur in the YouTube player API and only happens in nwjs as far as my tests go:

base.js:4165 Uncaught (in promise) DOMException: The play() request was interrupted by a new load request.

I’ve Googled this error a lot today and cannot find any references or fixes for it. I don’t think it’s an issue specifically in the YouTube API because the videos in question work fine in Chrome and Electron.

Here is a reproducible test case that shows off the problem:

Once nwjs loads, click the video to play and it will error and not play. The devtools will display the error message above.

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>YouTube Test</title>

    <style>
      #player {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
      }
    </style>

    <script>
      var win = nw.Window.get();

      win.on("loaded", function() {
        win.showDevTools();
      });
    </script>
  </head>
  <body>
    <iframe id="player" src="https://www.youtube.com/embed/D_8y-XX9wM8" frameborder="0" allowfullscreen></iframe>
  </body>
</html>

package.json

{
  "name": "yt-test",
  "main": "index.html",
  "window": {
    "toolbar": false,
    "width": 640,
    "height": 400,
    "min_width": 640,
    "min_height": 400
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
frankhalecommented, Apr 24, 2016

Okay this is related to not having something compiled into ffmpeg.dll perhaps H.264? I dunno, I’m just guessing. I copied the ffmpeg.dll from Electron over the one provided by NWJS and now videos that failed to play are playing.

Just to provide a little more info:

I replaced the ffmpeg.dll from nwjs 0.14.2 with the ffmpeg.dll that ships with Electron 0.37.7 and it solved the issues I was seeing with some videos not playing.

0reactions
frankhalecommented, Apr 25, 2016

Yeah the question I supposed was a rhetorical question.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DOMException - The play() request was interrupted
Uncaught (in promise) DOMException: The play() request was interrupted by a new load request. You're in the right place then. Have no fear....
Read more >
How to prevent "The play() request was interrupted by a call to ...
Based on this great SO answer, here's a way you can check if the video is (or isn't) truly playing, so you can...
Read more >
Uncaught (in promise) DOMException: The play() request was ...
Only in Google Chrome: "buffer-controller.js:76 Uncaught (in promise) DOMException: The play() request was interrupted by a new load request."
Read more >
The play() request was interrupted by a call to pause()
We are facing the DomException while playing all audio immediately one by one. Error: The play() request was interrupted by a call to...
Read more >
Fix videos & games that won't play - Google Chrome Help
If a YouTube video, Facebook game, or other media isn't working, try the steps below to fix it. These steps can help for:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found