Issue playing *some* YouTube videos - DOMException: The play() request was interrupted by a new load request.
See original GitHub issuenwjs 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:
- Created 7 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
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.
Yeah the question I supposed was a rhetorical question.