ng-youtube-embed
ng-youtube-embed copied to clipboard
player.playVideo is not a function
The play button on your codepen demo doesn't work and i'm trying to do something like that :(
For some reason, the object returned from Youtube API is different from the documents. I needed the player.stopVideo and it gave me the same error. I have debuged the object returned and none of the methods was there.
If you're having trouble developing on your local pc, adding port to the iframe's origin address may solve it. I solved it that way.
@zumbrother What are you referring to, "adding port to the iframe's origin address"? I was struggling with this same issue.
http://unlockcampus.org/code/tutoring/ng-youtube-embed-demo
This example is live and working.
@jmoseman01 If you are using the IFrame API, , you should always specify your domain as the origin parameter value. This library considers the domain, but not the port. Therefore, 80 port will work as default, but won't work for any other port. So if your problem is similar with mine, you can solve the problem by adding the code to add port.
@zumbrother have you thought about doing a pull request with your change? I almost stopped using this library without the added info from this ticket.
@jmoseman01 After downloading the library, I just modified the line 50 of the source code (ng-youtube-embed.js) from 'options.origin = host;' to 'options.origin = host + ':' + window.location.port;' That's all I did.