开发者

Video play onload and then redirect to index.html

开发者 https://www.devze.com 2023-03-07 19:48 出处:网络
How can I have a video (or youtube video) play on loading my website with the option to \"s开发者_JAVA百科kip\". If the skip video is clicked then that will redirect to the index.html however how can

How can I have a video (or youtube video) play on loading my website with the option to "s开发者_JAVA百科kip". If the skip video is clicked then that will redirect to the index.html however how can I set it up so that when the Video finishes playing it automatically loads the index.html in the website.

(If the video has to be embedded in the index.html so that the rest of the website is elsewhere that's fine too).

Just a heads up I am using WordPress.

Thanks in advance.


You can use autoplay=1 and enable the Youtube jsapi to do what you want:

http://code.google.com/apis/youtube/player_parameters.html#enablejsapi

Use autoplay=1&enablejsapi=1

Then use Youtube Javascript Api event onStateChange

This event is fired whenever the player's state changes. Possible values are unstarted
(-1), ended (0), playing (1), paused (2), buffering (3), video cued (5). When the SWF 
is first loaded it will broadcast an unstarted (-1) event. When the video is cued and 
ready to play it will broadcast a video cued event (5).

http://code.google.com/apis/youtube/js_api_reference.html#Operations

The skip function is easier just add a link to your website.

0

精彩评论

暂无评论...
验证码 换一张
取 消