paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.84k stars 271 forks source link

Enable JS control of playing video by adding enablejsapi=1 parameter to iFrame src #128

Closed hannahbeasley closed 7 months ago

hannahbeasley commented 2 years ago

It would be great to update the iFrame src so that controlling the video via JS is possible! Tested and verified that adding the parameter works perfectly. Reference to solution found here: https://stackoverflow.com/questions/15164942/stop-embedded-youtube-iframe#comment70304120_30358006

kingkool68 commented 7 months ago

You can pass any additional parameters to the YouTube iframe src using the params parameter like this <lite-youtube videoid="ogfYd705cRs" params="enablejsapi=1"></lite-youtube>

And here is a list of all the supported parameters and their values: https://developers.google.com/youtube/player_parameters#Parameters

paulirish commented 7 months ago

Yup can be done with params as mentioned. but now we have firstclass support via #164