2011-05-20 42 views
0

如何使用「跳過」選項加載我的網站時播放視頻(或youtube視頻)。如果單擊跳過的視頻,那麼它將重定向到index.html,但是如何設置它以便在視頻播放完畢後自動加載網站中的index.html。視頻播放onload,然後重定向到index.html

(如果視頻必須嵌入index.html,以便其他網站的其他地方也可以)。

只是頭向上我正在使用WordPress。

在此先感謝。

回答

1

您可以使用自動播放= 1並啓用的Youtube JSAPI做你想做什麼:

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

使用自動播放= 1個& enablejsapi = 1

然後使用YouTube的JavaScript API事件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

跳過功能更容易,只需添加一個鏈接到您的網站。

相關問題