Embedding Youtube videos not working with Node-webkit

风流意气都作罢 提交于 2019-12-22 18:46:11

问题


I have an embedded youtube video in my nw.js app. The preview for the correct video shows up properly but when I click to play it I am met with the following error:

An error occurred, please try again later

All of the videos in the app get this error, except for one that gets this puzzling error:

The following video contains content from the International Basketball Federation

When I click these videos, I can see the first split second of the video before the error shows up.

I tried enabling/disabling the webkit plugin in the manifest:

  "webkit": {
    "plugin": true
    }

and I tried using the Javascript Player API as suggested by in this post. However I still get the same errors.

How can I get these videos to play properly?

Here is the HTML (I'm using angularJS and the video is in a modal window) that displays the video:

<script type="text/ng-template" id="myModalContent.html">
        <object width="100%" height="600px" data={{video}}> 
        </object>

</script>

I also tried copying this example using the Javascript Player API and even tried using the same video as the example but I'm still getting the same error.

Thank you very much for your time. Let me know if you need anything else from me or if I am being unclear.


回答1:


Ok so the issue was the ffmpegsumo.dll. At first I tried replacing it with the dll from chrome 39 and 42 and that did not fix my issue. After replacing the file with the ffmpegsumo.dll from Chrome 38.0.2125.122, my issue was fixed and videos played as expected.

Chrome 38.0.2125.122 ffmpegsumo.dll 32 bit

Chrome 38.0.2125.122 ffmpegsumo.dll 64 bit




回答2:


You need the flash plugins in the plugins directory at the same root level as the package.json NPSWF32_13_0_0_214.dlland NPSWF32_14_0_0_125.dll. This with the above will enable Flash.




回答3:


Had the same problem in Linux 64 bits using Yeoman Node Webkit Generator (https://github.com/Dica-Developer/generator-node-webkit/wiki/Getting-Started)

Just fixed it by adding the so lib:

$ cp nwjs/nwjs-v0.12.0-linux-x64/libffmpegsumo.so  dist/Linux64_v0.12.0/


来源:https://stackoverflow.com/questions/28972140/embedding-youtube-videos-not-working-with-node-webkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!