Error when trying to play embedded YouTube videos
I cannot get embedded YouTube videos in my app and have found several others online with the same problem.
The correct video image loads, but upon clicking play I am met with "An error has ocurred. Please try again later."
This post provided some suggestions for fixes, but none have worked for me with the 32-bit windows 12.0 version of nw.js.
Has anyone been able to successfully display and play youtube videos within their nw.js app?
You may need to replace the default ffmpegsumo.dll to one which supports media from YouTube. Search ffmpeg here inside issues and you will find threads linking to files for 11.6,
But I suggest you read this before you distribute your app using the modified file: https://github.com/nwjs/nw.js/wiki/Using-MP3-&-MP4-%28H.264%29-using-the--video--&--audio--tags.
If this resolves your problem, I'd kindly suggest closing this issue, this has been discussed before. If not then post a snippet of your code.
@mscreenie Here is one snippet of code I tested with. Here is the code working in a plunker. My stack question shows screenshots of the errors I'm getting in nw.js. I tried copying the ffmpegsumo.dll from Chome into the folder with my node elements. However, after doing that the app proceeded crash when I clicked play on the videos.
Any ideas on what might be going on here?
I used the ffmpegsumo.dll from Chrome 41.0.2272.76 and v12.0 nw.js.
Thanks for reaching out. Let me know if you need more info or if I am being unclear.
You're using Javascript to write a Flash element to embed a YouTube video. This would require you to use Flash with nwjs, until you do this the video will not play. I suppose one of the reasons why it works when plugins are enabled presumably nwjs would use your native installed plugins and load them during initialization.
If your application requirements can change, you should resort to YouTube's API to write Iframes, this way your using HTML5
I'm using YouTube API with nwjs 11.6 myself and it works well and as expected without flash, if you get the same error then force HTML5, some videos may not support HTML5 (a small minority), in which case you'd have to use Flash in your app.
Hope that helps u.
@mscreenie I used the "Getting Started" example from the YouTube Player API Page (shown here working in a plunker) and I still encounter the same error with the iframe. I will try downloading nw.js 11.6 and see if I can get it to work with that.
@mscreenie I see the same error in 11.6. I'm using the 32 bit version but I can change machines and try the 64 bit version as well. If you have time, would you mind posting an example code snippet that properly plays in nw.js 11.6 so that I can try to replicate? Thanks again.
Post your code. If you're using YouTube's API correctly it should work. Are you sure you've replaced ffmpeg with the correct file?
@mscreenie I wasn't using the correct ffmpeg.dll. Once I replaced it I had tried the Chromium 39 and 42 versions which did not resolve my issue. The dll from Chrome 38.0.2125.122 is what I needed. Videos are now working. Thank you very much!
For anyone looking for the Chrome 38.0.2125.122 dll, I downloaded it here.