当前位置: 代码迷 >> JavaScript >> 在页面中安插视频
  详细解决方案

在页面中安插视频

热度:145   发布时间:2012-09-07 10:38:15.0
在页面中插入视频
我想在网页中插入个视频,但是用了两个方法都不行,不知道为什么,请各位指点下。或者还有别的方法没有?
<embed height="340" width="439" src="/userfiles/1.mpg">用这个不知道为什么在XP系统中就不能播放,而且好像IE6、360浏览器也都有问题。
<object classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" id="ActiveMovie1" width="239" height="250"> 
<param name="Appearance" value="0"> 
<param name="AutoStart" value="-1"> 
<param name="AllowChangeDisplayMode" value="-1"> 
<param name="AllowHideDisplay" value="0"> 
<param name="AllowHideControls" value="-1"> 
<param name="AutoRewind" value="-1"> 
<param name="Balance" value="0"> 
<param name="CurrentPosition" value="0"> 
<param name="DisplayBackColor" value="0"> 
<param name="DisplayForeColor" value="16777215"> 
<param name="DisplayMode" value="0"> 
<param name="Enabled" value="-1"> 
<param name="EnableContextMenu" value="-1"> 
<param name="EnablePositionControls" value="-1"> 
<param name="EnableSelectionControls" value="0"> 
<param name="EnableTracker" value="-1"> 
<param name="Filename" value="视频地址" valuetype="ref"> 
<param name="FullScreenMode" value="0"> 
<param name="MovieWindowSize" value="0"> 
<param name="PlayCount" value="1"> 
<param name="Rate" value="1"> 
<param name="SelectionStart" value="-1"> 
<param name="SelectionEnd" value="-1"> 
<param name="ShowControls" value="-1"> 
<param name="ShowDisplay" value="-1"> 
<param name="ShowPositionControls" value="0"> 
<param name="ShowTracker" value="-1"> 
<param name="Volume" value="-480"> 
</object> 
网上有很多是用这个方法,但我也还是播放不了。

------解决方案--------------------
你播放的是什么格式的?转成flv的吧,网上flv代码的很多,你上面那段代码我没用过
------解决方案--------------------
格式与浏览器兼容性是考虑重中之重
------解决方案--------------------
HTML code

  <form id="form1" runat="server">
    
    
<object id="MediaPlayer" width="320" height="240" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase= http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 
standby="Loading Microsoft? Windows Media? Player components..." type="application/x-oleobject"  onclick="alert('a')">
<param name="AudioStream" value="0">
<param name="URL" value="hiv00007.wmv ">
<param name="UIMode" value="full">
<param name="AutoStart" value="true">
<param name="Enabled" value="true">
<param name="enableContextMenu" value="true">
</object>


<input type="button" value="暂停" onclick="msg()" />


<object ID="javademo" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" 
        HEIGHT="280"> 
<param name="AUTOSTART" value="0"> 
<param name="SHUFFLE" value="0"> 
<param name="PREFETCH" value="0"> 
<param name="NOLABELS" value="0"> 
<param name="SRC" value="hiv00007.wmv"> 
<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>  

<%--<embed src="hiv00007.wmv" width="331" height="240" autostart="true"></embed>--%>


<object id="mePlay" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,5,0803" 
standby="Loading Windows Media Player components..." 
        type="application/x-oleobject" 
        style="border:1px solid #666666; width: 372px; height: 70px;"> 
<param NAME="AutoStart" VALUE="-1"> 
<!--是否自动播放--> 
<param NAME="Balance" VALUE="1"> 
<!--调整左右声道平衡,同上面旧播放器代码--> 
<param name="enabled" value="-1"> 
<!--播放器是否可人为控制--> 
<param NAME="EnableContextMenu" VALUE="-1"> 
<!--是否启用上下文菜单--> 
<param NAME="url" VALUE="hiv00007.wmv"> 
<!--播放的文件地址--> 
<param NAME="PlayCount" VALUE="1"> 
<!--播放次数控制,为整数--> 
<param name="rate" value="1"> 
<!--播放速率控制,1为正常,允许小数,1.0-2.0--> 
<param name="currentPosition" value="0"> 
<!--控件设置:当前位置--> 
<param name="currentMarker" value="0"> 
<!--控件设置:当前标记--> 
<param name="defaultFrame" value=""> 
<!--显示默认框架--> 
<param name="invokeURLs" value="0"> 
<!--脚本命令设置:是否调用URL--> 
<param name="baseURL" value=""> 
<!--脚本命令设置:被调用的URL--> 
<param name="stretchToFit" value="0"> 
<!--是否按比例伸展--> 
<param name="volume" value="50"> 
<!--默认声音大小0%-100%,50则为50%--> 
<param name="mute" value="0"> 
<!--是否静音--> 
<param name="uiMode" value="mini"> 
<!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示--> 
<param name="windowlessVideo" value="0"> 
<!--如果是0可以允许全屏,否则只能在窗口中查看--> 
<param name="fullScreen" value="0"> 
<!--开始播放是否自动全屏--> 
<param name="enableErrorDialogs" value="-1"> 
<!--是否启用错误提示报告--> 
<param name="SAMIStyle" value> 
<!--SAMI样式--> 
<param name="SAMILang" value> 
<!--SAMI语言--> 
<param name="SAMIFilename" value> 
<!--字幕ID--> 
</object> 


<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="phx" width="245">
<param name="URL" value="hiv00007.wmv">
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="59.000">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="autoStart" value="0">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="6482">
<param name="_cy" value="6350">
</object>





    </form> 
  相关解决方案