防止嵌入式HTML视频自动播放

时间:2015-10-08 20:35:04

标签: html video embed

这是我的代码:

<object id="flashObj" width="640" height="390" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0">
   <param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9?isSlim=0" />
   <param name="bgcolor" value="#FFFFFF" />
   <param name="flashVars" value="videoId=3945004669001&playerID=2868544859001&playerKey=AQ~~,AAAABvZFMzE~,IXjx0MpOF0rs6Zj6tTY84DVV4TqsG9K-&domain=embed&dynamicStreaming=true" />
   <param name="base" value="http://admin.brightcove.com" />
   <param name="seamlesstabbing" value="false" />
   <param name="allowFullScreen" value="true" />
   <param name="swLiveConnect" value="true" />
   <param name="allowScriptAccess" value="always" />
   <embed src="http://c.brightcove.com/services/viewer/federated_f9?isSlim=1" bgcolor="#FFFFFF" flashVars="videoId=3945004669001&playerID=2868544859001&playerKey=AQ~~,AAAABvZFMzE~,IXjx0MpOF0rs6Zj6tTY84DVV4TqsG9K-&domain=embed&dynamicStreaming=true" base="http://admin.brightcove.com" name="flashObj" width="640" height="390" seamlesstabbing="false" type="application/x-shockwave-flash" allowFullScreen="true" swLiveConnect="true" allowScriptAccess="always" pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></embed>
</object>

我需要添加哪些代码,或者如何防止其自动播放?

1 个答案:

答案 0 :(得分:0)

您可以尝试添加flashvars="play=false"

等内容

然而,这是否有效取决于许多不同的未知数。

查看How to make an embedded video not autoplay第一个答案提供了比我更好的解释。

然而,个人如果这是我遇到的问题,假设没有什么能阻止我这样做我会使用HTML5的视频标签将所需的视频转换为MP4并以这种方式使用它 查看W3cshools以获取有关HTML 5视频http://www.w3schools.com/html/html5_video.asp

的更多信息

我希望有所帮助!