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

Add a js-api attribute to opt-in to the YouTube Iframe Player API #164

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

zachleat
Copy link
Contributor

@zachleat zachleat commented Feb 23, 2024

Allows using the getPlayer asynchronous method to access the player instance to control the video.

https://developers.google.com/youtube/iframe_api_reference#seekTo

Added an additional test/demo that shows usage examples.

Inspired by work on this stream: https://www.youtube.com/watch?v=MrVMewBq0jE

This comment was marked as off-topic.

@zachleat zachleat changed the title Add the js-api to unlock usage of the YouTube Iframe Player API Add a js-api attribute to unlock usage of the YouTube Iframe Player API Feb 23, 2024
@zachleat zachleat changed the title Add a js-api attribute to unlock usage of the YouTube Iframe Player API Add a js-api attribute to opt-in to the YouTube Iframe Player API Feb 23, 2024
Copy link
Owner

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

she's a beauty! i have no nits, even.

thank you much @zachleat :D

@paulirish paulirish merged commit bc16d39 into paulirish:master Mar 2, 2024
2 checks passed
@paulirish
Copy link
Owner

Danke!

@Stanzilla
Copy link

Demo errors with

Uncaught (in promise) TypeError: video.getPlayer is not a function
    at seekTo (js-api.html:17:27)
    at HTMLButtonElement.onclick (js-api.html:25:59)

@zachleat
Copy link
Contributor Author

zachleat commented Mar 4, 2024

@Stanzilla looks like it was post-merge refactored as getYTPlayer.

@paulirish don’t forget to change README.md and variants/js-api.html too!

@zachleat
Copy link
Contributor Author

zachleat commented Mar 4, 2024

(also, yay! thanks!)

@paulirish
Copy link
Owner

paulirish commented Mar 4, 2024

@Stanzilla looks like it was post-merge refactored as getYTPlayer.
@paulirish don’t forget to change README.md and variants/js-api.html too!

Yup yup. Thanks! missed these. 😊

Edit: all fixed and shipped a 0.3.2 just to make sure readme docs are good on npm.

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

Successfully merging this pull request may close these issues.

3 participants