`
ConeyLiu
  • 浏览: 128137 次
  • 性别: Icon_minigender_2
  • 来自: 重庆
社区版块
存档分类
最新评论

flvplayer 播放器

 
阅读更多

1.       flvplayer.swf放入工程

2.       在页面引入swfobject.jsp

3.       在页面写入视频控件:

 

<p id="player1">
          <a href="http://www.macromedia.com/go/getflashplayer">下载播放器</a> 找不到播放器.
</p>

 

这段js得放在html后面执行

<script type="text/javascript">
		var s1 = new SWFObject("flvplayer.swf","single","190","140","7");
 				s1.addParam("allowfullscreen","true");
 				//视频位置
 				s1.addVariable("file","${videoDto.fileUrl}");
 				//显示图片
 				s1.addVariable("image",'flvplayer.jpg');
 				s1.addVariable("width","190");
 				s1.addVariable("height","140");
 				s1.addVariable("autostart",'false');
 				//在指定ID的标签中显示视频
//注:JS生成视频控件的代码必须写在该标签后

 				s1.write("player1");
			</script>

 

 

当前这html页面导入这swfobject.js

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

 

默认播放器显示的是一张图片flvplayer.jpg

 

             

  • 大小: 9.2 KB
分享到:
评论

相关推荐

    flvplayer播放器使用方法

    flvplayer播放器使用方法,FLVPLAYER.SWF 包含所有的参数。网上很多介绍参数使用都不太对,这个是正确的版本

    FlvPlayer播放器

    浏览器支持FLV格式的播放器.

    kindeditor编辑器flvplayer播放器

    kindeditor编辑器flvplayer播放器,Kindeditor编辑器是挺好用的,可是上传的flv视频文件在前台是无法访问的。使用这个播放器可以解决这个问题。

    flvplayer播放器

    专门播放mp4,mp3,flv播放器,大家快来下载看看~~~~

    极酷Flvplayer网页播放器

    1.极酷Flvplayer网页播放器支持flv,mp3,mp4; 2.支持 [单文件播放] 或 [列表连播]; 3.支持LOGO图标显示或隐藏; 4.支持 [顺序播放] 或 [随机播放]; 5.自由设置播放器色彩; 6.自由设置播放器大小; 7.支持全屏; 8...

    FLVPlayer播放器

    经过整理的FLV播放器 编译采用FLASH IDE,界面修改直观方便,可在舞台直接点击修改 flv资源路径在类:ConfigureClass修改

    网页FLVplayer

    网页FLV播放器示例代码网页FLV播放器示例代码网页FLV播放器示例代码网页FLV播放器示例代码

    极酷FlvPlayer网页播放器201002(B2版)

    极酷FlvPlayer网页播放器201002(B2版) 这是一款功能最强大的flv超酷网页播放器 1.极酷Flvplayer网页播放器支持flv,mp3,mp4; 2.支持 [单文件播放] 或 [列表连播]; 3.支持LOGO图标显示或隐藏; 4.支持 [顺序播放] ...

    Flvplayer播放器

    一款好用的播放器,一切资源免费,所有资源都经过检测,请放心下载! 尊重他人劳动成果,转载请自觉注明出处!

    FLV Player FLV播放器

    FLV Player FLV播放器 好资源,大家分享!

    FlvPlayer(网页播放器)

    两个FlvPlayer,一个黑色的一个红色的。 在body中放入 object type="application/x-shockwave-flash" data="FlvPlayer201002.swf?file=Video/片头.flv" style="width: 514px; height: 299px;" &gt; ...

    FLV文件播放器FLVPlayer

    真正可以播放FLV文件的播放器

    免费FLV播放器Professional Web Flv Player

    免费FLV播放器Professional Web Flv Player 免费FLV播放器Professional Web Flv Player 免费FLV播放器Professional Web Flv Player 免费FLV播放器Professional Web Flv Player

    websocket-fmp4、websocket-flv 视频播放器 web端 wsplayer

    websocket-fmp4、websocket-flv 视频播放器 web端 wsplayer

    FLV播放器FLVPlayer4Free

    FLVPlayer4Free(非常漂亮的FLV播放器) 最华丽的 FLV 播放器,使用的皮肤控件应该是 SkinCrafter:) 该 FLV 播放器除支持调整播放画面大小、切换全屏显示/置顶显示、切换静音等常规特性,还允许截取 FLV 中的帧为...

    flvplayer flv播放器

    flv的播放器,目前互联网上flv格式的媒体越来越多,你也需要一款小巧的播放器

    功能比较全面的flv播放器源码

    功能比较全的flv网页播放器源码,可以支持任何flv格式的视频文件。

    FLVPlayer4Free(FLV 播放器) v7.8.0.0.zip

    FLVPlayer4FreeSH是一款简单好用的FLV 播放器软件。软件功能强大,支持包括调整播放画面大小、切换全屏显示/置顶显示、切换静音等诸多常规特性,还允许截取 FLV 中的帧为静态的图片,并自带文件类型关联特性,与 ...

Global site tag (gtag.js) - Google Analytics