(function(){function x(a){var c=document.createElement("script");c.type="text/javascript";c.src=a;document.getElementsByTagName("head")[0].appendChild(c)}function pa(a){if(!a)return"";var a=a.toString(),c,b,f,k,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];k=a.length;f=0;for(e="";f>4);do{c=a.charCodeAt(f++)&255;if(61==c)return e;c=h[c]}while(f>2);do{b=a.charCodeAt(f++)&255;if(61==b)return e;b=h[b]}while(fh;h++)b[h]=h;for(h=0;256>h;h++)f=(f+b[h]+a.charCodeAt(h%a.length))%256,k=b[h],b[h]=b[f],b[f]=k;for(var p=f=h=0;p=a[f]?a[f].charCodeAt(0)-97:a[f]-0+26,g=0;36>g;g++)if(c[g]==e){e=g;break}b[f]=25>>32-c}function b(a){var c="",d,f;for(d=7;0<=d;d--)f=a>>>4*d&15,c+=f.toString(16);return c}var f,e,g=Array(80),h=1732584193,p=4023233417,i=2562383102,l=271733878,m=3285377520,o,n,t,q,r,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),c="",b=0;bd?c+=String.fromCharCode(d):(127d?c+=String.fromCharCode(d>>6|192):(c+=String.fromCharCode(d>>12|224),c+=String.fromCharCode(d>>6&63|128)),c+=String.fromCharCode(d& 63|128))}return c}(a);o=a.length;var s=[];for(f=0;f>>29);s.push(o<<3&4294967295);for(a=0;af;f++)g[f]= s[a+f];for(f=16;79>=f;f++)g[f]=c(g[f-3]^g[f-8]^g[f-14]^g[f-16],1);e=h;o=p;n=i;t=l;q=m;for(f=0;19>=f;f++)r=c(e,5)+(o&n|~o&t)+q+g[f]+1518500249&4294967295,q=t,t=n,n=c(o,30),o=e,e=r;for(f=20;39>=f;f++)r=c(e,5)+(o^n^t)+q+g[f]+1859775393&4294967295,q=t,t=n,n=c(o,30),o=e,e=r;for(f=40;59>=f;f++)r=c(e,5)+(o&n|o&t|n&t)+q+g[f]+2400959708&4294967295,q=t,t=n,n=c(o,30),o=e,e=r;for(f=60;79>=f;f++)r=c(e,5)+(o^n^t)+q+g[f]+3395469782&4294967295,q=t,t=n,n=c(o,30),o=e,e=r;h=h+e&4294967295;p=p+o&4294967295;i=i+n&4294967295; l=l+t&4294967295;m=m+q&4294967295}r=b(h)+b(p)+b(i)+b(l)+b(m);return r.toLowerCase()}function y(a,c){if("js"==c){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a)}else"css"==c&&(b=document.createElement("link"),b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.setAttribute("href",a));"undefined"!=typeof b&&document.getElementsByTagName("head")[0].appendChild(b)}function Q(){return e.isAndroid?e.isAndroid4?"adr4":"adr":e.isIPHONE? "iph":e.isIPAD?"ipa":e.isIPOD?"ipo":"oth"}function z(a){return e.isIPAD&&0<=window.location.href.indexOf("v.youku.com")?"x-player":200>=a?"x-player x-player-200":300>=a?"x-player x-player-200-300":660>=a?"x-player x-player-300-660":800>=a?"x-player x-player-660-800":"x-player"}VER="2013/12/2713:55:33";VER="2014/08/2518:26:49";VER="2014/08/2916:02:44";VER="2014/08/2916:05:39";VER="2014/08/2916:10:08";VER="2014/08/2916:19:00";VER="2014/08/2916:19:25";VER="2014/08/2916:39:16";VER="2014/08/2916:40:26"; VER="2014/09/0116:01:10";VER="2014/09/0116:15:20";VER="2014/09/0116:17:27";VER="2014/09/0212:00:09";VER="2014/09/0212:00:41";VER="2014/09/0216:19:29";VER="2014/09/0216:26:07";VER="2014/09/0417:44:57";VER="2014/09/0417:46:33";VER="2014/09/0417:47:49";VER="2014/09/0417:49:21";VER="2014/09/0417:49:56";VER="2014/09/0418:15:26";VER="2014/09/3010:56:11";VER="2014/10/1611:25:41";VER="2014/10/1611:28:29";VER="2014/10/1616:22:57";VER="2014/10/2115:53:11";VER="2014/10/2115:54:04";VER="2014/10/2115:55:08";VER= "2014/10/2812:03:59";VER="2014/10/2813:08:13";VER="2014/11/0417:56:16";VER="2014/11/0417:59:22";VER="2014/11/0418:03:16";VER="2014/11/0418:23:28";VER="2014/11/0418:28:34";VER="2014/11/0418:32:33";VER="2014/11/0510:56:34";VER="2014/11/0510:57:54";VER="2014/11/0510:59:03";VER="2014/11/0511:00:06";VER="2014/11/0511:02:24";VER="2014/11/0511:11:34";VER="2014/11/1010:38:18";VER="2014/11/1318:06:15";VER="2014/11/1318:23:25";VER="2014/11/1318:29:24";VER="2014/11/1318:30:27";VER="2014/11/1318:31:03";VER="2014/11/1318:32:38"; VER="2014/11/1318:35:09";VER="2014/11/1318:36:04";VER="2014/11/1318:36:59";VER="2014/11/1318:37:54";VER="2014/11/1318:39:50";VER="2014/11/1318:40:10";VER="2014/11/1318:41:10";VER="2014/11/1318:45:44";VER="2014/11/1318:46:49";VER="2014/11/1318:47:19";VER="2014/11/1410:12:17";VER="2014/11/1410:14:53";VER="2014/11/1410:16:39";VER="2014/11/1410:18:07";VER="2014/11/1410:19:15";VER="2014/11/1410:52:32";VER="2014/11/1410:54:46";VER="2014/11/1410:59:26";VER="2014/11/1411:14:09";VER="2014/11/1411:15:20";VER= "2014/11/1411:16:59";VER="2014/11/1411:17:24";VER="2014/11/1411:57:02";VER="2014/11/1711:02:45";VER="2014/11/1817:14:29";VER="2014/11/2017:50:34";VER="2014/11/2017:50:55";VER="2014/11/2017:51:40";VER="2014/11/2017:53:29";VER="2014/11/2017:54:06";VER="2014/11/2017:57:26";VER="2014/11/2017:59:13";VER="2014/11/2018:00:57";VER="2014/11/2018:33:10";VER="2014/11/2018:34:26";VER="2014/11/2018:36:46";VER="2014/11/2018:40:49";VER="2014/11/2018:42:03";VER="2014/11/2411:24:13";VER="2014/11/2815:53:58";VER="2014/12/0418:00:32"; VER="2014/12/0418:09:56";VER="2015/01/2610:31:10";VER="2015/02/0416:13:08";VER="2015/02/0416:18:05";VER="2015/02/0416:19:46";VER="2015/02/0416:39:16";DEBUG__=0;if(0==DEBUG__||!window.console)window.console={},window.console.log=function(){};debug={log:function(a){null!=document.getElementById("debug")&&(document.getElementById("debug").innerHTML+=a+" | ")}};var b={},C={},e={playerType:"",uniplayerUrl:"http://passport-log.youku.com/logsys/logstorage/append?project=uniplayer&log=",MPIECEURL:"http://passport-log.youku.com/logsys/logstorage/append?project=mpiece&log=", 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(a,c){var b=document.createElement("img");c&&b.addEventListener("error",c,!1);b.src=a+"&r_="+Math.floor(1E4*Math.random());b.id="youku-uniplayer-stat"},isNeedAdrTrick:function(){return e.isAndroid&& !e.adrPlayTrick&&!e.isHTC&&e.isNeedFrontAd&&!e.isVIVO},adrInvalidPauseCheck:function(a){var c=a.currentTime,b=0,f=!1;e.adrPlayTrick=!0;a.pause();a.play();setInterval(function(){a.currentTime==c&&!f?(b++,a.play(),0==b%10&&(a.load(),a.play())):f=!0},1E3)},sendErrorReport:function(a){var c={},d="",d=e.isIPAD?"xplayer_ipad":e.isIPHONE?"xplayer_iphone":"xplayer_android";c.m=d;c.ec=a;d="";1E3==a&&(d=b.v.data[0].error_code);c.gc=d;c.u=encodeURIComponent(window.location.href);c.v=b.videoInfo?b.videoInfo._sid: "";c.ct=b.v?b.v.data[0].ct:"";c.cs=b.v?b.v.data[0].cs:"";c.hd=e.hd?e.hd:0;c.a=b.v?b.v.controller.area_code+"|"+b.v.controller.dma_code:"";a="";b.initConfig.vvlogconfig&&b.initConfig.vvlogconfig.pvid&&(a=b.initConfig.vvlogconfig.pvid);c.pid=a;e.Log("http://v.l.youku.com/perror?"+n(c))},uniReport:function(a){a.partner=b.initConfig.client_id;a.os=escape(e.os);a.mios=e.isMobileIOS;a.adrd4=e.isAndroid4;a.mobile=e.isMobile;a.adrpad=e.isAndroidPad;!1==a.mobile&&(a.ua=escape(navigator.userAgent.replace(/[\/\+\*@\(\)\,]/g, "")));a.version=VER.replace(/[-: ]/g,"");e.Log(e.uniplayerUrl+r(a))},Load:function(a,c){if("js"==c){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a)}else"css"==c&&(b=document.createElement("link"),b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.setAttribute("href",a));"undefined"!=typeof b&&document.getElementsByTagName("head")[0].appendChild(b)},showError:function(a,c){var d=b.get("#x-player");d.innerHTML=c?c:"\u8be5\u89c6\u9891\u683c\u5f0f\u7279\u6b8a\uff0c\u8bf7\u5728PC\u4e0a\u89c2\u770b"; d.style.textAlign="center";d.style.color="white";d.style.lineHeight=d.offsetHeight+"px";if(b.playerEvents&&b.playerEvents.onPlayError)b.playerEvents.onPlayError(c?c:"\u8be5\u89c6\u9891\u683c\u5f0f\u7279\u6b8a\uff0c\u8bf7\u5728PC\u4e0a\u89c2\u770b")}};(function(){var a=document.createElement("video"),c={MP4:"video/mp4",OGG:"video/ogg",WEBM:"video/webm"},b={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",isVIVO:"vivo"};e.supportHTML5Video=!1;e.isIOS=!1;e.os="";if(a.canPlayType){e.supportHTML5Video=!0;for(var f in c)e["canPlay"+f]=a.canPlayType(c[f])?!0:!1}for(var k in b)if(-1!==navigator.userAgent.indexOf(b[k])?(e[k]=!0,e.os+=b[k]+" "):e[k]=!1,-1!==navigator.userAgent.indexOf("Android"))a=navigator.userAgent.indexOf("Android"), a=navigator.userAgent.substr(a,10),a>b.isAndroid4&&(e.isAndroid4=!0,e.os+=a+" ");e.isMobileIOS=e.isIPAD||e.isIPHONE||e.isIPOD;e.isIOS=e.isMobileIOS||e.isMac;e.isSupportH5M3U8=e.isMobileIOS||e.isMac&&e.isSafari&&!e.isChrome||e.isLEPAD||e.isSonyDTV;e.isSupportH5MP4=(e.isChrome||e.isIE10||e.isAndroid41||e.isAndroid4)&&e.canPlayMP4;k=b=0;try{if(document.all){var g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");g&&(b=1,VSwf=g.GetVariable("$version"),parseInt(VSwf.split(" ")[1].split(",")[0]))}else if(navigator.plugins&& 0';this.bind_inputpassword=b.bindAsEventListener(this,this.inputPassword);this.setButton("\u786e\u5b9a",this.bind_inputpassword);break;case -8:this.setMessage(v["-8"]);break;case -15:this.setMessage(v["-15"]);break;case -25:this.setMessage(v["-25"]); break;case -26:this.setMessage(v["-26"]);break;default:this.setMessage(a.data[0].error)}this.show();this.showMessage()}},bindEvent:function(){},show:function(){b.show(this._feedback)},hide:function(){b.hide(this._feedback)},showMessage:function(){b.show(this._message)},hideMessage:function(){b.hide(this._message)},setMessage:function(a){this._messagetxt.innerHTML="

"+a+"

"},setButton:function(a,c){this._messagebtn.innerHTML="";var d=this._message.getElementsByClassName("x-btn")[0]; b.addEventHandler(d,"click",c)},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 a=this._messagetxt.getElementsByClassName("x-message-input")[0],c=a.value;if(null==c||0==c.replace(/\s/g,"").length)a.value="",a.placeholder="\u5bc6\u7801\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165"; else{var d=this.player;b.password=c;i.start(this._vid,c,b.config.content,function(a,e){b.hide(b.get(".x-feedback"));b.password=c;b.show(b.get(".x-video-button"));b.hide(b.get(".x-message"));d.startPlay(a,e)})}}};var X=function(a){this._handler={};this.player=a;this._fullflag=null;this.init();this._fullscreen=b.get(".x-fullscreen");this._btn=this._fullscreen.getElementsByTagName("button")[0];this._btnb=this._btn.getElementsByTagName("b")[0];this.bindEvent()};X.prototype={addEventListener:function(a, b){this._handler[a]=b},removeEventListener:function(a){this._handler[a]=null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},init:function(){},bindEvent:function(){this.bind_switch=b.bindAsEventListener(this,this.switchFullScreen);b.addEventHandler(this._fullscreen,"click",this.bind_switch,!0)},removeEvent:function(){b.removeEventHandler(this._fullscreen,"click",this.bind_switch,!0)},zoomStatus:function(){return this._btnb.className},fullFlag:function(){if(null!== this._fullflag)return this._fullflag;var a=this.player.video.webkitDisplayingFullscreen;return this._fullflag="undefined"!=typeof a?a:!1},switchFullScreen:function(a){var c=a.method||"c",d=this._btnb.className;b.config.events&&b.config.events.onSwitchFullScreen?(-1===d.indexOf("in")?(this._fullflag=!1,this._btnb.className=d.replace(/out/g,"in"),this.player.controls.hideShowListBtn(),this.player._reporter.sendUserActionReport("xexfs",c),this.player.adjustVideoRatio(1),this.dispatch({type:"exitfullscreen"})): (this._fullflag=!0,this._btnb.className=d.replace(/in/g,"out"),this.player.controls.showShowListBtn(),this.player._reporter.sendUserActionReport("xenfs",c),this.player.adjustVideoRatio(),this.dispatch({type:"enterfullscreen"})),c=b.config.events.onSwitchFullScreen,c(a,d)):(a=document.getElementById("x-player"),-1===d.indexOf("in")?(this.player._reporter.sendUserActionReport("xexfs",c),document.webkitCancelFullScreen&&(this._btnb.className=d.replace(/out/g,"in"),this._fullflag=!1,document.webkitCancelFullScreen())): (this.player._reporter.sendUserActionReport("xenfs",c),a.webkitRequestFullScreen?(this._btnb.className=d.replace(/in/g,"out"),this._fullflag=!0,a.webkitRequestFullScreen()):this.player.video.webkitSupportsFullscreen&&1<=this.player.video.readyState&&this.player.video.webkitEnterFullscreen()))}};var Y=function(a,c){this.handler={};this.player=a;this.information=b.get(".x-video-info");this.title=this.information.getElementsByClassName("x-title")[0];this.videoState=this.information.getElementsByClassName("x-video-state")[0]; b.hide(this.videoState);this.init(c)};Y.prototype={init:function(a){!a.data[0].trial&&(!a.data[0].error_code&&!a.data[0].error)&&(this.title.innerHTML=a.data[0].title.substr(0,20),this.videoState.innerHTML="\u65f6\u957f: "+b.getTime(parseInt(a.data[0].seconds))+"",this.show())},show:function(){b.v.data[0].trial||b.show(this.information)},hide:function(){b.hide(this.information)},bindEvent:function(){}};var Z=function(a){this.player=a;this._tip=b.get(".x-prompt");this.init()};Z.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(a){!0!=this._progressFlag&&(this._time.innerHTML=b.getTime(parseInt(a)))},setStatus:function(a){this._statusTxt.innerHTML=a;this.showStatus()},hideStatus:function(){b.hide(this._status);b.hide(this._tip)},showStatus:function(){b.hide(this._mode);b.show(this._status);b.show(this._tip)}, setTip:function(a,c){this._progressFlag=!0;this._time.innerHTML=b.getTime(ra(a+c));0>=c?(b.show(this._back),b.hide(this._forward)):(b.show(this._forward),b.hide(this._back));var d=this;setTimeout(function(){d._progressFlag=false},1E3)},isVisible:function(){return"none"!=this._tip.style.display},hide:function(){b.hide(this._tip)},show:function(){b.show(this._mode);b.hide(this._status);b.show(this._tip)},autoHide:function(a){var b=this;setTimeout(function(){b.hide()},a||1E3)}};var $=function(a,c){this._handler= {};b.isWeixin?b.get(".x-localization").style.display="none":!c||!c.data||!c.data[0]||!c.data[0].dvd||!c.data[0].dvd.audiolang?b.get(".x-localization").style.display="none":(this.player=a,this._language=b.get(".x-localization"),this.init(c),this.bindEvent(),this._button=this._language.getElementsByTagName("button")[0],this._panel=this._language.getElementsByTagName("div")[0],this._nodes=this._language.getElementsByTagName("li"))};$.prototype={addEventListener:function(a,b){this._handler[a]=b},removeEventListener:function(a){this._handler[a]= null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},init:function(a){for(var a=a.data[0],b=a.dvd.audiolang,d=[""],f=["
    ","","
","
"],e=[],g=0;g"):h+=">";h+=b[g].lang+"";e[b[g].langid]=h}f[1]=e.join("");this._language.innerHTML= d.join("")+f.join("")},bindEvent:function(){var a=this._language.getElementsByTagName("li");if(0!=a.length){this.bind_toggle=b.bindAsEventListener(this,this.toggleLanguagePanel);b.addEventHandler(this._language,"click",this.bind_toggle);for(var c=0;c\u4ed8\u8d39\u5f71\u7247",this._payBtn.innerHTML="\u7acb\u5373\u8d2d\u4e70"):(this._title.innerHTML=b+"\u4ed8\u8d39\u5305\u6708\u5f71\u7247",this._payBtn.innerHTML="\u5f00\u901a\u4f1a\u5458"); this.bindEvent();this.show();this.player._reporter.sendPayReport()}},play:function(){if((e.isIPHONE||e.isIPOD)&&null!=b.v.data[0].trial)this.player.video.style.display="block";0===this.activeTime?this.player.seek(0):this.player.video.play();this.player._reporter.sendUserActionReport("xtry","c")},pay:function(){this.player.video.pause();b.v.payInfo&&b.v.payInfo.h5_caseurl&&window.open(b.v.payInfo.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&&b.hide(this._tryBtn))},isBlock:function(){return"block"==this._payInfo.style.display},showTip:function(){this._hasPayInfo&&(this._tip.innerHTML="\u514d\u8d39\u8bd5\u770b\u5df2\u7ecf\u7ed3\u675f\uff0c\u4ed8\u8d39\u5373\u53ef\u89c2\u770b",this.show())},clearTip:function(){this._tip.innerHTML=""},hasPayInfo:function(){return this._hasPayInfo},tryDuration:function(){return this._tryDuration}}; var ca=function(a,b){this._handler={};this.player=a;this._videoInfo=b;this._app_disable=!1;this._limitTime=2400;!0==this._videoInfo.controller.app_disable&&(this._app_disable=!0);this._isLimit=!1;!0==this._videoInfo.controller.xplayer_disable&&(this._isLimit=!0,this.player.tryDuration=this._limitTime);this._isCreated=!1;debug.log("videoInfo.controller.xplayer_disable:",this._isLimit);debug.log("videoInfo.controller.app_disable:",this._app_disable)};ca.prototype={addEventListener:function(a,b){this._handler[a]= b},removeEventListener:function(a){this._handler[a]=null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},create:function(){if(!this._isCreated){debug.log("playLimit create");this.player.video.pause();this._isCreated=!0;var a=b.get("#x-player"),c=this._videoInfo.controller.mobile_disabled,d=this._videoInfo.controller.pad_disabled,f=this._videoInfo.controller.pc_disabled,c=!1==this._app_disable&&(!0==c||!0==d)&&!1==f;!0==this._app_disable||c?(a.innerHTML="

\u672c\u9875\u9762\u63d0\u4f9b40\u5206\u949f\u9884\u89c8\uff0c

\u8bf7\u4f7f\u7528\u7535\u8111\u89c2\u770b\u5b8c\u6574\u7248\uff01

", this._content=b.get(".x-app-guide"),e.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009227&cpp=1000752&url=")):(a.innerHTML='

\u672c\u9875\u9762\u63d0\u4f9b40\u5206\u949f\u9884\u89c8

',this._content=b.get(".x-app-guide"),this._fullBtn= this._content.getElementsByClassName("x-btn")[0],this._openApp=this._content.getElementsByClassName("x-app-openapp")[0],this.bind_onFullClick=b.bindAsEventListener(this,this.onFullClick),b.addEventHandler(this._fullBtn,"click",this.bind_onFullClick),e.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009212&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(){debug.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=b.bindAsEventListener(this,this.onDownloadClick);this.bind_onKnow=b.bindAsEventListener(this,this.onKnowClick); b.addEventHandler(this._downloadBtn,"click",this.bind_onDownload);b.addEventHandler(this._knowBtn,"click",this.bind_onKnow);e.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(){e.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009215&cpp=1000752&url=");e.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(){e.Log("http://hz.youku.com/red/click.php?tp=1&cp=4009216&cpp=1000752&url=");setTimeout(function(){window.location.reload()}, 500)},openApp:function(){var a=document.createElement("iframe");a.height=0;a.width=0;a.frameBorder="no";a.src="youku://play?vid="+b.initConfig.vid;e.isIPAD&&(a.src="youkuhd://play?vid="+b.initConfig.vid);document.getElementsByTagName("body")[0].appendChild(a)},isLimit:function(){return this._isLimit},limitTime:function(){return this._limitTime}};var B={2:"2\u500d","1.5":"1.5\u500d",1:"\u5e38\u901f","0.8":"0.8\u500d"},da=function(a,c){this._handler={};!b.isWeixin&&e.isIPAD7&&(this.player=a,this.playRate= b.get(".x-playspeed"),this.init(c),this.bindEvent(),this.button=this.playRate.getElementsByTagName("button")[0],this.panel=this.playRate.getElementsByTagName("div")[0],this.nodes=this.playRate.getElementsByTagName("li"),b.show(this.playRate))};da.prototype={addEventListener:function(a,b){this._handler[a]=b},removeEventListener:function(a){this._handler[a]=null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},init:function(){for(var a=[""],b=['"],d="",f=[],e=["2","1.5","1","0.8"],g=0;g"+p+B[h]+"";f.push(B[h])}b[1]=d;this.playRate.innerHTML=a.join("")+b.join("")},bindEvent:function(){var a=this.playRate.getElementsByTagName("li");if(0!=a.length){this.bind_toggle=b.bindAsEventListener(this,this.toggleRatePanel);b.addEventHandler(this.playRate, "click",this.bind_toggle);for(var c=0;ce-g?e-g+"px":100*Math.min(Math.max(f,0),1)+"%";this.uCurrentTime.innerHTML=b.getTime(d);!0!==c&&(this.loadTime=d+=Math.max(this.player.bufferedEnd()-a, 0),f=d/b.videoInfo.totalTime,this._load.style.width=100*Math.min(Math.max(f+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(a,c){var d=1,f=b.get(".x-fs-console");f&&(d=parseFloat(b.getCurrentStyle(f).zoom));return a/(c*d)},seek:function(a){var c=(new Date).getTime()-fa;if(a.srcElement==this._seek||c","",""],d=['"],f="",e=[],g;for(g in u)if(-1!==a.streamtypes.indexOf(g)&&-1===e.indexOf(u[g])){var h="",i="";g==b.defaultVideoType&&(h="",c[1]=u[g],i=" class=selected");f+="
  • "+h+u[g]+"
  • ";e.push(u[g])}""==c[1]&&(c[1]=e[0]);d[1]=f;this._quality.innerHTML=c.join("")+d.join("")},bindEvent:function(){var a=this._quality.getElementsByTagName("li");if(0!=a.length){this.bind_toggle=b.bindAsEventListener(this,this.toggleQualityPanel);b.addEventHandler(this._quality, "click",this.bind_toggle);for(var c=0;c";this._listinner=this._panel.getElementsByClassName("x-pages")[0]},request:function(a){var c,d={};d.vid=a.data[0].videoid;d.uid=a.data[0].userid;a.data[0].show&&a.data[0].show.showid&&(d.sid=a.data[0].show.showid);d.cate=a.data[0].categories;d.site="1"; d.module="2";a=a.controller.playmode;d.pg="1";d.pg={normal:1,show:3,folder:4}[a];"interior"==b.config.winType?d.apptype=12:(d.apptype=12,d.pg=1);d.pl=36;for(c in b.initConfig.playlistconfig)d[c]=b.initConfig.playlistconfig[c];d.callback="relatedpanel.parseResponse";c="http://ykrec.youku.com/video/packed/list.json?"+n(d);x(c);this._apt=d.apptype;this._pg=d.pg;this._md=d.module},parseResponse:function(a){this._info=a;this.buildPanel(this._info)},buildPanel:function(a){var a=a.data,c=a.length;debug.log("realted len = "+ c);var d=[];d.push('
    ');for(var f=Math.floor((this._panel.offsetWidth-60+16)/166)*Math.floor((this._panel.offsetHeight-120+12)/97),f=(f>c?c:f)-1,f=0>f?0:f,c=0;c
  • '+g+'
  • ')}this._listinner.innerHTML= d.join("");this.bindDynamicEvent();this.buildImgEvent()},getReportParam:function(a){var c={};c.pos=""+a;c.sct=b.v.data[0].categories;c.dct=this._info.data[a].dct;c.ord=this._info.ord;c.req_id=this._info.req_id;c.abver=this._info.ver;c.dma=this._info.data[a].dma;c.algInfo=this._info.data[a].algInfo;c.apt=this._apt;c.md=this._md;c.pg=this._pg;c.r=(new Date).getTime();c.vid=b.v.data[0].vidEncoded;c.uid=b.v.data[0].userid;1==this._info.data[a].type?c.dvid=this._info.data[a].id:c.dsid=this._info.data[a].id; c.sid="";b.v.data[0].show&&b.v.data[0].show.showid&&(c.sid=b.v.data[0].show.showid);return c},buildImgEvent:function(){for(var a=this._listinner.getElementsByClassName("x-item-img"),c=0;c
    '; 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];var c=a.data[0].list;if(!(null==c||0==c.length)){for(var d=["
      ","","
    "],f=[],e=0;e"+g.title.substr(0,20)+"";f.push(g)}d[1]=f.join("");this._slbd.innerHTML=d.join("");d="
    ;;
      ;;
    ;".split(";");f=[];i=a.data[0].list_pre?parseInt(a.data[0].list_pre.seq/60):0;for(e=0;e<(c.length- 1)/60+1;e++)a="",e==i&&(a=" class=current"),g=""+(e+1)+"",f.push(g);d[3]=f.join("");this._slft.innerHTML=d.join("")}},addEventListener:function(a,b){this._handler[a]=b},removeEventListener:function(a){this._handler[a]=null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},bindEvent:function(){this.bind_close=b.bindAsEventListener(this,this.hide);b.addEventHandler(this._closeHandle,"click",this.bind_close);this.bind_toggle=b.bindAsEventListener(this, this.toggle);b.addEventHandler(this._showbtn,"click",this.bind_toggle)},removeEvent:function(){b.removeEventHandler(this._closeHandle,"click",this.bind_close)},hide:function(){this._showbtn.className=this._showbtn.className.replace(/[\s]*pressed/g,"");b.hide(this._showlist)},show:function(){this._showbtn.className+=" pressed";b.show(this._showlist)},showListBtn:function(){var a=b.v.data[0].list;null==a||1>=a.length||b.show(this._showbtn)},hideListBtn:function(){var a=b.v.data[0].list;null==a||0== a.length||(b.hide(this._showbtn),this.hide())},toggle:function(a){"block"!=this._showlist.style.display?(this.show(),this.player._reporter.sendUserActionReport("xshl","c"),e.Log(e.uniplayerUrl+r({e:"xshl",adr:e.isAndroid,ios:e.isIPAD}))):this.hide();this.dispatch(a)},touchStart:function(a){this._sx=a.targetTouches[0].clientX;this._sy=a.targetTouches[0].clientY;this._ex=this._sx;this._ey=this._ey},touchEnd:function(){},touchMove:function(a){this._ex=a.targetTouches[0].clientX;this._ey=a.targetTouches[0].clientY; this._dx=this._ex-this._sx;this._dy=this._ey-this._sy;Math.abs(this._dx)>Math.abs(this._dy)||a.preventDefault()}};var ka=function(a){this.player=a;this._handle={};this._tips=b.get(".x-tips");b.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==l.getItem("youku_conf_skip")&& l.setItem("youku_conf_skip",!0);this.bindEvent()};ka.prototype={bindEvent:function(){b.addEventHandler(this._ctip,"click",b.bindAsEventListener(this,this.closeTip))},closeTip:function(){b.hide(this._tips);this.keepLastTime()},autoHide:function(a){var b=this;setTimeout(function(){b.closeTip()},a)},keepLastTime:function(){},ignoreLastTime:function(){},isShowTimeTip:function(){var a=l.getItem("youku_keep_lasttime"),a=parseInt(a),b=l.getItem("youku_ignore_lasttime"),b=parseInt(b);return 3<=a||3<=b?!1: !0},showLastTimeTip:function(a){a=b.getTime(a);debug.log("last = "+a);!1!=this.isShowTimeTip()&&(this._ptip.innerHTML="\u4f18\u9177\u8bb0\u5fc6\u60a8\u4e0a\u6b21\u64ad\u653e\u5230"+a+", \u4ece\u5934\u89c2\u770b",this._playBegin=this._ptip.getElementsByClassName("x-tip-timebegin")[0],b.addEventHandler(this._playBegin,"click",b.bindAsEventListener(this,this.seekBegin)),b.show(this._tips),this.autoHide(5E3))},onSkipTail:function(){"true"== l.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],b.addEventHandler(this._skipnowtail,"click",b.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], b.addEventHandler(this._skipalwtail,"click",b.bindAsEventListener(this,this.skipAlways)));b.show(this._tips);this.autoHide(1E4)},onSkipHead:function(){"true"==l.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],b.addEventHandler(this._skipnow,"click",b.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],b.addEventHandler(this._skipalw,"click",b.bindAsEventListener(this,this.skipImediately)));b.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 ";b.show(this._tips);var a=this;setTimeout(function(){b.hide(a._tips)},15E3)},closeUglyHint:function(){b.hide(this._tips)}, skipImediately:function(){debug.log("skip imediately");this.player._reporter.sendUserActionReport("xskh","c");l.setItem("youku_conf_skip",!0);var a=parseInt((b.v.data[0].dvd||"").head)/1E3;this.onSkipHead();this.player.seek(a);return!1},skipNoway:function(){this.player._reporter.sendUserActionReport("xnsk","c");l.setItem("youku_conf_skip",!1);this._ptip.innerHTML="\u8bbe\u7f6e\u6210\u529f";return!1},skipAlways:function(){this.player._reporter.sendUserActionReport("xask","c");l.setItem("youku_conf_skip", !0);this._ptip.innerHTML="\u8bbe\u7f6e\u6210\u529f";return!1},seekBegin:function(){this.player._reporter.sendUserActionReport("xseb","c");b.hide(this._tips);this.ignoreLastTime();this.player.seek(0);return!1}};var L=function(a,b,d){this.player=a;this.v=b;this.sid=d;this.isSendedConsumeReport=!1;e.hd=this.getHDFlag();if(0k;k++)var g=Math.floor(61*Math.random()),f=f+"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".substring(g, g+1);hstr=c+f;hashcash=qa(hstr);"00"==hashcash.substring(0,2)&&(d=!0)}a.h=f;a.totalseg=b.pieceLength();a=n(a);e.Log("http://stat.youku.com/player/addPlayerStaticReport?"+a)},sendUserActionReport:function(a,c,d){c={t:1002,e:a,v:c};c.d=E(Q());var f={v:"h5player",vid:b.v.data[0].videoid,ssid:b.videoInfo._sid,ct:b.v.data[0].ct,cs:b.v.data[0].cs,uid:0};b.v.data[0].user&&(f.uid=b.v.user.id);f.sid="";b.v.data[0].show&&(f.sid=b.v.data[0].show.showid);f.tc=this.player.currentTime||0;f.w=b.get("#x-player").offsetWidth; f.h=b.get("#x-player").offsetHeight;f.f=this.player.video.webkitDisplayingFullscreen?"on":"off";f.q=this.player.getQuality();f.ver="1.0.0";for(var k in d)f[k]=d[k];c.x=E(n(f));k=n(c);if("xre"==a)this.checkPlayerResize("http://e.stat.ykimg.com/red/ytes.php?",k);else{if("xenfs"==a||"xexfs"==a){this._giveupReTag=!0;var g=this;setTimeout(function(){g._giveupReTag=false},800)}e.Log("http://p-log.ykimg.com/event?"+k)}this.sendCustomUserAction(a,d)},checkScreenRotate:function(a,b){var d=screen.availWidth, f=screen.availHeight;debug.log("
    rota w,h = "+d+","+f);if(this.screenDim.w!=d||this.screenDim.h!=f)this.screenDim.w=d,this.screenDim.h=f,debug.log("rotate"),e.Log(a+b)},checkPlayerResize:function(a,b){if(!0===this._giveupReTag)debug.log("give up xre after enfs or exfs");else{var d=document.getElementById("x-player");this._resizeList=this._resizeList||[];this._resizeList.push({str:b,time:(new Date).getTime(),w:d.offsetWidth,h:d.offsetHeight});var f=this;setTimeout(function(){if(0!= f._resizeList.length){for(var b=f._resizeList[0].time,c=0;cMath.abs(a._timelist[0]-a._timelist[2])&&(debug.log("ad unexpected pause"),a.video.play(),0==a.leftSecond()&&(debug.log("exception left = 0 "),a.onAdEnded())),a._timelist=[])},1E3)}},onAdPlay:function(){this.checkPause();var a=this.controls.container.poster;b.hide(this.controls.buttons.videobtn);b.hide(a);b.hide(b.get(".x-video-info")); this.video.style.display="block";a=this._addata.curnum;debug.log("left="+this.leftSecond()+" curtotal="+this._addata.seconds[a]+" curtime="+this.video.currentTime);this._adplugin.setLeftSecond(this.leftSecond());var c=this;setTimeout(function(){debug.log("ad media timeout check begin = "+c._adBegin);c._adBegin||(c.removeAdEvent(),c._adplugin.hide(),c._adplugin.reportTime("advideo",-1,!1),c.dispatch({type:ADConstant.AD_ERROR,data:!0}))},1E4);this._playTag[a]||(this._playTag[a]=!0,this._adfirsttu=!1, this._adplugin.recordTime("advideo"),l.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:ADConstant.AD_ERROR,data:!0})},onAdEnded:function(a){debug.log("ad ended");this._adreporter.sendSUE();this.checkVTVC(this._addata.curnum+1);if(this._addata.curnumad suspend")},onAdStalled:function(){debug.log("ad stalled")},onAdWaiting:function(a){this.controls.onWaiting(a)},onAdTimeUpdate:function(){b.hide(this.controls.buttons.loading);this._adBegin=!0;b.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"),e.isNeedAdrTrick()&&e.adrInvalidPauseCheck(this.video),0===this._adplugin.SKIP&&this.dispatch({type:ADConstant.UGLY_CLOSE_AD_HINT}))},onAdLoadedMetaData:function(){this._adBegin=!0},onAdClick:function(){this.video.pause();this._adreporter.sendCUM();var a=this._addata,a=a.info.VAL[a.curnum].CU;debug.log("click cu="+a);window.open(a,"","",!1)}};ADConstant={FRONT_REQUEST_BASE:"http://mf.atm.youku.com/mf?",BACK_REQUEST_BASE:"http://mb.atm.youku.com/mb?", PAUSE_REQUEST_BASE:"http://mp.atm.youku.com/mp?",INSERT_REQUEST_BASE:"http://valo.atm.youku.com/valo?",OVERLAY_REQUEST_BASE:"http://valc.atm.youku.com/valc?",FRONT_AD:"frontAD",BACK_AD:"backAD",INSERT_AD:"insertAD",PAUSE_AD:"pauseAD",OVERLAY_AD:"overlayAD",AD_END:"adend",AD_ERROR:"aderror",UGLY_CLOSE_AD:"uglyclosead",FRONT_AD_END:"frontADend",FRONT_AD_ERROR:"frontADerror",FRONT_AD_INFO_OK:"frontAdinfook",FRONT_AD_UNITED_INFO_OK:"unitedfrontadinfook",FRONT_AD_INFO_ADAPER_OK:"frontAdinfoadapterok", FRONT_AD_INFO_TIMEOUT:"frontAdinfotimeout",BACK_AD_END:"backAdend",BACK_AD_ERROR:"backaderror",BACK_AD_INFO_OK:"backAdinfook",BACK_AD_INFO_TIMEOUT:" backAdinfotimeout",INSERT_AD_INFO_OK:"insertAdinfook",PAUSE_AD_INFO_OK:"pauseAdinfook",PAUSE_AD_INFO_ERROR:"pauseAdinfoerror",PAUSE_AD_INFO_TIMEOUT:"pauseadinfotimeout",OVERLAY_AD_INFO_OK:"overlayAdinfook",AdPluginObject:"adpluginobject"};var N=function(a,c,d){this._handler={};this.player=a;this.sid=d;this._advids=[];this._adsecs=[];this._adsrcs=[];this._vid= c.data[0].videoid;this._advert=b.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(c);this.bindEvent()};N.prototype={init:function(a){this.initRequestParam(a);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]},initRequestParam:function(a){var c={site:1,p:0,vl:parseInt(a.data[0].seconds),fu:0,ct:a.data[0].ct,cs:a.data[0].cs,d:0,paid:a.data[0].show?a.data[0].show.paid:0,s:a.data[0].show?a.data[0].show.showid:0,sid:this.sid,td:a.data[0].sourceVid?a.data[0].sourceVid:0,v:a.data[0].videoid,vip:a.user.vip?1:0,wintype:"xplayer_m3u8",u:a.data[0].userid,bt:e.isPad? "pad":"phone",os:e.isMobileIOS?"ios":"Android",rst:e.isMobileIOS?"m3u8":"3gphd",tict:0,aw:"w",vs:"1.0"};null!=b.config.partner_config&&(c.partnerid=b.initConfig.client_id,c.atm=b.config.partner_config.atm);for(var d in b.initConfig.adconfig)c[d]=b.initConfig.adconfig[d];this._param=c;this._ti=encodeURIComponent(a.data[0].title);this._k=encodeURIComponent((a.data[0].tags||[]).join("|"));this.loadPartnerParam()},loadPartnerParam:function(){},partnerParse:function(){},initRequestParam_:function(a){var c= {ct:a.data[0].ct,cs:a.data[0].cs,v:a.data[0].videoid,t:parseInt(a.data[0].seconds),u:a.data[0].userid,fileid:"todo",winType:"xplayer_m3u8",partnerid:b.config.partnerId,sid:this.sid,k:"",td:"todo"};c.s=a.data[0].show?a.data[0].show.showid:"";a.user&&(c.vip=a.user.vip?1:0);c.paid=a.data[0].show?a.data[0].show.paid:0;for(var d in b.initConfig.adconfig)c[d]=b.initConfig.adconfig[d];this._param=c},bindEvent:function(){var a=this;this.fSkipAd=function(){a.adplayer.video.pause();window.open("http://cps.youku.com/redirect.html?id=000002bf", "","",!1)};this._adskip.addEventListener("click",this.fSkipAd,!1);this._adknowdet.addEventListener("click",function(){debug.log("detail clicked");a.adplayer.onAdClick("")},!1)},addEventListener:function(a,b){this._handler[a]=b},removeEventListener:function(a){this._handler[a]=null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},show:function(){b.show(this._advert)},hide:function(){b.hide(this._advert)},setLeftSecond:function(a){debug.log(a);this._adsec&& (this._adsec.innerText=a)},splitVTVC:function(a){debug.log("split adinfo vt vc");this._vtvc=[];var b={},d;for(d in a)"VAL"!=d&&(b[d]=a[d]);b.VAL=[];a=a.VAL;for(d=0;dbefore split val length = "+a.VAL.length+ ""),a=this.splitVTVC(a),debug.log("after : val length = "+a.VAL.length+""));if(null==a||null==a.VAL||0==a.VAL.length)a={VAL:[]},this.dispatch({type:ADConstant.FRONT_AD_UNITED_INFO_OK,data:{info:{VAL:[]},vtvc:this._vtvc||[]}});else{var a=new la(a,this._vtvc),b=this;a.addEventListener(ADConstant.FRONT_AD_INFO_ADAPER_OK,function(a){debug.log("ad info adapter ok");b.dispatch({type:ADConstant.FRONT_AD_UNITED_INFO_OK,data:{info:a.data,vtvc:b._vtvc||[]}})});a.run()}},adParse:function(a){this.checkSkip(a); l.appendItem("phase","adinfo");this.reportTime("adinfo");this._isAdInfoOk=!0;if(a&&a.VAL)for(var a=this.splitVTVC(a),b=a.VAL,d=0;d ad parse pause ");l.appendItem("phase","pauseadinfo");this.reportTime("adinfo");this._isPauseAdInfoOk=!0;null==a||null==a.VAL||0==a.VAL.length||10!=a.P?this.dispatch({type:ADConstant.PAUSE_AD_INFO_ERROR}):(debug.log("pause ad len = "+a.VAL.length+""),this.dispatch({type:ADConstant.PAUSE_AD_INFO_OK,data:{info:a}}))},frontAd:function(){this._param.fu=this.player.controls.fullscreenPanel.fullFlag()?1:0;this._param.p=7;this._param.callback= ADConstant.AdPluginObject+".adParse";b.OLD_M3U8=!0;e.isIPAD&&(debug.log(" new m3u8 api"),b.OLD_M3U8=!1,this._param.callback=ADConstant.AdPluginObject+".adParseUnited");var a=ADConstant.FRONT_REQUEST_BASE+n(this._param)+"&ti="+this._ti+"&k="+this._k;x(a);this.recordTime("adinfo");var c=this;setTimeout(function(){if(!c._isAdInfoOk){debug.log("adinfo timeout");c.reportTime("adinfo",-1);c.dispatch({type:ADConstant.FRONT_AD_INFO_TIMEOUT,data:{timeout:8E3}})}},8E3)},pauseAd:function(){this._param.r_= parseInt(1E4*Math.random());this._param.p=10;this._param.fu=this.player.controls.fullscreenPanel.fullFlag()?1:0;this._param.callback=ADConstant.AdPluginObject+".adParsePause";var a=ADConstant.PAUSE_REQUEST_BASE+n(this._param)+"&ti="+this._ti+"&k="+this._k;x(a);this.recordTime("adinfo");var b=this;setTimeout(function(){b._isPauseAdInfoOk||(debug.log("pause ad info timeout"),b.reportTime("adinfo",-1),b.dispatch({type:ADConstant.PAUSE_AD_INFO_TIMEOUT,data:{timeout:8E3}}))},8E3)},recordTime:function(a){null== this._timearr&&(this._timearr={});this._timearr[a]=(new Date).getTime()},reportTime:function(a,b,d){null==this._timearr&&(this._timearr={});b=b||(new Date).getTime()-this._timearr[a];this.player._reporter.sendUepReport({adinfo:"valfload",advideo:"adload"}[a],b,d)},backAd:function(){this._param.fu=this.player.controls.fullscreenPanel.fullFlag();this._param.p=9;this._param.callback=ADConstant.AdPluginObject+".adParse";this._param.ctu=0;var a=ADConstant.BACK_REQUEST_BASE+n(this._param)+"&ti="+this._ti+ "&k="+this._k;x(a);var b=this;setTimeout(function(){b._isAdInfoOk||(debug.log("adinfo timeout"),b.dispatch({type:ADConstant.BACK_AD_INFO_TIMEOUT,data:{timeout:5E3}}))},5E3)},insertAd:function(){this._param.ps=0;this._param.pt=0}};var H=function(a,b){this.adplayer=a;this.addata=b;"undefined"==typeof b.curnum&&(this.addata.curnum=0)};H.prototype={sendSUS:function(){var a=this.addata.info.VAL[this.addata.curnum].SUS;if("undefined"!=typeof a)for(var b=0;b vc = "+d+""),y(d,"js"))},sendVC:function(){var a=this.addata.info.VAL[this.addata.curnum];"undefined"!=typeof a.VT&&y(a.VC,"js")},sendSUS_:function(){var a=this.addata.info,b=this.addata.curnum+2,d=a["A"+b].ATMSU,f=a["A"+b].ISOSU;e.Log(a["A"+ b].SU);e.Log(d);e.Log(f)},sendSUE:function(){var a=this.addata.info.VAL[this.addata.curnum].SUE;if("undefined"!=typeof a)for(var b=0;b=parseInt(b)&&(a=this.addata.info["A"+curnum].CMU,e.Log(this.addata.info["A"+curnum].MU),e.Log(a))},sendCUM:function(){var a=this.addata.info.VAL[this.addata.curnum].CUM;if("undefined"!=typeof a)for(var b=0;b=d)d=1;this.info.VAL[0].W=a*d;this.info.VAL[0].H=c*d;debug.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(){b.hide(this.adpause)},play:function(){2!=this.info.VAL[0].VT&& (b.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)&&y(this.info.VAL[0].VC,"js")}};var na=function(a,b){this._handler={};this.player=a;this.video=this.player.video;this.controls=this.player.controls;this._adplugin=this.player._adplugin;this._adplugin.adplayer=this;this._addata=b.data.info;this.video.preload="none";this.video.src=this._addata.VAL[0].RS; debug.log("ad src="+this.video.src);this.video.style.display="block";this._playTag=[];this.bindAdEvent();this._adreporter=new H(this,{curnum:0,info:this._addata})};na.prototype={addEventListener:function(a,b){this._handler[a]=b},removeEventListener:function(a){this._handler[a]=null},dispatch:function(a){a&&this._handler[a.type]&&(a._target=this,this._handler[a.type](a))},bindAdEvent:function(){this.bind_fadtoplay=b.bindAsEventListener(this,this.onPlayClick);this.bind_fadplay=b.bindAsEventListener(this, this.onAdPlay);this.bind_fadended=b.bindAsEventListener(this,this.onAdEnded);this.bind_faderror=b.bindAsEventListener(this,this.onAdError);this.bind_fadpause=b.bindAsEventListener(this,this.onAdPause);this.bind_fadsuspend=b.bindAsEventListener(this,this.onAdSuspend);this.bind_fadstalled=b.bindAsEventListener(this,this.onAdStalled);this.bind_fadwaiting=b.bindAsEventListener(this,this.onAdWaiting);this.bind_fadloadedmetadata=b.bindAsEventListener(this,this.onAdLoadedMetaData);this.bind_fadtimeupdate= b.bindAsEventListener(this,this.onAdTimeUpdate);b.addEventHandler(this.video,"play",this.bind_fadplay);b.addEventHandler(this.video,"error",this.bind_faderror);b.addEventHandler(this.video,"pause",this.bind_fadpause);b.addEventHandler(this.video,"suspend",this.bind_fadsuspend);b.addEventHandler(this.video,"stalled",this.bind_fadstalled);b.addEventHandler(this.video,"waiting",this.bind_fadwaiting);b.addEventHandler(this.video,"loadedmetadata",this.bind_fadloadedmetadata);b.addEventHandler(this.video, "timeupdate",this.bind_fadtimeupdate);this.shadow=this.controls.buttons.shadow;this.videobtn=this.controls.buttons.videobtn;b.addEventHandler(this.videobtn,"click",this.bind_fadtoplay,!0)},removeAdEvent:function(){b.removeEventHandler(this.video,"play",this.bind_fadplay);b.removeEventHandler(this.video,"ended",this.bind_fadended);b.removeEventHandler(this.video,"error",this.bind_faderror);b.removeEventHandler(this.video,"pause",this.bind_fadpause);b.removeEventHandler(this.video,"suspend",this.bind_fadsuspend); b.removeEventHandler(this.video,"stalled",this.bind_fadstalled);b.removeEventHandler(this.video,"waiting",this.bind_fadwaiting);b.removeEventHandler(this.video,"timeupdate",this.bind_fadtimeupdate);b.removeEventHandler(this.video,"loadedmetadata",this.bind_fadloadedmetadata);b.removeEventHandler(this.videobtn,"click",this.bind_fadtoplay,!0)},onPlayClick:function(){this.video.play()},play:function(){this.video.load();this.video.play()},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 a=this;this._timelist=[];this._checkTimer=setInterval(function(){if(a.video.paused)a.onAdPause();else a._timelist.push(a.video.currentTime),3<=a._timelist.length&&(1>Math.abs(a._timelist[0]-a._timelist[2])&&(debug.log("ad unexpected pause"),a.video.play(),0==a.leftSecond()&&(debug.log("exception left = 0 "),a.onAdEnded())),a._timelist= [])},1E3)}},onAdPlay:function(){this.checkPause();var a=this.controls.container.poster;b.hide(this.controls.buttons.videobtn);b.hide(a);b.hide(b.get(".x-video-info"));this.video.style.display="block";this._adplugin.setLeftSecond(this.leftSecond());var c=this;setTimeout(function(){debug.log("ad media timeout check begin = "+c._adBegin);c._adBegin||(c.removeAdEvent(),c._adplugin.hide(),c._adplugin.reportTime("advideo",-1,!1),c.dispatch({type:ADConstant.AD_ERROR,data:!0}))},15E3);this._playTag[0]||(this._playTag[0]= !0,this._adfirsttu=!1,this._adplugin.recordTime("advideo"),l.appendItem("phase","adplay"))},uglyClose:function(){debug.log("united ugly close");this.onAdError()},onAdError:function(){this.removeAdEvent();this._adplugin.hide();this._adplugin.reportTime("advideo",-1,!1);this.clearTimer();this.dispatch({type:ADConstant.AD_ERROR,data:!0})},onAdEnded:function(){debug.log("united ad ended");this._adreporter.sendSUE();this.removeAdEvent();this._adplugin.hide();this.clearTimer();this.dispatch({type:ADConstant.AD_END, data:!0});l.appendItem("phase","adend")},onAdPause:function(){this.player.video.ended||(b.show(this.controls.buttons.videobtn),b.hide(this.controls.buttons.shadow))},onAdSuspend:function(){debug.log("ad suspend")},onAdStalled:function(){debug.log("ad stalled")},onAdWaiting:function(a){this.controls.onWaiting(a)},onAdTimeUpdate:function(){if(this.video.currentTime>this._addata.VAL[0].AL)this.onAdEnded();else b.hide(this.controls.buttons.loading),this._adBegin= !0,b.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:ADConstant.UGLY_CLOSE_AD_HINT}))},onAdLoadedMetaData:function(){this._adBegin=!0},onAdClick:function(){this.video.pause();this._adreporter.sendUnitedCUM(this.video.currentTime|| 0);for(var a=this._addata.VAL[0].CU,b=this.video.currentTime,d=0;d
    '}, bindEvent:function(){this._videobtn=b.get(".x-video-button");b.addEventHandler(this._videobtn,"click",b.bindAsEventListener(this,this.redirect))},startPlay:function(a,c){b.v=a;b.videoInfo=c;b.videoInfo._playListData=a.data[0];this._pimg=b.get("#x-img");this._pimg.src=a.data[0].logo;this._title=b.get(".x-title");this._title.innerHTML=a.data[0].title;this._timespan=b.get(".x-time-span");this._timespan.innerHTML=b.getTime(a.data[0].seconds);b.show(b.get(".x-video-poster"));b.show(b.get(".x-video-info")); this.adapterForReport();this._reporter=new L(this,b.v,b.videoInfo._sid);this.bindEvent()},onPlayStart:function(){b.config.events&&b.config.events.onPlayStart&&(e.playerCurrentState=e.playerState.PLAYER_STATE_PLAYING,debug.log(e.playerCurrentState),debug.log("api:onplaystart"),b.config.events.onPlayStart())},getSrc:function(){if(this.src)return this.src;"m3u8"==b.config.content?this.src=b.videoInfo.src:null!=b.videoInfo._videoSegsDic&&null!=b.videoInfo._videoSegsDic[m]&&(this.src=b.videoInfo._videoSegsDic[m][0].src); return this.src},redirect:function(){var a=this.getSrc();debug.log("redirect play src="+a);e.isMIUI?window.location.href=a:window.open(a,"","",!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.sendCustomLoadedTime(1);this._reporter.sendClientConsumeReport()},adapterForReport:function(){this.controls= {fullscreenPanel:{fullFlag:function(){return 1}}};this.video={src:this.getSrc()};this.getQuality=function(){return"m"}}};y("http://player.youku.com/h5player/play.css?ver="+VER.replace(/[-:]/g,""),"css");var R=function(a){this._id=a.id;this._pid=a.pid||"";this._url=a.url;this._box=a.parentBox;this._gotInfo=!1;a.width=q(a.parentBox).offsetWidth;a.height=q(a.parentBox).offsetHeight;b.config=a;this.request()};R.prototype={request:function(){window.pkinfo=this;x(this._url+"/h5/videos/play.json?vid="+this._id+ "&pid="+this._pid+"&callback=pkinfo.parse");var a=this;setTimeout(function(){!0!=a._gotInfo&&a.showError()},5E3)},parse:function(a){this._gotInfo=!0;0==a.error?(this.videoSrc=a.results.url,this.imgSrc=a.results.cover,this.buildDom()):this.showError()},buildDom:function(){var a="
    ";this.$(this._box).innerHTML=a+"
    ";this.video=b.get(".x-video-player");this.cover=b.get(".x-video-poster");this.videoBtn=b.get(".x-video-button");this.loading=b.get(".x-video-loading");b.addEventHandler(this.videoBtn,"click",b.bindAsEventListener(this,this.onOverBtnClick));b.addEventHandler(this.video,"ended",b.bindAsEventListener(this, this.onEnded));b.addEventHandler(this.video,"timeupdate",b.bindAsEventListener(this,this.onTimeUpdate));b.addEventHandler(this.video,"waiting",b.bindAsEventListener(this,this.onWaiting))},showError:function(){this.$(this._box).innerHTML='
    \u89c6\u9891\u4fe1\u606f\u51fa\u9519\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5
    '},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(a){return e.isIPAD&& 0<=window.location.href.indexOf("v.youku.com")?"x-player":200>=a?"x-player x-player-200":300>=a?"x-player x-player-200-300":660>=a?"x-player x-player-300-660":800>=a?"x-player x-player-660-800":"x-player"},$:function(a){return document.getElementById(a)}};var oa=function(a,c){this.setting={debug:!1,controls:b.get(".x-console"),feedback:b.get(".x-feedback"),container:{poster:b.get(".x-video-poster")},buttons:{pointVideo:b.get("#point-video"),playControl:b.get(".x-play-control"),play:b.get("#x-playbtn"), videobtn:b.get(".x-video-button"),loading:b.get(".x-video-loading"),videoinfo:b.get(".x-video-info"),shadow:b.get(".x-trigger"),currentTime:b.get(".x-time-current"),totalTime:b.get(".x-time-duration"),fullscreen:b.get(".x-fullscreen")},classNames:{play:"x-playing",pause:"x-pause"},init:function(){}};b.extend(this.setting,c);this.player=a;this.dashboard=this.setting.controls;this.container=this.setting.container;this.progressBar=new ea(a);this.progressBar.uCurrentTime=this.setting.buttons.currentTime; this.miniProgressBar=new aa(a);this.fullscreenPanel=new X(a);this.interactionPanel=new Z(a);this.xplayer=b.get("#x-player");this.buttons=this.setting.buttons};oa.prototype={init:function(a,c){this.buttons.totalTime.innerHTML=c.totalTime?b.getTime(c.totalTime):"00:00";this.resetProgress();this.buttons.play.className=this.setting.classNames.play;var d=this.container.poster.getElementsByTagName("img")[0];b.config.poster?d.src=b.config.poster:a.data[0].trial||-6==a.data[0].error_code?(this.container.poster.style.backgroundColor= "black",d.parentNode.removeChild(d),b.show(this.container.poster)):(d.src=a.data[0].logo,this.container.poster.style.display="block");this._qualityPanel=new ha(this.player,a);this._languagePanel=new $(this.player,a);this._playratePanel=new da(this.player,a);this._payPanel=new ba(this.player,a);this._feedbackPanel=new K(this.player,a);this._informationPanel=new Y(this.player,a);this.tipPanel=new ka(this.player,a);this.showlistPanel=new ja(this.player,a);this.playLimit=new ca(this.player,a);this.bindDynamicEvent()}, bindDynamicEvent:function(){this.bind_mutualHide=b.bindAsEventListener(this,this.mutualHide);b.addEventHandler(this._languagePanel,"click",this.bind_mutualHide);b.addEventHandler(this._qualityPanel,"click",this.bind_mutualHide);b.addEventHandler(this.showlistPanel,"click",this.bind_mutualHide);b.addEventHandler(this._playratePanel,"click",this.bind_mutualHide);this.bind_progress=b.bindAsEventListener(this,this.onProgress);b.addEventHandler(this.progressBar,"progressing",this.bind_progress);b.addEventHandler(this.progressBar, "progressend",b.bindAsEventListener(this,this.onProgressEnd));b.addEventHandler(this._languagePanel,"settingdone",b.bindAsEventListener(this,this.onSettingDone));b.addEventHandler(this._qualityPanel,"settingdone",b.bindAsEventListener(this,this.onSettingDone));b.addEventHandler(this._playratePanel,"settingdone",b.bindAsEventListener(this,this.onSettingDone));b.addEventHandler(this._languagePanel,"settingshow",b.bindAsEventListener(this,this.onSettingShow));b.addEventHandler(this._qualityPanel,"settingshow", b.bindAsEventListener(this,this.onSettingShow));b.addEventHandler(this._playratePanel,"settingshow",b.bindAsEventListener(this,this.onSettingShow));b.addEventHandler(this._languagePanel,"settinghide",b.bindAsEventListener(this,this.onSettingHide));b.addEventHandler(this._qualityPanel,"settinghide",b.bindAsEventListener(this,this.onSettingHide));b.addEventHandler(this._playratePanel,"settinghide",b.bindAsEventListener(this,this.onSettingHide));b.addEventHandler(this.fullscreenPanel,"enterfullscreen", b.bindAsEventListener(this,this.onEnterFullScreen));b.addEventHandler(this.fullscreenPanel,"exitfullscreen",b.bindAsEventListener(this,this.onExitFullScreen))},retimer:function(){debug.log("retimer");this.autoHideDashBoard()},hideDashBoard:function(){var a=this._payPanel,b=this._informationPanel,d=this.miniProgressBar,e=this.interactionPanel,k=this._languagePanel;this.setting.controls.style.display="none";d.show();a.hide();b.hide();e.hideStatus();k.hide();this._qualityPanel.hide();this._playratePanel.hide()}, autoHideDashBoard:function(a){this.dashboardTimer&&clearTimeout(this.dashboardTimer);var c=this;this.dashboardTimer=setTimeout(function(){"block"==b.get(".x-showlist").style.display?c.autoHideDashBoard(a):c.player.video.paused||c.hideDashBoard()},a||2E3)},onMultiTouch:function(){},showUglyHint:function(){},closeUglyHint:function(){},showBoardInfo:function(){b.show(this.setting.controls);this.miniProgressBar.hide();this._informationPanel.show();this._payPanel.hasPayInfo()&&this._payPanel.show()},toggleDashBoard:function(a){if(!("touchend"== a.type&&1a.scale&&!b)a.method="m",this.fullscreenPanel.switchFullScreen(a)}, toggleVolume:function(){},changeVolume:function(){},rePlay:function(){debug.log("replay");this.player._reporter.sendUserActionReport("xrp","c");w=!1;(this._recommend=b.get(".x-recommend"))&&b.get("#x-player").removeChild(this._recommend);this.resetProgress();this._first=!1;this.player.replay();debug.log("replay func end")},redirect:function(a){this.player.redirect(a)},hideFacade:function(){var a=this.container.poster;b.hide(this.buttons.videobtn);b.hide(a);b.hide(b.get(".x-feedback"));debug.log("hide facade")}, onVideoBtnTouchStart:function(a){this._vtsx=a.targetTouches[0].clientX;this._vtsy=a.targetTouches[0].clientY},onVideoBtnTouchEnd:function(a){debug.log("video btn clicked");a=a||{};w?this.rePlay():a&&a.changedTouches&&50= a&&d.offsetHeight>=c},isNeedPauseAd:function(){return this.player.video.paused&&b.isLandScape()},checkPauseAd:function(){this.isNeedPauseAd()?(this._pauseAdPlugin=new N(this.player,b.v,b.videoInfo._sid),this._pauseAdPlugin.addEventListener(ADConstant.PAUSE_AD_INFO_OK,b.bindAsEventListener(this,this.onPauseAdInfoOK)),this._pauseAdPlugin.addEventListener(ADConstant.PAUSE_AD_INFO_TIMEOUT,b.bindAsEventListener(this,this.onPauseAdInfoTimeout)),this._pauseAdPlugin.addEventListener(ADConstant.PAUSE_AD_INFO_ERROR, b.bindAsEventListener(this,this.onPauseAdInfoERROR)),window[ADConstant.AdPluginObject]=this._pauseAdPlugin,this._pauseAdPlugin.pauseAd(),debug.log("send pause ad request
    ")):(debug.log(" donot need pause ad "),this.hidePauseAd())},hidePauseAd:function(){b.hide(b.get(".x-ad-pause"))},onPauseAdInfoOK:function(a){debug.log("pause info ok");this._pauseAdStart||(this._pauseAdStart=!0);this._pauseAdPlayer=new ma(this.player,a);this._pauseAdPlayer.play()},onPauseAdInfoTimeout:function(a){debug.log("pause info timeout = "+ a.data.timeout);this._pauseAdStart||(this._pauseAdStart=!0)},onPauseAdInfoERROR:function(){debug.log("pause info error no info");this._pauseAdStart||(this._pauseAdStart=!0)},autoShow:function(){this.show();var a=this;setTimeout(function(){a.hide()},5E3)},mutualHide:function(a){a._target==this._languagePanel?(this._qualityPanel.hide(!0),this._playratePanel.hide(!0),this.showlistPanel.hide()):a._target==this._qualityPanel?(this._languagePanel.hide(!0),this._playratePanel.hide(!0), this.showlistPanel.hide()):a._target==this.showlistPanel?(this._qualityPanel.hide(!0),this._languagePanel.hide(!0),this._playratePanel.hide(!0)):a._target==this._playratePanel&&(this._qualityPanel.hide(!0),this._languagePanel.hide(!0),this.showlistPanel.hide())},show:function(a){a?b.show(this.buttons[a]):b.show(this.setting.controls)},hide:function(a){a?b.hide(this.buttons[a]):b.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==b.v.data[0].trial&&!1!=b.initConfig.show_related&&(this._relatedPanel=new ia(this.player,b.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=b.get(".x-recommend"))&&b.get("#x-player").removeChild(this._recommend);w=!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;b.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(){debug.log("try end");var a=this.player.video;this.player.video.pause();this._payPanel.activeTime=0;w=!0;this.onEnded({target:a});this._payPanel.showTip();var b=this;setTimeout(function(){b.dashboard.style.display="none";b.buttons.shadow.style.display="none";b.interactionPanel.hide()},1E3)},onTimeUpdate:function(a){this.buttons.loading.style.display= "none";if(a.target==this.player.video){var b=this.player.currentTime;4==a.target.readyState&&this.setProgress(b);if(this._payPanel.hasPayInfo()&&b>=this._payPanel.tryDuration())this.onTryPlayEnded();this.playLimit.isLimit()&&b>=this.playLimit.limitTime()&&this.playLimit.create()}},checkPlayLimit:function(){return this.playLimit.isLimit()?(this.playLimit.create(),!0):!1},removeControls:function(){this.video.controls=!1},loadControls:function(){this.video.controls=!0},setProgress:function(a){a=Math.min(Math.max(a, 0),b.videoInfo.totalTime);this.progressBar.setProgress(a);this.miniProgressBar.setProgress(a);this.buttons.currentTime.innerHTML=b.getTime(this.progressBar.playTime)},resetProgress:function(){this.progressBar.resetProgress();this.miniProgressBar.resetProgress();this.buttons.currentTime.innerHTML="00:00"},hideTimeTip:function(a){if(a.srcElement.id==this.buttons.progressHandler.id)return!1;this.buttons.progressTime.style.display="none"},showTimeTip:function(a){if(a.srcElement.id==this.buttons.progressHandler.id|| a.srcElement.id==this.buttons.progressTime.id||a.srcElement.id==this.buttons.pointVideo.id)return!1;a=a.offsetX/this.buttons.progressBar.offsetWidth;this.buttons.progressTime.innerHTML=b.getTime(a*b.videoInfo.totalTime);this.buttons.progressTime.style.left=100*Math.min(Math.max(a,0.023),0.977)+"%";this.buttons.progressTime.style.display="block"},shadowTouchStart:function(a){1d?1:-1);1==this._stmlrtag&&a.preventDefault();if(1!=this._sactionType)if(100d&&500>e)debug.log("quick seek moving"),this.player.video.pause(),this._sactionType=1,e=this._smx>this._sx?30:-30,this.interactionPanel.setTip(this._stime,e),this.interactionPanel.show();else if(200>b&&(100>d&&1E3d||this._stmtag)debug.log("stmtag ="+this._stmtag),this._sactionType= 2,this._stmtag=!0,this.player.video.pause(),this.dragging(a)}},shadowTouchEnd:function(a){1Math.abs(this._smx-this._sx)?"xdud":"xdlr",debug.log("shadow action = "+a),this.player._reporter.sendUserActionReport(a,"d"),2==this._sactionType?(debug.log("
    normal seek"),this.player.video.play(), this.player.seek(this._ttime),this.interactionPanel.hide(),this.player._reporter.sendUserActionReport("xtseek","d"),e.Log(e.uniplayerUrl+r({e:"xtseek",adr:e.isAndroid,ios:e.isIPAD,d:parseInt(this._ttime-this._stime)}))):1==this._sactionType&&(a=0quick seek deltat = "+a+" cur="+this._stime+""),this.setProgress(this._stime+a),this.interactionPanel.setTip(this._stime,a),this.interactionPanel.show(),this.interactionPanel.autoHide(),this.player.video.play(), this.player.seek(this._stime+a),this.player._reporter.sendUserActionReport("xqseek","d"),e.Log(e.uniplayerUrl+r({e:"xqseek",adr:e.isAndroid,ios:e.isIPAD,d:a})),debug.log("
    "))))},dragging_:function(a){var c=this._smx-this._presmx;this._deltaxs.push(10setting show");clearTimeout(this.pbarClickTimer);this.progressBar.removeClickEvent()},onSettingHide:function(){debug.log("setting hide");var a=this;this.pbarClickTimer=setTimeout(function(){a.progressBar.addClickEvent()},1E3)},onEnterFullScreen:function(){e.isIPAD&&b.addClass(this.setting.controls,"x-fs-console")},onExitFullScreen:function(){e.isIPAD&&b.removeClass(this.setting.controls, "x-fs-console")},adrAdapt:function(a){e.isAndroid&&(this._smx=a.changedTouches[0].clientX,this._smy=a.changedTouches[0].clientY,debug.log("
    adr smy= "+this._smy+" y = "+this._sy))},isShadowTouchTooShort:function(a){return this.isTouchTooShort({x:this._sx,y:this._sy},{x:this._smx,y:this._smy},a)},isTouchTooShort:function(a,b,d){var e=Math.abs(b.x-a.x),e=e||1.0E-6,a=(a=Math.abs(b.y-a.y))||1.0E-6;debug.log(e+","+a);d=d||100;return e=a||this.tipPanel.showLastTimeTip(a)},uiInit:function(){debug.log("uiInit");w&&(w=!1,this.buttons.videobtn.style.display="block")},onResize:function(a){var c=q(b.config.parentBox).offsetWidth,d=q(b.config.parentBox).offsetHeight;if(c&&(d&&b.resizeTag)&&(d=this.xplayer.className,this.xplayer&&(-1===d.indexOf("fullscreen")?this.xplayer.className=z(c):(c=window.innerWidth,this.xplayer.className=z(c)+" x-player-fullscreen")), this._relatedPanel))this._relatedPanel.onResize(a)}};var O=function(){this.video=b.get("#youku-html5player-video");this._startPlayTime=-1;this.currentTime=this._waitTry=0};O.prototype={getVideo:function(){return this.video},show:function(){b.show(this.video)},hide:function(){b.hide(this.video)},play:function(){b.v&&b.v.data[0].trial&&0==b.v.data[0].trial.time?debug.log(" trial time = 0 "):this.video.play()},pause:function(){this.video.pause()},setupControls:function(a){this.controls&&this.controls.removeEvent(); return new oa(a)},hideControls:function(){this.controls.hide()},showControls:function(){this.controls.show()},removeControls:function(){this.controls.removeControls()},loadControls:function(){this.controls.loadControls()},retry:function(){},showError:function(a){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=a;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);e.uniReport({error:10,vid:b.v.data[0].videoid,time:this.currentTime,errorcode:this.video.error.code,ua:escape(navigator.userAgent.replace(/[\/\+\*@\(\)\,]/g,""))});e.sendErrorReport(2001); if(0<=this._retry--)-1!==this.video.src.indexOf("m3u8")&&(this.video.src=b.m3u8src_v2(b.v.data[0].videoid,b.defaultVideoType)),debug.log("video onerror retry it ,time="+this.currentTime+" src="+this.video.src),this.video.load(),this.video.play(),this.seek(this.currentTime);else if(!(this.isOnePiece()&&!0==this.controls.checkPlayLimit())&&!this._errorTag){e.uniReport({error:11,errorcode:this.video.error.code,vid:b.v.data[0].videoid,ua:escape(navigator.userAgent.replace(/[\/\+\*@\(\)\,]/g,""))});this._errorTag= !0;if(b.playerEvents&&b.playerEvents.onPlayError)b.playerEvents.onPlayError("\u62b1\u6b49\uff0c\u89c6\u9891\u51fa\u9519\uff0c\u8bf7\u5237\u65b0");var a=b.get("#x-player");a.innerHTML="\u62b1\u6b49\uff0c\u89c6\u9891\u51fa\u9519\uff0c\u8bf7\u5237\u65b0";a.style.textAlign="center";a.style.color="white";a.style.lineHeight=a.offsetHeight+"px"}},onPause:function(){this.controls.onPause()},onPlayIPH:function(){debug.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(){debug.log("onplay");this.controls.onPlay();this._firstPlayTag||(this._firstPlayTag=!0,this.onPlayStart(),b.initConfig.firsttime?(debug.log("starttime = "+b.initConfig.firsttime),this.seek(b.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());l.appendItem("phase","videoplay")},onVolumeChange:function(){},onPlaying:function(){},onStalled:function(a){debug.log("stalled");if(this.isOnePiece()||a.target==this.video)this.controls.onWaiting(a)},onSuspend:function(){},onWaiting:function(a){if(this.isOnePiece()||a.target==this.video)this.controls.onWaiting(a)},onSeeked:function(){debug.log("onSeeked waitSkip="+this._waitSeek+" try= "+this._waitTry); if(!isNaN(this._waitSeek)){var a=this._waitSeek;10=this._waitTry?(this._waitTry+=1,this.seek(a)):this._waitSeek="NaN"}},onSeeking:function(a){debug.log("seeking");if(this.isOnePiece()||a.target==this.video){var b=this;setTimeout(function(){b.controls.onWaiting(a)},100)}},onDurationChange:function(){},onProgress:function(){},onRateChange:function(){},customWaiting:function(){var a=this;!1==this.video.paused&&this._lastTime===this.currentTime&&(debug.log("custom waiting!:) networkstate="+ this.video.networkState),this.controls.onWaiting());this._lastTime=this.currentTime;setTimeout(function(){a.customWaiting()},5E3)},sendLoadedTime:function(){var a=0,a=-1==this._startPlayTime?0:(new Date).getTime()-this._startPlayTime;this._reporter.sendLoadedTime(a)},onTimeUpdate:function(a){if(this.isOnePiece())this.currentTime=this.video.currentTime,b.unitedTag&&(this.currentTime-=b.unitedTag.offset);else{for(var c=0,d=0;d=b&&(this.video.load(),this.play(),this.timeoutTimer=setTimeout(function(){d.detectIsPlaying(++b)},1E3))},isOnePiece:function(){return"m3u8"== b.config.content||"mp4"==b.config.content&&1==b.videoInfo._videoSegsDic[m].length},bindEvent:function(){if(!b.v.data[0].error_code&&!b.v.data[0].error)if("directsrc"==b.config.playType&&!1==b.isWeixin)b.addEventHandler(this.video,"play",b.bindAsEventListener(this,this.onPlayIPH)),b.addEventHandler(this.video,"timeupdate",b.bindAsEventListener(this,this.onTimeUpdateIPH)),b.addEventHandler(this.video,"ended",b.bindAsEventListener(this,this.onEndedIPH)),b.addEventHandler(this.video,"webkitendfullscreen", b.bindAsEventListener(this,this.onEndFullscreen));else{var a={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"},c;for(c in a)b.addEventHandler(this.video,c,b.bindAsEventListener(this,this[a[c]]))}}};var s=-1,w=!1,m=null,fa=0,ga=600,u={flvhd:"\u6807\u6e05",flv:"\u6807\u6e05",mp4:"\u9ad8\u6e05",hd2:"\u8d85\u6e05"};b.WIN_TYPE=30;b.defaultVideoType="mp4";b.resizeTag=!0;b.extend=function(a,b){for(var d in b)a[d]=b[d]};b.inherits=function(a,b){var d=function(){};d.prototype=b.prototype;a.prototype=new d;a.prototype.constructor=a};b.bind=function(a,b){return function(){return b.apply(a, arguments)}};b.bindAsEventListener=function(a,b){var d=Array.prototype.slice.call(arguments).slice(2);return function(e){return b.apply(a,[e||window.event].concat(d))}};b.getCurrentStyle=function(a){return a.currentStyle||document.defaultView.getComputedStyle(a,null)};b.addEventHandler=function(a,c,d,e){b.config.isMobile&&("click"==c&&!e)&&(c="touchend");a.addEventListener?a.addEventListener(c,d,!1):a.attachEvent?a.attachEvent("on"+c,d):a["on"+c]=d};b.removeEventHandler=function(a,c,d,e){b.config.isMobile&& ("click"==c&&!e)&&(c="touchend");a.removeEventListener?a.removeEventListener(c,d,!1):a.detachEvent?a.detachEvent("on"+c,d):a["on"+c]=null};b.show=function(a){a.style.display="video"===a.tagName.toLowerCase()?"":"block"};b.hide=function(a){a&&(a.style.display="none")};b.getLeftPosition=function(a){for(var b=a.offsetLeft;a.offsetParent;)a=a.offsetParent,b+=a.offsetLeft;return b};b.get=function(a){return document.querySelector(a)};b.pieceLength=function(){return"m3u8"==b.config.content?1:b.videoInfo._videoSegsDic[m].length}; b.multiPieceSrc=function(a){return a>=b.videoInfo._videoSegsDic[m].length?"":b.videoInfo._videoSegsDic[m][a].src};b.getTime=function(a){if(!a)return"00:00";var b=Math.floor(a),a=b%60,b=Math.floor(b/60);return(10>b?"0"+b:b)+":"+(10>a?"0"+a:a)};b.addClass=function(a,c){b.hasClass(a,c)||(a.className+=" "+c)};b.hasClass=function(a,b){return RegExp("(^| )"+b+"( |$)").test(a.className)};b.removeClass=function(a,b){a.className=a.className.replace(RegExp("(^| )"+b+"( |$)")," ").replace(/^\s+|\s+$/g,"")}; b.m3u8src=function(a,b){var d="http://v.youku.com/player/getM3U8/vid/"+a+"/type/"+b+"/ts/"+parseInt((new Date).getTime()/1E3);if(e.isIPHONE||e.isIPOD)d+="/useKeyFrame/0";return d+"/v.m3u8"};b.m3u8src_v2=function(a,c){if(b.OLD_M3U8)return b.m3u8src(a,c);var d={vid:a,type:c,ts:parseInt((new Date).getTime()/1E3),keyframe:e.isIPHONE?0:1};b.password&&(d.password=b.password);b.password&&(b.initConfig.client_id&&b.config.partner_config&&1==b.config.partner_config.status&&1==b.config.partner_config.passless)&& (d.client_id=b.initConfig.client_id);var f=encodeURIComponent(E(F(G(b.mk.a4+"poz"+e.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(),e.userCache.sid+"_"+a+"_"+e.userCache.token)));d.ep=f;d.sid=e.userCache.sid;d.token=e.userCache.token;d.ctype="12";d.ev="1";d.oip=b.v.data[0].ip;d="http://pl.youku.com/playlist/m3u8?"+n(d);""!=b.getUCStr(a)&&(d+=b.getUCStr(a));return d};b.isLandScape=function(){return 90==window.orientation|| -90==window.orientation};b.getUCStr=function(a){var c="";if("undefined"!=typeof getUCSecret)a=getUCSecret(a),c+="&xk="+a;else if("undefined"!=typeof uckey)var d=uckey.getUCKey(a),c=c+("&vid="+a+"&uc_param_str=xk&xk="+d);else!0==b.isUCBrowserAndValidVersion()&&(c+="&vid="+a+"&uc_param_str=xk");return c};b.isUCBrowserAndValidVersion=function(){var a=navigator.userAgent,b=a.search(/ucbrowser/i);return-1!=b&&9.8<=parseFloat(a.substr(b+10,4))?!0:!1};var q=function(a){return document.getElementById(a)}; YoukuHTML5Player=function(a,c){null==a.parentBox&&(a.parentBox="parentBox");a.expand&&0';e="";b.isWeixin&&(e="webkit-playsinline");d.innerHTML=playerDom+"

    \u8be6\u7ec6\u4e86\u89e3
    00:00/00:00
    '; O.apply(this,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()};b.inherits(YoukuHTML5Player,O);b.extend(YoukuHTML5Player.prototype,{startPlay:function(a,c,d){if(a&&(a.data&&a.data[0])&&(a.data[0].show=a.data[0].show||{},c.abstarttime=(new Date).getTime(),c._playListData=a.data[0],c._user=a.user,b.v=a,b.videoInfo=c,this.setting={},b.extend(this.setting,d), !a.data[0].error_code&&!a.data[0].error||!this.processError(a,c,d)))if(this._reporter=new L(this,b.v,b.videoInfo._sid),this.controls=this.setupControls(this),this.controls.init(b.v,b.videoInfo),this.mpieceReport(),this.createIdNode(),this.isNeedAdRequest())this.processAd();else if(this.controls.bindVideoBtnEvent(),this.realStartPlay(),1==b.initConfig.ucautoplay)this.controls.onVideoBtnClick({})},isNeedAdRequest:function(){"undefined"==typeof this._frontAdTag&&(this._frontAdTag=!1);e.isNeedFrontAd= !this._frontAdTag&&"directsrc"!=b.config.playType&&!b.v.data[0].trial;return e.isNeedFrontAd},processAd:function(){if(this.isNeedAdRequest()&&(this._frontAdTag=!0,this._adplugin=new N(this,b.v,b.videoInfo._sid),this.bind_frontAd=b.bindAsEventListener(this,this.onFrontAdInfoOK),this.bind_frontAdInfoTimeout=b.bindAsEventListener(this,this.onFrontAdInfoTimeout),this._adplugin.addEventListener(ADConstant.FRONT_AD_INFO_OK,this.bind_frontAd,!1),this._adplugin.addEventListener(ADConstant.FRONT_AD_INFO_TIMEOUT, this.bind_frontAdInfoTimeout),this.bind_unitedFrontAd=b.bindAsEventListener(this,this.onUnitedFrontAdInfoOK),this._adplugin.addEventListener(ADConstant.FRONT_AD_UNITED_INFO_OK,this.bind_unitedFrontAd,!1),this.bind_backAdInfoOK=b.bindAsEventListener(this,this.onBackAdInfoOK),this.bind_backAdInfoTimeout=b.bindAsEventListener(this,this.onBackAdInfoTimeout),this._adplugin.addEventListener(ADConstant.BACK_AD_INFO_OK,this.bind_backAdInfoOK,!1),this._adplugin.addEventListener(ADConstant.BACK_AD_INFO_TIMEOUT, this.bind_backAdInfoTimeout),this.bind_uglyCloseAd=b.bindAsEventListener(this,this.onUglyCloseAd),this._adplugin.addEventListener(ADConstant.UGLY_CLOSE_AD,this.bind_uglyCloseAd),this.controls.bindAdVideoBtnEvent(),window[ADConstant.AdPluginObject]=this._adplugin,1==b.initConfig.ucautoplay))this.controls.onVideoBtnTouchEnd({})},requestAd:function(){this._adplugin&&this._adplugin.frontAd()},onUglyCloseHint:function(){this.controls.showUglyHint()},onUglyCloseAd:function(){debug.log("ugly close");this.controls.closeUglyHint(); this.adplayer.uglyClose()},onFrontAdInfoTimeout:function(){this._hasStartPlay=!0;this.realStartPlay(!0)},onUnitedFrontAdInfoOK:function(a){debug.log("on united front adinfo ok");var c=a.data.info;if(0==a.data.info.VAL.length)debug.log("onUnitedFrontAdInfoOK val length == 0 "),this.loadVTVC(a.data.vtvc),this.video.src=b.m3u8src_v2(b.v.data[0].videoid,b.defaultVideoType),this.unitedStartPlay(c,!0);else{this.adplayer=new na(this,a);var d=this;this.adplayer.addEventListener(ADConstant.AD_END, function(){debug.log("united ad end");d._realFlag||(d._realFlag=!0,d.adplayer.clearTimer(),d.unitedStartPlay(c))},!1);this.adplayer.addEventListener(ADConstant.AD_ERROR,function(){debug.log("united ad error");d._realFlag||(b.unitedTag=null,d._realFlag=!0,d.adplayer.clearTimer(),d.video.src=b.m3u8src_v2(b.v.data[0].videoid,b.defaultVideoType),d.unitedStartPlay(c,!0))},!1);this.adplayer.addEventListener(ADConstant.UGLY_CLOSE_AD_HINT,function(){debug.log("ugly hint"); d.onUglyCloseHint()},!1);this.adplayer.play();this.createIdNode()}},loadVTVC:function(a){for(var b=0;bad error");b._realFlag||(b._realFlag=!0,b.adplayer.clearTimer(),b.realStartPlay(a.data))},!1);this.adplayer.addEventListener(ADConstant.UGLY_CLOSE_AD_HINT,function(){debug.log("ugly hint");b.onUglyCloseHint()},!1);this.adplayer.play();this.createIdNode()}},onBackAdInfoTimeout:function(){debug.log("onBackAdInfoTimeout");this.showEndCard()}, onBackAdInfoOK:function(a){debug.log("onBackAdInfoOK");if(0==a.data.urls.length)this.showEndCard();else{this.adplayer=new M(this,a);var b=this;this.adplayer.addEventListener(ADConstant.AD_END,function(){b.showEndCard()});this.adplayer.addEventListener(ADConstant.AD_ERROR,function(){b.showEndCard()});this.adplayer.play()}},prepareVideoTag:function(){this.video.preload="none";"m3u8"==b.config.content?this.video.src=b.videoInfo.src:null!=b.videoInfo._videoSegsDic&&null!=b.videoInfo._videoSegsDic[m]&& (this.video.src=b.videoInfo._videoSegsDic[m][0].src);b.v.data[0].trial&&0==b.v.data[0].trial.time&&(this.video.src=null);this.createIdNode()},createIdNode:function(){if(!q(b.config.id)){var a=document.createElement("div");a.id=b.config.id;q(b.config.parentBox).appendChild(a)}},redirect:function(){var a="";"m3u8"==b.config.content?a=b.videoInfo.src:null!=b.videoInfo._videoSegsDic&&null!=b.videoInfo._videoSegsDic[m]&&(a=b.videoInfo._videoSegsDic[m][0].src);debug.log("redirect play src="+a);this._reporter.addPlayerStaticReport(); this._reporter.addPlayerDurationReport(59);this._reporter.sendVVLog(59);this._reporter.sendTSLog(60);this._reporter.sendUserActionReport("xps","c");window.open(a,"","",!1);this._reporter.sendClientConsumeReport();this.onPlayStart()},realStartPlay:function(a){debug.log("realStartPlay "+a);this.controls.bindEvent();this.bindEvent();this.prepareVideoTag();this.playVideos(a)},unitedStartPlay:function(a,c){debug.log("united start play ");b.unitedTag={offset:a.VAL.length?a.VAL[0].AL:0};this.controls.bindEvent(); this.bindEvent();if(!0===c)this.video.load(),this.video.play();else this.onPlay();this.controls.onPlay()},playVideos:function(a){debug.log("playVideos "+a);w=!1;s=0;this.video.style.display=(e.isIPHONE||e.isIPOD)&&null!=b.v.data[0].trial?"none":"block";if(b.config.autoplay||b.config.nextAutoPlay||a)debug.log("src= "+this.video.src+" auto = "+a),this.video.load(),this.video.play()},processError:function(a){var c=a.data[0].error_code;if(-12==c||-13==c)return a.data[0].error_code=null,a.data[0].error= null,a.data[0].trial={time:0},!1;b.hide(b.get(".x-video-poster"));this.feedbackPanel=new K(this,a);return!0},mpieceReport:function(){"mp4"==b.config.content&&(b.videoInfo._videoSegsDic&&null!=b.videoInfo._videoSegsDic[m]&&1=this.tryDuration:!1},replay:function(){s=0;this._ireflag=this._comscoreflag=!1;this._firstflag=e.adrPlayTrick=!1;this.video.style.display="block";this.isOnePiece()||(this.video.src=b.multiPieceSrc(s));e.isIPAD&&(this.video.src=b.m3u8src_v2(b.v.data[0].videoid,b.defaultVideoType),b.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(e.isAndroid)return!1;var a=b.v.data[0].lastpoint/1E3||-1,c=parseInt(l.getItem(b.v.data[0].videoid+"_playpoint"))||-1,d=-1;-1!=a&&-1!=c?(d=a,60>Math.abs(a-c)&&(d=c)):(d=a,-1==a&&(d=c));debug.log("lastpoint="+d);a=l.getItem("youku_ignore_lasttime");a=parseInt(a)||0;return-1!==d&&120<=d&&3>a&&null==b.v.data[0].trial&&!1==b.v.controller.xplayer_disable&&600<=b.v.data[0].seconds?(this.controls.showLastTimeTip(d),e.isAndroid&&(this._waitSeek= d),this.seek(d),!0):!1},clearLocalPlayPoint:function(){var a=b.v.data[0].videoid;clearTimeout(this._recordLPPTimer);l.removeItem(a+"_playpoint")},recordLocalPlayPoint:function(){var a=b.v.data[0].videoid,c=this.currentTime||0,d=this;this._recordLPPTimer=setTimeout(function(){d.recordLocalPlayPoint()},1E4);l.removeItem(a+"_playpoint");if(600<=b.v.data[0].seconds&&(c=c/1E3-10&&!this._tailTip)&&(debug.log("skiptail(act before 10) ="+c),this._tailTip=!0,this.controls.tipPanel.onSkipTail());-1!=c&&(a>=c/1E3&&!this._tailSkipped)&&(this._tailSkipped=!0,"true"==l.getItem("youku_conf_skip")&&this.seek(parseInt(b.v.data[0].seconds)-1))}},assistSkipTail:function(a){var c=parseInt((b.v.data[0].dvd|| {}).tail||-1);this._tailTip=a>=c/1E3?this._tailSkipped=!0:this._tailSkipped=!1},seek:function(a,c){a=a||0;a=Math.max(a,0);b.videoInfo.totalTime&&(a=Math.min(a,b.videoInfo.totalTime-5));this.isOutTryDuration(a)&&(a=this.tryDuration-1);this.assistSkipTail(a);var d=this;this.switchTimer&&clearTimeout(this.switchTimer);this.currentTime=a;if(this.isOnePiece()){var e=this.video.seekable;b.unitedTag&&(a+=b.unitedTag.offset);1==e.length&&aseekto callback(mayby play)"),b())}},multiSeekTo_:function(){debug.log("YoukuHTML5 ")}, multiSeekTo:function(a){debug.log("YoukuHTML5Player multiSeekTo !");for(var c=0,d=0,e=0,i=0;ia){d=i;e=g-(c-a);break}else if(c==a){d=i+1;e=0;break}}this.video.pause();if(d==s){debug.log(" piece time = "+e);try{this.video.currentTime=e}catch(h){}}else{s=d;var l=0,n=this;this.video.addEventListener("canplay",function(){1!==l&&(l=1,debug.log("canplay time="+e),n.video.currentTime=e)});this.video.src= b.multiPieceSrc(s);this.video.load()}this.video.play();this.video.style.display="block"},adjustVideoRatio:function(a){if(!e.isIOS){if(("onorientationchange"in window||"orientation"in window)&&!this._avrTag){this._avrTag=!0;var c=this;window.addEventListener("orientationchange",function(){!0===c.controls.fullscreenPanel.fullFlag()&&c.adjustVideoRatio()})}var c=this,d=this.video;setTimeout(function(){if(1===a)d.style.width="100%",d.style.height="100%",d.style.top=null,d.style.left=null;else{var c=b.get(".x-player"), c=c.offsetWidth/c.offsetHeight,e=d.videoWidth/d.videoHeight;isNaN(e)||isNaN(c)||!isFinite(c)||!isFinite(e)?(d.style.width="100%",d.style.height="100%",d.style.top=null,d.style.left=null):c i.mp4srcs.length||(clearInterval(i._tid),i.cleanSrc(),i.cache(),null==i._callback?e.GetMP4OK(i._v,i._videoInfo):i._callback(i._v,i._videoInfo))};window.QS=function(){for(var a={},b=window.location.search.substring(1).split("&"),d=0;d