2011-11-04 83 views
0

我有下面這段代碼播放FLV文件,FLV播放器無法在IE瀏覽器中使用?

<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" /> 

以上這些只能在FF的代碼,鉻不能在IE瀏覽器。

此外,我refered鏈路How to embed a SWF file in an HTML page?改變像下面的上面的代碼,

<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> 

這上面的代碼只能工作在FF不是在鉻和IE。

如何在所有瀏覽器中播放我的flv文件?

回答

1

試試這個方法。

<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> 

並看看這個Documentation

+0

非常感謝 – mymotherland

相關問題