html中嵌入flash视频,SWFObject嵌入的方式网上已经泛滥,这里只介绍一种方式,使用object嵌入的方式。个人使用后很好用,也很简单。
先上一个文件截图
再上代码
<div id="flash" style="">
<object type="application/x-shockwave-flash" data="images/swf/vcastr3.swf" width="100%" height="100%" id="vcastr3">
<param name="movie" value="vcastr3.swf">
<param name="allowFullScreen" value="true">
<param name="FlashVars" value="xml=images/swf/vcastr.xml">
</object>
</div>
这里看到的三个文件中,vcastr3.swf其实是一个容器,真正的显示文件是show.flv,其中vcastr.xml是配置FlashVars的值,xml文件如下:
<?xml version="1.0" encoding="utf-8" ?>
<vcastr>
<channel>
<item>
<source>./show.flv</source>
<duration></duration>
<title>your video</title>
</item>
</channel>
<config>
<bufferTime>4</bufferTime>
<contralPanelAlpha>0.55</contralPanelAlpha>
<controlPanelBgColor>0xEDB307</controlPanelBgColor>
<controlPanelBtnColor>0xffffff</controlPanelBtnColor>
<contralPanelBtnGlowColro>0xffff00</contralPanelBtnGlowColro>
<controlPanelMode>normal</controlPanelMode>
<defautVolume>0.7</defautVolume>
<isAutoPlay>true</isAutoPlay>
<isLoadBegin>true</isLoadBegin>
<isShowAbout>false</isShowAbout>
<scaleMode>showAll</scaleMode>
<isRepeat>true</isRepeat>
</config>
<plugIns>
</plugIns>
</vcastr>
很明显,其中配置的source值就是源文件show.flv,其他的都是根据字面意思即可理解。
就是这么简单。