当使用flash到html5后备时,如果设置html5自动播放为真,则两个播放器都将播放 [英] Both player will playback if set html5 autoplay to be true when using flash to html5 fallback

查看:292
本文介绍了当使用flash到html5后备时,如果设置html5自动播放为真,则两个播放器都将播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个页面使用和标签启用flowplayer flash到html5后备。下面的代码片段如下:

We have a page that use the and tags to enable flowplayer flash to html5 fallback. A code snippet is below:

<object id="flowplayer" width="100%" height="100%" bgcolor="#000000"
data="/flowplayer/3.2.11/flowplayer.unlimited-3.2.11.swf"
type="application/x-shockwave-flash"> 

<param name="movie" value="flowplayer/3.2.11/flowplayer.unlimited-3.2.11.swf" /> 

<param name="allowfullscreen" value="true" /> 
<param value="always" name="allowscriptaccess"/>
<param value="high" name="quality"/>
<param value="true" name="cachebusting"/>
<param value="#000000" name="bgcolor"/> 

<param value="config=/r/m/veuscqj/e8EJVo/config" name="flashvars"/>

    <video controls="controls" autoplay  style="height:100%; width:100%;">
            <source src="/veuscqj/25aRpC/20120521011327_CONT3Emp4MEDIUM_mp4-MEDIUM.mp4"
                type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'
            >
    </video>    

问题出在我们设置的时候对于html5播放器的自动播放属性,如果给定的浏览器支持html5并提供编码,浏览器将始终几乎同时播放两个播放器(flash和html5)。结果,你会听到两个音频在后台播放,有几秒钟的差距。

The problem is when we set autoplay attribute for html5 player, the browser will always play the two players (flash and html5) nearly simultaneously if the given browser supports html5 and provided encodes. As a result, you will hear two audios playing at the background with seconds gap.

理论上,我们认为html5播放器只会在flash对象时触发然而,无法加载,实际上无论浏览器如何都会加载播放器。

In theory, what we thought is the html5 player will only be trigger if the flash object failed to load, however, in reality it appears both player being loaded regardless the browser.

如果为html5禁用自动播放,则不会出现此问题。

The issue will not occur if the autoplay is disabled for html5.

任何人都可以帮我们解决问题?

Any one can help us to solve the issue?

推荐答案

请原谅我之前的回答。

Excuse my previous answer.

但是,我找到了另一种解决方案。我们需要检查闪存是否可用,对吗?
如果是这种情况,此链接可能会有用。

I have, however, found you an alternate solution. We need to check whether flash is available, correct? If that's the case, this link might prove useful.

关键是,你可以使用swfobject创建一个if / else结构来确定需要显示什么并因此执行。

The point being, you can use swfobject to create an if / else structure to determine what needs to be displayed and therefore executed.

这篇关于当使用flash到html5后备时,如果设置html5自动播放为真,则两个播放器都将播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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