您的位置:首页 > 运维架构 > 网站架构

一段视频网站的FSCOMMAND代码

2007-05-09 17:55 417 查看
;(function(){var $$;$$=jQuery.fn.flash=function(htmlOptions,pluginOptions,replace,update){var block=replace||$$.replace;pluginOptions=$$.copy($$.pluginOptions,pluginOptions);if(!$$.hasFlash(pluginOptions.version)){if(pluginOptions.expressInstall&&$$.hasFlash(6,0,65)){var expressInstallOptions={flashvars:{MMredirectURL:location,MMplayerType:'PlugIn',MMdoctitle:jQuery('title').text()}};}else if(pluginOptions.update){block=update||$$.update;}else{return this;}}
htmlOptions=$$.copy($$.htmlOptions,expressInstallOptions,htmlOptions);return this.each(function(){block.call(this,$$.copy(htmlOptions));});};$$.copy=function(){var options={},flashvars={};for(var i=0;i<arguments.length;i++){var arg=arguments[i];if(arg==undefined)continue;jQuery.extend(options,arg);if(arg.flashvars==undefined)continue;jQuery.extend(flashvars,arg.flashvars);}
options.flashvars=flashvars;return options;};$$.hasFlash=function(){if(/hasFlash/=true/.test(location))return true;if(/hasFlash/=false/.test(location))return false;var pv=$$.hasFlash.playerVersion().match(//d+/g);var rv=String([arguments[0],arguments[1],arguments[2]]).match(//d+/g)||String($$.pluginOptions.version).match(//d+/g);for(var i=0;i<3;i++){pv[i]=parseInt(pv[i]||0);rv[i]=parseInt(rv[i]||0);if(pv[i]<rv[i])return false;if(pv[i]>rv[i])return true;}
return true;};$$.hasFlash.playerVersion=function(){try{try{var axo=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{axo.AllowScriptAccess='always';}
catch(e){return'6,0,0';}}catch(e){}
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(//D+/g,',').match(/^,?(.+),?$/)[1];}catch(e){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(//D+/g,",").match(/^,?(.+),?$/)[1];}}catch(e){}}
return'0,0,0';};$$.htmlOptions={height:240,flashvars:{},pluginspage:'http://www.adobe.com/go/getflashplayer',src:'#',type:'application/x-shockwave-flash',width:320};$$.pluginOptions={expressInstall:false,update:true,version:'6.0.65'};$$.replace=function(htmlOptions){this.innerHTML='<div class="alt">'+this.innerHTML+'</div>';jQuery(this).addClass('flash-replaced').prepend($$.transform(htmlOptions));};$$.update=function(htmlOptions){var url=String(location).split('?');url.splice(1,0,'?hasFlash=true&');url=url.join('');var msg='<p>要播放土豆的视频请先安装 Flash 播放器。 <a href="http://www.adobe.com/go/getflashplayer">点击这里去 Adobe 网站下载播放器(Flash Player)</a>. <a href="'+url+'"><strong>如果你已经安装了播放器请点击这里.</strong></a></p>';this.innerHTML='<span class="alt">'+this.innerHTML+'</span>';jQuery(this).addClass('flash-update').prepend(msg);};function toAttributeString(){var s='';for(var key in this)
if(typeof this[key]!='function')
s+=key+'="'+this[key]+'" ';return s;};function toFlashvarsString(){var s='';for(var key in this)
if(typeof this[key]!='function')
s+=key+'='+escape(this[key])+'&';return s.replace(/&$/,'');};$$.transform=function(htmlOptions){htmlOptions.toString=toAttributeString;if(htmlOptions.flashvars)htmlOptions.flashvars.toString=toFlashvarsString;return'<embed '+String(htmlOptions)+'/>';};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}})();$.fn.flvPlayer=function(id){var _u='undefined';if(typeof sid==_u)sid=0;if(typeof local==_u)local=0;if(typeof is_3gp_item==_u)is3gp='true';this.each(function(){if($.browser.mozilla){$(this).position('absolute');$('<div id="playerPlaceHolder" style="width:488px;height:415px"></div>').insertAfter($(this));}
$(this).empty().css('z-index','120').width('488px').height('415px').flash({src:'/static/t/leopard0.swf',width:'100%',height:'100%',allowScriptAccess:'always',allowFullScreen:'true',flashvars:{iid:id,isNotEmbed:1,source_id:sid,local:local,is_3gp_item:is3gp,referer:document.referrer,userid:(typeof uid!='undefined'?(uid|0):0),page_url:location.href,nielsen:(typeof nielsen=='undefined'?'':nielsen),is_rec:(location.href.match(/is_rec/i)?1:0)}},{update:false})})
try{markAsPlayed(id)}catch(e){}
return this;}
$.fn.playlistPlayer=function(id,_iid){var _u='undefined';if(typeof id==_u||id==null||id==0)id=0;if(typeof lid!=_u&&id==0)id=lid|0;if(typeof listMode==_u)listMode=0;if(typeof _iid==_u)_iid=0;if(location.hash.substr(1)|0>0){_iid=location.hash.substr(1)|0;}
this.each(function(){if($.browser.mozilla){$(this).position('absolute');$('<div id="playerPlaceHolder" style="width:488px;height:434px"></div>').insertAfter($(this));}
$(this).empty().css('z-index','120').width('488px').height('434px').flash({src:'/static/t/s.swf',width:'100%',height:'100%',allowScriptAccess:'always',allowFullScreen:'true',flashvars:{lid:id,iid:_iid,isMozilla:$.browser.mozilla,playMode:listMode}},{expressInstall:true,update:true})})
return this;}
var actionListener='';function syncPlayerAction(){var s=actionListener;actionListener='';return s}
function togglePlayerSize(b){try{var f=$('#player');if((f.width()|0)>488||b){f.width('488px').height('415px').left('').top('');if(!$.browser.mozilla){f.position('relative');$('html').css('overflow','');}
$('.side').show();return 0}else{if(!$.browser.mozilla){f.position('absolute');$('html').css('overflow','hidden');}
f.width('100%').height('100%').left(0).top(0);if($.browser.msie){window.onresize=ieAutoSize;ieAutoSize();}
$('.side').hide();window.scrollTo(0,0);return 1}}catch(e){alert("Tudou: Oops, it doesn't work.")}}
function ieAutoSize(){$('#player').height($('#ieHeightFixer').height()+'px').width($('#ieHeightFixer').width()+'px').left(0).top(0)}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐