由于Embed標(biāo)簽是Netscape的私有財(cái)產(chǎn),故一直未被W3C認(rèn)可,對(duì)于各種媒體文件使用Embed標(biāo)簽是非標(biāo)準(zhǔn)的,如何改變?Elizabeth Castro的 Bye Bye Embed 一文對(duì)于各種媒體播放器給出了很好的符合web標(biāo)準(zhǔn)的代碼。
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>
上面的代碼沒(méi)有Windows Media Player特有的classid,作者在IE5.5, IE6, IE7, Opera Win/Mac, Firefox Win/Mac, Safari下測(cè)試通過(guò)。
QuickTime movies 沒(méi)有 embed 標(biāo)簽
代碼如下:
<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>
更多信息請(qǐng)查看IT技術(shù)專(zhuān)欄