开发者

Troubleshooting a redirect after a video

开发者 https://www.devze.com 2023-02-09 10:51 出处:网络
This script should play a video then redirect to another page. The video portion loads and plays automatically. The redirect feature does not work after the video finishes playing. The code is below:

This script should play a video then redirect to another page.

The video portion loads and plays automatically. The redirect feature does not work after the video finishes playing. The code is below:

<video src="http://brigadapictures.com/images/image1.m4v" autoplay height="396" width="704">

video>

var listenToMe:Object = new Object();
listenToMe.complete = fun开发者_如何学Pythonction(evt) {
getURL("http://brigadapictures.com/Home.html");

}
myMediaPlayer.addEventListener("complete",listenToMe);


which Mediaplayer lib do you use? Does the player run into your complete event? If it does, try the following code, instead of getURL("http://brigadapictures.com/Home.html");

location.href = 'http://brigadapictures.com/Home.html';

BTW: in IE, you have to use attachEvent, instead of addEventListener.

https://developer.mozilla.org/en/DOM/element.addEventListener#Internet_Explorer

0

精彩评论

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