0

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>    

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.

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.

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

Any one can help us to solve the issue?

Yudong Li
  • 1,784
  • 2
  • 17
  • 32
  • There is a similar question being asked before: http://stackoverflow.com/questions/8753846/both-html5-video-and-flash-fallback-loading-if-browser-supports-both. However, the answer is take html5 as a default player and then fallback to flash if needed. But what we would really like is take the flash as the preferred player and then fallback to html5 if necessary. – Yudong Li May 28 '12 at 03:52

1 Answers1

1

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.

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

Digitalis
  • 570
  • 2
  • 12
  • I don't think I quite got your answer. What happens now is both html5 and flash are executed, but this is not what I want.I would like only flash executed and if not, then html5. – Yudong Li May 28 '12 at 03:54
  • The idea is that you paste the html 5 code as the alternative content to show. – Digitalis May 28 '12 at 04:13
  • Sounds like a reasonable solution though I am not familiar with swfobject. Will come back to confirm, but thanks in advance! – Yudong Li May 28 '12 at 04:40
  • Don't mention it. I'm going to drink some coffee to prevent further bogus answers ;) Good luck and do let me know if it worked out. – Digitalis May 28 '12 at 04:45
  • Yep, it indeed solves my problem! swfobject is a pretty good tool, simple, just a simple if can let me play lots of tricks there. BTW, if you are really in Netherslands, omg that is only 7am. Thanks for your reply! – Yudong Li May 28 '12 at 05:00
  • :) Nice, glad to be of service. It is indeed 7AM, and it is indeed the Netherlands. However, I'm on a coding tear. Just taking a break solving other peoples challenges. Good luck in further development! – Digitalis May 28 '12 at 05:04