Jacob
Jacob

Reputation: 624

How to prevent related videos from showing up when pausing an embedded YouTube video (YouTube API)

I have a youtube player integrated into my site, the problem is if I'm logged into my google account, every time I pause the video an inline menu appears showing recommended videos. Using playerVars: {rel: 0} only removed the recommended videos from the end, so that doesn't work for this problem. I could be mistaken, but I think this is a new feature of the Youtube API.

So, my question is, is there an option to removed those related videos without logging out of my google account

Upvotes: 1

Views: 2006

Answers (1)

anon123
anon123

Reputation: 1

Implement your own pause:

  • capture the pre-pause state
  • mute
  • setPlaybackRate to the slowest possible (e.g. 0.25)
  • seekTo the pre-pause state's time every 100ms

Implement your own play:

  • revert back to the pre-pause state

Incorporate these implementations with detecting state changes (e.g. onStateChange for the pause value of 2)

Upvotes: 0

Related Questions