David Tuite
David Tuite

Reputation: 22663

Prevent embedded YouTube player from plating onclick

When you embed a YouTube video in a page, there is a big play button in the middle of it which plays the video when clicked. For example:

example of button

Is there a way that I can capture this click event before it plays the video and divert it to do something else?

Upvotes: 2

Views: 1161

Answers (1)

dutchguy
dutchguy

Reputation: 333

You can put something on top of it..it can link or execute some code
If Youtube player is Flash ..then you need to add the parameter
wmode=transparent to the player embed-code
this will prevent the Flash to stay on top.

Officially its against Youtube´s rules (T.O.S.) to overlay anything on top
even worse if it misleads the visitor...who thinks he will play the video
but gets redirected to something else.
Make at least shure that clicking the play-video button will indeed play that video.

Upvotes: 1

Related Questions