`

推荐几种在网页中播放FLV文件的代码

    博客分类:
  • html
XML 
阅读更多
推荐几种在网页中播放FLV文件的代码
使用方法:

方法一、js嵌入

直接copy下面代码,修改其中红色部分,即:swf_width、swf_height、texts、files 参数

<script type="text/javascript">
var swf_width=240
var swf_height=240
var texts=’幸福的脚丫预告片’
var files=’http://www.ruochi.com/product/vcastr/flv/happy_feet.flv’
document.write(’<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://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="http://www.ruochi.com/product/vcastr2/vcastr22.swf"><param name="quality" value="high">’);
document.write(’<param name="menu" value="false"><param name="allowFullScreen" value="true" />’);
document.write(’<param name="FlashVars" value="vcastr_file=’+files+’&vcastr_title=’+texts+’">’);
document.write(’<embed src="http://www.ruochi.com/product/vcastr2/vcastr22.swf" allowFullScreen="true" FlashVars="vcastr_file=’+files+’&vcastr_title=’+texts+’" menu="false" quality="high" width="’+ swf_width +’" height="’+ swf_height +’" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />’); document.write(’</object>’);
</script>
其中:
幸福的脚丫预告片 是标题。
http://www.ruochi.com/product/vcastr/flv/happy_feet.flv 是FLV文件地址。
http://www.ruochi.com/product/vcastr2/vcastr22.swf 是FLV文件播放器地址(如果你不会制作,可下载别人的然后上传到自己的空间再调用)。
flv播放器 Vcastr 2.0 下载
http://www.ruochi.com/product/vcastr2/vcastr22.zip


方法二、简单直接传递影片地址

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="240" height="180">
<param name="movie" value="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv">
<param name="quality" value="high">
<param name="allowFullScreen" value="true" />
<embed src="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="180"></embed>
</object>

方法三、读取影片xml

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="240" height="120">
<param name="movie" value="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_xml=http://www.ruochi.com/product/vcastr2/vcastr.xml">
<param name="quality" value="high">
<param name="allowFullScreen" value="true" />
<embed src="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_xml=http://www.ruochi.com/product/vcastr2/vcastr.xml" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="120"></embed>
</object>
其中:http://www.ruochi.com/product/vcastr/vcastr.xml 是播放列表的xml地址

高级选项

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="240" height="180">
<param name="movie" value="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv">
<param name="quality" value="high">
<param name="allowFullScreen" value="true" />
<embed src="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="180"></embed>
</object>

<http://www.ruochi.com/product/vcastr2/vcastr22.swf?参数A=111&参数B=222&....>
在以上"参数A=111&参数B=222"部分添加参数,使用 参数=值 的格式,多个参数用&连接,参数数量不限制,注意有2个红色部分http://www.ruochi.com/product/vcastr2/vcastr22.swf地方需要修改

例如:

value="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv&vcastr_title=幸福的脚丫预告片&BarColor=0xFF6600&BarPosition=1"
表示影片地址是"http://www.ruochi.com/product/vcastr/flv/happy_feet.flv",标题是"变形金刚预告片",控制栏颜色是0xFF6600,控制栏位置在下方。

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="500" height="224">
<param name="movie" value="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv&vcastr_title=幸福的脚丫预告片&BarColor=0xFF6600&BarPosition=1">
<param name="quality" value="high">
<param name="allowFullScreen" value="true" />
<embed src="http://www.ruochi.com/product/vcastr2/vcastr22.swf?vcastr_file=http://www.ruochi.com/product/vcastr/flv/happy_feet.flv&vcastr_title=幸福的脚丫预告片&BarColor=0xFF6600&BarPosition=1" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="224"></embed>
参数名称 参数说明 默认值
vcastr_file 方法2传递影片flv文件地址参数,多个使用|分开 空
vcastr_title 影片标题参数,多个使用|分开,与方法2配合使用 空
vcastr_xml 方法3 传递影片flv文件地址参数,样板参考 http://www.ruochi.com/product/vcastr2/vcastr.xml vcastr.xml
IsAutoPlay 影片自动播放参数:0表示不自动播放,1表示自动播放 0
IsContinue 影片连续播放参数:0表示不连续播放,1表示连续循环播 1
IsRandom 影片随机播放参数:0表示不随机播放,1表示随机播放 0
DefaultVolume 默认音量参数 :0-100 的数值,设置影片开始默认音量大小 100
BarPosition 控制栏位置参数 :0表示在影片上浮动显示,1表示在影片下方显示 0
IsShowBar 控制栏显示参数 :0表示不显示;1表示一直显示;2表示鼠标悬停时显示;3表示开始不显示,鼠标悬停后显示 2
BarColor 播放控制栏颜色,颜色都以0x开始16进制数字表示 0x000033
BarTransparent 播放控制栏透明度 60
GlowColor 按键图标颜色,颜色都以0x开始16进制数字表示 0x66ff00
IconColor 鼠标悬停时光晕颜色,颜色都以0x开始16进制数字表示 0xFFFFFF
TextColor 播放器文字颜色,颜色都以0x开始16进制数字表示 0xFFFFFF
LogoText 可以添加自己网站名称等信息(英文) 空
LogoUrl 可以从外部读取logo图片,注意自己调整logo大小,支持图片格式和swf格式 空
EndSwf 影片播放结束后,从外部读取swf文件,可以添加相关影片信息,影片分享等信息,需自己制作 空
BeginSwf 影片开始播放之前,从外部读取swf文件,可以添加广告,或者网站信息,需自己制作 空
IsShowTime 是否显示时间 : 0表示不显示时间,1表示显示时间 1
BufferTime 影片缓冲时间,单位(秒) 2
常见问题

问:Logo 文字无法显示
答:Logo 文字不能支持中文,可以用LogoUrl参数将Logo做成.swf文件或者.png文件。
问:xml 如何设置高级参数
答:如下
<param name="FlashVars" value="vcastr_xml=http://www.ruochi.com/product/vcastr2/vcastr.xml&vcastr_title=幸福的脚丫预告片|变形金刚预告片|江南MV|魔兽世界-晚安部落&BarColor=0xFF6600&BarPosition=1" />
<embed src="http://www.ruochi.com/product/vcastr2/vcastr2.swf" allowFullScreen="true" FlashVars="vcastr_xml=http://www.ruochi.com/product/vcastr2/vcastr.xml&vcastr_title=幸福的脚丫预告片|变形金刚预告片|江南MV|魔兽世界-晚安部落&BarColor=0xFF6600&BarPosition=1">
问:不能全屏
答:需要升级到flashplayer9.0以上
问:不能退出全屏
答:双击可以进入或退出全屏
问:影片不能拖动进度
答:是由于转换文件格式时候有一些信息丢失,可以使用FLV MetaData Injector修复, 下载地址: http://www.buraks.com/flvmdi ;
问:flv放在自己服务器上就不能播放了
答:是由于您的服务器不支持.flv文件格式下载,修改成其他格式比如.swf,当然,相应的vcastr_file或者vcastr_xml中的flv文件名也要修改成.swf

注:最简单的方式:
http://www.qqywf.com/show/flv.swf?url=这里为FLV视频地址
分享到:
评论

相关推荐

    几种在网页中播放FLV视频文件的代码.pdf

    几种在网页中播放FLV视频文件的代码.pdf几种在网页中播放FLV视频文件的代码.pdf

    网页中播放FLV文件的代码

    网页中播放FLV文件的代码,几种方法,仅供参考学习

    avplayer源代码

    目前, 在这个代码中, 主要链接到FFmpeg来进行解码, 并将其改造成一个通用的播放器框架. 在这个框架中能够接受各种数据的读入, 可以很方便的封装自己的数据读取模块, 也可以很方便的定制自己的视频渲染模块和音频播放...

    livecamera:从android设备的摄像头创建流文件,然后上传服务器,并为flashsafarivplayer生成m3u8播放列表

    简短的 实时摄像头是系统从android设备的摄像头创建流文件的系统 然后上传服务器,并为Flash / Safari / vplayer生成m3u8...该演示将数据组合到flv框架中,并创建文件段。 它使用HTTP将数据传输到服务器,这意味着您可

    使用red5.doc

    在声音上碰到了一些问题,在不添加参数的情况下,有一部分视频的声音会有问题,有的视频无论怎么添加参 数,都出不来声音,报错提示的是不支持所带的声音采样格式,只支持几种固定的格式,我看了一下代码,确实是这...

    C#开发实例大全(基础卷).软件开发技术联盟(带详细书签) PDF 下载

    《C#开发实例大全(基础卷)》筛选、汇集了C#开发从基础知识到高级应用各个层面约600个实例及源代码,每个实例都按实例说明、关键技术、设计过程、详尽注释、秘笈心法的顺序进行了分析解读。全书分6篇共25章,主要...

    Fckeditor2.6.4插件 for pjblog

    3、在你的header.asp和Template\static.htm两个文件中找到以下一句代码代码:[removed][removed]低版本pjblog用户可查找代码:[removed][removed]在此之前插入以下几句代码代码:&lt;link rel="stylesheet" rev=...

    Freemake Video Converter影音转换器 v4.1.9.rar

    freemake video converter是一个免费的视频...合并几个视频为一个文件,在片段之间加入转换。使输出文件的大小适合任何限制(例如700MB、1.4GB、4.7GB)。调整输出视频到既定的纵横比:添加黑边、拉伸、缩放、自动调整。

    Android 56视频播放

    小编亲自测试过本项目支持播放3gp、flv、wmv、avi、mp4、mkv在内的多种格式的本地视频,其他格式没有测试,但应该不会仅限于这几种视频格式。播放界面简洁优美,视频播放清晰流畅。右边上下滑动屏幕,调节亮度,左边...

    计算机应用技术(实用手册)

    这个项目可控制DRAM作用指令与读取/写入指令之间的延迟时间,有2,3,4几种选择。数值越小,性能越好。 DRAM RAS# Precharge: 这个项目是用来控制当预充电(precharge)指令送到DRAM之后,频率等待启动的等待...

    PJBLOG3海神扩展增强版3.0.6.170

    就是在发布日志时可以简单的插入QQ号码的在线状态按钮,点击后打开QQ临时对话窗口,需要发布的QQ显示状态风格改变时,请打开ubbcode.asp文件,查找这样一句代码http://wpa.qq.com/pa?p=1:$1:1修改这句代码中最后冒号...

Global site tag (gtag.js) - Google Analytics