Fred McDowell
Fred McDowell

Reputation: 51

Is it possible to disable cookies for YouTube API iFrame Player

I am wondering if there is a "nocookie" option when using the API? https://developers.google.com/youtube/iframe_api_reference

Upvotes: 5

Views: 6645

Answers (3)

If you are using the src attribute for the iframe:

src="http://www.youtube-nocookie.com/embed/video_id?.."

Upvotes: 0

Jelle Verzijden
Jelle Verzijden

Reputation: 325

It's possible to overwrite the default host with the no-cookie domain. Example:

player = new YT.Player('youtubePlayer', {
    videoId : ID,
    height : '300px',
    width : '100%',
    host: 'http://www.youtube-nocookie.com',
    playerVars: {rel: 0},
    events : {
        'onReady' : onPlayerReady,
        'onStateChange' : onPlayerStateChange
    }
});

Upvotes: 12

MαπμQμαπkγVπ.0
MαπμQμαπkγVπ.0

Reputation: 6737

Here is a github code you can use.

I got the reference from the SO post

The free cookie law tools with features was also given in the post.

Another way also is to use the www version that was an answer given in the SO post.

That is the version their automatic code generator outputs as well, when you chose the extended privacy option.

Looks like they removed the non-www version for some reason. (Although doing that without adding an automatic redirect would be kind of a weird move. Perhaps it is just a temporary problem or error.)

Upvotes: 0

Related Questions