网页播放视频(js,flv,flash)问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了网页播放视频(js,flv,flash)问题相关的知识,希望对你有一定的参考价值。
网页上做好的用FLASH播放FLV视频,但现在没有播放,请大虾帮忙找出原因
<%
Set rsFlv=server.createobject("adodb.recordset")
sqlFlv="SELECT * FROM [Info] WHERE Url<>'flv/视频.flv' AND State=1 AND Url<>'' ORDER BY UpdateTime DESC"
rsFlv.open sqlFlv,conn,1,1
IF Not rsFlv.Eof Then
url=rsFlv("Url")
End If
%>
<script type="text/javascript" language="JavaScript">
GnxFlashActivate('flv/play.swf', '246', '176', 'transparent', '0', '0', '');vcastr_file=<% =url%></script>
=========================
GnxFlashActivate.js
function GnxFlashActivate ( strFlashUrl , n4Witdh , n4Height , strWmode , strId , strClassName , strFlashvar )
//width,height 咯何 & 弓澜 (width,height啊 绝阑锭绰 0 栏肺 急攫)
var str ;
if (n4Witdh != 0)
objSize_attribute = " width='"+ n4Witdh +"' height='"+ n4Height +"'";
else
objSize_attribute = "";
//id
if (strId != 0)
objId_attribute = " id='" + strId + "'";
objId_IE_attribute = " id='" + strId + "'";
else
objId_attribute = "";
objId_IE_attribute = "";
//class 咯何 (class啊 绝阑锭绰 0 栏肺 急攫)
if (strClassName != 0)
className_attribute = " class='" + strClassName + "'";
else
className_attribute = "";
//wmode 咯何 (wmode啊 绝阑锭绰 0 栏肺 急攫)
if (strWmode != 0)
wmode_param = "<param name='wmode' value='" + strWmode + "' />";
wmode_attribute = " wmode='" + strWmode + "'";
else
wmode_param = "";
wmode_attribute = "";
//Flashvar 咯何 (wmode啊 绝阑锭绰 0 栏肺 急攫)
if (strFlashvar != 0)
Flashvar_param = "<param name='flashvars' value='" + strFlashvar + "' />";
Flashvar_attribute = "Flashvars='" + strFlashvar + "'";
else
Flashvar_param = "";
Flashvar_attribute = "";
document.writeln( "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' " + objSize_attribute + objId_IE_attribute + className_attribute + ">" );
document.writeln( "<param name='movie' value='"+ strFlashUrl +"' />" );
document.writeln( "<param name='quality' value='high' />" );
document.writeln( "<param name='allowScriptAccess' value='always' />" );
document.writeln( "<PARAM NAME='wmode' VALUE='transparent' />" );
document.writeln( wmode_param );
document.writeln( Flashvar_param );
document.writeln( "<!-- Hixie method -->" );
document.writeln( "<!--[if !IE]> <-->" );
document.writeln( "<object type='application/x-shockwave-flash' data='"+ strFlashUrl +"'" + Flashvar_attribute + objSize_attribute + objId_attribute + wmode_attribute + className_attribute + "></object>" );
document.writeln( "<!--> <![endif]-->" );
document.writeln( "</object>" );
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="720" height="555">
<param name="movie" value=" mflvplayer.swf">
<param name="quality" value="high">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="True" />
<embed src="mflvplayer.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="720" height="555" allowScriptAccess="sameDomain" allowFullScreen="True">
</embed>
</object>
Well, have you noticed the mflvplayer.swf in blue? Replace it with the SWF file you generated. Here you can also type in the URL of the SWF, such as http://www.myhomepage.com/mflvplayer.swf
The width="720" height="555" in black indicates the width and the height of your video.
上传到服务器的时候,要把flv,swf放在一个文件夹下.
参考资料:http://www.video-to-flash.com/create_flash_video/
参考技术A 视频文件名及路径如果用汉字的话,很容易播放不出来JavaCV音视频开发宝典:使用JavaCV和springBoot实现websocket-flv直播服务,无需流媒体服务,浏览器网页flv.js播放器直接播放rtsp,rtmp等实时视频
《JavaCV音视频开发宝典》专栏目录导航
《JavaCV音视频开发宝典》专栏介绍和目录
硬核注意:本文默认读者已经熟练掌握springboot和websocket的前置知识,并已基本掌握JavaCV音视频原理。
前言
前面我们已经讲了webm直播,http-flv直播,本章就直接开始动手实现websocket-flv直播。
关于flv格式的起源与发展等等基本知识在上一章:
《JavaCV音视频开发宝典:使用JavaCV和springBoot实现http-flv直播服务,无需流媒体服务,浏览器网页flv.js转封装方式播放rtsp,rtmp和桌面投屏实时画面》中基本上都讲过了,不再赘述,有兴趣的可以去看看。
websocket-flv是为了解决http-flv的一些弊端而出现的流媒体传输技术。
websocket-flv是要解决什么问题呢?
这就不得不提到浏览器的ht
以上是关于网页播放视频(js,flv,flash)问题的主要内容,如果未能解决你的问题,请参考以下文章