(function(){var Q,z,D,I,R,S,T;function C(b,d){if(!d)return b;for(var c in d)Fa.call(d,c)&&(b[c]=d[c]);return b}function Ga(b){if(!b)return"";var b=b.toString(),d,c,g,j,f,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];j=b.length;g=0;for(f="";g>4);do{d=b.charCodeAt(g++)&255;if(61==d)return f;d=h[d]}while(g>2);do{c=b.charCodeAt(g++)&255;if(61==c)return f;c=h[c]}while(gh;h++)c[h]=h;for(h=0;256>h;h++)g=(g+c[h]+b.charCodeAt(h%b.length))%256,j=c[h],c[h]=c[g],c[g]=j;for(var l=g=h=0;l=b[g]?b[g].charCodeAt(0)-97:b[g]-0+26,f=0;36>f;f++)if(d[f]==j){j=f;break}c[g]=25>>32-d}function c(b){var d="",e,g;for(e=7;0<=e;e--)g=b>>>4*e&15,d+=g.toString(16);return d}var g,j,f=Array(80),h=1732584193,l=4023233417,A=2562383102,i=271733878,n=3285377520,r,v,w,q,p,b=function(b){for(var b=b.replace(/\r\n/g,"\n"),d="",c=0;ce?d+=String.fromCharCode(e):(127e?d+=String.fromCharCode(e>>6| 192):(d+=String.fromCharCode(e>>12|224),d+=String.fromCharCode(e>>6&63|128)),d+=String.fromCharCode(e&63|128))}return d}(b);r=b.length;var s=[];for(g=0;g>>29);s.push(r<<3&4294967295);for(b=0;bg;g++)f[g]=s[b+g];for(g=16;79>=g;g++)f[g]=d(f[g-3]^f[g-8]^f[g-14]^f[g-16],1);j=h;r=l;v=A;w=i;q=n;for(g=0;19>=g;g++)p=d(j,5)+(r&v|~r&w)+q+f[g]+1518500249&4294967295,q=w,w=v,v=d(r,30),r=j,j=p;for(g=20;39>=g;g++)p=d(j,5)+(r^v^w)+q+f[g]+1859775393&4294967295,q=w,w=v,v=d(r,30),r=j,j=p;for(g=40;59>=g;g++)p=d(j,5)+(r&v|r&w|v&w)+q+f[g]+2400959708&4294967295,q=w,w=v,v=d(r,30),r=j,j=p;for(g=60;79>=g;g++)p=d(j,5)+(r^v^ w)+q+f[g]+3395469782&4294967295,q=w,w=v,v=d(r,30),r=j,j=p;h=h+j&4294967295;l=l+r&4294967295;A=A+v&4294967295;i=i+w&4294967295;n=n+q&4294967295}p=c(h)+c(l)+c(A)+c(i)+c(n);return p.toLowerCase()}function E(b,d){if("js"==d){var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",b)}else"css"==d&&(c=document.createElement("link"),c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("href",b));"undefined"!=typeof c&&document.getElementsByTagName("head")[0].appendChild(c)} function ca(){return f.isAndroid?f.isAndroid4?"adr4":"adr":f.isIPHONE?"iph":f.isIPAD?"ipa":f.isIPOD?"ipo":"oth"}function F(b){return f.isIPAD&&0<=window.location.href.indexOf("v.youku.com")?"x-player":200>=b?"x-player x-player-200":300>=b?"x-player x-player-200-300":660>=b?"x-player x-player-300-660":800>=b?"x-player x-player-660-800":"x-player"}var y=window.console,y={log:function(){}},h={log:function(b){null!=document.getElementById("debug")&&(document.getElementById("debug").innerHTML+=b+" | ")}}, c={},p={},f={playerType:"",userCache:{a1:"4",a2:"1"},playerState:{PLAYER_STATE_INIT:"PLAYER_STATE_INIT",PLAYER_STATE_READY:"PLAYER_STATE_READY",PLAYER_STATE_AD:"PLAYER_STATE_AD",PLAYER_STATE_PLAYING:"PLAYER_STATE_PLAYING",PLAYER_STATE_END:"PLAYER_STATE_END",PLAYER_STATE_ERROR:"PLAYER_STATE_ERROR"},playerCurrentState:"PLAYER_STATE_INIT",Log:function(b,d){var c=document.createElement("img");d&&c.addEventListener("error",d,!1);c.src=b+"&r_="+Math.floor(1E4*Math.random());c.id="youku-uniplayer-stat"}, isNeedAdrTrick:function(){return f.isAndroid&&!f.adrPlayTrick&&!f.isHTC&&f.isNeedFrontAd&&!f.isVIVO},getParentUrl:function(){var b=null;if(parent!==window)try{b=parent.location.href}catch(d){b=document.referrer}return b},adrInvalidPauseCheck:function(b){var d=b.currentTime,c=0,g=!1;f.adrPlayTrick=!0;b.pause();b.play();setInterval(function(){b.currentTime==d&&!g?(c++,b.play(),0==c%10&&(b.load(),b.play())):g=!0},1E3)},sendPlayServiceQuality:function(b,d,e){b={n:b,vid:c.initConfig.vid,u:encodeURIComponent(f.getParentUrl()? f.getParentUrl():window.location.href),c:d,t:e/1E3,p:"hvp"};f.Log("http://v.l.youku.com/h_player_service?"+s(b))},sendErrorReport:function(b){var d={},e="",e=f.isIPAD?"xplayer_ipad":f.isIPHONE?"xplayer_iphone":"xplayer_android";d.m=e;d.ec=b;e="";1E3==b&&(e=c.v.data.error.code);d.gc=e;d.u=encodeURIComponent(window.location.href);d.v=c.videoInfo?c.videoInfo._sid:"";d.ct=c.v?c.v.data?c.v.data.video?c.v.data.video.category_id:"":"":"";d.hd=f.hd?f.hd:0;c.v&&c.v.data.network&&(d.a=c.v?c.v.data.network.area_code+ "|"+c.v.data.network.dma_code:"");b="";c.initConfig.vvlogconfig&&c.initConfig.vvlogconfig.pvid&&(b=c.initConfig.vvlogconfig.pvid);d.pid=b;f.Log("http://v.l.youku.com/perror?"+s(d))},Load:function(b,d){if("js"==d){var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",b)}else"css"==d&&(c=document.createElement("link"),c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("href",b));"undefined"!=typeof c&&document.getElementsByTagName("head")[0].appendChild(c)}, showError:function(b,d){var e=c.get("#x-player");e.innerHTML=d?d:"\u8be5\u89c6\u9891\u683c\u5f0f\u7279\u6b8a\uff0c\u8bf7\u5728PC\u4e0a\u89c2\u770b";e.style.textAlign="center";e.style.color="white";e.style.lineHeight=e.offsetHeight+"px";f.onError(b,d)},onError:function(b,d){b=b||{code:"1000",message:"\u672a\u5b9a\u4e49\u9519\u8bef"};if(c.playerEvents&&c.playerEvents.onPlayError)c.playerEvents.onPlayError(d?d:"\u8be5\u89c6\u9891\u683c\u5f0f\u7279\u6b8a\uff0c\u8bf7\u5728PC\u4e0a\u89c2\u770b",b)}};(function(){var b= document.createElement("video"),d={MP4:"video/mp4",OGG:"video/ogg",WEBM:"video/webm"},c={isWin:"Win",isMac:"Mac",isSafari:"Safari",isChrome:"Chrome",isIPAD:"iPad",isIPAD7:"iPad; CPU OS 7",isIPHONE:"iPhone",isIPOD:"iPod",isLEPAD:"lepad_hls",isMIUI:"MI-ONE",isAndroid:"Android",isAndroid4:"Android 4.",isAndroid41:"Android 4.1",isSonyDTV:"SonyDTV",isBlackBerry:"BlackBerry",isMQQBrowser:"MQQBrowser",isMobile:"Mobile",isSamSung:"SAMSUNG",isHTC:"HTC",isLumia:"Lumia",isVIVO:"vivo",isWeixin:"MicroMessenger"}; f.supportHTML5Video=!1;f.isIOS=!1;f.os="";if(b.canPlayType){f.supportHTML5Video=!0;for(var g in d)f["canPlay"+g]=b.canPlayType(d[g])?!0:!1}for(var j in c)if(-1!==navigator.userAgent.indexOf(c[j])?(f[j]=!0,f.os+=c[j]+" "):f[j]=!1,-1!==navigator.userAgent.indexOf("Android"))b=navigator.userAgent.indexOf("Android"),b=navigator.userAgent.substr(b,10),b>c.isAndroid4&&(f.isAndroid4=!0,f.os+=b+" ");f.isMobileIOS=f.isIPAD||f.isIPHONE||f.isIPOD;f.isIOS=f.isMobileIOS||f.isMac;f.isSupportH5M3U8=f.isMobileIOS|| f.isMac&&f.isSafari&&!f.isChrome||f.isLEPAD||f.isSonyDTV;f.isSupportH5MP4=(f.isChrome||f.isIE10||f.isAndroid41||f.isAndroid4||f.isLumia)&&f.canPlayMP4;j=c=0;try{if(document.all){var o=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(o){var c=1,h=o.GetVariable("$version");parseInt(h.split(" ")[1].split(",")[0])}}else if(navigator.plugins&&0'); else{var g=M(N(c.mk.a3+"o0b"+f.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(),Ga(d.security.encrypt_string));if(2>g.split("_").length)f.sendErrorReport(2004),f.showError({code:"2004",message:"\u6570\u636e\u89e3\u6790\u9519\u8bef"},"\u6570\u636e\u89e3\u6790\u9519\u8bef");else{f.userCache.sid=g.split("_")[0];f.userCache.token=g.split("_")[1];if(null!=d.error){if(-202==d.error.code||-203==d.error.code)f.sendErrorReport(4E3); else{if(-402==d.error.code){f.sendErrorReport(2007);f.showError({code:"2007",message:"\u7528\u6237\u6ca1\u6709\u6743\u9650\u89c2\u770b"},"\u7528\u6237\u6ca1\u6709\u6743\u9650\u89c2\u770b,\u8bf7\u8fd4\u56de\u4e3b\u7ad9\u64ad\u653e");return}f.sendErrorReport(1E3)}if(this.processError(d))return}this._videoInfo=new ka(d,e,this._type);e=this._videoInfo._videoSegsDic;g="";c.defaultLanguage==e.lang?g=c.defaultLanguage:(g=e.lang,c.defaultLanguage=e.lang);var j=n.total(e.streams,g,e.typeArr[g][0]);this._videoInfo.totalTime= j?j.totalTime:d.video.seconds;if("m3u8"==this._type)c.defaultVideoType="mp4",null!=i.getItem("defaultVideoType")&&(c.defaultVideoType=i.getItem("defaultVideoType")),-1==b.data.stream[0].stream_type.indexOf(c.defaultVideoType)&&(c.defaultVideoType="mp4",-1==b.data.stream[0].stream_type.indexOf("mp4")&&(c.defaultVideoType="flv")),h.log("default = "+c.defaultVideoType),this._videoInfo.src=n.m3u8src(c.defaultVideoType),this.cache(),this._callback(this._v,this._videoInfo);else if("mp4"==this._type){d= ["3gphd","mp4","flv"];c.defaultVideoType=null;for(j=0;j(b/=g/2)?e/2*b*b+c:-e/2*(--b*(b-2)-1)+c};FX.transitions.cubicIn=function(b,c,e,g){return e*(b/=g)*b*b+c};FX.transitions.cubicOut=function(b,c,e,g){return e*((b=b/g-1)*b*b+1)+c};FX.transitions.cubicInOut=function(b,c,e,g){return 1>(b/=g/2)?e/2*b*b*b+c:e/2*((b-=2)*b*b+2)+c};FX.transitions.quartIn=function(b,c,e,g){return e*(b/=g)*b*b*b+c};FX.transitions.quartOut=function(b,c,e,g){return-e*((b=b/g-1)*b*b*b-1)+c};FX.transitions.quartInOut= function(b,c,e,g){return 1>(b/=g/2)?e/2*b*b*b*b+c:-e/2*((b-=2)*b*b*b-2)+c};FX.transitions.quintIn=function(b,c,e,g){return e*(b/=g)*b*b*b*b+c};FX.transitions.quintOut=function(b,c,e,g){return e*((b=b/g-1)*b*b*b*b+1)+c};FX.transitions.quintInOut=function(b,c,e,g){return 1>(b/=g/2)?e/2*b*b*b*b*b+c:e/2*((b-=2)*b*b*b*b+2)+c};FX.transitions.expoIn=function(b,c,e,g){return 0==b?c:e*Math.pow(2,10*(b/g-1))+c-0.001*e};FX.transitions.expoOut=function(b,c,e,g){return b==g?c+e:1.001*e*(-Math.pow(2,-10*b/g)+1)+ c};FX.transitions.expoInOut=function(b,c,e,g){return 0==b?c:b==g?c+e:1>(b/=g/2)?e/2*Math.pow(2,10*(b-1))+c-5.0E-4*e:1.0005*(e/2)*(-Math.pow(2,-10*--b)+2)+c};FX.transitions.circIn=function(b,c,e,g){return-e*(Math.sqrt(1-(b/=g)*b)-1)+c};FX.transitions.circOut=function(b,c,e,g){return e*Math.sqrt(1-(b=b/g-1)*b)+c};FX.transitions.circInOut=function(b,c,e,g){return 1>(b/=g/2)?-e/2*(Math.sqrt(1-b*b)-1)+c:e/2*(Math.sqrt(1-(b-=2)*b)+1)+c};FX.transitions.backIn=function(b,c,e,g,f){f=f||1.70158;return e*(b/= g)*b*((f+1)*b-f)+c};FX.transitions.backOut=function(b,c,e,g,f){f=f||1.70158;return e*((b=b/g-1)*b*((f+1)*b+f)+1)+c};FX.transitions.backBoth=function(b,c,e,g,f){f=f||1.70158;return 1>(b/=g/2)?e/2*b*b*(((f*=1.525)+1)*b-f)+c:e/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c};FX.transitions.elasticIn=function(b,c,e,g,f,h){if(0==b)return c;if(1==(b/=g))return c+e;h||(h=0.3*g);!f||fb?-0.5*f*Math.pow(2,10*(b-=1))*Math.sin((b*g-m)*2*Math.PI/h)+c:0.5*f*Math.pow(2,-10*(b-=1))*Math.sin((b* g-m)*2*Math.PI/h)+e+c};FX.transitions.backIn=function(b,c,e,g,f){"undefined"==typeof f&&(f=1.70158);return e*(b/=g)*b*((f+1)*b-f)+c};FX.transitions.backOut=function(b,c,e,g,f){"undefined"==typeof f&&(f=1.70158);return e*((b=b/g-1)*b*((f+1)*b+f)+1)+c};FX.transitions.backBoth=function(b,c,e,g,f){"undefined"==typeof f&&(f=1.70158);return 1>(b/=g/2)?e/2*b*b*(((f*=1.525)+1)*b-f)+c:e/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c};FX.transitions.bounceIn=function(b,c,e,g){return e-FX.transitions.bounceOut(g-b,0, e,g)+c};FX.transitions.bounceOut=function(b,c,e,g){return(b/=g)<1/2.75?e*7.5625*b*b+c:b<2/2.75?e*(7.5625*(b-=1.5/2.75)*b+0.75)+c:b<2.5/2.75?e*(7.5625*(b-=2.25/2.75)*b+0.9375)+c:e*(7.5625*(b-=2.625/2.75)*b+0.984375)+c};FX.transitions.bounceBoth=function(b,c,e,g){return b>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);c+="==";break}h=b.charCodeAt(e++);if(e==g){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>> 2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(h&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);c+="=";break}m=b.charCodeAt(e++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(h&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(m&192)>>6); c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63)}return c},L={"-100":"\u8be5\u89c6\u9891\u6b63\u5728\u8f6c\u7801\u4e2d... , \u8bf7\u7a0d\u5019","-101":"\u8be5\u89c6\u9891\u6b63\u5728\u5ba1\u6838\u4e2d... , \u8bf7\u7a0d\u5019","-102":"\u8be5\u89c6\u9891\u5df2\u88ab\u5c4f\u853d","-103":"\u8be5\u89c6\u9891\u8f6c\u7801\u5931\u8d25","-201":"\u8be5\u89c6\u9891\u88ab\u8bbe\u4e3a\u79c1\u5bc6","-202":"\u8be5\u89c6\u9891\u5df2\u7ecf\u52a0\u5bc6","-203":"\u5bf9\u4e0d\u8d77\uff0c\u60a8\u8f93\u5165\u7684\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165", "-204":"\u7c89\u4e1d\u89c2\u770b\u89c6\u9891","-301":"","-302":"\u4ed8\u8d39\u89c6\u9891\u8d85\u8fc7\u89c2\u770b\u4e0a\u9650\u6b21\u6570","-303":"\u4ed8\u8d39\u89c6\u9891\u4e0b\u7ebf","-306":"\u8d26\u53f7\u5206\u4eab\u4e0d\u5408\u6cd5, IP\u4e0a\u9650","-307":"\u4ed8\u8d39\u89c6\u9891, \u672a\u767b\u5f55","-401":"\u96c6\u56e2\u64ad\u63a7\u7cfb\u7edf\u9650\u5236","-402":"\u7528\u6237\u6ca1\u6709\u6743\u9650\u89c2\u770b(\u9632\u76d7\u94fenonce)","-501":"\u670d\u52a1\u5668\u53d1\u751f\u9519\u8bef","-601":"\u53c2\u6570\u9519\u8bef"}, V=function(b,d){this.player=b;this._handle={};this._feedback=c.get(".x-feedback");this._message=this._feedback.getElementsByClassName("x-message")[0];this._messagetxt=this._message.getElementsByClassName("x-message-txt")[0];this._messagebtn=this._message.getElementsByClassName("x-message-btn")[0];this._errorcode=this._error=null;this.init(d);this.bindEvent()};V.prototype={init:function(b){if(b&&(b.data&&b.data&&b.data.error)&&(c.hide(c.get(".x-video-button")),c.hide(c.get(".x-console")),this._vid= b.data.id,this._title=b.data.video.title,this._userid=b.data.video.userid,this._error=b.data.error,this._errorcode=parseInt(b.data.error.code),!(-301==this._errorcode||-307==this._errorcode||-308==this._errorcode))){switch(this._errorcode){case -100:this.setMessage(L["-100"]);f.onError({code:"1000",message:"\u89c6\u9891\u8f6c\u7801\u4e2d"},"\u89c6\u9891\u8f6c\u7801\u4e2d");break;case -101:this.setMessage(L["-101"]);f.onError({code:"1000",message:"\u89c6\u9891\u5ba1\u6838\u4e2d"},"\u89c6\u9891\u5ba1\u6838\u4e2d"); break;case -102:this.setMessage(L["-102"]);this.setButton("\u641c\u7d22",this.search);f.onError({code:"2999",message:"\u89c6\u9891\u5df2\u88ab\u5c4f\u853d"},"\u89c6\u9891\u5df2\u88ab\u5c4f\u853d");break;case -103:this.setMessage(L["-103"]);this.bind_feedback=c.bindAsEventListener(this,this.feedback);this.setButton("\u5728\u7ebf\u53cd\u9988",this.bind_feedback);f.onError({code:"2999",message:"\u89c6\u9891\u8f6c\u7801\u5931\u8d25"},"\u89c6\u9891\u8f6c\u7801\u5931\u8d25");break;case -201:this.setMessage(L["-201"]); this.bind_contact=c.bindAsEventListener(this,this.contactOwner);this.setButton("\u8054\u7cfb\u4e0a\u4f20\u8005",this.bind_contact);f.onError({code:"1000",message:"\u79c1\u5bc6\u89c6\u9891\uff0c\u7528\u6237\u6ca1\u6709\u6743\u9650\u89c2\u770b"},"\u79c1\u5bc6\u89c6\u9891\uff0c\u7528\u6237\u6ca1\u6709\u6743\u9650\u89c2\u770b");break;case -202:this._messagetxt.innerHTML="";this.bind_inputpassword=c.bindAsEventListener(this, this.inputPassword);this.setButton("\u786e\u5b9a",this.bind_inputpassword);break;case -203:this._messagetxt.innerHTML='';this.bind_inputpassword=c.bindAsEventListener(this,this.inputPassword);this.setButton("\u786e\u5b9a",this.bind_inputpassword);break;case -306:this._messagetxt.innerHTML=''+b.data.error.note+"";f.onError({code:"2008",message:"\u8d26\u53f7\u7591\u4f3c\u88ab\u5206\u4eab"},"\u5e10\u53f7\u5206\u4eab\u4e0d\u5408\u6cd5");break;default:this.setMessage(b.data.error.note),f.onError({code:"1000",message:b.data.error.note},b.data.error.note)}this.show();this.showMessage()}},bindEvent:function(){},show:function(){c.show(this._feedback)},hide:function(){c.hide(this._feedback)},showMessage:function(){c.show(this._message)},hideMessage:function(){c.hide(this._message)}, setMessage:function(b){this._messagetxt.innerHTML="

"+b+"

"},setButton:function(b,d){this._messagebtn.innerHTML="";var e=this._message.getElementsByClassName("x-btn")[0];c.addEventHandler(e,"click",d)},search:function(){window.location.href="http://www.soku.com/search_video/q_"+this._title},feedback:function(){window.location.href="http://www.youku.com/service/feed/subtype/4/"},contactOwner:function(){window.location.href="http://i.youku.com/u/id_"+ this._userid},onPasswordConfirm:function(){},inputPassword:function(){var b=this._messagetxt.getElementsByClassName("x-message-input")[0],d=b.value;if(null==d||0==d.replace(/\s/g,"").length)b.value="",b.placeholder="\u5bc6\u7801\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165";else{var e=this.player;c.password=d;n.start(this._vid,d,c.config.content,function(b,f){c.hide(c.get(".x-feedback"));c.password=d;c.show(c.get(".x-video-button"));c.hide(c.get(".x-message"));e.startPlay(b,f)})}}};var ma=function(b){this._handler= {};this.player=b;this._fullflag=null;this.init();this._fullscreen=c.get(".x-fullscreen");this._btn=this._fullscreen.getElementsByTagName("button")[0];this._btnb=this._btn.getElementsByTagName("b")[0];this.bindEvent()};ma.prototype={addEventListener:function(b,c){this._handler[b]=c},removeEventListener:function(b){this._handler[b]=null},dispatch:function(b){b&&this._handler[b.type]&&(b._target=this,this._handler[b.type](b))},init:function(){},bindEvent:function(){this.bind_switch=c.bindAsEventListener(this, this.switchFullScreen);c.addEventHandler(this._fullscreen,"click",this.bind_switch,!0)},removeEvent:function(){c.removeEventHandler(this._fullscreen,"click",this.bind_switch,!0)},zoomStatus:function(){return this._btnb.className},fullFlag:function(){if(null!==this._fullflag)return this._fullflag;var b=this.player.video.fullscreenchange;return this._fullflag="undefined"!=typeof b?b:!1},switchFullScreen:function(b){var d=b.method||"c",e=this._btnb.className;c.config.events&&c.config.events.onSwitchFullScreen? (-1===e.indexOf("in")?(this._fullflag=!1,this._btnb.className=e.replace(/out/g,"in"),this.player.controls.hideShowListBtn(),this.player._reporter.sendUserActionReport("xexfs",d),this.player.adjustVideoRatio(1),this.dispatch({type:"exitfullscreen"})):(this._fullflag=!0,this._btnb.className=e.replace(/in/g,"out"),this.player.controls.showShowListBtn(),this.player._reporter.sendUserActionReport("xenfs",d),this.player.adjustVideoRatio(),this.dispatch({type:"enterfullscreen"})),d=c.config.events.onSwitchFullScreen, d(b,e)):(b=document.getElementById("x-player"),-1===e.indexOf("in")?(this.player._reporter.sendUserActionReport("xexfs",d),document.webkitCancelFullScreen&&(this._btnb.className=e.replace(/out/g,"in"),this._fullflag=!1,document.webkitCancelFullScreen())):(this.player._reporter.sendUserActionReport("xenfs",d),b.webkitRequestFullScreen?(this._btnb.className=e.replace(/in/g,"out"),this._fullflag=!0,b.webkitRequestFullScreen()):this.player.video.webkitSupportsFullscreen&&1<=this.player.video.readyState&& this.player.video.webkitEnterFullscreen()))}};var na=function(b,d){this.handler={};this.player=b;this.information=c.get(".x-video-info");this.title=this.information.getElementsByClassName("x-title")[0];this.videoState=this.information.getElementsByClassName("x-video-state")[0];c.hide(this.videoState);this.init(d)};na.prototype={init:function(b){this.title.innerHTML=b.data.show&&b.data.show.title?b.data.show.title.substr(0,20):b.data.video.title.substr(0,20);if(b.data.trial||b.data.error)if("episodes"== c.v.data.trial.type)this.show();else return;this.videoState.innerHTML="\u65f6\u957f: "+c.getTime(parseInt(b.data.video.seconds))+"";this.show()},show:function(){if(c.v.data.trial)if("episodes"==c.v.data.trial.type)c.show(this.information);else return;c.show(this.information)},hide:function(){c.hide(this.information)},bindEvent:function(){}};var oa=function(b){this.player=b;this._tip=c.get(".x-prompt");this.init()};oa.prototype={init:function(){this._tip.innerHTML='
\u5feb\u8fdb
\u5feb\u9000
'; this._mode=this._tip.getElementsByClassName("x-prompt-mode")[0];this._time=this._tip.getElementsByClassName("x-prompt-time")[0];this._back=this._tip.getElementsByClassName("x-prompt-back")[0];this._forward=this._tip.getElementsByClassName("x-prompt-forward")[0];this._status=this._tip.getElementsByClassName("x-prompt-status")[0];this._statusTxt=this._tip.getElementsByClassName("x-prompt-txt")[0]},setProgress_:function(b){!0!=this._progressFlag&&(this._time.innerHTML=c.getTime(parseInt(b)))},setStatus:function(b){this._statusTxt.innerHTML= b;this.showStatus()},hideStatus:function(){c.hide(this._status);c.hide(this._tip)},showStatus:function(){c.hide(this._mode);c.show(this._status);c.show(this._tip)},setTip:function(b,d){this._progressFlag=!0;this._time.innerHTML=c.getTime(Ia(b+d));0>=d?(c.show(this._back),c.hide(this._forward)):(c.show(this._forward),c.hide(this._back));var e=this;setTimeout(function(){e._progressFlag=false},1E3)},isVisible:function(){return"none"!=this._tip.style.display},hide:function(){c.hide(this._tip)},show:function(){c.show(this._mode); c.hide(this._status);c.show(this._tip)},autoHide:function(b){var c=this;setTimeout(function(){c.hide()},b||1E3)}};var pa=function(b,d){var e=!0;this._handler={};if(c.isWeixin)c.get(".x-localization").style.display="none";else if(!d||!d.data||!d.data||!d.data.dvd||!d.data.dvd.audiolang)c.get(".x-localization").style.display="none";else{if(c.videoInfo._videoSegsDic){var g=c.videoInfo._videoSegsDic.streams,f=!1,h;for(h in g){e="";for(k in g[h])e+=k+",";(e=-1","",""],g=["
    ","","
","
"],f=[],h=0;h"):m+=">";m+=c[h].lang+"";f[h]=m}g[1]=f.join("");this._language.innerHTML= e.join("")+g.join("")},bindEvent:function(){var b=this._language.getElementsByTagName("li");if(0!=b.length){this.bind_toggle=c.bindAsEventListener(this,this.toggleLanguagePanel);c.addEventHandler(this._language,"click",this.bind_toggle);for(var d=0;d",e.buy_desc="\u7acb\u5373\u8d2d\u4e70"):(e.product_desc="<\u4ed8\u8d39\u5305\u6708\u5f71\u7247>",e.buy_desc="\u5f00\u901a\u4f1a\u5458");this._type=b.data.show.pay_type;if(!g&&b.data.error)switch(parseInt(b.data.error.code)){case -301:break;case -307:e.product_desc="<\u4ed8\u8d39\u8282\u76ee\uff0c\u8bf7\u5148\u767b\u5f55\uff01>"; e.buy_desc="";break;default:e.product_desc="<\u81ea\u9891\u9053\u4f1a\u5458\u89c6\u9891>",e.buy_desc=""}c._hasPayInfo=!0;this._tryDuration=parseInt(b.data.trial.time||0);this.player.tryDuration=this._tryDuration;h.log("try = "+this._tryDuration);this.processData(e,b);this.bindEvent();this._payData=e;g&&c.getData({vid:b.data.id},function(e){c._payData=e;c.processData(e,b);b.data.error&&c.showTip()},function(){b.data.error&&c.showTip()});0>=this._tryDuration?this.showTip():this.show()}},processData:function(b, d){var e=b.product_desc||"",g=d.data.video.title;12)]{0,}>/g,function(b){var c=b.indexOf("<"),d=b.indexOf(">");return b.substring(0,c)+" "+b.substring(c+1,d)+" "+b.substring(d+1)+" "});this._title.innerHTML=g+e;this._payBtn.innerHTML=b.buy_desc;this._panelTitle.innerHTML="

"+d.data.video.title+"

";this._panelTip.innerHTML=''+e;(this._panelPay.innerHTML=b.buy_desc)?(this._payBtn.style.cssText= "",this._panelPay.style.cssText=""):(c.hide(this._payBtn),c.hide(this._panelPay))},getData:function(b,c,e){p.jsonp({url:"http://vip.youku.com/",data:{c:"xhr",a:"h5_player_get_pay_info",video_id:b.vid},success:function(b){b.code&&b.result?c(b.result):e(b)},fail:function(b){e(b)}})},play:function(){if((f.isIPHONE||f.isIPOD)&&null!=c.v.data.trial)this.player.video.style.display="block";0===this.activeTime||this.player.currentTime>=this._tryDuration?(this.player.replay(),this.activeTime=-1):this.player.video.play(); this.player._reporter.sendUserActionReport("xtry","c");c.hide(this._panel)},pay:function(){this.player.video.pause();this._payData.buy_link?window.open(this._payData.buy_link,"","",!1):(c.v.data.pay&&c.v.data.pay.h5_caseurl&&window.open(c.v.data.pay.h5_caseurl,"","",!1),this.player._reporter.sendUserActionReport("xbuy","c"))},hide:function(){this._payInfo&&(this._payInfo.style.display="none")},show:function(){!1!=this._hasPayInfo&&(this._payInfo.style.display="block",0>=this._tryDuration&&c.hide(this._tryBtn))}, isBlock:function(){return"block"==this._payInfo.style.display},showTip:function(){this._hasPayInfo&&(this._panel.style.display="block",0>=this._tryDuration&&c.hide(this._panelTry))},hideTip:function(){this._hasPayInfo&&c.hide(this._panel)},clearTip:function(){this._tip.innerHTML=""},hasPayInfo:function(){return this._hasPayInfo},tryDuration:function(){return this._tryDuration}};var sa=function(b,c){this._handler={};this.player=b;this._videoInfo=c;this._isLimit=this._html5_disable=!1;this._limitMinute= 40;this._videoInfo.data.controller&&!0==this._videoInfo.data.controller.html5_disable&&(this._html5_disable=this._isLimit=!0);this._limitTime=this._videoInfo.data.trial&&"episodes"!=this._videoInfo.data.trial.type?this._videoInfo.data.trial.time:60*this._limitMinute;this._html5_disable&&(this.player.tryDuration=this._limitTime);this._isCreated=!1;h.log("videoInfo.controller.xplayer_disable:",this._isLimit);h.log("videoInfo.controller.app_disable:",this._app_disable)};sa.prototype={addEventListener:function(b, c){this._handler[b]=c},removeEventListener:function(b){this._handler[b]=null},dispatch:function(b){b&&this._handler[b.type]&&(b._target=this,this._handler[b.type](b))},create:function(){if(!this._isCreated){h.log("playLimit create");this.player.video.pause();this._isCreated=!0;var b=c.get("#x-player");!1!=this._html5_disable&&(c.v.data.trial&&"episodes"!=c.v.data.trial.type?f.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009227&cpp=1000752&url="):(b.innerHTML="

\u672c\u9875\u9762\u63d0\u4f9b"+ this._limitMinute+'\u5206\u949f\u9884\u89c8

',this._content=c.get(".x-app-guide"),this._fullBtn=this._content.getElementsByClassName("x-btn")[0],this._openApp=this._content.getElementsByClassName("x-app-openapp")[0],this.bind_onFullClick=c.bindAsEventListener(this,this.onFullClick), c.addEventHandler(this._fullBtn,"click",this.bind_onFullClick),f.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009227&cpp=1000752&url="),this._content.style.marginLeft=parseInt(-this._content.offsetWidth/2)+"px",this._content.style.marginTop=parseInt(-this._content.offsetHeight/2)+"px"))}},onFullClick:function(){h.log("onFullClick");this._content.getElementsByClassName("x-app-guide-action")[0].innerHTML=''; this._downloadBtn=this._content.getElementsByClassName("x-btn")[0];this._knowBtn=this._content.getElementsByClassName("x-btn")[1];this.bind_onDownload=c.bindAsEventListener(this,this.onDownloadClick);this.bind_onKnow=c.bindAsEventListener(this,this.onKnowClick);c.addEventHandler(this._downloadBtn,"click",this.bind_onDownload);c.addEventHandler(this._knowBtn,"click",this.bind_onKnow);f.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009213&cpp=1000752&url=");this._content.getElementsByClassName("x-app-guide-tips")[0].innerHTML= "

\u770b\u5b8c\u6574\u7248\u9700\u5b89\u88c5\u6700\u65b0\u4f18\u9177app

";this._content.style.marginLeft=parseInt(-this._content.offsetWidth/2)+"px";this._content.style.marginTop=parseInt(-this._content.offsetHeight/2)+"px";this.openApp()},onDownloadClick:function(){f.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009215&cpp=1000752&url=");f.isAndroid?window.open("http://dl.m.cc.youku.com/android/phone/Youku_Android_xianbobofangqi.apk","_blank"):window.open("http://hz.youku.com/red/click.php?tp=1&cp=4008066&cpp=1000687&url=http://m.youku.com/webapp/dl?app=youku&source=webqr", "_blank")},onKnowClick:function(){f.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009216&cpp=1000752&url=");setTimeout(function(){window.location.reload()},500)},openApp:function(){var b=document.createElement("iframe");b.height=0;b.width=0;b.frameBorder="no";b.src="youku://play?vid="+c.initConfig.vid;f.isIPAD&&(b.src="youkuhd://play?vid="+c.initConfig.vid);document.getElementsByTagName("body")[0].appendChild(b)},isLimit:function(){return this._isLimit},limitTime:function(){return this._limitTime}}; var H={2:"2\u500d","1.5":"1.5\u500d",1:"\u5e38\u901f","0.8":"0.8\u500d"},ta=function(b,d){this._handler={};!c.isWeixin&&f.isIPAD7&&(this.player=b,this.playRate=c.get(".x-playspeed"),this.init(d),this.bindEvent(),this.button=this.playRate.getElementsByTagName("button")[0],this.panel=this.playRate.getElementsByTagName("div")[0],this.nodes=this.playRate.getElementsByTagName("li"),c.show(this.playRate))};ta.prototype={addEventListener:function(b,c){this._handler[b]=c},removeEventListener:function(b){this._handler[b]= null},dispatch:function(b){b&&this._handler[b.type]&&(b._target=this,this._handler[b.type](b))},init:function(){for(var b=[""],c=['"],e="",g=[],f=["2","1.5","1","0.8"],h=0;h"+l+H[m]+"";g.push(H[m])}c[1]=e;this.playRate.innerHTML=b.join("")+c.join("")},bindEvent:function(){var b= this.playRate.getElementsByTagName("li");if(0!=b.length){this.bind_toggle=c.bindAsEventListener(this,this.toggleRatePanel);c.addEventHandler(this.playRate,"click",this.bind_toggle);for(var d=0;df-h?f-h+"px":100*Math.min(Math.max(g,0),1)+"%";this.uCurrentTime.innerHTML=c.getTime(e);!0!==d&&(this.loadTime=e+=Math.max(this.player.bufferedEnd()-b,0),g=e/c.videoInfo.totalTime,this._load.style.width=100*Math.min(Math.max(g+0.05,0),1)+"%")},resetProgress:function(){this._seek.style.left=this._seek.style.width;this._load.style.width="0";this._play.style.width="0"},getRate:function(b,d){var e=1,g=c.get(".x-fs-console");g&&(e=parseFloat(c.getCurrentStyle(g).zoom)); return b/(d*e)},seek:function(b){var d=(new Date).getTime()-va;if(b.srcElement==this._seek||d","",""],e=['"],g="",f=[],h;for(h in B)if(-1!==b[c.defaultLanguage].indexOf(h)&&-1===f.indexOf(B[h])){var i="",l="";h==c.defaultVideoType&&(i="",d[1]=B[h],l=" class=selected");g+="
  • "+i+B[h]+"
  • ";f.push(B[h])}""==d[1]&&(d[1]=f[0]);e[1]=g;this._quality.innerHTML=d.join("")+e.join("")},bindEvent:function(){var b=this._quality.getElementsByTagName("li"); if(0!=b.length){this.bind_toggle=c.bindAsEventListener(this,this.toggleQualityPanel);c.addEventHandler(this._quality,"click",this.bind_toggle);for(var d=0;d
  • '); for(var g=Math.floor((this._panel.offsetWidth-60+16)/166)*Math.floor((this._panel.offsetHeight-120+12)/97),g=(g>d?d:g)-1,g=0>g?0:g,d=0;d
  • '+o+'
  • ')}this._listinner.innerHTML=e.join("");this.bindDynamicEvent();this.buildImgEvent()},getReportParam:function(b){var d={};d.pos=""+b;d.sct=c.v.data.video.category_id;d.dct=this._info.data[b].dct; d.ord=this._info.ord;d.req_id=this._info.req_id;d.abver=this._info.ver;d.dma=this._info.data[b].dma;d.algInfo=this._info.data[b].algInfo;d.apt=this._apt;d.md=this._md;d.pg=this._pg;d.r=(new Date).getTime();d.vid=c.v.data.video.encodeid;d.uid=c.v.data.video.userid;1==this._info.data[b].type?d.dvid=this._info.data[b].id:d.dsid=this._info.data[b].id;d.sid="";c.v.data.show&&c.v.data.show.id&&(d.sid=c.v.data.show.id);return d},buildImgEvent:function(){for(var b=this._listinner.getElementsByClassName("x-item-img"), d=0;d
    ';this._slhd= this._showlist.getElementsByClassName("x-showlist-hd")[0];this._slbd=this._showlist.getElementsByClassName("x-showlist-bd")[0];this._slft=this._showlist.getElementsByClassName("x-showlist-ft")[0];this._slhd.innerHTML="
    ";this._closeHandle=this._slhd.getElementsByClassName("x-showlist-close")[0];if(b.data.videos){for(var d=b.data.videos.list,e=["
      ","","
    "],g=[],f=0;f"+h.title.substr(0,20)+"";g.push(h)}e[1]=g.join("");this._slbd.innerHTML=e.join("");e="
    ;;
      ;;
    ;".split(";");g=[];l=b.data.videos.previous?parseInt(b.data.videos.previous.seq/60): 0;for(f=0;f<(d.length-1)/60+1;f++)b="",f==l&&(b=" class=current"),h=""+(f+1)+"",g.push(h);e[3]=g.join("");this._slft.innerHTML=e.join("")}},addEventListener:function(b,c){this._handler[b]=c},removeEventListener:function(b){this._handler[b]=null},dispatch:function(b){b&&this._handler[b.type]&&(b._target=this,this._handler[b.type](b))},bindEvent:function(){this.bind_close=c.bindAsEventListener(this,this.hide);c.addEventHandler(this._closeHandle,"click",this.bind_close);this.bind_toggle= c.bindAsEventListener(this,this.toggle);c.addEventHandler(this._showbtn,"click",this.bind_toggle)},removeEvent:function(){c.removeEventHandler(this._closeHandle,"click",this.bind_close)},hide:function(){this._showbtn.className=this._showbtn.className.replace(/[\s]*pressed/g,"");c.hide(this._showlist)},show:function(){this._showbtn.className+=" pressed";c.show(this._showlist)},showListBtn:function(){if(c.v.data.videos){var b=c.v.data.videos.list;null==b||1>=b.length||c.show(this._showbtn)}else c.hide(this._showbtn)}, hideListBtn:function(){if(c.v.data.videos){var b=c.v.data.videos.list;null==b||0==b.length||(c.hide(this._showbtn),this.hide())}},toggle:function(b){"block"!=this._showlist.style.display?(this.show(),this.player._reporter.sendUserActionReport("xshl","c")):this.hide();this.dispatch(b)},touchStart:function(b){this._sx=b.targetTouches[0].clientX;this._sy=b.targetTouches[0].clientY;this._ex=this._sx;this._ey=this._ey},touchEnd:function(){},touchMove:function(b){this._ex=b.targetTouches[0].clientX;this._ey= b.targetTouches[0].clientY;this._dx=this._ex-this._sx;this._dy=this._ey-this._sy;Math.abs(this._dx)>Math.abs(this._dy)||b.preventDefault()}};var Aa=function(b){this.player=b;this._handle={};this._tips=c.get(".x-tips");c.hide(this._tips);this._tips.innerHTML="
    ";this._ptip=this._tips.getElementsByClassName("x-tips-txt")[0];this._ctip=this._tips.getElementsByClassName("x-tips-close")[0]; null==i.getItem("youku_conf_skip")&&i.setItem("youku_conf_skip",!0);this.bindEvent()};Aa.prototype={bindEvent:function(){c.addEventHandler(this._ctip,"click",c.bindAsEventListener(this,this.closeTip))},closeTip:function(){c.hide(this._tips);this.keepLastTime()},autoHide:function(b){var c=this;setTimeout(function(){c.closeTip()},b)},keepLastTime:function(){},ignoreLastTime:function(){},isShowTimeTip:function(){var b=i.getItem("youku_keep_lasttime"),b=parseInt(b),c=i.getItem("youku_ignore_lasttime"), c=parseInt(c);return 3<=b||3<=c?!1:!0},showLastTimeTip:function(b){b=c.getTime(b);h.log("last = "+b);!1!=this.isShowTimeTip()&&(this._ptip.innerHTML="\u4f18\u9177\u8bb0\u5fc6\u60a8\u4e0a\u6b21\u64ad\u653e\u5230"+b+", \u4ece\u5934\u89c2\u770b",this._playBegin=this._ptip.getElementsByClassName("x-tip-timebegin")[0],c.addEventHandler(this._playBegin,"click",c.bindAsEventListener(this,this.seekBegin)),c.show(this._tips),this.autoHide(5E3))}, onSkipTail:function(){"true"==i.getItem("youku_conf_skip")?(this._ptip.innerHTML="\u5373\u5c06\u4e3a\u60a8\u8df3\u8fc7\u7247\u5c3e, \u4e0d\u518d\u8df3\u8fc7",this._skipnowtail=this._ptip.getElementsByClassName("x-tip-skipnoway")[0],c.addEventHandler(this._skipnowtail,"click",c.bindAsEventListener(this,this.skipNoway))):(this._ptip.innerHTML="\u662f\u5426\u8df3\u8fc7\u7247\u5934\u7247\u5c3e? \u59cb\u7ec8\u8df3\u8fc7",this._skipalwtail= this._ptip.getElementsByClassName("x-tip-skipalways")[0],c.addEventHandler(this._skipalwtail,"click",c.bindAsEventListener(this,this.skipAlways)));c.show(this._tips);this.autoHide(1E4)},onSkipHead:function(){"true"==i.getItem("youku_conf_skip")?(this._ptip.innerHTML="\u5df2\u7ecf\u4e3a\u60a8\u8df3\u8fc7\u7247\u5934, \u4e0d\u518d\u8df3\u8fc7",this._skipnow=this._ptip.getElementsByClassName("x-tip-skipnoway")[0],c.addEventHandler(this._skipnow,"click",c.bindAsEventListener(this, this.skipNoway))):(this._ptip.innerHTML="\u662f\u5426\u8df3\u8fc7\u7247\u5934\u7247\u5c3e? \u59cb\u7ec8\u8df3\u8fc7",this._skipalw=this._ptip.getElementsByClassName("x-tip-skipalways")[0],c.addEventHandler(this._skipalw,"click",c.bindAsEventListener(this,this.skipImediately)));c.show(this._tips);this.autoHide(5E3)},onUglyAdPlay:function(){this._ptip.innerHTML="\u5c0a\u656c\u7684\u4f1a\u5458\uff0c\u56e0\u7248\u6743\u539f\u56e0\uff0c\u8bf7\u70b9\u51fb\u53f3\u4e0a\u89d2 \u5173\u95ed\u5e7f\u544a "; c.show(this._tips);var b=this;setTimeout(function(){c.hide(b._tips)},15E3)},closeUglyHint:function(){c.hide(this._tips)},skipImediately:function(){h.log("skip imediately");this.player._reporter.sendUserActionReport("xskh","c");i.setItem("youku_conf_skip",!0);var b=parseInt((c.v.data.dvd||"").head)/1E3;this.onSkipHead();this.player.seek(b);return!1},skipNoway:function(){this.player._reporter.sendUserActionReport("xnsk","c");i.setItem("youku_conf_skip",!1);this._ptip.innerHTML="\u8bbe\u7f6e\u6210\u529f"; return!1},skipAlways:function(){this.player._reporter.sendUserActionReport("xask","c");i.setItem("youku_conf_skip",!0);this._ptip.innerHTML="\u8bbe\u7f6e\u6210\u529f";return!1},seekBegin:function(){this.player._reporter.sendUserActionReport("xseb","c");c.hide(this._tips);this.ignoreLastTime();this.player.seek(0);return!1}};var ba="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),W=function(b,c,e){this.player=b;this.v=c;this.sid=e;this.isSendedConsumeReport=!1;f.hd=this.getHDFlag(); if(0rota w,h = "+e+","+g);if(this.screenDim.w!=e||this.screenDim.h!=g)this.screenDim.w=e,this.screenDim.h=g,h.log("rotate"),f.Log(b+c)},checkPlayerResize:function(b,c){if(!0===this._giveupReTag)h.log("give up xre after enfs or exfs");else{var e=document.getElementById("x-player");this._resizeList=this._resizeList||[];this._resizeList.push({str:c,time:(new Date).getTime(),w:e.offsetWidth,h:e.offsetHeight});var g= this;setTimeout(function(){if(0!=g._resizeList.length){for(var c=g._resizeList[0].time,d=0;dMath.abs(b._timelist[0]-b._timelist[2])&&(h.log("ad unexpected pause"),b.video.play(),0==b.leftSecond()&&(h.log("exception left = 0 "),b.onAdEnded())),b._timelist=[])},1E3)}},onAdPlay:function(){this.checkPause(); var b=this.controls.container.poster;c.hide(this.controls.buttons.videobtn);c.hide(b);c.hide(c.get(".x-video-info"));this.video.style.display="block";b=this._addata.curnum;h.log("left="+this.leftSecond()+" curtotal="+this._addata.seconds[b]+" curtime="+this.video.currentTime);this._adplugin.setLeftSecond(this.leftSecond());var d=this;setTimeout(function(){h.log("ad media timeout check begin = "+d._adBegin);d._adBegin||(d.removeAdEvent(),d._adplugin.hide(),d._adplugin.reportTime("advideo",-1,!1),d.dispatch({type:z, data:!0}))},1E4);this._playTag[b]||(this._playTag[b]=!0,this._adfirsttu=!1,this._adplugin.recordTime("advideo"),i.appendItem("phase","adplay"))},uglyClose:function(){this.video.src="";this.video.load();this.video.play()},onAdError:function(){this.checkVTVC(this._addata.curnum+1);this.removeAdEvent();this._adplugin.hide();this._adplugin.reportTime("advideo",-1,!1);this.dispatch({type:z,data:!0})},onAdEnded:function(b){h.log("ad ended");this._adreporter.sendSUE();this.checkVTVC(this._addata.curnum+ 1);if(this._addata.curnumad suspend")},onAdStalled:function(){h.log("ad stalled")},onAdWaiting:function(b){this.controls.onWaiting(b)},onAdTimeUpdate:function(){c.hide(this.controls.buttons.loading);this._adBegin=!0;c.hide(this.controls.buttons.loading);this._pauseLeftSec||this._adplugin.setLeftSecond(this.leftSecond());this._adreporter.sendSU(this.video.currentTime);0.5<= this.video.currentTime&&this._adplugin.show();this._adfirsttu||(this._adfirsttu=!0,this._adreporter.sendSUS(),this._adreporter.sendVC(),this._adplugin.reportTime("advideo"),f.isNeedAdrTrick()&&f.adrInvalidPauseCheck(this.video),0===this._adplugin.SKIP&&this.dispatch({type:I}))},onAdLoadedMetaData:function(){this._adBegin=!0},onAdClick:function(){this.video.pause();this._adreporter.sendCUM();var b=this._addata,b=b.info.VAL[b.curnum].CU;h.log("click cu="+b);window.open(b,"","",!1)}};D="adend";z="aderror"; Q="frontAdinfoadapterok";I=void 0;var Y=function(b,d,e){this._handler={};this.player=b;this.sid=e;this._advids=[];this._adsecs=[];this._adsrcs=[];this._vid=d.data.video.encodeid;this._advert=c.get(".x-advert");this._adskip=this._advert.getElementsByClassName("x-advert-skip")[0];this._adcount=this._advert.getElementsByClassName("x-advert-countdown")[0];this._adknowdet=this._advert.getElementsByClassName("x-advert-detail")[0];this.init(d);this.bindEvent()};Y.prototype={init:function(b){this.initRequestParam(b); this._adskipTxt=this._adskip.getElementsByClassName("x-advert-txt")[0];this._adskipTxt.innerHTML="\u8df3\u8fc7\u5e7f\u544a";this._adcountTxt=this._adcount.getElementsByClassName("x-advert-txt")[0];this._adcountTxt.innerHTML="\u5e7f\u544a \u79d2";this._adsec=this._adcountTxt.getElementsByClassName("x-advert-sec")[0]},getSubCategories:function(b){for(var c="",e=0;ebefore split val length = "+b.VAL.length+""),b=this.splitVTVC(b),h.log("after : val length = "+b.VAL.length+""));if(null==b||null==b.VAL||0==b.VAL.length)b={VAL:[]},this.dispatch({type:"unitedfrontadinfook", data:{info:{VAL:[]},vtvc:this._vtvc||[]}});else{var b=new Ba(b,this._vtvc),c=this;b.addEventListener(Q,function(b){h.log("ad info adapter ok");c.dispatch({type:"unitedfrontadinfook",data:{info:b.data,vtvc:c._vtvc||[]}})});b.run()}},adParse:function(b){this.checkSkip(b);i.appendItem("phase","adinfo");this.reportTime("adinfo");if(b&&b.VAL)for(var b=this.splitVTVC(b),c=b.VAL,e=0;e ad parse pause ");i.appendItem("phase","pauseadinfo");this.reportTime("adinfo");null==b||null==b.VAL|| 0==b.VAL.length||10!=b.P?this.dispatch({type:"pauseAdinfoerror"}):(h.log("pause ad len = "+b.VAL.length+""),this.dispatch({type:"pauseAdinfook",data:{info:b}}))},frontAd:function(){this._param.fu=this.player.controls.fullscreenPanel.fullFlag()?1:0;this._param.p=7;var b=this;p.jsonp({url:"http://mf.atm.youku.com/mf?",data:C(this._param,{ti:this._ti,k:this._k}),time:8E3,success:function(d){f.isIPAD?(h.log(" new m3u8 api"),c.OLD_M3U8=!1,b.adParseUnited(d)):b.adParse(d)}, fail:function(){h.log("adinfo timeout");b.reportTime("adinfo",-1);b.dispatch({type:"frontAdinfotimeout",data:{timeout:8E3}})}});this.recordTime("adinfo")},pauseAd:function(){this._param.r_=parseInt(1E4*Math.random());this._param.p=10;this._param.fu=this.player.controls.fullscreenPanel.fullFlag()?1:0;var b=this;p.jsonp({url:"http://mp.atm.youku.com/mp?",data:C(this._param,{ti:this._ti,k:this._k}),callback:"callback",time:1E3,success:function(c){b.adParsePause(c)},fail:function(){h.log("pause ad info timeout"); b.reportTime("adinfo",-1);b.dispatch({type:"pauseadinfotimeout",data:{timeout:8E3}})}});this.recordTime("adinfo")},recordTime:function(b){null==this._timearr&&(this._timearr={});this._timearr[b]=(new Date).getTime()},reportTime:function(b,c,e){null==this._timearr&&(this._timearr={});c=c||(new Date).getTime()-this._timearr[b];this.player._reporter.sendUepReport({adinfo:"valfload",advideo:"adload"}[b],c,e)},backAd:function(){this._param.fu=this.player.controls.fullscreenPanel.fullFlag();this._param.p= 9;this._param.ctu=0;var b=this;p.jsonp({url:"http://mb.atm.youku.com/mb?",data:C(this._param,{ti:this._ti,k:this._k}),time:5E3,success:function(c){b.adParse(c)},fail:function(){h.log("adinfo timeout");b.dispatch({type:" backAdinfotimeout",data:{timeout:5E3}})}})},insertAd:function(){this._param.ps=0;this._param.pt=0}};var O=function(b,c){this.adplayer=b;this.addata=c;"undefined"==typeof c.curnum&&(this.addata.curnum=0)};O.prototype={sendSUS:function(){var b=this.addata.info.VAL[this.addata.curnum].SUS; if("undefined"!=typeof b)for(var c=0;c vc = "+e+""),E(e,"js"))},sendVC:function(){var b=this.addata.info.VAL[this.addata.curnum];"undefined"!=typeof b.VT&&E(b.VC,"js")},sendSUS_:function(){var b= this.addata.info,c=this.addata.curnum+2,e=b["A"+c].ATMSU,g=b["A"+c].ISOSU;f.Log(b["A"+c].SU);f.Log(e);f.Log(g)},sendSUE:function(){var b=this.addata.info.VAL[this.addata.curnum].SUE;if("undefined"!=typeof b)for(var c=0;c=parseInt(e)&&(b=this.addata.info["A"+c].CMU,f.Log(this.addata.info["A"+c].MU),f.Log(b))},sendCUM:function(){var b=this.addata.info.VAL[this.addata.curnum].CUM;if("undefined"!=typeof b)for(var c=0;c=e)e=1;this.info.VAL[0].W=b*e;this.info.VAL[0].H=d*e;h.log("pause img adjusted w = "+this.info.VAL[0].W+" h = "+this.info.VAL[0].H)},init:function(){this.adpause.innerHTML="
    "; this.adcontent=this.adpause.getElementsByClassName("x-pause-content")[0];this.adcontent.innerHTML=" ";this.adclose=this.adpause.getElementsByClassName("x-pause-close")[0];this.adimg=this.adcontent.getElementsByClassName("x-pause-img")[0];this.adimg.style.height=this.info.VAL[0].H+"px";this.adimg.style.width=this.info.VAL[0].W+"px";this.adpause.style.marginLeft="-"+this.info.VAL[0].W/2+"px"; this.adpause.style.marginTop="-"+this.info.VAL[0].H/2+"px"},hide:function(){c.hide(this.adpause)},play:function(){2!=this.info.VAL[0].VT&&(c.show(this.adpause),this._adreporter.sendSUS())},adClick:function(){window.open(this.info.VAL[0].CU,null);this._adreporter&&this._adreporter.sendCUM()},loadVC:function(){(2==this.info.VAL[0].VT||1==this.info.VAL[0].VT)&&E(this.info.VAL[0].VC,"js")}};var Da=function(b,c){this._handler={};this.player=b;this.video=this.player.video;this.controls=this.player.controls; this._adplugin=this.player._adplugin;this._adplugin.adplayer=this;this._addata=c.data.info;this.video.preload="none";this.video.src=this._addata.VAL[0].RS;h.log("ad src="+this.video.src);this.video.style.display="block";this._playTag=[];this.bindAdEvent();this._adreporter=new O(this,{curnum:0,info:this._addata})};Da.prototype={addEventListener:function(b,c){this._handler[b]=c},removeEventListener:function(b){this._handler[b]=null},dispatch:function(b){b&&this._handler[b.type]&&(b._target=this,this._handler[b.type](b))}, bindAdEvent:function(){this.bind_fadtoplay=c.bindAsEventListener(this,this.onPlayClick);this.bind_fadplay=c.bindAsEventListener(this,this.onAdPlay);this.bind_fadended=c.bindAsEventListener(this,this.onAdEnded);this.bind_faderror=c.bindAsEventListener(this,this.onAdError);this.bind_fadpause=c.bindAsEventListener(this,this.onAdPause);this.bind_fadsuspend=c.bindAsEventListener(this,this.onAdSuspend);this.bind_fadstalled=c.bindAsEventListener(this,this.onAdStalled);this.bind_fadwaiting=c.bindAsEventListener(this, this.onAdWaiting);this.bind_fadloadedmetadata=c.bindAsEventListener(this,this.onAdLoadedMetaData);this.bind_fadtimeupdate=c.bindAsEventListener(this,this.onAdTimeUpdate);this.bind_fademptied=c.bindAsEventListener(this,this.onEmptied);c.addEventHandler(this.video,"play",this.bind_fadplay);c.addEventHandler(this.video,"error",this.bind_faderror);c.addEventHandler(this.video,"pause",this.bind_fadpause);c.addEventHandler(this.video,"suspend",this.bind_fadsuspend);c.addEventHandler(this.video,"stalled", this.bind_fadstalled);c.addEventHandler(this.video,"waiting",this.bind_fadwaiting);c.addEventHandler(this.video,"loadedmetadata",this.bind_fadloadedmetadata);c.addEventHandler(this.video,"timeupdate",this.bind_fadtimeupdate);c.addEventHandler(this.video,"emptied",this.bind_fademptied);this.shadow=this.controls.buttons.shadow;this.videobtn=this.controls.buttons.videobtn;c.addEventHandler(this.videobtn,"click",this.bind_fadtoplay,!0)},removeAdEvent:function(){c.removeEventHandler(this.video,"play", this.bind_fadplay);c.removeEventHandler(this.video,"ended",this.bind_fadended);c.removeEventHandler(this.video,"error",this.bind_faderror);c.removeEventHandler(this.video,"pause",this.bind_fadpause);c.removeEventHandler(this.video,"suspend",this.bind_fadsuspend);c.removeEventHandler(this.video,"stalled",this.bind_fadstalled);c.removeEventHandler(this.video,"waiting",this.bind_fadwaiting);c.removeEventHandler(this.video,"timeupdate",this.bind_fadtimeupdate);c.removeEventHandler(this.video,"loadedmetadata", this.bind_fadloadedmetadata);c.removeEventHandler(this.video,"loadedmetadata",this.bind_fademptied);c.removeEventHandler(this.videobtn,"click",this.bind_fadtoplay,!0)},onPlayClick:function(){this.video.play()},play:function(){this.video.load();this.video.play()},onEmptied:function(){this.checkPause()},leftSecond:function(){return parseInt(Math.max(0,this._addata.VAL[0].AL-this.video.currentTime))},clearTimer:function(){clearInterval(this._checkTimer);this._checkTimer=null},checkPause:function(){if(!this._checkTimer){var b= this;this._timelist=[];this._checkTimer=setInterval(function(){if(b.video.paused)b.onAdPause();else b._timelist.push(b.video.currentTime),3<=b._timelist.length&&(1>Math.abs(b._timelist[0]-b._timelist[2])&&(h.log("ad unexpected pause"),b.video.play(),0==b.leftSecond()&&(h.log("exception left = 0 "),b.onAdEnded())),b._timelist=[])},1E3)}},onAdPlay:function(){this.checkPause();var b=this.controls.container.poster;c.hide(this.controls.buttons.videobtn);c.hide(b);c.hide(c.get(".x-video-info")); this.video.style.display="block";this._adplugin.setLeftSecond(this.leftSecond());var d=this;setTimeout(function(){h.log("ad media timeout check begin = "+d._adBegin);d._adBegin||(d.removeAdEvent(),d._adplugin.hide(),d._adplugin.reportTime("advideo",-1,!1),d.dispatch({type:z,data:!0}))},15E3);this._playTag[0]||(this._playTag[0]=!0,this._adfirsttu=!1,this._adplugin.recordTime("advideo"),i.appendItem("phase","adplay"))},uglyClose:function(){h.log("united ugly close");this.onAdError()},onAdError:function(){this.removeAdEvent(); this._adplugin.hide();this._adplugin.reportTime("advideo",-1,!1);this.clearTimer();this.dispatch({type:z,data:!0})},onAdEnded:function(){h.log("united ad ended");this._adreporter.sendSUE();this.removeAdEvent();this._adplugin.hide();this.clearTimer();this.dispatch({type:D,data:!0});i.appendItem("phase","adend")},onAdPause:function(){this.player.video.ended||(c.show(this.controls.buttons.videobtn),c.hide(this.controls.buttons.shadow))},onAdSuspend:function(){h.log("ad suspend")}, onAdStalled:function(){h.log("ad stalled")},onAdWaiting:function(b){this.controls.onWaiting(b)},onAdTimeUpdate:function(){if(this.video.currentTime>this._addata.VAL[0].AL)this.onAdEnded();else c.hide(this.controls.buttons.loading),this._adBegin=!0,c.hide(this.controls.buttons.loading),this._adplugin.setLeftSecond(this.leftSecond()),this._adreporter.sendSU(this.video.currentTime),this._adreporter.sendUnitedVTVC(this.video.currentTime),this._adfirsttu||(this._adplugin.show(), this._adreporter.sendSUS(),this._adfirsttu=!0,this._adplugin.reportTime("advideo"),0===this._adplugin.SKIP&&this.dispatch({type:I}))},onAdLoadedMetaData:function(){this._adBegin=!0},onAdClick:function(){this.video.pause();this._adreporter.sendUnitedCUM(this.video.currentTime||0);for(var b=this._addata.VAL[0].CU,c=this.video.currentTime,e=0;e

    '}, bindEvent:function(){this._videobtn=c.get(".x-video-button",this.parentBox);c.addEventHandler(this._videobtn,"click",c.bindAsEventListener(this,this.redirect))},startPlay:function(b,d){c.v=b;c.videoInfo=d;c.videoInfo._playListData=b.data;this._pimg=c.get("#x-img",this.parentBox);this._pimg.src=b.data.video.logo;this._title=c.get(".x-title",this.parentBox);this._title.innerHTML=b.data.video.title;this._timespan=c.get(".x-time-span",this.parentBox);this._timespan.innerHTML=c.getTime(b.data.video.seconds); c.show(c.get(".x-video-poster",this.parentBox));c.show(c.get(".x-video-info",this.parentBox));this.adapterForReport();this._reporter=new W(this,c.v,c.videoInfo._sid);this.bindEvent()},onPlayStart:function(){f.playerCurrentState=f.playerState.PLAYER_STATE_PLAYING;c.config.events&&c.config.events.onPlayStart&&(h.log(f.playerCurrentState),h.log("api:onplaystart"),c.config.events.onPlayStart())},getSrc:function(){if(this.src)return this.src;"m3u8"==c.config.content?this.src=c.videoInfo.src:null!=c.videoInfo._videoSegsDic&& null!=c.videoInfo._videoSegsDic[c.defaultVideoType]&&(this.src=c.videoInfo._videoSegsDic[c.defaultVideoType][0].src);return this.src},redirect:function(){var b=this.getSrc();h.log("redirect play src="+b);f.isMIUI?window.location.href=b:window.open(b,"","",!1);this.onPlayStart();this._reporter.addPlayerStaticReport();this._reporter.addPlayerDurationReport(59);this._reporter.sendVVLog(59);this._reporter.sendTSLog(60);this._reporter.sendUserActionReport("xps","c");this._reporter.sendThirdPartyReport("xplayer_dl"); this._reporter.sendClientConsumeReport()},adapterForReport:function(){this.controls={fullscreenPanel:{fullFlag:function(){return 1}}};this.video={src:this.getSrc()};this.getQuality=function(){return"m"}}};(function(b){b.getCurrAbsPath=function(){if(document.currentScript)return document.currentScript.src;var b;try{a.b.c()}catch(c){b=c.fileName||c.sourceURL||c.stack||c.stacktrace,!b&&window.opera&&(b=((""+c).match(/of linked script \S+/g)||[]).join(" "))}if(b)return b=b.split(/[@ ]/g).pop(),b="("== b[0]?b.slice(1,-1):b,b.replace(/(:\d+)?:\d+$/i,"");b=-1===(""+document.querySelector).indexOf("[native code]");for(var g=document.scripts,f=g.length-1,h;h=g[f--];)if("interactive"===h.readyState)return b?h.getAttribute("src",4):h.src}})(window);var fa=/(http|https|file):\/\/.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/.exec(getCurrAbsPath())[0];E(fa+"/h5player/play.css?ver="+"2016/03/2919:47:13".replace(/[-:]/g,""),"css");var da=function(b){this._id=b.id;this._pid=b.pid||""; this._url=b.url;this._box=q(b.parentBox);this._gotInfo=!1;b.width=q(b.parentBox).offsetWidth;b.height=q(b.parentBox).offsetHeight;c.config=b;this.request()};da.prototype={request:function(){var b=this;p.jsonp({url:this._url+"/h5/videos/play.json",data:{vid:this._id,pid:this._pid},time:5E3,success:function(c){b.parse(c)},fail:function(){b.showError()}})},parse:function(b){this._gotInfo=!0;0==b.error?(this.videoSrc=b.results.url,this.imgSrc=b.results.cover,this.buildDom()):this.showError()},buildDom:function(){this._box.innerHTML= '
    ';this.video=c.get(".x-video-player",this._box);this.cover=c.get(".x-video-poster", this._box);this.videoBtn=c.get(".x-video-button",this._box);this.loading=c.get(".x-video-loading",this._box);c.addEventHandler(this.videoBtn,"click",c.bindAsEventListener(this,this.onOverBtnClick));c.addEventHandler(this.video,"ended",c.bindAsEventListener(this,this.onEnded));c.addEventHandler(this.video,"timeupdate",c.bindAsEventListener(this,this.onTimeUpdate));c.addEventHandler(this.video,"waiting",c.bindAsEventListener(this,this.onWaiting))},showError:function(){this._box.innerHTML='
    \u89c6\u9891\u4fe1\u606f\u51fa\u9519
    '},onOverBtnClick:function(){this.video.play();this.loading.style.display="block";this.videoBtn.style.display="none"},onEnded:function(){this.cover.style.display= "block";this.videoBtn.style.display="block";this.loading.style.display="none";this.video.style.display="none"},onTimeUpdate:function(){"none"!=this.loading.style.display&&(this.loading.style.display="none");"block"!=this.video.style.display&&(this.video.style.display="block");"none"!=this.cover.style.display&&(this.cover.style.display="none")},onWaiting:function(){this.loading.style.display="block"},cssAdapt:function(b){return f.isIPAD&&0<=window.location.href.indexOf("v.youku.com")?"x-player":200>= b?"x-player x-player-200":300>=b?"x-player x-player-200-300":660>=b?"x-player x-player-300-660":800>=b?"x-player x-player-660-800":"x-player"}};var Ea=function(b,d){this.setting={debug:!1,controls:c.get(".x-console"),feedback:c.get(".x-feedback"),container:{poster:c.get(".x-video-poster")},buttons:{pointVideo:c.get("#point-video"),playControl:c.get(".x-play-control"),play:c.get("#x-playbtn"),videobtn:c.get(".x-video-button"),loading:c.get(".x-video-loading"),videoinfo:c.get(".x-video-info"),shadow:c.get(".x-trigger"), currentTime:c.get(".x-time-current"),totalTime:c.get(".x-time-duration"),fullscreen:c.get(".x-fullscreen")},classNames:{play:"x-playing",pause:"x-pause"},init:function(){}};c.extend(this.setting,d);this.player=b;this.dashboard=this.setting.controls;this.container=this.setting.container;this.progressBar=new ua(b);this.progressBar.uCurrentTime=this.setting.buttons.currentTime;this.miniProgressBar=new qa(b);this.fullscreenPanel=new ma(b);this.interactionPanel=new oa(b);this.xplayer=c.get("#x-player"); this.buttons=this.setting.buttons};Ea.prototype={init:function(b,d){this.buttons.totalTime.innerHTML=d.totalTime?c.getTime(d.totalTime):"00:00";this.resetProgress();this.buttons.play.className=this.setting.classNames.play;var e=this.container.poster.getElementsByTagName("img")[0];c.config.poster?e.src=c.config.poster:b.data.trial&&"episodes"!=b.data.trial.type||b.data.error?null!=b.data.error&&-203==b.data.error.code&&(this.container.poster.style.backgroundColor="black",e.parentNode.removeChild(e), c.show(this.container.poster)):(e.src=b.data.video.logo,this.container.poster.style.display="block");this._qualityPanel=new xa(this.player,b);this._languagePanel=new pa(this.player,b);this._playratePanel=new ta(this.player,b);this._payPanel=new ra(this.player,b);this._feedbackPanel=new V(this.player,b);this._informationPanel=new na(this.player,b);this.tipPanel=new Aa(this.player,b);this.showlistPanel=new za(this.player,b);this.playLimit=new sa(this.player,b);this.bindDynamicEvent()},bindDynamicEvent:function(){this.bind_mutualHide= c.bindAsEventListener(this,this.mutualHide);c.addEventHandler(this._languagePanel,"click",this.bind_mutualHide);c.addEventHandler(this._qualityPanel,"click",this.bind_mutualHide);c.addEventHandler(this.showlistPanel,"click",this.bind_mutualHide);c.addEventHandler(this._playratePanel,"click",this.bind_mutualHide);this.bind_progress=c.bindAsEventListener(this,this.onProgress);c.addEventHandler(this.progressBar,"progressing",this.bind_progress);c.addEventHandler(this.progressBar,"progressend",c.bindAsEventListener(this, this.onProgressEnd));c.addEventHandler(this._languagePanel,"settingdone",c.bindAsEventListener(this,this.onSettingDone));c.addEventHandler(this._qualityPanel,"settingdone",c.bindAsEventListener(this,this.onSettingDone));c.addEventHandler(this._playratePanel,"settingdone",c.bindAsEventListener(this,this.onSettingDone));c.addEventHandler(this._languagePanel,"settingshow",c.bindAsEventListener(this,this.onSettingShow));c.addEventHandler(this._qualityPanel,"settingshow",c.bindAsEventListener(this,this.onSettingShow)); c.addEventHandler(this._playratePanel,"settingshow",c.bindAsEventListener(this,this.onSettingShow));c.addEventHandler(this._languagePanel,"settinghide",c.bindAsEventListener(this,this.onSettingHide));c.addEventHandler(this._qualityPanel,"settinghide",c.bindAsEventListener(this,this.onSettingHide));c.addEventHandler(this._playratePanel,"settinghide",c.bindAsEventListener(this,this.onSettingHide));c.addEventHandler(this.fullscreenPanel,"enterfullscreen",c.bindAsEventListener(this,this.onEnterFullScreen)); c.addEventHandler(this.fullscreenPanel,"exitfullscreen",c.bindAsEventListener(this,this.onExitFullScreen))},retimer:function(){h.log("retimer");this.autoHideDashBoard()},hideDashBoard:function(){var b=this._payPanel,c=this._informationPanel,e=this.miniProgressBar,g=this.interactionPanel,f=this._languagePanel;this.setting.controls.style.display="none";e.show();b.hide();c.hide();g.hideStatus();f.hide();this._qualityPanel.hide();this._playratePanel.hide()},autoHideDashBoard:function(b){this.dashboardTimer&& clearTimeout(this.dashboardTimer);var d=this;this.dashboardTimer=setTimeout(function(){var e=c.get(".x-showlist");e&&"block"==e.style.display?d.autoHideDashBoard(b):d.player.video.paused||d.hideDashBoard()},b||2E3)},onMultiTouch:function(){},showUglyHint:function(){},closeUglyHint:function(){},showBoardInfo:function(){c.show(this.setting.controls);this.miniProgressBar.hide();this._informationPanel.show();this._payPanel.hasPayInfo()&&this._payPanel.show()},toggleDashBoard:function(b){if(!("touchend"== b.type&&1b.scale&&!c)b.method="m",this.fullscreenPanel.switchFullScreen(b)},toggleVolume:function(){}, changeVolume:function(){},rePlay:function(){h.log("replay");this.player._reporter.sendUserActionReport("xrp","c");t=!1;(this._recommend=c.get(".x-recommend"))&&c.get("#x-player").removeChild(this._recommend);this.resetProgress();this._first=!1;this.player.replay();h.log("replay func end")},redirect:function(b){this.player.redirect(b)},hideFacade:function(){var b=this.container.poster;c.hide(this.buttons.videobtn);c.hide(b);c.hide(c.get(".x-feedback"));h.log("hide facade")}, onVideoBtnTouchStart:function(b){this._vtsx=b.targetTouches[0].clientX;this._vtsy=b.targetTouches[0].clientY},onVideoBtnTouchEnd:function(b){h.log("video btn clicked");b=b||{};t?this.rePlay():b&&b.changedTouches&&50= b&&e.offsetHeight>=d},isNeedPauseAd:function(){return this.player.video.paused&&c.isLandScape()},checkPauseAd:function(){this.isNeedPauseAd()?(this._pauseAdPlugin=new Y(this.player,c.v,c.videoInfo._sid),this._pauseAdPlugin.addEventListener("pauseAdinfook",c.bindAsEventListener(this,this.onPauseAdInfoOK)),this._pauseAdPlugin.addEventListener("pauseadinfotimeout",c.bindAsEventListener(this,this.onPauseAdInfoTimeout)),this._pauseAdPlugin.addEventListener("pauseAdinfoerror",c.bindAsEventListener(this, this.onPauseAdInfoERROR)),window.adpluginobject=this._pauseAdPlugin,this._pauseAdPlugin.pauseAd(),h.log("send pause ad request
    ")):(h.log(" donot need pause ad "),this.hidePauseAd())},hidePauseAd:function(){c.hide(c.get(".x-ad-pause"))},onPauseAdInfoOK:function(b){h.log("pause info ok");this._pauseAdStart||(this._pauseAdStart=!0);this._pauseAdPlayer=new Ca(this.player,b);this._pauseAdPlayer.play()},onPauseAdInfoTimeout:function(b){h.log("pause info timeout = "+b.data.timeout); this._pauseAdStart||(this._pauseAdStart=!0)},onPauseAdInfoERROR:function(){h.log("pause info error no info");this._pauseAdStart||(this._pauseAdStart=!0)},autoShow:function(){this.show();var b=this;setTimeout(function(){b.hide()},5E3)},mutualHide:function(b){b._target==this._languagePanel?(this._qualityPanel.hide(!0),this._playratePanel.hide(!0),this.showlistPanel.hide()):b._target==this._qualityPanel?(this._languagePanel.hide(!0),this._playratePanel.hide(!0),this.showlistPanel.hide()): b._target==this.showlistPanel?(this._qualityPanel.hide(!0),this._languagePanel.hide(!0),this._playratePanel.hide(!0)):b._target==this._playratePanel&&(this._qualityPanel.hide(!0),this._languagePanel.hide(!0),this.showlistPanel.hide())},show:function(b){b?c.show(this.buttons[b]):c.show(this.setting.controls)},hide:function(b){b?c.hide(this.buttons[b]):c.hide(this.setting.controls)},backAdPrepare:function(){this.dashboard.style.display="none";this.buttons.shadow.display="none"},onEnded:function(){this.dashboard.style.display= "none";this.buttons.shadow.display="none";this.buttons.videobtn.style.display="block";this.container.poster.style.display="block";this._informationPanel.show();this.miniProgressBar.hide();this.interactionPanel.hide();null==c.v.data.trial&&!1!=c.initConfig.show_related&&(this._relatedPanel=new ya(this.player,c.v))},onPlay:function(){this.player.video.style.display="block";this.buttons.play.className=this.setting.classNames.pause;this.buttons.videobtn.style.display="none";this.container.poster.style.display= "none";this.hidePauseAd();this.buttons.shadow.style.display="block";(this._recommend=c.get(".x-recommend"))&&c.get("#x-player").removeChild(this._recommend);t=!1;this._first||(this._first=!0,this._informationPanel.show(),this.setting.controls.style.display="block");this.autoHideDashBoard(5E3)},onPause:function(){this.buttons.play.className=this.setting.classNames.play;c.hide(this.buttons.loading);this.interactionPanel.isVisible()||(this.showBoardInfo(),this.interactionPanel.setStatus("\u6682\u505c"))}, onWaiting:function(){!this.player.video.paused&&"none"==this.buttons.videobtn.style.display&&(this.buttons.loading.style.display="block")},onTryPlayEnded:function(){h.log("try end");this.player.video.pause();this._payPanel.activeTime=0;t=!0;this._payPanel.showTip()},onTimeUpdate:function(b){this.buttons.loading.style.display="none";if(b.target==this.player.video){var c=this.player.currentTime;4==b.target.readyState&&this.setProgress(c);this._payPanel.hasPayInfo()&&c>=this._payPanel.tryDuration()&& (this.onTryPlayEnded(),this.onPlayEnd());this.playLimit.isLimit()&&c>=this.playLimit.limitTime()&&(this.playLimit.create(),this.onPlayEnd())}},onPlayEnd:function(){f.playerCurrentState!=f.playerState.PLAYER_STATE_END&&(f.playerCurrentState=f.playerState.PLAYER_STATE_END,c.config.events&&c.config.events.onPlayEnd&&(h.log("callback: on play end"),c.config.events.onPlayEnd()))},checkPlayLimit:function(){var b=!1;c.v.data.trial?b=this.player.currentTime>=c.v.data.trial.time/100:this.playLimit.isLimit()&& (b=this.player.currentTime>=this.playLimit.limitTime());if(!b)return!1;this.playLimit.create();this.onPlayEnd();return!0},removeControls:function(){this.video.controls=!1},loadControls:function(){this.video.controls=!0},setProgress:function(b){b=Math.min(Math.max(b,0),c.videoInfo.totalTime);this.progressBar.setProgress(b);this.miniProgressBar.setProgress(b);this.buttons.currentTime.innerHTML=c.getTime(this.progressBar.playTime)},resetProgress:function(){this.progressBar.resetProgress();this.miniProgressBar.resetProgress(); this.buttons.currentTime.innerHTML="00:00"},hideTimeTip:function(b){if(b.srcElement.id==this.buttons.progressHandler.id)return!1;this.buttons.progressTime.style.display="none"},showTimeTip:function(b){if(b.srcElement.id==this.buttons.progressHandler.id||b.srcElement.id==this.buttons.progressTime.id||b.srcElement.id==this.buttons.pointVideo.id)return!1;b=b.offsetX/this.buttons.progressBar.offsetWidth;this.buttons.progressTime.innerHTML=c.getTime(b*c.videoInfo.totalTime);this.buttons.progressTime.style.left= 100*Math.min(Math.max(b,0.023),0.977)+"%";this.buttons.progressTime.style.display="block"},shadowTouchStart:function(b){1e?1:-1);1==this._stmlrtag&&b.preventDefault();if(1!=this._sactionType)if(100e&&500>g)h.log("quick seek moving"),this.player.video.pause(),this._sactionType=1,g=this._smx> this._sx?30:-30,this.interactionPanel.setTip(this._stime,g),this.interactionPanel.show();else if(200>c&&(100>e&&1E3e||this._stmtag)h.log("stmtag ="+this._stmtag),this._sactionType=2,this._stmtag=!0,this.player.video.pause(),this.dragging(b)}},shadowTouchEnd:function(b){1Math.abs(this._smx-this._sx)?"xdud":"xdlr",h.log("shadow action = "+b),this.player._reporter.sendUserActionReport(b,"d"),2==this._sactionType?(h.log("
    normal seek"),this.player.video.play(),this.player.seek(this._ttime),this.interactionPanel.hide(),this.player._reporter.sendUserActionReport("xtseek","d")):1==this._sactionType&&(b=0quick seek deltat = "+b+" cur="+this._stime+""),this.setProgress(this._stime+b),this.interactionPanel.setTip(this._stime, b),this.interactionPanel.show(),this.interactionPanel.autoHide(),this.player.video.play(),this.player.seek(this._stime+b),this.player._reporter.sendUserActionReport("xqseek","d"),h.log("
    "))))},dragging_:function(b){var d=this._smx-this._presmx;this._deltaxs.push(10setting show");clearTimeout(this.pbarClickTimer);this.progressBar.removeClickEvent()},onSettingHide:function(){h.log("setting hide");var b=this;this.pbarClickTimer=setTimeout(function(){b.progressBar.addClickEvent()},1E3)},onEnterFullScreen:function(){f.isIPAD&&c.addClass(this.setting.controls,"x-fs-console")},onExitFullScreen:function(){f.isIPAD&&c.removeClass(this.setting.controls, "x-fs-console")},adrAdapt:function(b){f.isAndroid&&(this._smx=b.changedTouches[0].clientX,this._smy=b.changedTouches[0].clientY,h.log("
    adr smy= "+this._smy+" y = "+this._sy))},isShadowTouchTooShort:function(b){return this.isTouchTooShort({x:this._sx,y:this._sy},{x:this._smx,y:this._smy},b)},isTouchTooShort:function(b,c,e){var g=Math.abs(c.x-b.x),g=g||1.0E-6,b=(b=Math.abs(c.y-b.y))||1.0E-6;h.log(g+","+b);e=e||100;return g=b||this.tipPanel.showLastTimeTip(b)},uiInit:function(){h.log("uiInit");t&&(t=!1,this.buttons.videobtn.style.display="block")},onResize:function(b){var d=q(c.config.parentBox).offsetWidth,e=q(c.config.parentBox).offsetHeight;if(d&&(e&&c.resizeTag)&&(e=this.xplayer.className,this.xplayer&&(-1===e.indexOf("fullscreen")?this.xplayer.className=F(d):(d=window.innerWidth,this.xplayer.className=F(d)+" x-player-fullscreen")), this._relatedPanel))this._relatedPanel.onResize(b)}};var Z=function(b){this.video=b;this._startPlayTime=-1;this.currentTime=this._waitTry=0};Z.prototype={getVideo:function(){return this.video},show:function(){c.show(this.video)},hide:function(){c.hide(this.video)},play:function(){c.v&&c.v.data.trial&&0==c.v.data.trial.time?h.log(" trial time = 0 "):this.video.play()},pause:function(){this.video.pause()},setupControls:function(b){this.controls&&this.controls.removeEvent();return new Ea(b)}, hideControls:function(){this.controls.hide()},showControls:function(){this.controls.show()},removeControls:function(){this.controls.removeControls()},loadControls:function(){this.controls.loadControls()},retry:function(){},showError:function(b){this.errorBox||(this.errorBox=document.createElement("div"),this.errorBox.style.cssText="position:absolute;width:100%;top:50%;display:none;text-align:center;",this.video.parentNode.appendChild(this.errorBox));this.errorBox.innerHTML=b;this.errorBox.style.marginTop= "-"+this.errorBox.offsetHeight/2+"px";this.errorBox.style.display="block"},onLoadStart:function(){},onCanPlay:function(){},onLoadedData:function(){},onLoadedMetaData:function(){},onAbort:function(){},onError:function(){this._reporter.sendUserActionReport("xve","e");this._reporter.sendUepReport("videoload",-1,!1);f.sendErrorReport(2001);0<=this._retry--?(-1!==this.video.src.indexOf("m3u8")&&(this.video.src=c.m3u8src_v2(c.v.data.id,c.defaultVideoType)),h.log("video onerror retry it ,time="+this.currentTime+ " src="+this.video.src),this.video.load(),this.video.play(),this.seek(this.currentTime)):!(this.isOnePiece()&&!0==this.controls.checkPlayLimit())&&!this._errorTag&&(this._errorTag=!0,f.playerCurrentState=f.playerState.PLAYER_STATE_ERROR,f.showError({code:"2001",message:"\u62b1\u6b49\uff0c\u89c6\u9891\u51fa\u9519\uff0c\u8bf7\u5237\u65b0"},"\u62b1\u6b49\uff0c\u89c6\u9891\u51fa\u9519\uff0c\u8bf7\u5237\u65b0"))},onPause:function(){this.controls.onPause()},onPlayIPH:function(){h.log("onplayiph");this.onPlayStart(); this._firstPlayTag?!0==this._endedIPH&&(this._reporter.tsInit(),this._reporter.sendVVLog(62),this._reporter.sendTSLog(60),this._reporter.addPlayerDurationReport(62)):(this._firstPlayTag=!0,this._reporter.addPlayerStaticReport(),this._reporter.addPlayerDurationReport(59),this._reporter.sendVVLog(59),this._reporter.sendTSLog(60),this._reporter.sendUserActionReport("xps","c"),this._reporter.sendLoadedTime(3),this._reporter.sendThirdPartyReport("xplayer_iph"),this._reporter.sendClientConsumeReport())}, onTimeUpdateIPH:function(){this.currentTime=this.video.currentTime},onEndedIPH:function(){this.onPlayEnd();this._reporter.addPlayerDurationReport(61);this._reporter.sendTSLog(61);this._endedIPH=!0},onPlay:function(){h.log("onplay");this.controls.onPlay();if(this._firstPlayTag){if(f.playerCurrentState==f.playerState.PLAYER_STATE_END||f.playerCurrentState==f.playerState.PLAYER_STATE_ERROR)this.onPlayStart()}else this._firstPlayTag=!0,this.onPlayStart(),c.initConfig.firsttime?(h.log("starttime = "+c.initConfig.firsttime), this.seek(c.initConfig.firsttime)):this.seekToLastPoint()||this.skipHead(),this._startPlayTime=(new Date).getTime(),this._reporter.addPlayerStaticReport(),this._reporter.addPlayerDurationReport(59),this._reporter.sendVVLog(59),this._reporter.sendTSLog(60),this._reporter.sendClientConsumeReport();i.appendItem("phase","videoplay")},onVolumeChange:function(){},onPlaying:function(){},onStalled:function(b){h.log("stalled");if(this.isOnePiece()||b.target==this.video)this.controls.onWaiting(b)},onSuspend:function(){}, onWaiting:function(b){if(this.isOnePiece()||b.target==this.video)this.controls.onWaiting(b)},onSeeked:function(){h.log("onSeeked waitSkip="+this._waitSeek+" try= "+this._waitTry);if(!isNaN(this._waitSeek)){var b=this._waitSeek;10=this._waitTry?(this._waitTry+=1,this.seek(b)):this._waitSeek="NaN"}},onSeeking:function(b){h.log("seeking");if(this.isOnePiece()||b.target==this.video){var c=this;setTimeout(function(){c.controls.onWaiting(b)},100)}},onDurationChange:function(){}, onProgress:function(){},onRateChange:function(){},customWaiting:function(){var b=this;!1==this.video.paused&&this._lastTime===this.currentTime&&(h.log("custom waiting!:) networkstate="+this.video.networkState),this.controls.onWaiting());this._lastTime=this.currentTime;setTimeout(function(){b.customWaiting()},5E3)},sendLoadedTime:function(){var b=0,b=-1==this._startPlayTime?0:(new Date).getTime()-this._startPlayTime;this._reporter.sendLoadedTime(b)},onTimeUpdate:function(b){if(this.isOnePiece())this.currentTime= this.video.currentTime,c.unitedTag&&(this.currentTime-=c.unitedTag.offset);else{for(var d=0,e=0;e=c&&(this.video.load(),this.play(),this.timeoutTimer=setTimeout(function(){e.detectIsPlaying(++c)},1E3))},isOnePiece:function(){return"m3u8"==c.config.content||"mp4"==c.config.content&&1==c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType].length}, removeEvent:function(){},bindEvent:function(){if(!c.v.data.error)if("directsrc"==c.config.playType&&!1==c.isWeixin)c.addEventHandler(this.video,"play",c.bindAsEventListener(this,this.onPlayIPH)),c.addEventHandler(this.video,"timeupdate",c.bindAsEventListener(this,this.onTimeUpdateIPH)),c.addEventHandler(this.video,"ended",c.bindAsEventListener(this,this.onEndedIPH)),c.addEventHandler(this.video,"webkitendfullscreen",c.bindAsEventListener(this,this.onEndFullscreen));else{var b={loadstart:"onLoadStart", canplay:"onCanPlay",loadeddata:"onLoadedData",loadedmetadata:"onLoadedMetaData",abort:"onAbort",error:"onError",pause:"onPause",waiting:"onWaiting",stalled:"onStalled",suspend:"onSuspend",play:"onPlay",volumechange:"onVolumeChange",playing:"onPlaying",seeked:"onSeeked",seeking:"onSeeking",durationchange:"onDurationChange",progress:"onProgress",ratechange:"onRateChange",timeupdate:"onTimeUpdate",ended:"onEnded",webkitbeginfullscreen:"onBeginFullscreen",webkitendfullscreen:"onEndFullscreen"},d;for(d in b)c.addEventHandler(this.video, d,c.bindAsEventListener(this,this[b[d]]))}}};var u=-1,t=!1,va=0,wa=600,x=[],B={flvhd:"\u6807\u6e05",flv:"\u6807\u6e05",mp4:"\u9ad8\u6e05",hd2:"\u8d85\u6e05"};c.WIN_TYPE=30;c.defaultVideoType=null;c.defaultLanguage="guoyu";c.resizeTag=!0;c.extend=function(b,c){for(var e in c)b[e]=c[e]};c.inherits=function(b,c){var e=function(){};e.prototype=c.prototype;b.prototype=new e;b.prototype.constructor=b};c.bind=function(b,c){return function(){return c.apply(b,arguments)}};c.bindAsEventListener=function(b, c){var e=Array.prototype.slice.call(arguments).slice(2);return function(g){return c.apply(b,[g||window.event].concat(e))}};c.getCurrentStyle=function(b){return b.currentStyle||document.defaultView.getComputedStyle(b,null)};c.addEventHandler=function(b,d,e,g){c.config.isMobile&&("click"==d&&!g)&&(d="touchend");b.addEventListener?b.addEventListener(d,e,!1):b.attachEvent?b.attachEvent("on"+d,e):b["on"+d]=e};c.removeEventHandler=function(b,d,e,g){c.config.isMobile&&("click"==d&&!g)&&(d="touchend");b.removeEventListener? b.removeEventListener(d,e,!1):b.detachEvent?b.detachEvent("on"+d,e):b["on"+d]=null};c.show=function(b){b.style.display="video"===b.tagName.toLowerCase()?"":"block"};c.hide=function(b){b&&(b.style.display="none")};c.getLeftPosition=function(b){for(var c=b.offsetLeft;b.offsetParent;)b=b.offsetParent,c+=b.offsetLeft;return c};c.get=function(b,c){return(c||document).querySelector(b)};c.pieceLength=function(){return"m3u8"==c.config.content?1:c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType].length}; c.multiPieceSrc=function(b){return b>=c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType].length?"":c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType][b].src};c.getTime=function(b){if(!b)return"00:00";var c=Math.floor(b),b=c%60,c=Math.floor(c/60);return(10>c?"0"+c:c)+":"+(10>b?"0"+b:b)};c.addClass=function(b,d){c.hasClass(b,d)||(b.className+=" "+d)};c.hasClass=function(b,c){return RegExp("(^| )"+c+"( |$)").test(b.className)};c.removeClass=function(b,c){b.className= b.className.replace(RegExp("(^| )"+c+"( |$)")," ").replace(/^\s+|\s+$/g,"")};c.m3u8src=function(b,c){var e="http://v.youku.com/player/getM3U8/vid/"+b+"/type/"+c+"/ts/"+parseInt((new Date).getTime()/1E3);if(f.isIPHONE||f.isIPOD)e+="/useKeyFrame/0";return e+"/v.m3u8"};c.m3u8src_v2=function(b,d){if(c.OLD_M3U8)return c.m3u8src(b,d);var e={vid:b,type:d,ts:parseInt((new Date).getTime()/1E3),keyframe:f.isIPHONE?0:1};c.password&&(e.password=c.password);c.password&&(c.initConfig.client_id&&c.config.partner_config&& 1==c.config.partner_config.status&&1==c.config.partner_config.passless)&&(e.client_id=c.initConfig.client_id);var g=encodeURIComponent(K(M(N(c.mk.a4+"poz"+f.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(),f.userCache.sid+"_"+b+"_"+f.userCache.token)));e.ep=g;e.sid=f.userCache.sid;e.token=f.userCache.token;e.ctype="12";e.ev="1";e.oip=c.v.data.security.ip;return"http://pl.youku.com/playlist/m3u8?"+s(C(e,c.getUCParam(b)))}; c.isLandScape=function(){return 90==window.orientation||-90==window.orientation};c.getUCParam=function(b){var d={};"undefined"!=typeof getUCSecret?d.xk=getUCSecret(b):"undefined"!=typeof uckey?(d.uc_param_str="xk",d.xk=uckey.getUCKey(b)):!0==c.isUCBrowserAndValidVersion()&&(d.uc_param_str="xk");return d};c.isUCBrowserAndValidVersion=function(){var b=navigator.userAgent,c=b.search(/ucbrowser/i);return-1!=c&&9.8<=parseFloat(b.substr(c+10,4))?!0:!1};YoukuHTML5Player=function(b,d){null==b.parentBox&& (b.parentBox="parentBox");b.expand&&0

    \u8be6\u7ec6\u4e86\u89e3
    00:00/00:00
    '; e.innerHTML=g;e=c.get("video",this.root);Z.apply(this,[e].concat([].slice.call(arguments)));this.video.style.width="100%";this.video.style.height="100%";this.video.style.display="none";this.video.style.position="relative";this._firstPlayTag=!1;this._retry=2;this.uiAdapter()};c.inherits(YoukuHTML5Player,Z);c.extend(YoukuHTML5Player.prototype,{startPlay:function(b,d,e){if(b&&b.data&&(b.data.show=b.data.show||{},d.abstarttime=(new Date).getTime(),d._playListData=b.data,d._user=b.user,c.v=b,c.videoInfo= d,this.setting={},c.extend(this.setting,e),!b.data.error||!this.processError(b,d,e))){this._reporter=new W(this,c.v,c.videoInfo._sid);this.controls=this.setupControls(this);this.controls.init(c.v,c.videoInfo);this.mpieceReport();this.createIdNode();if(this.isNeedAdRequest())this.processAd();else if(this.controls.bindVideoBtnEvent(),this.realStartPlay(),1==c.initConfig.ucautoplay)this.controls.onVideoBtnClick({});"m3u8"==c.config.content&&new ja(this.video)}},isNeedAdRequest:function(){"undefined"== typeof this._frontAdTag&&(this._frontAdTag=!1);f.isNeedFrontAd=!this._frontAdTag&&"directsrc"!=c.config.playType&&!c.v.data.trial;return f.isNeedFrontAd},processAd:function(){if(this.isNeedAdRequest()&&(this._frontAdTag=!0,this._adplugin=new Y(this,c.v,c.videoInfo._sid),this.bind_frontAd=c.bindAsEventListener(this,this.onFrontAdInfoOK),this.bind_frontAdInfoTimeout=c.bindAsEventListener(this,this.onFrontAdInfoTimeout),this._adplugin.addEventListener("frontAdinfook",this.bind_frontAd,!1),this._adplugin.addEventListener("frontAdinfotimeout", this.bind_frontAdInfoTimeout),this.bind_unitedFrontAd=c.bindAsEventListener(this,this.onUnitedFrontAdInfoOK),this._adplugin.addEventListener("unitedfrontadinfook",this.bind_unitedFrontAd,!1),this.bind_backAdInfoOK=c.bindAsEventListener(this,this.onBackAdInfoOK),this.bind_backAdInfoTimeout=c.bindAsEventListener(this,this.onBackAdInfoTimeout),this._adplugin.addEventListener("backAdinfook",this.bind_backAdInfoOK,!1),this._adplugin.addEventListener(" backAdinfotimeout",this.bind_backAdInfoTimeout),this.bind_uglyCloseAd= c.bindAsEventListener(this,this.onUglyCloseAd),this._adplugin.addEventListener("uglyclosead",this.bind_uglyCloseAd),this.controls.bindAdVideoBtnEvent(),window.adpluginobject=this._adplugin,1==c.initConfig.ucautoplay))this.controls.onVideoBtnTouchEnd({})},requestAd:function(){this._adplugin&&this._adplugin.frontAd()},onUglyCloseHint:function(){this.controls.showUglyHint()},onUglyCloseAd:function(){h.log("ugly close");this.controls.closeUglyHint();this.adplayer.uglyClose()},onFrontAdInfoTimeout:function(){this._hasStartPlay= !0;this.realStartPlay(!0)},onUnitedFrontAdInfoOK:function(b){h.log("on united front adinfo ok");var d=b.data.info;if(0==b.data.info.VAL.length)h.log("onUnitedFrontAdInfoOK val length == 0 "),this.loadVTVC(b.data.vtvc),this.video.src=c.m3u8src_v2(c.v.data.id,c.defaultVideoType),this.unitedStartPlay(d,!0);else{this.adplayer=new Da(this,b);var e=this;this.adplayer.addEventListener(D,function(){h.log("united ad end");e._realFlag||(e._realFlag=!0,e.adplayer.clearTimer(), e.unitedStartPlay(d))},!1);this.adplayer.addEventListener(z,function(){h.log("united ad error");e._realFlag||(c.unitedTag=null,e._realFlag=!0,e.adplayer.clearTimer(),e.video.src=c.m3u8src_v2(c.v.data.id,c.defaultVideoType),e.unitedStartPlay(d,!0))},!1);this.adplayer.addEventListener(I,function(){h.log("ugly hint");e.onUglyCloseHint()},!1);this.adplayer.play();this.createIdNode()}},loadVTVC:function(b){for(var c=0;cad error");c._realFlag||(c._realFlag=!0,c.adplayer.clearTimer(), c.realStartPlay(b.data))},!1);this.adplayer.addEventListener(I,function(){h.log("ugly hint");c.onUglyCloseHint()},!1);this.adplayer.play();this.createIdNode()}},onBackAdInfoTimeout:function(){h.log("onBackAdInfoTimeout");this.showEndCard()},onBackAdInfoOK:function(b){h.log("onBackAdInfoOK");if(0==b.data.urls.length)this.showEndCard();else{this.adplayer=new X(this,b);var c=this;this.adplayer.addEventListener(D,function(){c.showEndCard()});this.adplayer.addEventListener(z,function(){c.showEndCard()}); this.adplayer.play()}},prepareVideoTag:function(){this.video.preload="none";"m3u8"==c.config.content?this.video.src=c.videoInfo.src:null!=c.videoInfo._videoSegsDic&&null!=c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType]&&(this.video.src=c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType][0].src);c.v.data.trial&&("episodes"!=c.v.data.trial.type&&0==c.v.data.trial.time)&&(this.video.src=null);this.createIdNode()},createIdNode:function(){if(!q(c.config.id)){var b= document.createElement("div");b.id=c.config.id;q(c.config.parentBox).appendChild(b)}},redirect:function(){var b="";"m3u8"==c.config.content?b=c.videoInfo.src:null!=c.videoInfo._videoSegsDic&&null!=c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType]&&(b=c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType][0].src);h.log("redirect play src="+b);this._reporter.addPlayerStaticReport();this._reporter.addPlayerDurationReport(59);this._reporter.sendVVLog(59);this._reporter.sendTSLog(60); this._reporter.sendUserActionReport("xps","c");window.open(b,"","",!1);this._reporter.sendClientConsumeReport();this.onPlayStart()},realStartPlay:function(b){h.log("realStartPlay "+b);this.controls.bindEvent();this.bindEvent();this.prepareVideoTag();this.playVideos(b)},unitedStartPlay:function(b,d){h.log("united start play ");c.unitedTag={offset:b.VAL.length?b.VAL[0].AL:0};this.controls.bindEvent();this.bindEvent();if(!0===d)this.video.load(),this.video.play();else this.onPlay();this.controls.onPlay()}, playVideos:function(b){h.log("playVideos "+b);t=!1;u=0;this.video.style.display=(f.isIPHONE||f.isIPOD)&&null!=c.v.data.trial?"none":"block";if(c.config.autoplay||c.config.nextAutoPlay||b)h.log("src= "+this.video.src+" auto = "+b),this.video.load(),this.video.play()},processError:function(b){var d=b.data.error.code;if(-301==d||-307==d||-308==d)return b.data.trial={time:0},!1;c.hide(c.get(".x-video-poster"),this.root);this.feedbackPanel=new V(this,b);return!0},mpieceReport:function(){"mp4"==c.config.content&& (c.videoInfo._videoSegsDic&&null!=c.videoInfo._videoSegsDic.streams[c.defaultLanguage][c.defaultVideoType]&&1=this.tryDuration:!1},replay:function(){u= 0;this._ireflag=this._comscoreflag=!1;this._firstflag=f.adrPlayTrick=!1;this.video.style.display="block";this.isOnePiece()||(this.video.src=c.multiPieceSrc(u));f.isIPAD&&(this.video.src=c.m3u8src_v2(c.v.data.id,c.defaultVideoType),c.unitedTag=null);this.video.load();this.video.play();this._reporter.tsInit();this._reporter.sendVVLog(62);this._reporter.sendTSLog(60);this._reporter.addPlayerDurationReport(62)},seekToLastPoint:function(){if(f.isAndroid)return!1;var b=c.v.data.id,d=-1;c.v.data.playlog&& (d=c.v.data.playlog.lastpoint/1E3);var e=parseInt(i.getItem(b+"_playpoint"))||-1,b=-1;-1!=d&&-1!=e?(b=d,60>Math.abs(d-e)&&(b=e)):(b=d,-1==d&&(b=e));h.log("lastpoint="+b);d=i.getItem("youku_ignore_lasttime");d=parseInt(d)||0;return-1!==b&&120<=b&&3>d&&!c.v.data.trial&&b=d/1E3-10&&!this._tailTip)&&(h.log("skiptail(act before 10) ="+d),this._tailTip=!0,this.controls.tipPanel.onSkipTail());-1!=d&&(b>=d/1E3&&!this._tailSkipped)&&(this._tailSkipped=!0,"true"==i.getItem("youku_conf_skip")&&this.seek(parseInt(c.v.data.video.seconds)-1))}},assistSkipTail:function(b){var d=parseInt((c.v.data.dvd||{}).tail||-1);this._tailTip=b>=d/1E3?this._tailSkipped=!0:this._tailSkipped=!1},seek:function(b,d){b=b||0;b=Math.max(b,0);c.videoInfo.totalTime&&(b=Math.min(b,c.videoInfo.totalTime- 5));this.isOutTryDuration(b)&&(b=this.tryDuration-1);this.assistSkipTail(b);var e=this;this.switchTimer&&clearTimeout(this.switchTimer);this.currentTime=b;if(this.isOnePiece()){var g=this.video.seekable,f=1==g.length?g.end(0):0;c.unitedTag&&(b+=c.unitedTag.offset,f+=c.unitedTag.offset);1==g.length&&bseekto callback(mayby play)"),c())}},multiSeekTo_:function(){h.log("YoukuHTML5 ")},multiSeekTo:function(b){h.log("YoukuHTML5Player multiSeekTo !");for(var d=0,e=0,g=0,f=0;fb){e=f;g=i-(d-b);break}else if(d==b){e=f+1;g=0;break}}this.video.pause();if(e==u){h.log(" piece time = "+g);try{this.video.currentTime=g}catch(m){}this.video.play()}else{u=e;var l=0,n=this;this.video.addEventListener("canplay",function(){1!==l&&(l=1,h.log("canplay time="+g),n.video.currentTime=g)});(b=c.multiPieceSrc(u))?(this.video.src=b,this.video.load(),this.video.play()):this.video.pause()}this.video.style.display= "block"},adjustVideoRatio:function(b){if(!f.isIOS){if(("onorientationchange"in window||"orientation"in window)&&!this._avrTag){this._avrTag=!0;var d=this;window.addEventListener("orientationchange",function(){!0===d.controls.fullscreenPanel.fullFlag()&&d.adjustVideoRatio()})}var d=this,e=this.video;setTimeout(function(){if(1===b)e.style.width="100%",e.style.height="100%",e.style.top=null,e.style.left=null;else{var d=c.get(".x-player",this.root),d=d.offsetWidth/d.offsetHeight,f=e.videoWidth/e.videoHeight; isNaN(f)||isNaN(d)||!isFinite(d)||!isFinite(f)?(e.style.width="100%",e.style.height="100%",e.style.top=null,e.style.left=null):d