anteriovieira / vue-youtube

A simple component for a powerful API. vue-youtube provides a simple layer for you to use your imagination while over the YouTube IFrame Player API.
MIT License
340 stars 56 forks source link

Option to use youtube embed with privacy enhanced mode (-nocookie youtube) #55

Closed henryzt closed 4 years ago

henryzt commented 4 years ago

Currently all the plays on the embedded youtube video will get tracked and stored in user's youtube watch history, this might not be an intended behaviour of many apps.

Adding an option to disable this would be awesome, and I think this can be implemented simply by adding -nocookie to the youtube embed URL, such as https://www.youtube-nocookie.com/embed/O17OWyx08Cg.

More about this mode can be found here

jamalroger commented 4 years ago

add host to player-vars porps

<youtube  ref="youtube" :video-id="video" :player-vars="{host:'www.youtube-nocookie.com'}"></youtube>
henryzt commented 4 years ago

add host to player-vars porps

<youtube  ref="youtube" :video-id="video" :player-vars="{host:'www.youtube-nocookie.com'}"></youtube>

Thanks! Unfortunately, that did not work for me. It seems that host para should be at the same level as player-vars when passed to the actual youtube player.

henryzt commented 4 years ago

Actually, after digging through the source code, turns out this function is already implemented 😅 . Just set nocookie prop to true, the host param will be changed to www.youtube-nocookie.com.