如何使嵌入的视频不能自动播放 [英] How to make an embedded video not autoplay

查看:244
本文介绍了如何使嵌入的视频不能自动播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Flash视频嵌入到HTML中,并希望用户必须点击才能开始播放。根据 Adob​​e < object>
< embed> 元素文档
,有许多方法可以做到这一点: 1)在< object> 标记内添加一个Flash参数:

 < param name =playvalue =false> 



<2>添加属性 play < embed> 标记:

 < play ... play = 假 > 

3)在属性中添加属性 flashvars < embed> 标签:

 < embed ... flashvars = 播放=假 > 

这真棒。只有...他们都不为我工作:
$ b

http://johnboxall.github.com/test/flash/flash.htm



现在我的代码如下所示: / p>

 < object width =590height =475> 
< param name =movievalue =untitled_skin.swf>
< param name =playvalue =false>
< / object>

任何人有什么想法?我在做什么错了?

解决方案

您正在使用的各种自动播放设置仅影响SWF的根时间线是否开始暂停。所以如果你的SWF有一个时间轴动画,或者它在根时间轴上有一个嵌入的视频,那么这些设置将会做你以后的事情。



然而,您正在使用的SWF在其时间轴上只有一帧,因此这些设置完全不会影响播放。该框架包含一些视频播放组件,其中包含控制视频行为的ActionScript。要让播放器组件开始暂停,您必须更改组件本身的设置。



不知道内容来自哪里,很难多说,但是当从Flash发布时,视频播放器组件通常包括用于是否自动播放的参数。如果你的SWF是由除Flash以外的应用程序发布的(Captivate,我想,但我没有做到),那么你最好的选择是检查该应用程序的设置。无论如何,这是不是你可以从HTML页面的水平控制。 (除非你使用JavaScript与SWF交流,为了实现这个功能,视频组件必须被设计为允许它。)

I'm embedding a Flash video into an HTML and would like the user to have to click it to begin playing. According to the Adobe <object> / <embed> element documentation, there are variety of methods to do this:

1) Add a Flash parameter inside the <object> tag:

<param name="play" value="false">

2) Add the attribute play inside the <embed> tag:

<embed ... play="false">

3) Add the attribute flashvars inside the <embed> tag:

<embed ... flashvars="play=false">

Which is awesome. Only ... none of them work for me:

http://johnboxall.github.com/test/flash/flash.htm

My code looks like this now:

<object width="590" height="475">
    <param name="movie" value="untitled_skin.swf">
    <param name="play" value="false">
    <embed src="untitled_skin.swf" width="590" height="475" type="application/x-shockwave-flash" play="false" flashvars="autoplay=false&play=false" menu="false"></embed>
</object>

Anyone have any ideas? What am I doing wrong?

解决方案

A couple of wires are crossed here. The various autoplay settings that you're working with only affect whether the SWF's root timeline starts out paused or not. So if your SWF had a timeline animation, or if it had an embedded video on the root timeline, then these settings would do what you're after.

However, the SWF you're working with almost certainly has only one frame on its timeline, so these settings won't affect playback at all. That one frame contains some flavor of video playback component, which contains ActionScript that controls how the video behaves. To get that player component to start of paused, you'll have to change the settings of the component itself.

Without knowing more about where the content came from it's hard to say more, but when one publishes from Flash, video player components normally include a parameter for whether to autoplay. If your SWF is being published by an application other than Flash (Captivate, I suppose, but I'm not up on that) then your best bet would be to check the settings for that app. Anyway it's not something you can control from the level of the HTML page. (Unless you were talking to the SWF from JavaScript, and for that to work the video component would have to be designed to allow it.)

这篇关于如何使嵌入的视频不能自动播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆