用户无法播放real文件,但是用户是安装了realpaly的,播放本地文件也是正常的。
我用javascript先判断客户端是否有realplay,也都是判断出来没有播放器
var RealMode=0;var RealPlayer5=0;var RealPlayer4=0;var RealPlayerG2=0;
if (navigator.userAgent.indexOf("MSIE")< 0 ){numPlugins = navigator.plugins.length;for (i = 0; i < numPlugins; i++){plugin = navigator.plugins[i];if (plugin.name.substring(0,10)=="RealPlayer"){RealMode=1;}}}// 以下代码通过VBScript的CreateObject()函数动态的创建RealPlayer对象document.write('<SCRIPT LANGUAGE=VBScript\> \n');document.write('on error resume next \n');document.write('RealPlayerG2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n');document.write('RealPlayer5 = (NOT IsNull(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")))\n');document.write('RealPlayer4 = (NOT IsNull(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)")))\n');document.write('</script\> \n');if ( RealPlayerG2 || RealPlayer5 || RealPlayer4 ){//可以在此处添加<object>对象}else if ( RealMode ){ // NetScape浏览器用户// 可以在此处加入<embed>对象}else{alert("请先安装realplayer再观看影片,您可以从本站首页下载这个软件进行安装"); 
window.location="/index.html";
————————————————————————————————————<OBJECT id="player" height="300" onerror="alert('没有安装RealPlayer');location.href='help/help_01.htm1'" width="458" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" name="player" viewastext>
<PARAM NAME="_ExtentX" VALUE="12118">
<PARAM NAME="_ExtentY" VALUE="7938">
<PARAM NAME="AUTOSTART" VALUE="-1">
<PARAM NAME="SHUFFLE" VALUE="0">
<PARAM NAME="PREFETCH" VALUE="0">
<PARAM NAME="NOLABELS" VALUE="0">
<PARAM NAME="SRC" VALUE="<%=strUrl%>">
<PARAM NAME="CONTROLS" VALUE="Imagewindow">
<PARAM NAME="CONSOLE" VALUE="clip1">
<PARAM NAME="LOOP" VALUE="0">
<PARAM NAME="NUMLOOP" VALUE="0">
<PARAM NAME="CENTER" VALUE="0">
<PARAM NAME="MAINTAINASPECT" VALUE="0">
<PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
</OBJECT>
<OBJECT id="RP2" style="WIDTH: 458px; HEIGHT: 60px" height="60" width="458" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
viewastext>
<PARAM NAME="_ExtentX" VALUE="12118">
<PARAM NAME="_ExtentY" VALUE="1588">
<PARAM NAME="AUTOSTART" VALUE="-1">
<PARAM NAME="SHUFFLE" VALUE="0">
<PARAM NAME="PREFETCH" VALUE="0">
<PARAM NAME="NOLABELS" VALUE="0">
<PARAM NAME="SRC" VALUE="<%=strUrl%>">
<PARAM NAME="CONTROLS" VALUE="ControlPanel,StatusBar">
<PARAM NAME="CONSOLE" VALUE="clip1">
<PARAM NAME="LOOP" VALUE="0">
<PARAM NAME="NUMLOOP" VALUE="0">
<PARAM NAME="CENTER" VALUE="0">
<PARAM NAME="MAINTAINASPECT" VALUE="0">
<PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
</OBJECT>