Clickable video embedded with JS
H开发者_如何学Goow do I make it so when I have an embed code for a video, if they click the video it goes to another page? but doesn't mess with the controls of the video itself?
Thanks!
Usually, the "link" the video goes to is actually controlled by the flash movie that plays the video. If you use HTML5 video, you can control it better with usual JS event listeners, but it's not supported everywhere.
Alternatively, you can put an absolutely positioned transparent image over the video part of the player, and use JS (or an tag) to turn it into a link to elsewhere, while leaving the controls uncovered. I would test this thoroughly, and it may not work as expected on older IE versions.
精彩评论