gpt4 book ai didi

html - 视频播放加载,然后重定向到index.html

转载 作者:行者123 更新时间:2023-12-03 06:04:23 26 4
gpt4 key购买 nike

如何在加载网站时播放带有“跳过”选项的视频(或youtube视频)。如果单击了跳过视频,则它将重定向到index.html,但是如何设置它,以便在视频播放完毕后自动将index.html加载到网站中。

(如果视频必须嵌入index.html中,以便网站的其余部分也可以)。

请注意,我正在使用WordPress。

提前致谢。

最佳答案

您可以使用autoplay = 1并启用Youtube jsapi来执行所需的操作:

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

使用autoplay = 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

只需添加指向您网站的链接,跳过功能就更容易了。

关于html - 视频播放加载,然后重定向到index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6074408/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com