一般在嵌入IE中的播放器都有一些要求,如支持ftp,http协议的,支持多种播放格式等。下面推荐2个播放。
1,qvod
<html>
<body>
<div>
<a href='#' οnclick='play(500,500,"ftp://...")'>测试</a></div>
<div id='content'>
</div>
</body>
<script>
function play(width,heigth,playUrl){
var StrHtml;
StrHtml = '<object id="QvodPlayer" name="QvodPlayer" width="'+width+'" height="'+height+'" classid="clsid:F3D0D36F-23F8-4682-A195-74C92B03D4AF" onError="show_ad()">';
StrHtml += '<PARAM NAME="URL" VALUE="'+playURL+'">';
StrHtml += '<param name="Autoplay" value="1">';
StrHtml += '<PARAM NAME="TextAd" VALUE="">';
StrHtml += '</object>';
document.getElementById('content').innerHTML = StrHtml;
}
</script>
</html>
2,vlc
<html>
<body>
<div>
<a href='#' οnclick='play(640,480,"ftp://....")'>测试</a>
</div>
<div>
<object classid="clsid:9be31822-fdad-461b-ad51-be1d1c159921"
width="640"
height="480"
id="vlc"
events="true">
<param name="mrl" value="" />
<param name="showdisplay" value="true" />
<param name="autoloop" value="false" />
<param name="autoplay" value="false" />
<param name="volume" value="50" />
<param name="starttime" value="0" />
<embed pluginspage="http://www.videolan.org"
type="application/x-vlc-plugin"
version="videolan.vlcplugin.2"
width="640"
height="480"
name="vlc">
</embed>
</object>
</div>
</body>
<script>
function play(width,heigth,playUrl){
var itemId = 0;
var vlc;
if (window.document["vlc"]){
vlc = window.document["vlc"];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1) {
if (document.embeds && document.embeds["vlc"])
vlc = document.embeds["vlc"];
}
else {
vlc = document.getElementById("vlc");
}
itemId=vlc.playlist.add(playURL);
vlc.playlist.playItem(itemId);
}
</script>
</html>