FLV 格式在早期網路視頻中廣泛使用,但許多 CMS 系統缺乏原生支援。vcastr 是一款功能強大的 Flash 基礎 FLV 播放器,支援自訂介面顏色、預設圖片、控制列樣式等豐富參數,以下提供完整整合範例與參數說明。
<div class="txt1">
<script type="text/javascript">
var swf_width = 307;
var swf_height = 182;
var texts = '快樂星漢堡';
var files = 'https://v.78.cn/kuailexing/sp.flv';
</script>
<script type="text/javascript">
var config = '0:自動播放|1:連續播放|100:預設音量|0:控制列位置|2:控制列顯示|0x000033:主體顏色|60:主體透明度|0x66ff00:光暈顏色|0xffffff:圖標顏色|0xffffff:文字顏色|:logo文字|:logo地址|end.flv:結束swf地址';
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + swf_width + '" height="' + swf_height + '">');
document.write('<param name="movie" value="https://www.78.cn/style/vcastr.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="vcastr_file=' + files + '&vcastr_title=' + texts + '&vcastr_config=' + config + '">');
document.write('<embed src="https://www.78.cn/style/vcastr.swf" wmode="opaque" FlashVars="vcastr_file=' + files + '&vcastr_title=' + texts + '&vcastr_config=' + config + '" menu="false" quality="high" width="' + swf_width + '" height="' + swf_height + '" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
</script>
</div>
以 | 分隔的鍵值對,順序固定:
| 索引 | 參數 | 說明 | 範例值 |
|---|---|---|---|
| 0 | 自動播放 | 0=否, 1=是 | 0 |
| 1 | 連續播放 | 0=否, 1=是 | 1 |
| 2 | 預設音量 | 0-100 | 100 |
| 3 | 控制列位置 | 0=底部, 1=頂部 | 0 |
| 4 | 控制列顯示模式 | 0=隱藏, 1=滑鼠顯示, 2=永久顯示 | 2 |
| 5 | 主體顏色 | 十六進位色碼 | 0x000033 |
| 6 | 主體透明度 | 0-100 | 60 |
| 7 | 光暈顏色 | 十六進位色碼 | 0x66ff00 |
| 8 | 圖標顏色 | 十六進位色碼 | 0xffffff |
| 9 | 文字顏色 | 十六進位色碼 | 0xffffff |
| 10 | Logo 文字 | 自訂文字 | (空) |
| 11 | Logo 連結 | URL 地址 | (空) |
| 12 | 結束影片 SWF | 播放結束導向檔案 | end.flv |
vcastr_file:FLV 影片絕對 URLvcastr_title:播放器標題文字vcastr_config:上述配置字串video/x-flv)vcastr 為舊專案維護提供快速方案,新專案建議採用 Video.js、Plyr 等現代 HTML5 播放器框架。