Accessing youtube in iframae
I am trying to convert my AngularJS app (https://github.com/viperfx/ng-juketube) to use node-webkit. For the most part its working, the app is working, the socket.io server is working and there are no issues there.
There problem seems to be that youtube videos are not playing. I am using the youtube IFrame API and it works fine in chrome on localhost and remote. However when I try with webkit lauched through node-webkit I get a message saying This video contains content from *. It is restricted from playback on certain sites. This message is the same for any video. There are no specific errors on the console so its not to with the API, it seems to be some restriction either with the app:// protocol?
package.json
{
"name": "nw-jukebox",
"node-main":"server.js",
"main": "app://localhost/index.html",
"webkit": {
"plugin": true
}
}
It might be that youtube doesn't like node-webkit, because it sends empty Referer: in HTTP Header while requesting for player content. Just a guess. I think you will know much more if you ask youtube dev team for that. This is like looking for needle in a haystack if you don't know how theirs algorithm actually works.
Any ideas where exactly to report this? The official youtube developer support is mostly about the API.
I'll see the Referer header. @viperfx is the node-webkit port of your app in your github repo so I can try it?
@rogerwang Yes here you go - https://github.com/viperfx/nw-juketube. If you launch node-webkit with the folder /dist as the argument it should work.
Cheers
Forgot to mention that pressing on the JukeTube heading in the top displays the div containing the youtube player, so you should be able to visually confirm the error message I am getting.
What I got is an error msg from your application, not the one in your report:
""TypeError: Object #\u003CR\u003E has no method 'playVideo'\n at SocketNamespace.eval (app://localhost/js/app.js:5:11970)\n at eval (app://localhost/js/app.js:5:15221)\n at Object.f.$eval (app://localhost/js/app.js:3:13716)\n at Object.f.$apply (app://localhost/js/app.js:3:13823)\n at SocketNamespace.eval (app://localhost/js/app.js:5:15201)\n at SocketNamespace.EventEmitter.emit [as $emit] (app://localhost/js/socket.io.js:633:15)\n at SocketNamespace.onPacket (app://localhost/js/socket.io.js:2248:20)\n at Socket.onPacket (app://localhost/js/socket.io.js:1930:30)\n at Transport.onPacket (app://localhost/js/socket.io.js:1332:17)\n at Transport.onData (app://localhost/js/socket.io.js:1303:16)"", source: app://localhost/js/app.js (2)
And I tried another sample of youtube it works well with both the file protocol and the app protocol:
<iframe width="420" height="345"
src="http://www.youtube.com/embed/XGSy3_Czz8k">
</iframe>
:+1:
closing this issue until there is more information.
Hi there, did you get a solution ? I'm doing something alike and having exact the same problem. @viperfx
I'm also using angular in node webkit and cannot get embedded youtube videos to play. I get "An error has occurred. Please try again later"
Same error here as @moranm6 Edit: scratch that, my error actually was the lack of mp4 support in my nw build