Skip to content
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

Browser use #64

Open
lollita opened this issue Dec 25, 2020 · 2 comments
Open

Browser use #64

lollita opened this issue Dec 25, 2020 · 2 comments

Comments

@lollita
Copy link

lollita commented Dec 25, 2020

How to use in browser?

<script src='https://www.youtube.com/iframe_api' async></script> <script type="text/javascript" src="yt-player.js"></script> const player = new YTPlayer('#player')

I get "Uncaught ReferenceError: YTPlayer is not defined".

@verhulstd
Copy link

verhulstd commented Apr 21, 2021

Seems like the global var to use is ytPlayer instead of YTPlayer.
So use
const player = new ytPlayer('#player')

@lollita
Copy link
Author

lollita commented Apr 21, 2021

Loading failed for the <script> with source “https://www.youtube.com/iframe_api”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants