-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoukuhtml5playerbookmark2.js
1 lines (1 loc) · 28.2 KB
/
youkuhtml5playerbookmark2.js
1
(function(f){var c={};var i=function(k){return c[k];};var r=function(k){if(!c[k]){var m={exports:{}};try{f[k].call(m.exports,m,m.exports,r,i)}catch(e){};c[k]=m.exports;}return c[k];};return r('a');})({a:function(module,exports,require,include){var _=require("A");var loader=require("b");_.log("加载妈妈计划中...");var sites={"163open":require("c"),acfun:require("C"),iqiyi:require("d"),qq:require("D"),sohu:require("e"),xunlei:require("E"),56:require("f"),bilibili:require("F"),letv:require("g"),sina:require("G"),tudou:require("h"),youku:require("H"),noop:{reg:true,call:function(){_.log("这个页面不在妈妈计划的涉及范围中");setTimeout(function(){_.rlog()},5e3)}}};_.each(sites,function(handler){if(handler.reg){handler.call(loader);return false}})},A:function(module,exports,require,include){var _={};_.environment="production";_.noop=function(){};_.each=function(arrOrObject,fn,context,i,len){if(typeof arrOrObject.length=="number"){for(i=0,len=arrOrObject.length;i<len;i++)if(fn.call(context,arrOrObject[i],i)==false)break}else for(i in arrOrObject)if(fn.call(context,arrOrObject[i],i)==false)break};_.byId=function(id){return document.getElementById(id)};_.rNode=function(el){try{el.parentNode.removeChild(el)}catch(e){}};_.cTag=function(tagName,styles,attrs,out,t,cssText){t=document.createElement(tagName),cssText="";_.each(styles||{},function(value,key){cssText+=[key,":",value,";"].join("")}),t.style.cssText=cssText;_.each(attrs||{},function(value,key){t.setAttribute(key,value)});return out&&out.appendChild(t)||t};_.hasClass=function(el,cls){return el.className.match(new RegExp("(\\s|^)"+cls+"(\\s|$)"))};_.addClass=function(el,cls){if(!_.hasClass(el,cls))el.className+=" "+cls};_.removeClass=function(el,cls){if(_.hasClass(el,cls)){el.className=el.className.replace(new RegExp("(\\s|^)"+cls+"(\\s|$)")," ").trim()}};_.jsonp=function(url,callback,handler,scr,back){window[back=handler||"HTML5PlayerBookMarkCodeByZythum"+ +(new Date)+Math.random().toString().replace(".","")]=function(){callback&&callback.apply(this,arguments);delete window[back];_.rNode(scr)};(scr=_.cTag("script",{},{},document.body)).src=url+back};_.canPlayM3U8=!!document.createElement("video").canPlayType("application/x-mpegURL")?true:false;_.js=function(path,url){url=_.environment=="development"?"http://zythum.sinaapp.com:8080/youkuhtml5playerbookmark/client/development/js":"http://2.zythum.sinaapp.com/youkuhtml5playerbookmark/client/production/js";return url+(path||"")+"?_t="+ +(new Date)};_.css=function(path,url){url=_.environment=="development"?"http://zythum.sinaapp.com:8080/youkuhtml5playerbookmark/client/development/static/css":"http://2.zythum.sinaapp.com/youkuhtml5playerbookmark/client/production/static/css";return url+(path||"")+"?_t="+ +(new Date)};_.html=function(path,url){url=_.environment=="development"?"http://zythum.sinaapp.com:8080/youkuhtml5playerbookmark/client/development/static/html":"http://2.zythum.sinaapp.com/youkuhtml5playerbookmark/client/production/static/html";return url+(path||"")};_.service=function(name,query){return"http://2.zythum.sinaapp.com/youkuhtml5playerbookmark/service/"+(name||"")+".php?"+query};var _logNode=_.cTag("div",{position:"fixed",top:"0",left:"0",height:"20pt","line-height":"20pt",padding:"2pt 5pt",color:"#fff",background:"rgb(131, 117, 91)","white-space":"nowrap","z-index":"999999999",margin:"0"});_.log=function(text){window.console||window.console(text);document.body.appendChild(_logNode).innerHTML=text};_.rlog=function(){_.rNode(_logNode)};module.exports=_},b:function(module,exports,require,include){require("B")();var key="MA_MA_SHUO_YAO_BU_HE_BIE_REN_MING_MING_CHONG_FU_JIU_YAO_ZU_GOU_CHANG";var _=require("A");var styles={position:"fixed",width:"100%",height:"100%",display:"block",top:"0",left:"0",bottom:"0",right:"0","z-index":"9999999",border:"none",background:"transparent"};var attrs={src:"about:blank",frameborder:"0",scrolling:"no",allowtransparency:"yes",mozallowfullscreen:"mozallowfullscreen",webkitallowfullscreen:"webkitallowfullscreen"};var playerPath=_.js("/"+playerOrMplayer()+"/index.js");var iframeContent='<textarea name="" id="info" style="display:none;">{info}</textarea>';function parseUrls(urls){var rs=[];_.each(urls,function(url,name){rs.push({name:name,url:url})});return rs}function playerOrMplayer(){return"player"}module.exports=function(videoInfo,iframe,iwindow,ibody){var cacheBodyStyle;if(key in window)return;window[key]={close:function(){iframe&&(iframe.src="");_.rNode(iframe);delete window[key];try{document.body.style.cssText=cacheBodyStyle;flashPlaceHoder.parentNode.insertBefore(flash,flashPlaceHoder);_.rNode(flashPlaceHoder)}catch(e){}},start:function(){cacheBodyStyle=document.body.style.cssText;document.body.style.cssText+=";overflow:hidden;"},rlog:function(){_.rlog()}};ibody=(iwindow=(iframe=_.cTag("iframe",styles,attrs,document.body)).contentWindow).document.body;ibody.innerHTML=iframeContent.replace("{info}",JSON.stringify({urls:parseUrls(videoInfo.urls)||[],comments:videoInfo.comment}));ibody.appendChild(_.cTag("script",null,{src:playerPath,charset:"UTF-8"}));try{var flash=_.byId(videoInfo.flashElementId);var flashPlaceHoder=_.cTag("span",null,null);flash.parentNode.insertBefore(flashPlaceHoder,flash);_.rNode(flash)}catch(e){}}},B:function(module,exports,require,include){var flashText='<div style="text-shadow:0 0 2px #eee;letter-spacing:-1px;background:#eee;font-weight:bold;padding:0;font-family:arial,sans-serif;font-size:30px;color:#ccc;width:152px;height:52px;border:4px solid #ccc;border-radius:12px;position:absolute;top:50%;left:50%;margin:-30px 0 0 -80px;text-align:center;line-height:52px;">Flash</div>';var count=0;var flashBlocks={};var click2ShowFlash=function(e){var index=this.getAttribute("data-flash-index");var flash=flashBlocks[index];flash.setAttribute("data-flash-show","isshow");this.parentNode.insertBefore(flash,this);this.parentNode.removeChild(this);this.removeEventListener("click",click2ShowFlash,false)};var createAPlaceHolder=function(flash,width,height){var index=count++;var style=document.defaultView.getComputedStyle(flash,null);var positionType=style.position;positionType=positionType==="static"?"relative":positionType;var margin=style["margin"];var display=style["display"]=="inline"?"inline-block":style["display"];var style=["","width:"+width+"px","height:"+height+"px","position:"+positionType,"margin:"+margin,"display:"+display,"margin:0","padding:0","border:0","border-radius:1px","cursor:pointer","background:-webkit-linear-gradient(top, rgba(240,240,240,1)0%,rgba(220,220,220,1)100%)",""];flashBlocks[index]=flash;var placeHolder=document.createElement("div");placeHolder.setAttribute("title","点我还原Flash");placeHolder.setAttribute("data-flash-index",""+index);flash.parentNode.insertBefore(placeHolder,flash);flash.parentNode.removeChild(flash);placeHolder.addEventListener("click",click2ShowFlash,false);placeHolder.style.cssText+=style.join(";");placeHolder.innerHTML=flashText;return placeHolder};var parseFlash=function(target){if(target instanceof HTMLObjectElement){if(target.innerHTML.trim()=="")return;if(target.getAttribute("classid")&&!/^java:/.test(target.getAttribute("classid")))return}else if(!(target instanceof HTMLEmbedElement))return;var width=target.offsetWidth;var height=target.offsetHeight;if(width>160&&height>60){createAPlaceHolder(target,width,height)}};var handleBeforeLoadEvent=function(e){var target=e.target;if(target.getAttribute("data-flash-show")=="isshow")return;parseFlash(target)};module.exports=function(){var embeds=document.getElementsByTagName("embed");var objects=document.getElementsByTagName("object");for(var i=0,len=objects.length;i<len;i++)objects[i]&&parseFlash(objects[i]);for(var i=0,len=embeds.length;i<len;i++)embeds[i]&&parseFlash(embeds[i])}},c:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var m3u8=function(callback){callback({"高清":window.openCourse.getCurrentMovie().appsrc})};module.exports={reg:/v\.163\.com/.test(window.location.host)&&window.openCourse&&canPlayM3U8,call:function(callback){return m3u8(function(urls){return callback({urls:urls,flashElementId:"FPlayer"})})}}},C:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var sina=function(vid,callback,commentInfo){callback({sina:"http://edge.v.iask.com.sinastorage.com/"+vid+".mp4"},commentInfo)};var youku=function(vid,callback,commentInfo){if(canPlayM3U8){callback({"标清":"http://v.youku.com/player/getM3U8/vid/"+vid+"/type/flv/ts/"+(new Date).getTime().toString().substring(0,10)+"/sc/2/useKeyframe/0/v.m3u8","原画":"http://v.youku.com/player/getM3U8/vid/"+vid+"/type/hd2/ts/"+(new Date).getTime().toString().substring(0,10)+"/sc/2/useKeyframe/0/v.m3u8"},commentInfo)}else{core.jsonp(core.service("getyoukuid","id="+vid+"&callback="),function(param){function getFileIDMixString(seed){var source="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/\\:._-1234567890".split(""),mixed=[],index;for(var i=0,len=source.length;i<len;i++){seed=(seed*211+30031)%65536;index=Math.floor(seed/65536*source.length);mixed.push(source[index]);source.splice(index,1)}return mixed.join("")}function getFileID(fileid,seed){var mixed=getFileIDMixString(seed),ids=fileid.split("*"),realId=[],idx;for(var i=0;i<ids.length;i++){idx=parseInt(ids[i],10);realId.push(mixed.charAt(idx))}return realId.join("")}var d=new Date,fileid=getFileID(param.data[0]["streamfileids"]["3gphd"],param.data[0]["seed"]),sid=d.getTime()+""+(1e3+d.getMilliseconds())+""+parseInt(Math.random()*9e3),k=param.data[0]["segs"]["3gphd"][0]["k"],st=param.data[0]["segs"]["3gphd"][0]["seconds"];core.jsonp("http://f.youku.com/player/getFlvPath/sid/"+sid+"_00/st/mp4/fileid/"+fileid+"?K="+k+"&hd=1&myp=0&ts=1156&ypp=0&ymovie=1&callback=",function(param){callback({"高清":param[0]["server"]},commentInfo)})})}};var qq=function(vid,callback,commentInfo){core.jsonp("http://vv.video.qq.com/geturl?otype=json&vid="+vid+"&charge=0&callback=",function(param){callback({"高清":param.vd.vi[0].url},commentInfo)})};var tudou=function(vid,callback,commentInfo){if(canPlayM3U8){callback({"标清":"http://vr.tudou.com/v2proxy/v2.m3u8?it="+vid+"&st=2","原画":"http://vr.tudou.com/v2proxy/v2.m3u8?it="+vid+"&st=5"},commentInfo)}else{core.jsonp("http://vr.tudou.com/v2proxy/v2.js?it="+vid+"&st=52%2C53%2C54&pw=&jsonp=",function(param){if(param.code==-1)return;for(var urls={},i=0,len=param.urls.length;i<len;i++){urls[i]=param.urls[i]}return callback(urls,commentInfo)})}};var init=function(callback){var vid=document.querySelectorAll("[data-vid].active")[0].getAttribute("data-vid");core.jsonp(core.service("acfun","vid="+vid+"&callback="),function(vid,videoInfo,commentInfo){videoInfo.toLowerCase()=="sina"?sina(vid,callback,commentInfo):videoInfo.toLowerCase()=="youku"?youku(vid,callback,commentInfo):videoInfo.toLowerCase()=="qq"?qq(vid,callback,commentInfo):videoInfo.toLowerCase()=="tudou"?tudou(vid,callback,commentInfo):"false"})};module.exports={reg:/acfun\./.test(window.location.host)&&window.system,call:function(callback){return init(function(urls,commentInfo){return callback({urls:urls,flashElementId:"area-player",comment:commentInfo})})}}},d:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var init=function(callback){var timer;if(window.info){var scr=document.createElement("script");scr.src="http://cache.video.qiyi.com/m/201971/"+window.info.videoId+"/";document.body.appendChild(scr);timer=setInterval(function(){if(window.ipadUrl){clearInterval(timer);if(canPlayM3U8){callback({"高清":ipadUrl.data.url})}else{var mp4Url=ipadUrl.data.mp4Url;var scr=document.createElement("script");scr.src=mp4Url;document.body.appendChild(scr);clearInterval(timer);timer=setInterval(function(){if(window.videoUrl){clearInterval(timer);callback({"高清":videoUrl.data.l})}},100)}}},100)}else{var box=document.getElementById("flashbox");var tvid=box.getAttribute("data-player-tvid");core.jsonp(core.service("iqiyi","tvid="+tvid+"&callback="),function(data){if(canPlayM3U8){callback({"高清":data.data.mpl[0].m3u})}else{var mp4Url=data.data.mpl[0].m4u;var scr=document.createElement("script");scr.src=mp4Url;document.body.appendChild(scr);clearInterval(timer);timer=setInterval(function(){if(window.videoUrl){clearInterval(timer);callback({"高清":videoUrl.data.l})}},100)}})}};module.exports={reg:/iqiyi\.com/.test(window.location.host),call:function(callback){return init(function(urls){return callback({urls:urls,flashElementId:"flash"})})}}},D:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var vid=location.search.match(/vid=([0-9a-zA-Z]+)/);if(vid){vid=vid[1]}else{vid=location.href.match(/\/([0-9a-zA-Z]+).html/);if(vid){vid=vid[1];if(window.COVER_INFO&&window.COVER_INFO.id==vid){vid=window.VIDEO_INFO.vid}}}var mp4=function(callback){core.jsonp("http://vv.video.qq.com/geturl?otype=json&vid="+vid+"&charge=0&callback=",function(param){callback({"高清":param.vd.vi[0].url})})};module.exports={reg:/v\.qq\.com/.test(window.location.host)&&window.COVER_INFO&&vid,call:function(callback){return mp4(function(urls){return callback({urls:urls,flashElementId:"mod_player"})})}}},e:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;function shift_en(e){var t=e.length,n=0;return this.replace(/[0-9a-zA-Z]/g,function(r){var i=r.charCodeAt(0),s=65,o=26;i>=97?s=97:i<65&&(s=48,o=10);var u=i-s;return String.fromCharCode((u+e[n++%t])%o+s)})}var vid=window.vid;var m3u8=function(callback){var sig=shift_en.call(""+(new Date).getTime(),[23,12,131,1321]);var key=shift_en.call(vid,[23,12,131,1321]);core.jsonp("http://pad.tv.sohu.com/playinfo?vid="+vid+"&playlistid=0&uid=&sig="+sig+"&key="+key+"&callback=",function(param){callback({"高清":param.highVid})})};var mp4=function(callback){core.jsonp("http://api.tv.sohu.com/v4/video/info/"+vid+".json?site=1&api_key=695fe827ffeb7d74260a813025970bd5&plat=17&sver=1.0&partner=1&callback=",function(param){callback({"高清":param.data.url_high_mp4})})};module.exports={reg:/sohu\.com/.test(window.location.host)&&vid,call:function(callback){return(canPlayM3U8?m3u8||mp4:mp4)(function(urls){return callback({urls:urls,flashElementId:"player"})})}}},E:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var getCookie=function(key){var cookies=document.cookie.split("; "),i=0,l=cookies.length,temp,value;for(;i<l;i++){temp=cookies[i].split("=");if(temp[0]===key){return decodeURIComponent(temp[1])}}return null};var m3u8=function(callback){var scrpit;core.each(document.getElementsByTagName("script"),function(s){if(s.src.indexOf("http://i.vod.xunlei.com/req_get_method_vod")==0){scrpit=s;return false}});core.jsonp(scrpit.src.replace("&jsonp=XL_CLOUD_FX_INSTANCEqueryBack","&jsonp=").replace("&platform=0&","&platform=1&"),function(param){var urls={};var format=["标清","高清","超清"];var list=param.resp.vodinfo_list;for(var i=0,len=list.length;i<len;i++){urls[format[i]]=list[i].vod_url}callback(urls)})};module.exports={reg:/iplay\.html/.test(window.location.pathname)&&window.gCloudVod&&canPlayM3U8,call:function(callback){return m3u8(function(urls){return callback({urls:urls,flashElementId:"XL_CLOUD_VOD_PLAYER"})})}}},f:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var page=window._page_;var mp4=function(callback){if(page.channel=="view"){var vid=location.href.match(/v\_([0-9a-zA-Z]+)\.html/);if(vid){vid=vid[1];callback({"高清":"http://vxml.56.com/m3u8/"+vid+"/"})}}else{var back="jsonp_dfInfo";var backup=window[back];core.jsonp("http://vxml.56.com/ipad/"+(window.oFlv.o.id||window._oFlv_c.id)+"/?src=site&callback=",function(param){urlList=param.df;var urls={};for(var i=param.df.length-1;i>=0;i--){urls[param.df[i]["type"]]=param.df[i]["url"]}callback(urls);window[back]=backup},back)}};module.exports={reg:/56\.com/.test(window.location.host)&&page,call:function(callback){return mp4(function(urls){return callback({urls:urls,flashElementId:"mod_player"})})}}},F:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var aid=window.aid,pageno=window.pageno;var sina=function(src,callback,commentInfo){var id=src.match(/vid\=([0-9a-zA-Z]+)/);if(id){id=id[1];src="http://edge.v.iask.com.sinastorage.com/"+id+".mp4"}callback({sina:src},commentInfo)};var youku=function(src,callback,commentInfo){var id=src.match(/vid\/([0-9a-zA-Z]+)\//);id=id[1];if(canPlayM3U8){callback({"标清":"http://v.youku.com/player/getM3U8/vid/"+id+"/type/flv/ts/"+(new Date).getTime().toString().substring(0,10)+"/sc/2/useKeyframe/0/v.m3u8","原画":"http://v.youku.com/player/getM3U8/vid/"+id+"/type/hd2/ts/"+(new Date).getTime().toString().substring(0,10)+"/sc/2/useKeyframe/0/v.m3u8"},commentInfo)}else{core.jsonp(core.service("getyoukuid","id="+id+"&callback="),function(param){function getFileIDMixString(seed){var source="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/\\:._-1234567890".split(""),mixed=[],index;for(var i=0,len=source.length;i<len;i++){seed=(seed*211+30031)%65536;index=Math.floor(seed/65536*source.length);mixed.push(source[index]);source.splice(index,1)}return mixed.join("")}function getFileID(fileid,seed){var mixed=getFileIDMixString(seed),ids=fileid.split("*"),realId=[],idx;for(var i=0;i<ids.length;i++){idx=parseInt(ids[i],10);realId.push(mixed.charAt(idx))}return realId.join("")}var d=new Date,fileid=getFileID(param.data[0]["streamfileids"]["3gphd"],param.data[0]["seed"]),sid=d.getTime()+""+(1e3+d.getMilliseconds())+""+parseInt(Math.random()*9e3),k=param.data[0]["segs"]["3gphd"][0]["k"],st=param.data[0]["segs"]["3gphd"][0]["seconds"];core.jsonp("http://f.youku.com/player/getFlvPath/sid/"+sid+"_00/st/mp4/fileid/"+fileid+"?K="+k+"&hd=1&myp=0&ts=1156&ypp=0&ymovie=1&callback=",function(param){callback({"高清":param[0]["server"]},commentInfo)})})}};var qq=function(src,callback,commentInfo){var id=src.match(/qq\.com\/([0-9a-zA-Z]+)\.mp4/);if(id){id=id[1];core.jsonp("http://vv.video.qq.com/geturl?otype=json&vid="+id+"&charge=0&callback=",function(param){callback({"高清":param.vd.vi[0].url},commentInfo)})}};var bili=function(src,callback,commentInfo){callback({bili:src},commentInfo)};var init=function(callback){core.jsonp(core.service("bilibili","aid="+aid+"&page="+pageno+"&callback="),function(cid,videoInfo,commentInfo){var src=videoInfo.durl[0]["url"];src.indexOf("v.iask.com")>=0?sina(src,callback,commentInfo):src.indexOf("v.youku.com")>=0?youku(src,callback,commentInfo):src.indexOf("qq.com")>=0?qq(src,callback,commentInfo):bili(src,callback,commentInfo)})};module.exports={reg:/bilibili/.test(window.location.host)&&window.aid,call:function(callback){return init(function(urls,commentInfo){return callback({urls:urls,flashElementId:"bofqi",comment:commentInfo})})}}},g:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var init=function(callback){var urls={};var mmsid=window.__INFO__.video.mmsid;var vid=window.__INFO__.video.vid;var auth=LTK.require("video.auth");var a=new auth;var tkey=a.getKey(Date.now()/1e3|0);core.jsonp("http://api.letv.com/mms/out/common/geturl?platid=3&splatid=304&playid=0&vtype=9,13,21&version=2.0&tss=ios&mmsid="+mmsid+"&vid="+vid+"&tkey="+tkey+"&retry=1&callback=",function(rs){var i=0;core.each(rs.data[0]["infos"],function(item){var type=item.vtype;switch(item.vtype){case"9":type="标清";break;case"13":type="高清";break;case"21":type="超清";break}i++;~function(type){var url=item.mainUrl+"&expect=3&format=1&termid="+(LTK.require("extend.detect").isLetv?4:2)+(canPlayM3U8?"":"&type=ad_m_gapqing_mp4")+"&jsonp=";if(!canPlayM3U8){url=url.replace("&tss=ios","")}core.jsonp(url,function(rs){urls[type]=rs.location;i--;if(i==0)urls&&callback(urls)})}(type)})})};module.exports={reg:/letv\.com/.test(window.location.host),call:function(callback){return init(function(urls){return callback({urls:urls,flashElementId:"fla_box"})})}}},G:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var _id;try{_id=$SCOPE.video.videoData.ipad_vid}catch(e){_id=false}var mp4=function(callback){callback({"高清":"http://edge.v.iask.com.sinastorage.com/"+_id+".mp4"})};module.exports={reg:/video\.sina\.com\.cn/.test(window.location.host)&&_id,call:function(callback){return mp4(function(urls){return callback({urls:urls,flashElementId:"myMovie"})})}}},h:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var _id=window.iid||window.pageConfig&&window.pageConfig.iid||window.itemData&&window.itemData.iid;var youkuCode=window.itemData&&window.itemData.vcode;var m3u8=function(callback){var urls={"标清":"http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=2","高清":"http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=3","超清":"http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=4","原画":"http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=5"};var _s;if(window.itemData&&window.itemData.segs){urls={};_s=JSON.parse(window.itemData.segs);if(_s[2])urls["标清"]="http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=2";if(_s[3])urls["高清"]="http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=3";if(_s[4])urls["超清"]="http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=4";if(_s[5])urls["原画"]="http://vr.tudou.com/v2proxy/v2.m3u8?it="+_id+"&st=5"}return!youkuCode?callback(urls):callback({"标清":"http://v.youku.com/player/getM3U8/vid/"+youkuCode+"/type/flv/ts/"+(new Date).getTime().toString().substring(0,10)+"/sc/2/useKeyframe/0/v.m3u8","原画":"http://v.youku.com/player/getM3U8/vid/"+youkuCode+"/type/hd2/ts/"+(new Date).getTime().toString().substring(0,10)+"/sc/2/useKeyframe/0/v.m3u8"})};var mp4=function(callback){if(!youkuCode){core.jsonp("http://vr.tudou.com/v2proxy/v2.js?it="+_id+"&st=52%2C53%2C54&pw=&jsonp=",function(param){if(param.code==-1)return;for(var urls={},i=0,len=param.urls.length;i<len;i++){urls[i]=param.urls[i]}return callback(urls)})}else{core.jsonp("https://openapi.youku.com/v2/videos/files.json?client_id=513edb6cf9833ca7&client_secret=eaf151ffdbf1383d934ab4cb91250fa6&type=play&video_id="+youkuCode+"&_="+(new Date).getTime().toString()+"&callback=",function(param){return callback({"标清":param.files["3gphd"].segs[0].url})})}};module.exports={reg:/tudou\.com/.test(window.location.host)&&_id,call:function(callback){return(canPlayM3U8?m3u8||mp4:mp4)(function(urls){return callback({urls:urls,flashElementId:"playerObject"})})}}},H:function(module,exports,require,include){var core=require("A");var canPlayM3U8=core.canPlayM3U8;var _id=window.videoId;var m3u8=function(callback){callback({"标清":location.protocol+"//"+location.host+"/player/getM3U8/vid/"+_id+"/type/flv/ts/"+(((new Date).getTime()/1e3).toString()|0)+"/v.m3u8","高清":location.protocol+"//"+location.host+"/player/getM3U8/vid/"+_id+"/type/mp4/ts/"+(((new Date).getTime()/1e3).toString()|0)+"/v.m3u8","超清":location.protocol+"//"+location.host+"/player/getM3U8/vid/"+_id+"/type/hd2/ts/"+(((new Date).getTime()/1e3).toString()|0)+"/v.m3u8"})};function na(a){if(!a)return"";var a=a.toString(),c,b,f,i,e,h=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];i=a.length;f=0;for(e="";f<i;){do c=h[a.charCodeAt(f++)&255];while(f<i&&-1==c);if(-1==c)break;do b=h[a.charCodeAt(f++)&255];while(f<i&&-1==b);if(-1==b)break;e+=String.fromCharCode(c<<2|(b&48)>>4);do{c=a.charCodeAt(f++)&255;if(61==c)return e;c=h[c]}while(f<i&&-1==c);if(-1==c)break;e+=String.fromCharCode((b&15)<<4|(c&60)>>2);do{b=a.charCodeAt(f++)&255;if(61==b)return e;b=h[b]}while(f<i&&-1==b);if(-1==b)break;e+=String.fromCharCode((c&3)<<6|b)}return e}function D(a){if(!a)return"";var a=a.toString(),c,b,f,e,g,h;f=a.length;b=0;for(c="";b<f;){e=a.charCodeAt(b++)&255;if(b==f){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);c+="==";break}g=a.charCodeAt(b++);if(b==f){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);c+="=";break}h=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(h&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h&63)}return c}function E(a,c){for(var b=[],f=0,i,e="",h=0;256>h;h++)b[h]=h;for(h=0;256>h;h++)f=(f+b[h]+a.charCodeAt(h%a.length))%256,i=b[h],b[h]=b[f],b[f]=i;for(var q=f=h=0;q<c.length;q++)h=(h+1)%256,f=(f+b[h])%256,i=b[h],b[h]=b[f],b[f]=i,e+=String.fromCharCode(c.charCodeAt(q)^b[(b[h]+b[f])%256]);return e}function F(a,c){for(var b=[],f=0;f<a.length;f++){for(var i=0,i="a"<=a[f]&&"z">=a[f]?a[f].charCodeAt(0)-97:a[f]-0+26,e=0;36>e;e++)if(c[e]==i){i=e;break}b[f]=25<i?i-26:String.fromCharCode(i+97)}return b.join("")}function T(a,c){this._sid=sid;this._seed=a.seed;this._fileType=c;var b=new U(this._seed);this._streamFileIds=a.streamfileids;this._videoSegsDic={};for(c in a.segs){for(var f=[],i=0,g=0;g<a.segs[c].length;g++){var h=a.segs[c][g],q={};q.no=h.no;q.size=h.size;q.seconds=h.seconds;h.k&&(q.key=h.k);q.fileId=this.getFileId(a.streamfileids,c,parseInt(g),b);q.type=c;q.src=this.getVideoSrc(h.no,a,c,q.fileId);f[i++]=q}this._videoSegsDic[c]=f}}function U(a){this._randomSeed=a;this.cg_hun()}U.prototype={cg_hun:function(){this._cgStr="";for(var a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/\\:._-1234567890",c=a.length,b=0;b<c;b++){var f=parseInt(this.ran()*a.length);this._cgStr+=a.charAt(f);a=a.split(a.charAt(f)).join("")}},cg_fun:function(a){for(var a=a.split("*"),c="",b=0;b<a.length-1;b++)c+=this._cgStr.charAt(a[b]);return c},ran:function(){this._randomSeed=(211*this._randomSeed+30031)%65536;return this._randomSeed/65536}};T.prototype={getFileId:function(a,c,b,f){for(var i in a)if(i==c){streamFid=a[i];break}if(""==streamFid)return"";c=f.cg_fun(streamFid);a=c.slice(0,8);b=b.toString(16);1==b.length&&(b="0"+b);b=b.toUpperCase();c=c.slice(10,c.length);return a+b+c},getVideoSrc:function(a,c,d,f,i,g){if(!c.videoid||!d)return"";var h={flv:0,flvhd:0,mp4:1,hd2:2,"3gphd":1,"3gp":0}[d],q={flv:"flv",mp4:"mp4",hd2:"flv","3gphd":"mp4","3gp":"flv"}[d],k=a.toString(16);1==k.length&&(k="0"+k);var l=c.segs[d][a].seconds,a=c.segs[d][a].k;if(""==a||-1==a)a=c.key2+c.key1;d="";c.show&&(d=c.show.show_paid?"&ypremium=1":"&ymovie=1");c="/player/getFlvPath/sid/"+sid+"_"+k+"/st/"+q+"/fileid/"+f+"?K="+a+"&hd="+h+"&myp=0&ts="+l+"&ypp=0"+d;f=encodeURIComponent(D(E(F(mk_a4+"poz"+userCache_a2,[19,1,4,7,30,14,28,8,24,17,6,35,34,16,9,10,13,22,32,29,31,21,18,3,2,23,25,27,11,20,5,15,12,0,33,26]).toString(),sid+"_"+f+"_"+token)));c=c+("&ep="+f)+"&ctype=12&ev=1"+("&token="+token);c+="&oip="+rs.data[0].ip;return"http://k.youku.com"+(c+((i?"/password/"+i:"")+(g?g:"")))}};var mk_a3="b4et";var mk_a4="boa4";var userCache_a1="4";var userCache_a2="1";var rs;var sid;var token;var mp4=function(callback){core.jsonp("http://v.youku.com/player/getPlaylist/VideoIDS/"+_id+"/Pf/4/ctype/12/ev/1?__callback=",function(param){rs=param;var a=param.data[0],c=E(F(mk_a3+"o0b"+userCache_a1,[19,1,4,7,30,14,28,8,24,17,6,35,34,16,9,10,13,22,32,29,31,21,18,3,2,23,25,27,11,20,5,15,12,0,33,26]).toString(),na(a.ep));sid=c.split("_")[0];token=c.split("_")[1];var t=new T(a);callback({"标清":t._videoSegsDic["3gphd"][0].src})})};var isPs=navigator.userAgent.indexOf("PlayStation")>-1;module.exports={reg:/youku\.com/.test(window.location.host)&&_id,call:function(callback){return(canPlayM3U8&&!isPs?m3u8||mp4:mp4)(function(urls){return callback({urls:urls,flashElementId:"movie_player"})})}}}});