0

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? That would be ideal.

4

2 回答 2

2
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>
于 2010-11-14T15:28:14.160 回答
0

控制嵌入的 SWF 和 SWF 中加载的视频的播放是完全不同的任务。如果您想在嵌入 SWF 之后延迟视频的开始,您需要在您的动作脚本中设置某种延迟方法。如果您想通过 JavaScript 控制视频,则需要使用 ExternalInterface。在http://learnswfobject.com/advanced-topics/external-interface/有一些 EI 示例

于 2010-11-14T23:43:54.407 回答