justinribeiro / lite-youtube

The fastest little YouTube web component on this side of the internet. The shadow dom web component version of Paul's lite-youtube-embed.
https://www.npmjs.com/package/@justinribeiro/lite-youtube
MIT License
948 stars 70 forks source link

params function not working #32

Closed Bandarian closed 3 years ago

Bandarian commented 3 years ago

Hey guys,

Been implementing this wonderful lite-youtube solution on my clients site to much success. Recently when asked to add the rel=0 param to the videos I followed the instructions listed and nothing happens. I also tried a load of other parameters to no success either. Could anyone assist me in getting the params to work :)

<lite-youtube videoid="arygCLXYB7Y" params="rel=0"> </lite-youtube>

justinribeiro commented 3 years ago

I followed the instructions listed and nothing happens

Appears to be working fine; the parameters are appended to the YouTube iframe src target as expected. What are you expecting to occur? Do you not see the params at the end of the src url as in the screenshot below?

ss-2021-08-20-justinribeiro-001

Bandarian commented 3 years ago

Hey Justin,

Thanks for getting back to me. I can see that it's working on the shot you sent me. However, on inspecting the site where I've input the code it doesn't appear to be affixing itself to the end of the src link. I've put the code inside an HTML embed inside my Webflow site here please take a look if you wish.

Screenshot (91)

The code is:

image

Thanks so much for your help

justinribeiro commented 3 years ago

You're using an old version that didn't support the params attr: ss-2021-08-20-justinribeiro-005

update your include line to:

<script type="module" 
src="https://cdn.jsdelivr.net/npm/@justinribeiro/lite-youtube@0.9.1/lite-youtube.js">
</script> 

and you'll be golden (seen her with an devTools override): ss-2021-08-20-justinribeiro-004

Bandarian commented 3 years ago

Awesome!

Thanks so much mate appreciate the help.

:)

yeaske commented 3 years ago

The CDN link in readme still shows old version. I guess that is causing this confusion.