开发者

Delay start of flash movie with autoplay?

开发者 https://www.devze.com 2023-01-25 05:05 出处:网络
I am wondering what my best option is to delay the loading/playing of a movie that is set to autoplay?

I am wondering what my best option is to delay the loading/playing of a movie that is set to autoplay?

The videos are all external if that matters; is there any kind of code I can fire within a javascript function once I want it to start? T开发者_如何学Pythonhat would be ideal.


var movie = '<object....><embed....</embed></object>';
window.onload=function() {
  var tId = setTimeout(function() {document.getElementById('movieContainer').innerHMTL=movie;},3000); // delay 3 secs
}
.
.
.
<div id="movieContainer"><img src="trailer.jpg" /></div>


Controlling the playback of an embedded SWF and a video loaded within the SWF are completely different tasks. If you'd like to delay the start of your video AFTER the SWF has been embedded, you'll need to set up some sort of delay method in your actionscript. If you'd like to control the video via JavaScript, you'll need to use ExternalInterface. There are some EI examples at http://learnswfobject.com/advanced-topics/external-interface/

0

精彩评论

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

关注公众号