全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
楼主: 408904199
打印 上一主题 下一主题

跪求迅雷云点播网页插件源代码!

[复制链接]
11#
发表于 2012-4-16 13:39:42 | 只看该作者
自己去扒吧http://wxwx.jimdo.com/vod/
12#
发表于 2012-4-16 14:16:01 | 只看该作者
  1. (function(){
  2.         setTimeout(function(){
  3.         var isUndef = function(a) {
  4.                                 return typeof a == "undefined";
  5.                         };
  6.                 var isNull = function(a) {
  7.                 return typeof a == "object" && !a;
  8.         };
  9.         var name = 'XL_CLOUD_VOD_PLAYER';
  10.         var isIpad = (window.navigator.userAgent.toLowerCase().indexOf('ipad') > 0 || window.navigator.userAgent.toLowerCase().indexOf('iphone') > 0) ? 1 : 0;
  11.         var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
  12.         var version='1.11';
  13.         function $(name){ return document.getElementById(name);}
  14.         var objs = $(name);
  15.         if(!objs) return false;

  16.         var getCookie = function(name){
  17.                         return (document.cookie.match(new RegExp("(^"+name+"| "+name+")=([^;]*)"))==null)?"":RegExp.$2;
  18.         }

  19.         function decode(str) {
  20.                 var r = '';
  21.                 try {
  22.                         r = decodeURIComponent(decodeURIComponent(str));
  23.                 } catch(e) {
  24.                         try {
  25.                                 r = decodeURIComponent(str);
  26.                         } catch(e) {
  27.                                 r = str;
  28.                         }
  29.                 }
  30.                 return r;
  31.         }
  32.         function encode(str) {
  33.                 return encodeURIComponent(str);
  34.         }
  35.         function JSONscriptRequest(fullUrl)
  36.         {
  37.                 this.fullUrl = fullUrl;
  38.                 this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
  39.                 this.headLoc = document.getElementsByTagName("head").item(0);
  40.                 this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
  41.         }
  42.         JSONscriptRequest.scriptCounter = 1;
  43.         JSONscriptRequest.prototype.buildScriptTag = function ()
  44.         {
  45.                 this.scriptObj = document.createElement("script");
  46.                 this.scriptObj.setAttribute("type", "text/javascript");
  47.                 this.scriptObj.setAttribute("src", this.fullUrl);
  48.         };
  49.         JSONscriptRequest.prototype.removeScriptTag = function () {
  50.                 this.headLoc.removeChild(this.scriptObj);
  51.         };
  52.         JSONscriptRequest.prototype.addScriptTag = function () {
  53.                 this.headLoc.appendChild(this.scriptObj);
  54.         };
  55.         function getJSONP(url,f,callback){
  56.                 var req = url;
  57.                 if(f)
  58.                         window[f]=callback;
  59.                 if(req.indexOf('?')!=-1){
  60.                         req+="&jsonp="+f;       
  61.                 }
  62.                 else{
  63.                         req+="?jsonp="+f;
  64.                 }
  65.                 var jsonReq = new JSONscriptRequest(req);
  66.                 jsonReq.buildScriptTag();
  67.                 jsonReq.addScriptTag();
  68.         }
  69.         function getJSONPC(url,f,callback){
  70.                 var req = url;
  71.                 window[f]=callback;
  72.                 req+="&callback="+f;
  73.                 var jsonReq = new JSONscriptRequest(req);
  74.                 jsonReq.buildScriptTag();
  75.                 jsonReq.addScriptTag();
  76.         }
  77.         function getAttr(obj,name){
  78.                 return obj.getAttribute(name);
  79.         }
  80.         function setCookie(name,value,hours,isBaseDomain){
  81.                 if(arguments.length>2){
  82.                         var expireDate=new Date(new Date().getTime()+hours*3600000);
  83.                         document.cookie = name + "=" + encodeURIComponent(value) + "; path=/; domain=xunlei.com; expires=" + expireDate.toGMTString() ;
  84.                 }else
  85.                         document.cookie = name + "=" + encodeURIComponent(value) + "; path=/; domain=xunlei.com";
  86.         }
  87.         var box_obj=objs;

  88.         var from=box_obj.getAttribute('from');
  89.         from=from||'xlpan_web';
  90.         var tmp=box_obj.getElementsByTagName('a');
  91.         if(tmp.length==0) return;       
  92.         var obj=tmp[0];
  93.         var autoplay = getAttr(obj,'autoplay');
  94.         if(!autoplay || autoplay!="true")
  95.                 autoplay = false;
  96.         else
  97.                 autoplay = true;
  98.                
  99.         var enable_panel = getAttr(obj,'enable_panel');
  100.         if(!enable_panel || enable_panel!="false")
  101.                 enable_panel = true;
  102.         else
  103.                 enable_panel = false;
  104.                
  105.         var share_url = getAttr(obj,'share_url');
  106.         if(!share_url)
  107.                 share_url = document.location.href;

  108.         var url = obj.getAttribute('href');
  109.         var filesize = getAttr(obj,'filesize');
  110.         var gcid = getAttr(obj,'gcid');
  111.         var cid = getAttr(obj,'cid');
  112.         var filename = getAttr(obj,'title');
  113.         var success = getAttr(obj,'onsuccess');
  114.         var fail = getAttr(obj,'onfail');
  115.         if(!box_obj.style.height){
  116.                 box_obj.style.height = '446px';
  117.         }
  118.         if(!box_obj.style.width){
  119.                 box_obj.style.width = '684px';
  120.         }
  121.         box_obj.style.overflow='hidden';
  122.         box_obj.style.position='relative';
  123.        
  124.         if(!url){
  125.                 var height = parseInt(box_obj.style.height)/2+22;
  126.                 box_obj.innerHTML = "<img src='http://vod.lixian.xunlei.com/img/play_bg.jpg' width='100%' height='100%' />"
  127.                 +"<div style='text-align:center;color:#FFF;margin:-"+height.toString()+"px 0 0 0;width:100%;height:22px;'>缺少必要参数,无法播放!</div>";
  128.                 return;
  129.         }
  130.        
  131.         var INSTANCE;

  132.         var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
  133.         var Class = function(){};
  134.         Class.extend = function(prop) {
  135.                 var _super = this.prototype;
  136.                 initializing = true;
  137.                 var prototype = new this();
  138.                 initializing = false;
  139.                 for (var name in prop) {
  140.                         prototype[name] = typeof prop[name] == "function" &&
  141.                         typeof _super[name] == "function" && fnTest.test(prop[name]) ?
  142.                         (function(name, fn){
  143.                                 return function() {
  144.                                         var tmp = this._super;
  145.                                         this._super = _super[name];
  146.                                         var ret = fn.apply(this, arguments);
  147.                                         this._super = tmp;
  148.                                         return ret;
  149.                                 };
  150.                         })(name, prop[name]) :
  151.                         prop[name];
  152.                 }
  153.                 function Class() {
  154.                         if ( !initializing && this.init )
  155.                                 this.init.apply(this, arguments);
  156.                 }
  157.                 Class.prototype = prototype;
  158.                 Class.constructor = Class;
  159.                 Class.extend = arguments.callee;
  160.                 return Class;
  161.         };

  162.         var _INSTANCE;
  163.         window.XL_CLOUD_FX_INSTANCE = {
  164.                 Class:Class,
  165.                 lastFormat:225536,
  166.                 init:function(instance){
  167.                         _INSTANCE = instance;
  168.                         var that = this;
  169.                         var id = box_obj.getAttribute('id');
  170.                         if(!id){
  171.                                 id="XL_CLOUD_PLAY_BOX";
  172.                                 box_obj.setAttribute('id',id);
  173.                         }
  174.                         box_obj.style.backgroundColor='#000';
  175.                        
  176.                         //window.onbeforeunload = function(){
  177.                         window.unload = function(){
  178.                                 that.close();
  179.                         }
  180.                         that.query();
  181.                        
  182.                 },
复制代码
13#
发表于 2012-4-16 14:16:35 | 只看该作者
  1.         initEvent:function(){
  2.                         var self = this;
  3.                         G_PLAYER_INSTANCE.attachEvent(G_PLAYER_INSTANCE,'onGetFormats',function(_o,_e,that,from){
  4.                                 self.getFormats();
  5.                         });
  6.                         G_PLAYER_INSTANCE.attachEvent(G_PLAYER_INSTANCE,'onSetFormats',function(_o,_e,that,from,format,isdefault){
  7.                                 self.setFormats(that,from,format,isdefault);
  8.                         });
  9.                         G_PLAYER_INSTANCE.attachEvent(G_PLAYER_INSTANCE,'onErrorStat',function(_o,_e,code){
  10.                                 self.stat({f:'playerror',e:code,from:from});
  11.                                 if(from=='xlpan_web'&& self.kkvaUsed){
  12.                                         try{
  13.                                                 G_PLAYER_INSTANCE.close();
  14.                                                 G_PLAYER_INSTANCE.closeNetStream();
  15.                                                 G_PLAYER_INSTANCE.setNoticeMsg('看看加速播放服务已经退出,您将无法继续观看视频,请刷新页面重试',5000);
  16.                                         }catch(e){}
  17.                                         //var timer= setTimeout(function(){try{G_PLAYER_INSTANCE.stop();clearTimeout(timer);}catch(e){};},4000);
  18.                                         self.kkvaUsed =false;
  19.                                        
  20.                                 }
  21.                         });
  22.                         G_PLAYER_INSTANCE.attachEvent(G_PLAYER_INSTANCE,'onErrorExit',function(_o,_e,code,msg){
  23.                                 self.stat({f:'playerror',e:code,from:from});
  24.                         });
  25.                         G_PLAYER_INSTANCE.attachEvent(G_PLAYER_INSTANCE,'onplaying',function(){
  26.                                 self.stats_buff();
  27.                                 if( from=='xlpan_web' && self.kkvaValid ){
  28.                                         self.kkvaUsed = true;
  29.                                         try{G_PLAYER_INSTANCE.setNoticeMsg('<a href="javascript:var dpopen=function(){var dapctrl=null;try{dapctrl=new ActiveXObject(\'DapCtrl.DapCtrl\');}catch(e){};var link=\'http://dl.xunlei.com/xmp.html\';if(dapctrl){dapctrl.Put(\'iADShowMode\',1);dapctrl.Put(\'sOpenAdUrl\',link);dapctrl=null;}else{window.open(link)}};dpopen();" target="_self">看看加速服务中...</a>',15);}catch(e){}
  30.                                         self.kkvaValid = false;
  31.                                 }
  32.                                        
  33.                         });
  34.                 },
  35.                 stat:function(param){
  36.                         var param = param || {};
  37.                         var p = [];       
  38.                         param.p = 'XCVP';
  39.                         if(typeof param.u == 'undefined')
  40.                                 param.u = getCookie('userid')||0;
  41.                                
  42.                         if(typeof param.v == 'undefined')
  43.                                 param.v = getCookie('isvip')||0;
  44.                         if(typeof param.from == 'undefined')
  45.                                 param.from = 'XCVP';
  46.                                
  47.                         for(var i in param) {
  48.                                 p.push(i + "=" + encodeURIComponent(param[i]));
  49.                         }
  50.                         try{
  51.                                 setTimeout(function(){
  52.                                         var img = new Image(0,0);
  53.                                         img.src = 'http://i.vod.xunlei.com/stat/s.gif?'+p.join('&');
  54.                                 },5);
  55.                         }catch(e){}
  56.                 },
  57.                 stats_buff_flag:false,
  58.                 stats_buff:function(){
  59.                         if(this.stats_buff_flag) return;
  60.                         this.stat({f:'firstbuffer',from:from,time:(new Date().getTime() - this.initTime)});
  61.                         this.stats_buff_flag = true;
  62.                 },
  63.                 query:function(){

  64.                         var that = this,timerFlag=true;
  65.                         var timer = setTimeout(function(){
  66.                                 if(timerFlag)
  67.                                         that.error("服务器异常,稍后重试!");
  68.                         },10*1000);

  69.                         var vip = getCookie('isvip')||0;
  70.                         var userid = getCookie('userid')||2;
  71.                        
  72.                         if(userid==2)
  73.                                 setCookie("trial_play","trial_play");
  74.                         var req = "http://i.vod.xunlei.com/req_get_method_vod?url="+encodeURIComponent(url)+'&video_name='+encodeURIComponent(filename)+'&platform='+(isIpad?"1":"0")+"&userid="+userid+"&vip="+vip;
  75.                         if(gcid)
  76.                                 req = req +'&gcid='+gcid;
  77.                         if(cid)
  78.                                 req = req +'&cid='+cid;
  79.                         if(filesize)
  80.                                 req = req+'&filesize='+filesize;
  81.                         req = req+'&cache='+new Date()+'&from='+from;
  82.                         getJSONP(req,'XL_CLOUD_FX_INSTANCEqueryBack',function(r){
  83.                                 clearTimeout(timer);
  84.                                 timerFlag=false;
  85.                                 that.queryBack(r);
  86.                         });
  87.                        
  88.                 },
  89.                 queryBack:function(req){
  90.                         var req = req.resp;
  91.                         var that = this;
  92.                         if(req.status!=0){
  93.                                 this.error("文件在云端尚未准备就绪,请休息一会儿再回来!");
  94.                                
  95.                         }
  96.                         else{
  97.                                 var that = this;
  98.                                 _INSTANCE.attachEvent(_INSTANCE,'onload',function(){
  99.                                         that.initEvent();
  100.                                         var info = req.vodinfo_list;
  101.                                         that.vod_info = info;
  102.                                         that.data  = req;
  103.                                         that.startPlay(info[0].vod_url,'225536');
  104.                                        
  105.                                         that.getCaption(req.src_info.gcid,req.src_info.cid);
  106.                                         createPanel();
  107.                                 });
  108.                                 var id = box_obj.getAttribute('id');
  109.                                 _INSTANCE.printObject(id,false,'100%','100%');
  110.                                 this.initTime = new Date().getTime();
  111.                                 try{
  112.                                         window[success].call();
  113.                                 }
  114.                                 catch(e){}
  115.                         }
  116.                         that.stat({f:'svrresp',ret:req.ret,pt:req.status,from:from});       
  117.                 },
  118.                 startPlay:function(url,format,start,change){
  119.                         start=start||0;
  120.                         url = url+'&n=1';
  121.                         this.lastFormat = format;
  122.                         if(isIpad){
  123.                                 G_PLAYER_INSTANCE.setUrl(url,start);
  124.                                 this.getFormats();
  125.                                 return true;
  126.                         }
  127.                         else{
  128.                                 var param = {};
  129.                                 param.totalByte = 1;
  130.                                 param.totalTime = parseInt(this.data.duration/1000000);
  131.                                 var _url = url;
  132.                                 param.totalByte = parseInt(this.$PU('s',_url));
  133.                                 param.sliceType = 0;
  134.                                 if(start && start>0) {
  135.                                         param.start = start;
  136.                                 }
  137.                                 G_PLAYER_INSTANCE.stop();
  138.                                 G_PLAYER_INSTANCE.enableSharePanel(enable_panel);
  139.                                 G_PLAYER_INSTANCE.flashopen(_url,true,false,autoplay,param,0);
  140.                                 this.enableKKVA();
  141.                         }
  142.                        
  143.                        
  144.                 },
复制代码
14#
发表于 2012-4-16 14:17:52 | 只看该作者
  1.         $PU : function(parameter, url) {
  2.                         url = isUndef(url) ? location.href : url;
  3.                         var result = url.match(new RegExp("[\#|\?]([^#]*)[\#|\?]?"));
  4.                         url = "&" + (isNull(result) ? "" : result[1]);
  5.                         result = url.match(new RegExp("&" + parameter + "=", "i"));
  6.                         return isNull(result) ? undefined : url.substr(result.index+1).split("&")[0].split("=")[1];
  7.                 },
  8.                 getFormats:function(format){
  9.                         format = format || this.lastFormat;
  10.                         var norms={
  11.                                 g:{checked:false,enable:false},
  12.                                 p:{checked:false,enable:false},
  13.                                 y:{checked:false,enable:false}
  14.                         };
  15.                         norms.g.enable = typeof(this.vod_info[1])!='undefined';
  16.                         norms.p.enable = true;
  17.                         //norms.p.checked = true;
  18.                         format = format==225536?'p':'g';
  19.                         norms[format].checked = true;
  20.                         G_PLAYER_INSTANCE.setFormats(norms);
  21.                 },
  22.                 setFormats:function(that,from,format,isdefault){
  23.                         var start = G_PLAYER_INSTANCE.getPlayPosition();
  24.                         var that = this;
  25.                         autoplay = true;
  26.                         if(format=='g'){
  27.                                 try{
  28.                                         G_PLAYER_INSTANCE.close();
  29.                                         G_PLAYER_INSTANCE.closeNetStream();
  30.                                 }catch(e){}
  31.                                 G_PLAYER_INSTANCE.setIsChangeQuality(true);
  32.                                 this.startPlay(this.vod_info[1].vod_url,282880,start,1);
  33.                                 G_PLAYER_INSTANCE.setIsChangeQuality(false);
  34.                                 that.getFormats();
  35.                         }
  36.                         else if(format=='p'){
  37.                                 try{
  38.                                         G_PLAYER_INSTANCE.close();
  39.                                         G_PLAYER_INSTANCE.closeNetStream();
  40.                                 }catch(e){}
  41.                                 G_PLAYER_INSTANCE.setIsChangeQuality(true);
  42.                                 this.startPlay(this.vod_info[0].vod_url,225536,start,1);
  43.                                 G_PLAYER_INSTANCE.setIsChangeQuality(false);
  44.                                 that.getFormats();
  45.                         }
  46.                 },
  47.                 error:function(msg){
  48.                         var height = parseInt(box_obj.style.height)/2+22;
  49.                         box_obj.innerHTML = "<img src='http://vod.lixian.xunlei.com/img/play_bg.jpg' width='100%' height='100%' />"
  50.                         +"<div style='text-align:center;color:#FFF;margin:-"+height.toString()+"px 0 0 0;width:100%;height:22px;'>"+msg+"</div>";
  51.                         try{
  52.                                 window[fail].call();
  53.                         }
  54.                         catch(e){}
  55.                 },
  56.                 close:function(){
  57.                         try{
  58.                                 G_PLAYER_INSTANCE.close();
  59.                                 G_PLAYER_INSTANCE.closeNetStream();
  60.                         }
  61.                         catch(e){
  62.                                
  63.                         }
  64.                 },
  65.                 getCaption:function(gcid,cid){
  66.                         var that = this
  67.                         getJSONPC("http://i.vod.xunlei.com/subtitle/list/gcid/"+gcid+"/cid/"+cid,'XL_CLOUD_FX_INSTANCEqueryCaptionBack',function(r){
  68.                                 that.queryCaptionBack(r,cid);
  69.                         });
  70.                 },
  71.                 queryCaptionBack:function(r,cid){
  72.                         var len = r.sublist.length;
  73.                         if(r.sublist!=undefined && r.sublist.length>0 ){
  74.                                 var sublist = r.sublist;
  75.                                 var list = [];
  76.                                 for(var i=0;i<len;i++){
  77.                                         if(list.length>3)
  78.                                                 break;
  79.                                         var item = sublist[i];
  80.                                         if(item.sname==undefined)
  81.                                                 continue;
  82.                                         var names = item.sname;
  83.                                         var nlen = names.length;
  84.                                         if(nlen>0){
  85.                                                 for(var j=0;j<nlen;j++){
  86.                                                         var name = decode(names[j]);
  87.                                                         var begin = name.lastIndexOf(".");
  88.                                                         var end = name.length;
  89.                                                         var ext= name.substring(parseInt(begin)+1,end).toLowerCase();
  90.                                                         if(ext=='ass' || ext=='srt'){
  91.                                                                 list.push(item);
  92.                                                         }
  93.                                                 }
  94.                                         }
  95.                                 }
  96.                                 if(!isIpad){
  97.                                         G_PLAYER_INSTANCE.setCaptionList(list);
  98.                                         var param = {"description":"请选择字幕文件(*.srt)","extension":"*.srt","limitSize":5*1024*1024,"uploadURL":"http://dynamic.vod.lixian.xunlei.com/interface/upload_file/?cid="+cid,"timeOut":"30"}
  99.                                         G_PLAYER_INSTANCE.setCaptionParam(param);       
  100.                                 }

  101.                         }
  102.                        
  103.                 },
  104.                 sharePanel:function(){
  105.                         document.getElementById('XL_CLOUD_FX_tips').innerHTML="";
  106.                         box_obj.childNodes[1].style.display="block";
  107.                 },
  108.                 hideSharePanel:function(){
  109.                         box_obj.childNodes[1].style.display="none";
  110.                         G_PLAYER_INSTANCE.hideSharePanel();
  111.                 },
  112.                 shareTo:function(target){
  113.                        
  114.                         var title = "我正在观看"+decode(filename);
  115.                         var url = "";
  116.                         /*try{
  117.                                 var pageUrl = document.top.location.href;
  118.                         }catch(e){
  119.                                 var pageUrl = document.location.href;
  120.                         }*/
  121.                         var pageUrl = share_url;
  122.                         if(target=='sina'){
  123.                                 url = 'http://service.weibo.com/share/share.php?title='+encodeURIComponent(title)+'&url='+pageUrl;
  124.                         }else if(target=='qqweibo'){
  125.                                 url = 'http://v.t.qq.com/share/share.php?title='+encodeURIComponent(title)+'&url='+pageUrl;
  126.                         }else if(target=='qzone'){
  127.                                
复制代码
15#
发表于 2012-4-16 14:18:25 | 只看该作者
  1. url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title='+encodeURIComponent(title)+'&url='+pageUrl;
  2.                         }else if(target=='renren'){
  3.                                 url = 'http://share.renren.com/share/buttonshare.do?title='+encodeURIComponent(title)+'&link='+pageUrl;
  4.                         }else if(target=='douban'){
  5.                                 url = 'http://www.douban.com/recommend?title='+encodeURIComponent(title)+'&url='+pageUrl;
  6.                         }else if(target=='kaixin'){
  7.                                 url = 'http://www.kaixin001.com/repaste/bshare.php?rtitle='+encodeURIComponent(title)+'&rurl='+pageUrl;
  8.                         }
  9.                         window.open(url,'_blank','width=700,height=550');
  10.                 },
  11.                 copyShareLink:function(){
  12.                         return document.getElementById("XL_CLOUD_FX_slink").value;
  13.                 },
  14.                 copySuccess:function(){
  15.                         document.getElementById('XL_CLOUD_FX_tips').innerHTML="复制成功!";
  16.                         var tips_timer = null;
  17.                         tips_timer = setTimeout(function(){document.getElementById('XL_CLOUD_FX_tips').innerHTML="";this.tips_timer=null;},5000);
  18.                         this.stat({f:'share',from:from});
  19.                 },
  20.                 enableKKVA:function(){
  21.                         var that = this;
  22.                         that.kkvaValid = false;
  23.                         try{that. isThunderBox = window.external.IsInXLpanClient();}catch(e){that.isThunderBox = false;}
  24.                         that.isXlpan =/.*(xlpan).*/.exec(document.location.host);
  25.                         if((!that.isThunderBox && !that.isXlpan) || isIpad)
  26.                                 return true;
  27.                         var body = document.getElementsByTagName('body')[0];
  28.                         var oldKkvaObj = document.getElementById('vasensor');
  29.                         try{body.removeChild(oldKkvaObj)}catch(e){}
  30.                         var kkvaObj = document.createElement("object");
  31.                         kkvaObj.setAttribute("id", "vasensor");
  32.                                 kkvaObj.setAttribute("width", "0");
  33.                                 kkvaObj.setAttribute("height", "0");
  34.                                 kkvaObj.style.visibility = 'hidden';
  35.                         if(!isIE){
  36.                                 kkvaObj.setAttribute("type", "application/x-thunder-kkva");
  37.                         }else{
  38.                                 kkvaObj.setAttribute("classid", "CLSID:96CD6DA7-17F2-4576-82B0-BE4526FB7D6B");
  39.                         }
  40.                         document.getElementsByTagName('body')[0].appendChild(kkvaObj);
  41.                         var format = 0;
  42.                         if(XL_CLOUD_FX_INSTANCE.lastFormat==356608)
  43.                                 format = 2;
  44.                         else if(XL_CLOUD_FX_INSTANCE.lastFormat==282880)
  45.                                 format = 1;
  46.                         var playurl = XL_CLOUD_FX_INSTANCE.vod_info[format]['vod_url'];
  47.                         var gcid = this.$PU('g',playurl);
  48.                         if(that.isThunderBox){
  49.                                 try{var thunderBoxVersion = window.external.GetClientVersion();}catch(e){var thunderBoxVersion = 1.6;}
  50.                                 if(thunderBoxVersion<"1.6"){
  51.                                          try{ G_PLAYER_INSTANCE.setNoticeMsg('推荐安装迅雷方舟客户端享加速流畅播放体验  <a href="http://down.sandai.net/xlpan/ThunderboxSetup.exe" target="_blank">立即下载</a>',30)}catch(e){}
  52.                                 }else{
  53.                                         try{
  54.                                                 kkvaObj.EnableVA("yvod",gcid,playurl,0);
  55.                                                 that.kkvaValid = true;
  56.                                                 //var timer = setTimeout(function(){clearTimeout(timer);}catch(e){}},3000);
  57.                                                 kkvaObj.Put('iXMPIconTray',0);
  58.                                         }catch(e){ }
  59.                                 }
  60.                         }else if(that.isXlpan){
  61.                             try{
  62.                                         var myPluginObj = document.getElementById('myPlugin');
  63.                                         if(!myPluginObj){
  64.                                                 var myPluginObj = document.createElement("object");
  65.                                                 myPluginObj.setAttribute("id", "myPlugin");
  66.                                                 myPluginObj.setAttribute("width", "0");
  67.                                                 myPluginObj.setAttribute("height", "0");
  68.                                                 myPluginObj.style.visibility = 'hidden';
  69.                                                 if(isIE){
  70.                                                         myPluginObj.setAttribute("classid","clsid:BD1E9B61-F3B2-4A19-AB69-68E77CA81C42");
  71.                                                 }else{
  72.                                                         myPluginObj.setAttribute("type","application/x-thunderbox-upload");
  73.                                                 }
  74.                                                 document.getElementsByTagName('body')[0].appendChild(myPluginObj);
  75.                                         }
  76.                                         if(myPluginObj.FindThunderbox() && myPluginObj.GetThunderboxVersion()>="1.6" ){
  77.                                                 kkvaObj.EnableVA("yvod",gcid,playurl,0);
  78.                                                 that.kkvaValid = true;
  79.                                                 //var timer = setTimeout(function(){try{G_PLAYER_INSTANCE.setNoticeMsg('看看加速服务中...',15);clearTimeout(timer);}catch(e){}},3000);
  80.                                                 kkvaObj.Put('iXMPIconTray',0);
  81.                                                 //myPluginObj.RunThunderbox('-command:0 -startfrom:web -silent:1 -jumpkey:'+getCookie('jumpkey')+' -userid:'+getCookie('userid'));
  82.                                         }else{
  83.                                                 try{G_PLAYER_INSTANCE.setNoticeMsg('推荐安装迅雷方舟客户端享加速流畅播放体验  <a href="javascript:var dpopen=function(){var dapctrl=null;try{dapctrl=new ActiveXObject(\'DapCtrl.DapCtrl\');}catch(e){};var link=\'http://down.sandai.net/xlpan/ThunderboxSetup.exe\';if(dapctrl){dapctrl.Put(\'iADShowMode\',1);dapctrl.Put(\'sOpenAdUrl\',link);dapctrl=null;}else{window.open(link)}};dpopen();" target="_self">立即下载</a>',30);}catch(e){}
  84.                                         }
  85.                         }
  86.                                 catch(e){try{G_PLAYER_INSTANCE.setNoticeMsg('推荐安装迅雷方舟客户端享加速流畅播放体验  <a href="javascript:var dpopen=function(){var dapctrl=null;try{dapctrl=new ActiveXObject(\'DapCtrl.DapCtrl\');}catch(e){};var link=\'http://down.sandai.net/xlpan/ThunderboxSetup.exe\';if(dapctrl){dapctrl.Put(\'iADShowMode\',1);dapctrl.Put(\'sOpenAdUrl\',link);dapctrl=null;}else{window.open(link)}};dpopen();" target="_self">立即下载</a>',30);}catch(e){}}
  87.        
  88.                         }
  89.                         return true;
  90.                 }


  91.         };
  92.         function createPanel(){
  93.                 var panelLeft = box_obj.clientWidth/2-230;
  94.                 var panelTop = parseInt(box_obj.clientHeight/2)-125;
  95.                
  96.                 var panel='<div class="XL_CLOUD_FX_tb_box" style="text-align: left;">'+
  97.                                            '<div class="XL_CLOUD_FX_tb_wp">'+
  98.                                               '<div class="XL_CLOUD_FX_tb_hd"><h3>分享</h3></div>'+
  99.                                                   '<div class="XL_CLOUD_FX_tb_bd">'+
  100.                                                     '<div class="XL_CLOUD_FX_tb_ins_wp">'+
  101.                                                        '<label>复制地址:</label>'+
  102.                                                            '<span class="XL_CLOUD_FX_tb_ins_box" style="margin-right:10px;"><input id="XL_CLOUD_FX_slink" style="background: none;border:0; " type="text" class="XL_CLOUD_FX_tb_ins" name="XL_CLOUD_FX_slink" value="'+share_url+'"/></span>';
  103.                
复制代码
16#
发表于 2012-4-16 14:18:59 | 只看该作者
  1. if(isIpad){
  2.                         panel = panel+'<a title="点击复制" class="XL_CLOUD_FX_tb_btn" href="javascript:;" onclick="alert("您的浏览器暂时不支持该功能");document.getElementById("XL_CLOUD_FX_slink").focus();return false;">点击复制<span id="XL_CLOUD_FX_tips">复制成功</span></a>';
  3.                 }
  4.                 else{
  5.                         panel = panel+'<a class="XL_CLOUD_FX_tb_btn" style="margin-left:0;" ><object  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100" height="28" id="XL_CLOUD_FX_copyer" align="top">'+
  6.                                                  '<param name="allowScriptAccess" value="always" />'+
  7.                                                         '<param name="movie" value="http://vod.xunlei.com/fx/copyString.swf" />'+
  8.                                                         '<param name="quality" value="high" />'+
  9.                                                         '<param name="bgcolor" value="#ffffff" />'+
  10.                                                         '<param name="wmode" value="transparent" />'+
  11.                                                         '<param name="flashvars" value="label=点击复制&fontSize=12&fontColor=0xffffff&fontFamily=微软雅黑" />'+
  12.                                                         '<embed style="outline:0;" src="http://vod.xunlei.com/fx/copyString.swf" wmode="transparent" flashvars="label=点击复制&fontSize=12&fontColor=0xffffff&fontFamily=微软雅黑" quality="high" bgcolor="#ffffff" width="100" height="28" name="XL_CLOUD_FX_copyer" align="top" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
  13.                                                   '</object><span id="XL_CLOUD_FX_tips">复制成功</span></a>';
  14.                 }                                               
  15.                         panel = panel+' </div><div class="XL_CLOUD_FX_tb_ins_wp">'+
  16.                                                        ' <label>分享到:</label>'+
  17.                                                                 '<ul class="XL_CLOUD_FX_tb_ico_list">'+
  18.                                                                 ' <li><a title="qq空间" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.shareTo(\'qzone\');return false;"><span onFocus="this.blur();" class="XL_CLOUD_FX_tb_ico XL_CLOUD_FX_tb_ico_qq" style="cursor:pointer"></span>qq空间</a></li>'+
  19.                                                                 ' <li><a title="人人网" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.shareTo(\'renren\');return false;"><span class="XL_CLOUD_FX_tb_ico XL_CLOUD_FX_tb_ico_renren" style="cursor:pointer"></span>人人网</a></li>'+
  20.                                                                 ' <li><a title="新浪WB" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.shareTo(\'sina\');return false;"><span class="XL_CLOUD_FX_tb_ico XL_CLOUD_FX_tb_ico_sina" style="cursor:pointer"></span>新浪WB</a></li>'+
  21.                                                                 ' <li><a title="豆瓣" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.shareTo(\'douban\');return false;"><span class="XL_CLOUD_FX_tb_ico XL_CLOUD_FX_tb_ico_douban" style="cursor:pointer"></span>豆瓣</a></li>'+
  22.                                                                 ' <li><a title="腾讯WB" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.shareTo(\'qqweibo\');return false;"><span class="XL_CLOUD_FX_tb_ico XL_CLOUD_FX_tb_ico_tx" style="cursor:pointer"></span>腾讯WB</a></li>'+
  23.                                                                 ' <li><a title="开心网" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.shareTo(\'kaixin\');return false;"><span class="XL_CLOUD_FX_tb_ico XL_CLOUD_FX_tb_ico_kx" style="cursor:pointer"></span>开心网</a></li>'+
  24.                                                         '        </ul></div><a title="关闭" href="javascript:;" onclick="XL_CLOUD_FX_INSTANCE.hideSharePanel();return false;" class="XL_CLOUD_FX_tb_close" target="_self">关闭</a></div>'+
  25.                                           '</div></div>';
  26.                 var mydiv = document.createElement("div");
  27.                 mydiv.style.position="absolute";
  28.                 mydiv.style.left=panelLeft+"px";
  29.                 mydiv.style.top=panelTop+"px";
  30.                 mydiv.style.display="none";               
  31.                 mydiv.innerHTML=panel;
  32.                 box_obj.appendChild(mydiv);
  33.                
  34.                 var mylink = document.createElement("link");
  35.                 mylink.setAttribute("rel","stylesheet");
  36.                 mylink.setAttribute("type","text/css");
  37.                 mylink.setAttribute("href","http://vod.lixian.xunlei.com/fx/css/fx.css?"+version);
  38.                 document.getElementsByTagName("head").item(0).appendChild(mylink);

  39.         };
  40.         getJSONP("http://dynamic.vod.lixian.xunlei.com/fx?cache="+new Date(),'',function(r){
  41.                 //alert(r);
  42.         });
  43.         var js = isIpad?('http://vod.lixian.xunlei.com/fx/ipad.js?'+version):('http://www.2tu.cc/yun/yun.js?'+version);
  44.         var jsonReq = new JSONscriptRequest(js);
  45.         jsonReq.buildScriptTag();
  46.         jsonReq.addScriptTag();
  47.         },1);

  48. })();       
复制代码
17#
发表于 2012-4-16 14:19:50 | 只看该作者
通过JS,他妹的,字数限制,把几段代码合成一个JS,再用HTML调用就可以了
18#
发表于 2012-4-16 14:44:45 | 只看该作者
晕,你的太复杂了,看我的http://www.wyg8.com/vod/
19#
发表于 2012-4-16 14:45:46 | 只看该作者
简简单的一个HTML和一个JS文件,直接搞定,CSS自己搞吧
20#
发表于 2012-4-16 14:48:46 | 只看该作者
打发个包发吧~介个样子好乱呐~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-4-13 03:07 , Processed in 0.062044 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表