Search code examples
htmlinternet-explorerfirefoxgoogle-chromeswfobject

FLV Player not works in IE Browser?


I have the following piece of code which play the flv file,

<embed align="middle" width="185" height="121" 
    pluginspage="http://www.macromedia.com/go/getflashplayer" 
    type="application/x-shockwave-flash" allowfullscreen="true"
    allowscriptaccess="sameDomain"
    name="vidplayer" bgcolor="#eae7db" quality="high" f
    lashvars="file=<?= $vUrl; ?>" src="scripts/flvplayer.swf" />

Above code which works only in FF,chrome not in IE Browser.

Also i refered link How to embed a SWF file in an HTML page? changed the above code like below,

<object width="185" height="121">
    <param name="movie" value="<?php echo BASE_URL; ?>scripts/flvplayer.swf">
    <embed align="middle" width="185" height="121"
        pluginspage="http://www.macromedia.com/go/getflashplayer" 
        type="application/x-shockwave-flash" allowfullscreen="true" 
        allowscriptaccess="sameDomain" name="vidplayer" bgcolor="#eae7db"
        quality="high" flashvars="file=<?= $vUrl; ?>"
        src="scripts/flvplayer.swf" >
    </embed>
</object>

This above code works only in FF not in Chrome and IE.

How can i play my flv file in all browsers ?


Solution

  • Try this way.

     <script type="text/javascript">        
           var flashvars = {};
           var params = {};
           var attributes = {};     
           flashvars.mp3="mast.mp3";
           var so = new swfobject.embedSWF("player.swf", "myContent", "300", "120", "9.0.0",true, flashvars, params, attributes);
           so.write("myContent");
        </script>
    

    and have a look at this Documentation.