-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getVideoData is not a function error #36
Comments
Dan, I still have this issue in a specific situation (this page). What exactly was the fix? The commit only contains an updated comment. |
@rmeekers Should've tagged this: 5162442#diff-2b793c9228aa48c6a2b22a75d366918bL151 Basically the issue was the code was calling new YT.Player() on all elements that might be YouTube videos, but sometimes YT.Player's had already been created with the element by other code (like yours). Now the script uses YT.get() first to see if a Player has already been initialized on the given DOM element, and uses the existing Player if so. Try with the latest version and see if it solves your issues. |
@DanWilkerson as far as I can see, the binding goes fine.
I've found some info about the We should use the YouTube API instead by calling |
@rmeekers That API was deprecated a little while ago and can no longer be used to retrieve title information; we actually switched to using .getVideoURL() a few versions back because of this. Update to the latest version and you'll be all set. |
@DanWilkerson I still get this error for some videos. Even with the current version of the script. I tried debugging it but can't find out what's going wrong. Any suggestions where I can look?
|
If you share a page where I can reproduce, I'd be happy to take a look! |
I've sent it by email (contact form on your website) few days ago. |
I can't seem to see the page any longer, but I did take a look and my guess is that some code on the page is messing with the functionality of the plugin. I'd try having just the video and the YouTube tracking script, then adding back in other stuff until it breaks again. |
When the script binds to an element that already is an YT player, it breaks. We can fix this by checking to see if YT.get(elementId || 'widget' + n), where n is the count of YouTube iframes we're on. If this is the case, we might be able to attach an event listener.
The text was updated successfully, but these errors were encountered: