日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Vcastr 3.0 - flash video(flv) player (开源 Open Source)

發布時間:2025/4/14 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Vcastr 3.0 - flash video(flv) player (开源 Open Source) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

特點

  • 使用as3.0重新寫了播放器
  • 播放器大小縮小,在20+k左右
  • 可以通過xml對播放器設置
  • 可以播放多個影片,并且有影片列表
  • 可以設置循環播放,自動播放,是否直接開始下載,控制欄的顏色和模式
  • 控制欄可以適應超小的尺寸
  • 可以使用插件擴充播放器的功能
  • 可以用插件設置logo及連接
  • 可以用插件來用javascript控制播放器
  • 可以用插件來用設定播放器開始或者結束的圖片或者flash(swf) beta

更新歷史

  • 更新歷史

下載

  • beta 實例
  • beta 源代碼
  • 實例
  • 源代碼
  • Google Code Project Hosting

插入代碼

直接寫入參數
<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>
? ? ? ? ? ? ? ? ? ? ? ? <plugIns>
? ? ? ? ? ? ? ? ? ? ? ? </plugIns>
? ? ? ? ? ? ? ? </vcastr>"/>
</object>

如果你需要符合w3c的標準,可以用”{”"}”替換xml中的”<"">“,例子

使用xml傳遞參數
<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.xml” />
</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>
? ? ? ? <plugIns>
? ? ? ? ? ? ? ? <logoPlugIn>
? ? ? ? ? ? ? ? ? ? ? ? <url>LogoPlugIn.swf</url>
? ? ? ? ? ? ? ? ? ? ? ? <logoText>Ruochi.com</logoText>
? ? ? ? ? ? ? ? ? ? ? ? <logoTextAlpha>0.75</logoTextAlpha>
? ? ? ? ? ? ? ? ? ? ? ? <logoTextFontSize>24</logoTextFontSize>???
? ? ? ? ? ? ? ? ? ? ? ? <logoTextColor>0xffffff</logoTextColor>
? ? ? ? ? ? ? ? ? ? ? ? <textMargin>10 auto auto 10</textMargin>
? ? ? ? ? ? ? ? ? ? ? ? <logoClipUrl>http://www.ruochigroup.com/images/logo.png</logoClipUrl>
? ? ? ? ? ? ? ? ? ? ? ? <logoClipAlpha>1</logoClipAlpha>
? ? ? ? ? ? ? ? ? ? ? ? <clipMargin>10 10 auto auto</clipMargin>
? ? ? ? ? ? ? ? </logoPlugIn>
? ? ? ? ? ? ? ? <beginEndImagePlugIn>
? ? ? ? ? ? ? ? ? ? ? ? <url>beginEndImagePlugIn.swf</url>
? ? ? ? ? ? ? ? ? ? ? ? <source>beginSwfTest.swf</source>
? ? ? ? ? ? ? ? ? ? ? ? <type>begin</type>
? ? ? ? ? ? ? ? ? ? ? ? <scaleType>exactFit</scaleType>
? ? ? ? ? ? ? ? </beginEndImagePlugIn>
? ? ? ? ? ? ? ? <javaScriptPlugIn>
? ? ? ? ? ? ? ? ? ? ? ? <url>javaScriptPlugIn.swf</url>
? ? ? ? ? ? ? ? </javaScriptPlugIn>
? ? ? ? </plugIns>
</vcastr>

以下用”.”描述xml樹結構并說明參數作用

影片信息

channel.item

影片信息,可以設置多個影片

channel.itme.source

flv影片地址參數,此參數是唯一必須要有的參數,其他參數都可以不要,播放器有默認參數

channel.itme.duration

對應影片的總時間, 單位是秒,由于有些影片在制作過程中時間信息丟失,可以通過這里來設置

channel.itme.tilte

對應影片的標題

channel.itme.link

對應影片點擊后的鏈接

播放器設置

config.bufferTime

在緩存區影片的時間,單位是秒

config.contralPanelAlpha

控制欄的透明度,在 0 — 1 之間

config.controlPanelBgColor

控制欄背景的顏色

config.controlPanelBtnColor

控制按鈕的顏色

config.contralPanelBtnGlowColro

控制按鈕光暈的顏色

config.defautVolume

默認的聲音大小,最大為1,最小為0

config.controlPanelMode

控制欄的顯示模式,
“float”: 默認的浮動模式,鼠標移除播放器就會隱藏掉
“normal”: 正常模式,任何時候都在影片的下部浮動顯示
“bottom”: 下部模式,不浮動在影片之上,而是顯示在影片下方
“none”: 不顯示播放器控制欄

config.isAutoPlay

是否影片自動開始播放,默認是true

config.isLoadBegin

是否一開始就讀取影片,默認是true

config.isRepeat

是否循環播放影片,默然是false

config.isShowAbout

是否顯示關于信息

config.scaleMode

影片放縮模式:
“showAll”: 可以看到全部影片,保持比例,可能上下或者左右
“exactFil”: 放縮影片到播放器的尺寸,可能比例失調
“noScale”: 影片的原始尺寸,無放縮
“noBorder”: 影片充滿播放器,保持比例,可能會被裁剪

插件設置

plugIns 中每一個子節點代表一個插件,可以設置多個插件

plugIns.logoPlugIn,顯示logo插件的參數設置

plugIns.logoPlugIn.url

插件的地址,可以使用絕對地址,也可以使用相對地址,絕對地址需要http://開始

plugIns.logoPlugIn.logoText

logo文字,注意之可以使用英文和英文標點,不支持中文,如果想放中文,就把中文做成文字png透明圖片,用plugIns.logoPlugIn.logoClipUrl參數設置

plugIns.logoPlugIn.logoTextAlpha

文字的透明度

plugIns.logoPlugIn.logoTextLink

文字的連接

plugIns.logoPlugIn.logoTextFontSize

文字字體的大小

plugIns.logoPlugIn.logoTextColor

文字的顏色

plugIns.logoPlugIn.textMargin

文字的位置,用了css的margin概念,四個數值代表 上 右 下 左 相對于播放器的距離,四個數值用空格分開,不需具體數值用”auto”填寫 ,比如左上對齊并都有10像素的距離可以寫 “10 auto auto 10″, 右下角對齊是”auto 10 10 auto”

plugIns.logoPlugIn.logoClipUrl

圖片logo的url,可以使用絕對地址,也可以使用相對地址,絕對地址需要http://開始

plugIns.logoPlugIn.logoClipAlpha

圖片logo的透明度

plugIns.logoPlugIn.logoClipLink

圖片logo的連接

plugIns.logoPlugIn.clipMargin

圖片logo的位置,用了css的margin概念,四個數值代表 上 右 下 左 相對于播放器的距離,四個數值用空格分開,不需具體數值用”auto”填寫 ,比如左上對齊并都有10像素的距離可以寫 “10 auto auto 10″, 右下角對齊是”auto 10 10 auto”

plugIns.javaScriptPlugIn,javaScript控制插件的參數設置

plugIns.javaScriptPlugIn.url

插件的地址,可以使用絕對地址,也可以使用相對地址,絕對地址需要http://開始

javaScript插件

使用方法參看實例頁面
http://vcastr.ruochi.com/v3/vcastr_javaScript_example.html

javaScript可以控制播放器 播放,暫停,停止,快進,快退,下一個,上一個,音量控制,影片跳轉到需要的時間
在javaScript可以獲得播放器的事件,有四個參數回來,分別是type:事件種類,state:當前狀態, phayHeadTime:當前播放時間,loadPersent:下載百分比

事件 type有
stateChange,播放狀態變化,播放或者暫停
complete,播放完畢
init,播放器初始化完畢
ready,影片下載了一部分,已經可以開始播放
playheadUpdate,每一秒即發一次
startBuffering,開始緩沖
stopBuffering,緩沖結束

狀態 state
playing,播放中
paused,暫停中

beginEndImagePlugIn 影片開始和結尾需要加載外部資源(可以是圖片或者swf)的插件

beginEndImagePlugIn.logoPlugIn.url

插件的地址,可以使用相對或者絕對地址,絕對地址需要http://開始

beginEndImagePlugIn.logoPlugIn.source

開始的圖片或者swf的地址

beginEndImagePlugIn.logoPlugIn.type

顯示方式,有3種顯示方法,begin:在開始的顯示,end:結尾部分顯示,beginEnd:在開始和結尾部分同時顯示

beginEndImagePlugIn.logoPlugIn.scaleType

“showAll”: 可以看到全部影片,保持比例,可能上下或者左右
“exactFil”: 放縮影片到播放器的尺寸,可能比例失調
“noScale”: 影片的原始尺寸,無放縮
“noBorder”: 影片充滿播放器,保持比例,可能會被裁剪

轉載于:https://www.cnblogs.com/codeyu/archive/2009/02/12/1388739.html

總結

以上是生活随笔為你收集整理的Vcastr 3.0 - flash video(flv) player (开源 Open Source)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。