符合web标准的媒体播放器代码
作者:
符合web标准的媒体播放器代码
由于Embed标签是Netscape的私有财产,故一直未被W3C认可,对于各种媒体文件使用Embed标签是非标准的,如何改变?Elizabeth Castro的 Bye Bye Embed 一文对于各种媒体播放器给出了很好的符合web标准的代码。
FLash文件
<object type="application/x-shockwave-flash"
data="http://video.google.com/googleplayer.swf? »
8755581808731033658"
width="400" height="326" id="VideoPlayback">
<param name="movie"
value="http://video.google.com/googleplayer.swf? »
docId=8755581808731033658" />
<param name="allowScriptAcess" value="sameDomain" />
<param name="quality" value="best" />
<param name="bgcolor" value="#FFFFFF" />
<param name="scale" value="noScale" />
<param name="salign" value="TL" />
<param name="FlashVars" value="playerMode=embedded" />
</object>
Windows Media Player 文件
<object type="video/x-ms-wmv"
data="http://www.sarahsnotecards.com/catalunyalive/ »
fishstore.wmv"
width="320" height="260">
<param name="src"
value="http://www.sarahsnotecards.com/catalunyalive/ »
fishstore.wmv" />
<param name="autostart" value="true" />
<param name="controller" value="true" />
</object>
上面的代码没有Windows Media Player特有的classid,作者在IE5.5, IE6, IE7, Opera Win/Mac, Firefox Win/Mac, Safari下测试通过。
QuickTime movies 没有 embed 标签
<object classid="clsid:02BF25D5-8C17-4B23-BC80- »
D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
width="320" height="260">
<param name="src"
value="http://www.sarahsnotecards.com/catalunyalive/ »
diables.mov" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<!--[if !IE]>-->
<object type="video/quicktime"
data="http://www.sarahsnotecards.com/catalunyalive/ »
diables.mov"
width="320" height="260">
<param name="autoplay" value="false" />
<param name="controller" value="true" />
</object>
<!--<![endif]-->
</object>
FLash文件
复制代码 代码如下:
<object type="application/x-shockwave-flash"
data="http://video.google.com/googleplayer.swf? »
8755581808731033658"
width="400" height="326" id="VideoPlayback">
<param name="movie"
value="http://video.google.com/googleplayer.swf? »
docId=8755581808731033658" />
<param name="allowScriptAcess" value="sameDomain" />
<param name="quality" value="best" />
<param name="bgcolor" value="#FFFFFF" />
<param name="scale" value="noScale" />
<param name="salign" value="TL" />
<param name="FlashVars" value="playerMode=embedded" />
</object>
Windows Media Player 文件
复制代码 代码如下:
<object type="video/x-ms-wmv"
data="http://www.sarahsnotecards.com/catalunyalive/ »
fishstore.wmv"
width="320" height="260">
<param name="src"
value="http://www.sarahsnotecards.com/catalunyalive/ »
fishstore.wmv" />
<param name="autostart" value="true" />
<param name="controller" value="true" />
</object>
上面的代码没有Windows Media Player特有的classid,作者在IE5.5, IE6, IE7, Opera Win/Mac, Firefox Win/Mac, Safari下测试通过。
QuickTime movies 没有 embed 标签
复制代码 代码如下:
<object classid="clsid:02BF25D5-8C17-4B23-BC80- »
D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
width="320" height="260">
<param name="src"
value="http://www.sarahsnotecards.com/catalunyalive/ »
diables.mov" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<!--[if !IE]>-->
<object type="video/quicktime"
data="http://www.sarahsnotecards.com/catalunyalive/ »
diables.mov"
width="320" height="260">
<param name="autoplay" value="false" />
<param name="controller" value="true" />
</object>
<!--<![endif]-->
</object>