支持播放列表的FLV播放器Vcastr 3.0

Vcastr 是开源的FLV播放器,使用简单,并且功能可以通过插件不断增加其功能,在页面中调用方式为:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="507" height="370">
  <param name="movie" value="vcastr3.swf" />
  <param name="quality" value="high" />
  <param name="allowFullScreen" value="true" />
  <param name="FlashVars" value="xml=xml文件路径或xml片断" />
  <embed src="vcastr3.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="507" height="370"></embed>
</object>

xml文件/片断内容如下:

<vcastr>
        <channel>
                <item>
                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                        <duration></duration>
                        <title></title>
                </item>
                <item>
                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                        <duration></duration>
                        <title></title>
                </item>
                <item>
                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                        <duration></duration>
                        <title></title>
                </item>
        </channel>
        <config>
                <bufferTime>4</bufferTime>
                <contralPanelAlpha>0.75</contralPanelAlpha>
                <controlPanelBgColor>0xff6600</controlPanelBgColor>
                <controlPanelBtnColor>0xffffff</controlPanelBtnColor>
                <contralPanelBtnGlowColro>0xffff00</contralPanelBtnGlowColro>
                <controlPanelMode>float</controlPanelMode>
                <defautVolume>0.8</defautVolume>
                <isAutoPlay>true</isAutoPlay>
                <isLoadBegin>true</isLoadBegin>
                <isShowAbout>true</isShowAbout>
                <scaleMode>showAll</scaleMode>
        </config>
</vcastr>

节点说明:

引用内容 引用内容
source:flv影片地址参数(必填)
duration:影片的总时间,单位是秒
tilte:影片的标题
link:影片点击后的链接
bufferTime:在缓存区影片的时间,单位是秒
contralPanelAlpha:控制栏的透明度,在 0-1 之间
controlPanelBgColor:控制栏背景的颜色
controlPanelBtnColor:控制按钮的颜色
contralPanelBtnGlowColro:控制按钮光晕的颜色
defautVolume:默认的声音大小,最大为1,最小为0
controlPanelMode:控制栏的显示模式,float|normal|bottom|none
isAutoPlay:是否影片自动开始播放,默认是true
isLoadBegin:是否一开始就读取影片,默认是true
isRepeat:是否循环播放影片,默认是false
isShowAbout:是否显示关于信息
scaleMode:影片放缩模式,showAll|exactFil|noScale|noBorder

上边xml内容可单独放在一个xml文件中(编码为utf-8),也可以直接跟在"xml="后面(为符合w3c标准,此时可用{代替<,}代替>),例如:

<object type="application/x-shockwave-flash" data="vcastr3.swf" width="650" height="500" id="vcastr3">
    <param name="movie" value="vcastr3.swf"/>
    <param name="allowFullScreen" value="true" />
    <param name="FlashVars" value="xml=
        {vcastr}
            {channel}
                {item}
                    {source}http://vcastr.ruochi.com/video/happy_feet.flv{/source}
                    {duration}{/duration}
                    {title}{/title}
                {/item}
            {/channel}
            {config}
            {/config}
        {/vcastr}"/>
</object>

页面中可用Javascript来对播放器进行控制,常用方法如下(FLVObject为页面的Vcastr播放器对象):

播放:FLVObject.videoPlay()
暂停:FLVObject.pause()
播放/暂停:FLVObject.playPause()
停止:FLVObject.videoStop()
上一个:FLVObject.prev()
下一个:FLVObject.next()
音量:FLVObject.volumeTo(n)


Vcastr 3.0源码下载:http://www.mzwu.com/pic/200902/Vcastr 3.0.zip
Vcastr 3.0官方站点:http://www.ruochi.com/main/2008/03/19/vcastr-30/

评论: 2 | 引用: 0 | 查看次数: 8825
dnawo[2011-10-10 10:16 AM | | | 120.36.4.61 | del | 回复回复]
板凳
@mol_xue,建议对地址进行编码应能解决
mol_xue[2011-10-09 04:26 PM | | | 1.202.132.26 | del | 回复回复]
沙发
请问source:flv影片地址我写了中文,会找不到影片,乱码,是由于本身不支持中文吗?
发表评论
登录后再发表评论!