zwplayer-vue2x 1.0.23 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,429 +1,435 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
typeof u&&u(
|
|
3
|
-
return!1}function Ra(
|
|
4
|
-
w.setUint16(22,1,!0);w.setUint32(24,16E3,!0);w.setUint32(28,32E3,!0);w.setUint16(32,4,!0);w.setUint16(34,16,!0);B(w,36,"data");w.setUint32(40,320,!0);let
|
|
5
|
-
|
|
6
|
-
B+u+y+F+J+w}function fb(
|
|
7
|
-
F.from=u(J[0].trim());F.to=u(J[1].trim());F.location=2;F.content=
|
|
8
|
-
1,
|
|
9
|
-
for(y++;y<
|
|
10
|
-
for(var w=1;40>=w;w++){var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ba=
|
|
17
|
-
if(
|
|
18
|
-
J);
|
|
19
|
-
|
|
1
|
+
(function(K){function Na(){return document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||!1}function bb(n,B,u){var y=new Date;y.setTime(y.getTime()+864E5*u);u="expires="+y.toGMTString();document.cookie=n+"="+B+"; "+u}function Ga(n,B,u){if(n){var y=parseInt(n.style.opacity)||1;y*=100;B=parseInt(B/50);0===B&&(B=1);var F=y/B;5>F&&(F=5);var J=setInterval(function(){0<y?(y-=F,0>y&&(y=0),n.style.opacity=y/100):(clearInterval(J),"function"==
|
|
2
|
+
typeof u&&u(n))},50);return J}return null}function Pa(n,B,u){if(n){var y=n.style.opacity;y*=100;B=parseInt(B/50);0===B&&(B=1);var F=(100-y)/B;5>F&&(F=5);var J=null;return J=setInterval(function(){100>y?(y+=F,100<y&&(y=100),n.style.opacity=y/100):(clearInterval(J),"function"==typeof u&&u(n))},50)}return null}function Qa(n,B){if(!n)return!1;if(n==B)return!0;var u=n.indexOf(B);if(0>u)return!1;if(0<u){if(" "==n.charAt(u-1)&&(n.length-u==B.length||" "==n.charAt(u+B.length)))return!0}else if(" "==n.charAt(B.length))return!0;
|
|
3
|
+
return!1}function Ra(n,B,u){var y=new XMLHttpRequest;y.onreadystatechange=function(){4===y.readyState&&(200<=y.status&&300>y.status||304===y.status?B(y.response):"function"===typeof u&&u(y))};y.open("GET",n,!0);y.send(null)}function cb(n){const B=function(J,w,I){for(var L=I.length,M=0;M<L;M++)J.setUint8(w+M,I.charCodeAt(M))};var u=function(){var J=new ArrayBuffer(364);let w=new DataView(J);B(w,0,"RIFF");w.setUint32(4,204,!0);B(w,8,"WAVE");B(w,12,"fmt ");w.setUint32(16,16,!0);w.setUint16(20,1,!0);
|
|
4
|
+
w.setUint16(22,1,!0);w.setUint32(24,16E3,!0);w.setUint32(28,32E3,!0);w.setUint16(32,4,!0);w.setUint16(34,16,!0);B(w,36,"data");w.setUint32(40,320,!0);let I=44;for(let L=0;160>L;L++)w.setInt16(I,15,!0),I+=2;J=new Uint8Array(J);return"data:audio/x-wav;base64,"+btoa(String.fromCharCode.apply(null,J))}(),y=new Audio(u),F=K.setTimeout(function(){F=0;"function"===typeof n&&n(!1)},500);y.play().then(function(){F&&K.clearTimeout(F);y.pause();n(!0)}).catch(function(J){F&&K.clearTimeout(F);"function"===typeof n&&
|
|
5
|
+
n(!1)})}async function db(n){navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({[n.type]:n})]).then(()=>{console.info("[setClipboard] clipboard suc")}).catch(B=>{console.error("[setClipboard] clipboard err",B)})}function eb(){var n=new Date,B=n.getMonth()+1;10>B&&(B="0"+B);var u=n.getDate();10>u&&(u="0"+u);var y=n.getHours();10>y&&(y="0"+y);var F=n.getMinutes();10>F&&(F="0"+F);var J=n.getSeconds();10>J&&(J="0"+J);var w=n.getMilliseconds();10>w?w="00"+w:100>w&&(w="0"+w);return""+n.getFullYear()+
|
|
6
|
+
B+u+y+F+J+w}function fb(n){var B={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},u=function(w){w=w.split(":");if(3!==w.length)return 0;var I=3600*parseInt(w[0],10),L=60*parseInt(w[1],10),M=parseInt(w[2],10),Q=w[2].indexOf(","),Y=0;0<Q&&(Y=parseInt(w[2].substr(Q+1))/1E3);return I+L+M+Y};n=n.replace(/\r/g,"");n=n.split("\n");for(var y=0;y<n.length-2;){var F={},J=n[y].trim();if(J){F.id=parseInt(J);J=n[y+1].split(" --\x3e ");if(2!==J.length)break;
|
|
7
|
+
F.from=u(J[0].trim());F.to=u(J[1].trim());F.location=2;F.content=n[y+2].trim();B.body.push(F);y+=3}else y++}return B}function Sa(n){var B={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},u=function(w){w=w.split(":");var I=0,L=0;if(3===w.length){I=3600*parseInt(w[0],10);L=60*parseInt(w[1],10);var M=parseInt(w[2],10)}else if(2===w.length)L=60*parseInt(w[0],10),M=parseInt(w[1],10);else if(1===w.length)M=parseInt(w[0],10);else return 0;var Q=w.length-
|
|
8
|
+
1,Y=w[Q].indexOf("."),ba=0;0<Y&&(ba=parseInt(w[Q].substr(Y+1))/1E3);return I+L+M+ba};n=n.replace(/\r/g,"");n=n.split("\n");if(2>n.length||"WEBVTT"!==n[0].substr(0,6)||0!==n[1].trim().length)return null;for(var y=2;y<=n.length-2;){var F={};if(!n[y].startsWith("NOTE")&&""!==n[y].trim()){var J=n[y].split(" --\x3e ");if(2!==J.length&&(J=n[y].trim(),F.id=parseInt(J),y++,J=n[y].split(" --\x3e "),2!==J.length)){y++;continue}F.from=u(J[0].trim());F.to=u(J[1].trim());F.location=2;y++;F.content=n[y].trim();
|
|
9
|
+
for(y++;y<n.length;){J=n[y].trim();if(!J)break;F.content+="<br/>"+J;y++}B.body.push(F)}y++}return B}function Ta(n){return!(!n.width()&&!n.height())&&"none"!==n.css("display")}function gb(n,B){var u="smilesFaces-view",y=Da.path+"widgets/smiles/p",F=$$(n);if(!F.hasClass("disabled")){u=F.attr("data-viewid");if(!F.attr("data-viewinit")&&0>=$$("#"+u).length){var J=F.closest(".zwp-barrage_form");n='<div id="'+u+'" style="position:absolute;display:none;z-index:1138;" class="zwp-smileview"><table border="0" cellspacing="0" cellpadding="0"><tr>';
|
|
10
|
+
for(var w=1;40>=w;w++){var I="[sm-"+w+"]";n+='<td><img src="'+y+w+'.png" onclick="insertSmile(this,\''+I+"');\" /></td>";0==w%8&&(n+="</tr><tr>")}J.append(n+"</tr></table></div>");F.attr("data-viewinit","1");$$(document).click(function(){$$("#"+u).hide()});$$(K).on("resize",function(){var Q=$$("#"+u);Ta(Q)&&(F.offset(),Q.outerHeight(!1),F.outerWidth(!1),Q.outerWidth(!1))})}var L=$$("#"+u);if(Ta(L))L.hide();else{F.offset();L[0].style.opacity=0;L[0].style.display="block";L.outerHeight(!1);F.outerWidth(!1);
|
|
11
|
+
L.outerWidth(!1);y=F.parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");L.get(0).inputbox=y.get(0);L.css({bottom:"36px",right:"26px"}).show();var M=function(){var Q=parseFloat(L[0].style.opacity);1>=Q&&(Q+=.1,1<Q&&(Q=1),L[0].style.opacity=Q,setTimeout(M,50))};setTimeout(M,50)}if(B=B||K.event)B.preventDefault?(B.preventDefault(),B.stopPropagation()):(K.event.cancelBubble=!0,K.event.returnValue=!1)}}function hb(n,B){if(n.dragableWinInited)"object"===typeof n.zwpDragable&&("oldX"in
|
|
12
|
+
n.zwpDragable&&(n.style.left=n.zwpDragable.oldX+"px"),"oldY"in n.zwpDragable&&(n.style.top=n.zwpDragable.oldY+"px"),"oldWidth"in n.zwpDragable&&(n.style.width=n.zwpDragable.oldWidth+"px"),"oldHeight"in n.zwpDragable&&(n.style.height=n.zwpDragable.oldHeight+"px"));else{var u='<div class="zwp-captionbar"><button class="closeBtn" title="'+(pa("closeSmallWindow","Close small window")+'"><i class="xicon xicon-close"></i></button></div><div class="zwp-gripper-right"></div><div class="zwp-gripper-bottom"></div><div class="zwp-gripper-bottom-right"></div>');
|
|
13
|
+
n.insertAdjacentHTML("beforeend",u);var y=function(M){M.stopPropagation();M.preventDefault();var Q=parseInt(n.offsetLeft),Y=parseInt(n.offsetTop),ba=M.pageX,Z=M.pageY,ha=K.innerWidth-n.offsetWidth-20,ma=K.innerHeight-n.offsetHeight-20,W=function(ia){var qa=Q+ia.pageX-ba;ia=Y+ia.pageY-Z;0>qa&&(qa=0);0>ia&&(ia=0);qa>ha&&(qa=ha);ia>ma&&(ia=ma);n.style.left=qa+"px";n.style.top=ia+"px";"object"===typeof n.zwpDragable&&(n.zwpDragable.oldX=qa,n.zwpDragable.oldY=ia)},ka=function(ia){document.removeEventListener("mousemove",
|
|
14
|
+
W);document.removeEventListener("mouseup",ka)};document.addEventListener("mousemove",W);document.addEventListener("mouseup",ka)};u=function(M){M.stopPropagation();M.preventDefault();var Q=n.offsetWidth,Y=M.pageX,ba=function(ha){ha=Q+ha.pageX-Y;200>ha&&(ha=200);n.style.width=ha+"px";"object"===typeof n.zwpDragable&&(n.zwpDragable.oldWidth=ha)},Z=function(ha){document.removeEventListener("mousemove",ba);document.removeEventListener("mouseup",Z)};document.addEventListener("mousemove",ba);document.addEventListener("mouseup",
|
|
15
|
+
Z)};var F=function(M){M.stopPropagation();M.preventDefault();var Q=n.offsetHeight,Y=M.pageY,ba=function(ha){ha=Q+ha.pageY-Y;180>ha&&(ha=180);n.style.height=ha+"px";"object"===typeof n.zwpDragable&&(n.zwpDragable.oldHeight=ha)},Z=function(ha){document.removeEventListener("mousemove",ba);document.removeEventListener("mouseup",Z)};document.addEventListener("mousemove",ba);document.addEventListener("mouseup",Z)},J=function(M){M.stopPropagation();M.preventDefault();var Q=n.offsetWidth,Y=n.offsetHeight,
|
|
16
|
+
ba=M.pageX,Z=M.pageY,ha=function(W){var ka=Q+W.pageX-ba;200>ka&&(ka=200);W=Y+W.pageY-Z;180>W&&(W=180);n.style.width=ka+"px";n.style.height=W+"px";"object"===typeof n.zwpDragable&&(n.zwpDragable.oldWidth=ka,n.zwpDragable.oldHeight=W)},ma=function(W){document.removeEventListener("mousemove",ha);document.removeEventListener("mouseup",ma)};document.addEventListener("mousemove",ha);document.addEventListener("mouseup",ma)};n.zwpDragable={};var w=n.querySelector(".zwp-captionbar");if(w){var I=w.querySelector(".closeBtn");
|
|
17
|
+
if(I){var L=B||function(){};I.addEventListener("click",function(M){M.preventDefault();M.stopPropagation();L(n)})}w.addEventListener("mousedown",y);n.zwpDragable.doc_mousedown=y}B=n.querySelector(".zwp-gripper-right");y=n.querySelector(".zwp-gripper-bottom");w=n.querySelector(".zwp-gripper-bottom-right");B&&(B.addEventListener("mousedown",u),n.zwpDragable.gripperR_mousedown=u);y&&(y.addEventListener("mousedown",F),n.zwpDragable.gripperB_mousedown=F);w&&(w.addEventListener("mousedown",J),n.zwpDragable.gripperBR_mousedown=
|
|
18
|
+
J);n.dragableWinInited=!0}}(function(n){var B=!1,u=!1,y=0,F=2E3,J=0,w=document,I=n(K),L=[],M=K.requestAnimationFrame||K.webkitRequestAnimationFrame||K.mozRequestAnimationFrame||!1,Q=K.cancelAnimationFrame||K.webkitCancelAnimationFrame||K.mozCancelAnimationFrame||!1;if(M)K.cancelAnimationFrame||(Q=function(T){});else{var Y=0;M=function(T,e){var l=(new Date).getTime(),m=Math.max(0,16-(l-Y));e=K.setTimeout(function(){T(l+m)},m);Y=l+m;return e};Q=function(T){K.clearTimeout(T)}}var ba=K.MutationObserver||
|
|
19
|
+
K.WebKitMutationObserver||!1,Z=Date.now||function(){return(new Date).getTime()},ha={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,
|
|
20
20
|
railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,rightdock:0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",
|
|
21
|
-
scriptpath:function(){var
|
|
22
|
-
w||"mozPointerLockElement"in w;
|
|
23
|
-
w.documentMode;
|
|
24
|
-
0<navigator.msMaxTouchPoints);
|
|
25
|
-
"transform"in
|
|
26
|
-
|
|
27
|
-
b;if(
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
f=0<g?1:-1;
|
|
31
|
-
function(){var D=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var R=b.lastdeltax+b.newscrollx;b.lastdeltax=0;b.rail.drag||b.doScrollPos(R,D)})}function
|
|
32
|
-
(f=-f);if(
|
|
33
|
-
(this.ispage?
|
|
34
|
-
this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;"auto"==
|
|
35
|
-
|
|
36
|
-
this.overflowy=
|
|
37
|
-
|
|
38
|
-
(b.synclist[g]=!1)};this.css=function(g,
|
|
39
|
-
g*g},getPos:function(){return(
|
|
40
|
-
-g[13]:-g[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(g){if(!g){if(g=
|
|
41
|
-
|
|
42
|
-
","+b.doc.translate.ty+")");
|
|
43
|
-
b.docscroll.scrollLeft():b.docscroll.scrollLeft()},this.setScrollLeft=function(g){return setTimeout(function(){if(b)return b.hasreversehr&&(g=b.detected.ismozilla?-(b.page.maxw-g):b.page.maxw-g),b.docscroll.scrollLeft(g)},1)};this.getTarget=function(g){return g?g.target?g.target:g.srcElement?g.srcElement:!1:!1};this.hasParent=function(g,
|
|
44
|
-
w.documentElement.scrollTop,left:
|
|
45
|
-
|
|
46
|
-
b.zoom&&b.zoom.css({top:f+1,left:1==b.rail.align?
|
|
47
|
-
g.clientX+w.documentElement.scrollLeft,g.pageY=g.clientY+w.documentElement.scrollTop),
|
|
48
|
-
"requestAnimationFrame"in
|
|
49
|
-
b.bind(b.doc,
|
|
50
|
-
top:0,"float":"right",width:
|
|
51
|
-
D[R];(
|
|
52
|
-
|
|
53
|
-
top:0,height:
|
|
54
|
-
x.outerHeight());da.css({height:da.height+"px",zIndex:b.zindex,background:
|
|
55
|
-
"HTML"==b.win[0].nodeName?b.body:b.win,
|
|
56
|
-
|
|
57
|
-
b.rail.css({opacity:
|
|
58
|
-
b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"hidden"==
|
|
59
|
-
var
|
|
60
|
-
ra=Ea.w-ra;b.rail.drag.ck=b.rail.scrollable&&!b.railh.scrollable?0<sa?"v":!1:!b.rail.scrollable&&b.railh.scrollable?0<ra?"h":!1:!1}
|
|
61
|
-
X._onclick.call(this,va)}),b.cancelEvent(E)):b.stopPropagation(E);/SUBMIT|CANCEL|BUTTON/i.test(
|
|
62
|
-
b.rail.drag.pt)return b.onmouseup(E)};var wa=
|
|
63
|
-
ra=-X.left,
|
|
64
|
-
xa=Math.round(xa/2):xa>b.page.maxw&&(xa=b.page.maxw+Math.round((xa-b.page.maxw)/2)):(0>xa&&(Ea=xa=0),xa>b.page.maxw&&(xa=b.page.maxw,Ea=0)));if(!b.hasmoving){if(b.rail.drag.y===E.clientY&&b.rail.drag.x===E.clientX)return b.cancelEvent(E);ra=Math.abs(X);X=Math.abs(
|
|
65
|
-
b.rail.drag.dl=X>ta?"f":"v":X>
|
|
66
|
-
b.rail.scrollable&&b.setScrollTop(va),b.scrollmom.update(Ea,sa),b.railh&&b.railh.scrollable?(b.setScrollLeft(xa),b.showCursor(va,xa)):b.showCursor(va),
|
|
67
|
-
|
|
68
|
-
if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(E.touches[0].clientX-b.rail.drag.x);0>b.scroll.x&&(b.scroll.x=0);var X=b.scrollvaluemaxw;b.scroll.x>X&&(b.scroll.x=X)}else b.scroll.y=b.rail.drag.sy+(E.touches[0].clientY-b.rail.drag.y),0>b.scroll.y&&(b.scroll.y=0),X=b.scrollvaluemax,b.scroll.y>X&&(b.scroll.y=X);b.synched("touchmove",function(){b.rail.drag&&3==b.rail.drag.pt&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*
|
|
69
|
-
b.scrollratio.y),
|
|
70
|
-
b.rail.drag.pt)return!0;
|
|
71
|
-
b.rail.drag.x);0>b.scroll.x&&(b.scroll.x=0);var X=b.scrollvaluemaxw;b.scroll.x>X&&(b.scroll.x=X)}else b.scroll.y=b.rail.drag.sy+(E.clientY-b.rail.drag.y),0>b.scroll.y&&(b.scroll.y=0),X=b.scrollvaluemax,b.scroll.y>X&&(b.scroll.y=X);b.synched("mousemove",function(){b.cursorfreezed&&(b.showCursor(),b.rail.drag.hr?b.scrollLeft(Math.round(b.scroll.x*b.scrollratio.x)):b.scrollTop(Math.round(b.scroll.y*b.scrollratio.y)))});
|
|
72
|
-
function(E){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(E)},b.onclick=
|
|
73
|
-
E}0!==b.selectiondrag.df&&(b.doScrollBy(-(2*b.selectiondrag.df/6)|0),b.debounced("doselectionscroll",function(){ua()},50))}};b.hasTextSelected="getSelection"in w?function(){return 0<w.getSelection().rangeCount}:"selection"in w?function(){return"None"!=w.selection.type}:function(){return!1};b.onselectionstart=function(E){b.ispage||(b.selectiondrag=b.win.offset())};b.onselectionend=function(E){b.selectiondrag=!1};b.onselectiondrag=
|
|
74
|
-
function(){ua(E)},250)}}
|
|
75
|
-
"MSPointerUp",b.ontouchend),b.delegate(w,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(E){E.preventDefault()}),b.bind(b.cursor,"contextmenu",function(E){E.preventDefault()})):
|
|
76
|
-
"mousemove",b.ontouchmove,!1,!0));if(
|
|
77
|
-
|
|
78
|
-
b.bind(b.cursorh,"click",function(E){b.cancelEvent(E)}),b.bind(b.cursorh,"dblclick",function(E){b.cancelEvent(E)})));
|
|
79
|
-
b.ontouchendCursor));
|
|
80
|
-
(b.bind(
|
|
81
|
-
b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(w,"mousemove",b.onselectiondrag)),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()})));
|
|
82
|
-
(b.win.attr("tabindex")||b.win.attr({tabindex:++y}),b.bind(b.win,"focus",function(E){B=b.getTarget(E).id||b.getTarget(E)||!1;b.hasfocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"blur",function(E){B=!1;b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(E){u=b.getTarget(E).id||b.getTarget(E)||!1;b.hasmousefocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(E){u
|
|
83
|
-
0===b.page.maxh)return!0;E=E||
|
|
84
|
-
(
|
|
85
|
-
sa=!0);break;case 27:b.zoomactive&&(b.doZoom(),sa=!0)}if(sa)return b.cancelEvent(E)}};
|
|
86
|
-
b.win.attr("style");f=parseFloat(b.win.css("width"))+1;b.win.css("width",f);b.synched("chromefix",function(){b.win.attr("style",Aa)})}b.onAttributeChange=function(E){b.lazyResize(b.isieold?250:30)};if(
|
|
87
|
-
b.observerbody.observe(w.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var ya=b.win[0];!1!==ba?(b.observer=new ba(function(E){E.forEach(b.onAttributeChange)}),b.observer.observe(ya,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new ba(function(E){E.forEach(function(X){if(0<X.removedNodes.length)for(var
|
|
88
|
-
{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(ya,
|
|
89
|
-
try{var E="contentDocument"in this?this.contentDocument:this.contentWindow._doc}catch(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"complete"===this.doc[0].readyState&&setTimeout(function(){za.call(b.doc[0],!1)},500);b.bind(this.doc,"load",za)}};this.showCursor=function(g,
|
|
93
|
-
(g=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x,b.cursorh.css({width:b.cursorwidth,left:!b.rail.align&&b.rail.visibility?g+b.rail.width:g}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:
|
|
94
|
-
b.cursoractive=!1);b.cursortimeout=0},g||
|
|
95
|
-
|
|
96
|
-
(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setScrollTop(0),b.rail&&(b.rail.scrollable=!1)):(b.page.maxh-=
|
|
97
|
-
0===b.page.maxw;if(b.railslocked)return b.ispage||b.updateScrollBar(b.view),!1;b.hidden||(b.rail.visibility||b.showRail(),b.railh&&!b.railh.visibility&&b.showRailHr());b.istextarea&&b.win.css("resize")&&"none"!=b.win.css("resize")&&(b.view.h-=20);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h/b.page.h*b.view.h));b.cursorheight=
|
|
98
|
-
|
|
99
|
-
b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=b.getScrollTop()/b.scrollratio.y|0,b.scroll.x=b.getScrollLeft()/b.scrollratio.x|0,b.cursoractive&&b.noticeCursor());b.scroll.y&&0===b.getScrollTop()&&b.doScrollTo(b.scroll.y*b.scrollratio.y|0);return b};this.resize=b.onResize;var
|
|
100
|
-
g=isNaN(g)?240:g;
|
|
101
|
-
|
|
102
|
-
Element.prototype.addEventListener=function(g,t
|
|
103
|
-
f:
|
|
104
|
-
|
|
105
|
-
function(){0===b.page.maxh||!b.ispage&&"none"==b.win.css("display")||(b.rail.visibility=!0,b.rail.css("display","block"));return b};this.showRailHr=function(){b.railh&&0!==b.page.maxw&&(b.ispage||"none"!=b.win.css("display"))&&(b.railh.visibility=!0,b.railh.css("display","block"));return b};this.hideRails=function(){return b.hideRail().hideRailHr()};this.hideRail=function(){b.rail.visibility=!1;b.rail.css("display","none");return b};this.hideRailHr=function(){b.railh&&(b.railh.visibility
|
|
106
|
-
"none"));return b};this.show=function(){b.hidden=!1;b.railslocked=!1;return b.showRails()};this.hide=function(){b.hidden=!0;b.railslocked=!0;return b.hideRails()};this.toggle=function(){return b.hidden?b.show():b.hide()};this.remove=function(){b.stop();b.cursortimeout&&clearTimeout(b.cursortimeout);for(var g in b.delaylist)b.delaylist[g]&&
|
|
107
|
-
b.undelegate(w,"touchmove",b.ontouchmove,!1,!0);b.unbindAll();
|
|
108
|
-
|
|
109
|
-
function(g){this.onzoomout=g;return b};this.isScrollable=function(g){g=g.target?g.target:g;if("OPTION"==g.nodeName)return!0;for(;g&&1==g.nodeType&&g!==this.me[0]&&!/^BODY|HTML/.test(g.nodeName);){var
|
|
110
|
-
if(/fixed|absolute/.test(
|
|
111
|
-
|
|
112
|
-
b.checkarea+600<
|
|
113
|
-
function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=!1;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this.getTransitionSpeed=function(g){return 80+g/72*
|
|
114
|
-
(
|
|
115
|
-
!1}};this.doScrollPos=function(g,t
|
|
116
|
-
var
|
|
117
|
-
clearTimeout(
|
|
118
|
-
g,
|
|
119
|
-
var f=b.getScrollLeft();(0>(b.newscrolly-
|
|
120
|
-
b.bzscroll={};
|
|
121
|
-
!1;return b};else this.doScrollLeft=function(g,
|
|
122
|
-
|
|
123
|
-
"position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),
|
|
124
|
-
zIndex:J+100,margin:0});
|
|
125
|
-
b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0 0"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(g)};this.doZoom=function(g){return b.zoomactive?b.doZoomOut(g):b.doZoomIn(g)};this.resizeZoom=function(){if(b.zoomactive){var g=b.getScrollTop();b.win.css({width:
|
|
126
|
-
this;this.nc=
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
b):(
|
|
131
|
-
!1;return
|
|
132
|
-
function(
|
|
133
|
-
|
|
134
|
-
(
|
|
135
|
-
new
|
|
136
|
-
|
|
137
|
-
function
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
Array};
|
|
141
|
-
(R=
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
f)}))},add:function(f,
|
|
149
|
-
f):
|
|
150
|
-
this.each(function(ea,da){for(;da&&!(R?0<=R.indexOf(da):
|
|
151
|
-
f)},contents:function(){return this.map(function(){return this.contentDocument||
|
|
152
|
-
this.style,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
0 in this?this.pluck("textContent").join(""):null},attr:function(f,
|
|
156
|
-
f.split(" ").forEach(function(
|
|
157
|
-
|
|
158
|
-
D={top:D.top-ea.top,left:D.left-ea.left};"static"==R.css("position")&&(D.position="relative");R.css(D)});if(!this.length)return null;if(
|
|
159
|
-
void 0;if(
|
|
160
|
-
hasClass:function(f){return f?
|
|
161
|
-
|
|
162
|
-
this[0];return f===
|
|
163
|
-
R.top,left:D.left-R.left}}},offsetParent:function(){return this.map(function(){for(var f=this.offsetParent||
|
|
164
|
-
|
|
165
|
-
this.length;return 1>ea.length?this:this.each(function(ta,ua){da=D?ua:ua.parentNode;ua=0==
|
|
166
|
-
|
|
167
|
-
(""+
|
|
168
|
-
ba?[
|
|
169
|
-
m[l]=function(){this[v]=
|
|
170
|
-
blur:"focusout"},
|
|
171
|
-
|
|
172
|
-
m
|
|
173
|
-
return(
|
|
174
|
-
|
|
175
|
-
u.Event=function(m
|
|
176
|
-
c,
|
|
177
|
-
[
|
|
178
|
-
!
|
|
179
|
-
ia,
|
|
180
|
-
"error"!=
|
|
181
|
-
json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:
|
|
182
|
-
|
|
183
|
-
v("Accept",
|
|
184
|
-
"file:"==b){
|
|
185
|
-
|
|
186
|
-
"json";return u.ajax(
|
|
187
|
-
function(){var y,F,J=[],w=function(
|
|
188
|
-
function(y){if(0 in arguments)this.bind("submit",y);else if(this.length){var F=u.Event("submit");this.eq(0).trigger(F);F.isDefaultPrevented()||this.get(0).submit()}return this}})(B);(function(u,y){function F(
|
|
189
|
-
y)return J="-"+
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.get(0).clientLeft;this.css(
|
|
193
|
-
|
|
194
|
-
F[J];if("SCRIPT"===w.nodeName.toUpperCase()&&w.id&&w.id==
|
|
195
|
-
u(
|
|
196
|
-
w.id&&w.id==
|
|
197
|
-
function(){
|
|
198
|
-
/iPhone|iPad|iPod/.test(navigator.userAgent);(function(
|
|
199
|
-
null};HUAYI={};HUAYI.Danmu=function(){var
|
|
21
|
+
scriptpath:function(){var T;(T=w.currentScript)||(T=w.getElementsByTagName("script"),T=T.length?T[T.length-1]:!1);T=T?T.src.split("?")[0]:"";return 0<T.split("/").length?T.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},ma=!1,W=function(){if(ma)return ma;var T=w.createElement("DIV"),e=T.style,l=navigator.userAgent,m=navigator.platform,c={};c.haspointerlock="pointerLockElement"in w||"webkitPointerLockElement"in
|
|
22
|
+
w||"mozPointerLockElement"in w;c.isopera="opera"in K;c.isopera12=c.isopera&&"getUserMedia"in navigator;c.isoperamini="[object OperaMini]"===Object.prototype.toString.call(K.operamini);c.isie="all"in w&&"attachEvent"in T&&!c.isopera;c.isieold=c.isie&&!("msInterpolationMode"in e);c.isie7=c.isie&&!c.isieold&&(!("documentMode"in w)||7===w.documentMode);c.isie8=c.isie&&"documentMode"in w&&8===w.documentMode;c.isie9=c.isie&&"performance"in K&&9===w.documentMode;c.isie10=c.isie&&"performance"in K&&10===
|
|
23
|
+
w.documentMode;c.isie11="msRequestFullscreen"in T&&11<=w.documentMode;c.ismsedge="msCredentials"in K;c.ismozilla="MozAppearance"in e;c.iswebkit=!c.ismsedge&&"WebkitAppearance"in e;c.ischrome=c.iswebkit&&"chrome"in K;c.ischrome38=c.ischrome&&"touchAction"in e;c.ischrome22=!c.ischrome38&&c.ischrome&&c.haspointerlock;c.ischrome26=!c.ischrome38&&c.ischrome&&"transition"in e;c.cantouch="ontouchstart"in w.documentElement||"ontouchstart"in K;c.hasw3ctouch=(K.PointerEvent||!1)&&(0<navigator.maxTouchPoints||
|
|
24
|
+
0<navigator.msMaxTouchPoints);c.hasmstouch=!c.hasw3ctouch&&(K.MSPointerEvent||!1);c.ismac=/^mac$/i.test(m);c.isios=c.cantouch&&/iphone|ipad|ipod/i.test(m);c.isios4=c.isios&&!("seal"in Object);c.isios7=c.isios&&"webkitHidden"in w;c.isios8=c.isios&&"hidden"in w;c.isios10=c.isios&&K.Proxy;c.isandroid=/android/i.test(l);c.haseventlistener="addEventListener"in T;c.trstyle=!1;c.hastransform=!1;c.hastranslate3d=!1;c.transitionstyle=!1;c.hastransition=!1;c.transitionend=!1;c.trstyle="transform";c.hastransform=
|
|
25
|
+
"transform"in e||function(){for(var v=["msTransform","webkitTransform","MozTransform","OTransform"],z=0,A=v.length;z<A;z++)if(void 0!==e[v[z]]){c.trstyle=v[z];break}c.hastransform=!!c.trstyle}();c.hastransform&&(e[c.trstyle]="translate3d(1px,2px,3px)",c.hastranslate3d=/translate3d/.test(e[c.trstyle]));c.transitionstyle="transition";c.prefixstyle="";c.transitionend="transitionend";c.hastransition="transition"in e||function(){c.transitionend=!1;for(var v="webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),
|
|
26
|
+
z="-webkit- -ms- -moz- -o- -o -khtml-".split(" "),A="webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),b=0,O=v.length;b<O;b++)if(v[b]in e){c.transitionstyle=v[b];c.prefixstyle=z[b];c.transitionend=A[b];break}c.ischrome26&&(c.prefixstyle=z[1]);c.hastransition=c.transitionstyle}();c.cursorgrabvalue=function(){var v=["grab","-webkit-grab","-moz-grab"];if(c.ischrome&&!c.ischrome38||c.isie)v=[];for(var z=0,A=v.length;z<A;z++){var b=v[z];e.cursor=
|
|
27
|
+
b;if(e.cursor==b)return b}return"url("+(ha.scriptpath+"css/openhand.cur),n-resize")}();c.hasmousecapture="setCapture"in T;c.hasMutationObserver=!1!==ba;T=null;return ma=c},ka=function(T,e){function l(){var g=b.doc.css(G.trstyle);return g&&"matrix"==g.substr(0,6)?g.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function m(){var g=b.win;if("zIndex"in g)return g.zIndex();for(;0<g.length&&9!=g[0].nodeType;){var r=g.css("zIndex");if(!isNaN(r)&&0!==r)return parseInt(r);g=g.parent()}return!1}
|
|
28
|
+
function c(g,r,t){r=g.css(r);g=parseFloat(r);return isNaN(g)?(g=d[r]||0,t=3==g?t?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1,b.isie8&&g&&(g+=1),t?g:0):g}function v(g,r,t,f){b._bind(g,r,function(p){p=p||K.event;var D={original:p,target:p.target||p.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==p.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){p.preventDefault?p.preventDefault():p.returnValue=!1;return!1},stopImmediatePropagation:function(){p.stopImmediatePropagation?
|
|
29
|
+
p.stopImmediatePropagation():p.cancelBubble=!0}};"mousewheel"==r?(p.wheelDeltaX&&(D.deltaX=-.025*p.wheelDeltaX),p.wheelDeltaY&&(D.deltaY=-.025*p.wheelDeltaY),D.deltaY||D.deltaX||(D.deltaY=-.025*p.wheelDelta)):D.deltaY=p.detail;return t.call(g,D)},f)}function z(g,r,t,f){b.scrollrunning||(b.newscrolly=b.getScrollTop(),b.newscrollx=b.getScrollLeft(),N=Z());var p=Z()-N;N=Z();V=350<p?1:V+(2-V)/10;g=g*V|0;r=r*V|0;if(g){if(f)if(0>g){if(b.getScrollLeft()>=b.page.maxw)return!0}else if(0>=b.getScrollLeft())return!0;
|
|
30
|
+
f=0<g?1:-1;P!==f&&(b.scrollmom&&b.scrollmom.stop(),b.newscrollx=b.getScrollLeft(),P=f);b.lastdeltax-=g}if(r){if(function(){var D=b.getScrollTop();if(0>r){if(D>=b.page.maxh)return!0}else if(0>=D)return!0}()){if(x.nativeparentscrolling&&t&&!b.ispage&&!b.zoomactive)return!0;t=b.view.h>>1;b.newscrolly<-t?(b.newscrolly=-t,r=-1):b.newscrolly>b.page.maxh+t?(b.newscrolly=b.page.maxh+t,r=1):r=0}t=0<r?1:-1;H!==t&&(b.scrollmom&&b.scrollmom.stop(),b.newscrolly=b.getScrollTop(),H=t);b.lastdeltay-=r}(r||g)&&b.synched("relativexy",
|
|
31
|
+
function(){var D=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var R=b.lastdeltax+b.newscrollx;b.lastdeltax=0;b.rail.drag||b.doScrollPos(R,D)})}function A(g,r,t){if(!t&&S)return!0;if(0===g.deltaMode){var f=-(x.mousescrollstep/54*g.deltaX)|0;var p=-(x.mousescrollstep/54*g.deltaY)|0}else 1===g.deltaMode&&(f=-(g.deltaX*x.mousescrollstep*50/80)|0,p=-(g.deltaY*x.mousescrollstep*50/80)|0);r&&x.oneaxismousemode&&0===f&&p&&(f=p,p=0,t&&(0>f?b.getScrollLeft()>=b.page.maxw:0>=b.getScrollLeft())&&(p=f,f=0));b.isrtlmode&&
|
|
32
|
+
(f=-f);if(z(f,p,t,!0))t&&(S=!0);else return S=!1,g.stopImmediatePropagation(),g.preventDefault()}var b=this;this.version="3.7.6";this.name="nicescroll";this.me=e;var O=n("body"),x=this.opt={doc:O,win:!1};n.extend(x,ha);x.snapbackspeed=80;if(T)for(var ca in x)void 0!==T[ca]&&(x[ca]=T[ca]);x.disablemutationobserver&&(ba=!1);this.iddoc=(this.doc=x.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(x.win?x.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==x.win;this.win=x.win||
|
|
33
|
+
(this.ispage?I:this.doc);this.docscroll=this.ispage&&!this.haswrapper?I:this.win;this.body=O;this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=x.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=
|
|
34
|
+
this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;"auto"==x.rtlmode?(T=this.win[0]==K?this.body:this.win,e=T.css("writing-mode")||T.css("-webkit-writing-mode")||T.css("-ms-writing-mode")||T.css("-moz-writing-mode"),"horizontal-tb"==e||"lr-tb"==e||""===e?(this.isrtlmode="rtl"==T.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==e||"tb"==e||"tb-rl"==e||"rl-tb"==e,this.isvertical="vertical-rl"==
|
|
35
|
+
e||"tb"==e||"tb-rl"==e)):(this.isrtlmode=!0===x.rtlmode,this.isvertical=!1);this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;if(!1!==x.scrollbarid)this.id=x.scrollbarid;else{do this.id="ascrail"+F++;while(w.getElementById(this.id))}this.hidden=this.locked=this.railslocked=this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=x.overflowx;
|
|
36
|
+
this.overflowy=x.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=W();var G=n.extend({},this.detected);this.ishwscroll=(this.canhwscroll=G.hastransform&&x.hwacceleration)&&b.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?!(G.iswebkit||G.isie||G.isie11):!(G.iswebkit||G.isie&&!G.isie10&&!G.isie11):!1;this.istouchcapable=!1;G.cantouch||!G.hasw3ctouch&&!G.hasmstouch?!G.cantouch||
|
|
37
|
+
G.isios||G.isandroid||!G.iswebkit&&!G.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;x.enablemouselockapi||(G.hasmousecapture=!1,G.haspointerlock=!1);this.debounced=function(g,r,t){b&&(b.delaylist[g]||(b.delaylist[g]={h:M(function(){b.delaylist[g].fn.call(b);b.delaylist[g]=!1},t)},r.call(b)),b.delaylist[g].fn=r)};this.synched=function(g,r){b.synclist[g]?b.synclist[g]=r:(b.synclist[g]=r,M(function(){b&&(b.synclist[g]&&b.synclist[g].call(b),b.synclist[g]=null)}))};this.unsynched=function(g){b.synclist[g]&&
|
|
38
|
+
(b.synclist[g]=!1)};this.css=function(g,r){for(var t in r)b.saved.css.push([g,t,g.css(t)]),g.css(t,r[t])};this.scrollTop=function(g){return void 0===g?b.getScrollTop():b.setScrollTop(g)};this.scrollLeft=function(g){return void 0===g?b.getScrollLeft():b.setScrollLeft(g)};var ja=function(g,r,t,f,p,D,R){this.st=g;this.ed=r;this.spd=t;this.p1=f||0;this.p2=p||1;this.p3=D||0;this.p4=R||1;this.ts=Z();this.df=r-g};ja.prototype={B2:function(g){return 3*(1-g)*(1-g)*g},B3:function(g){return 3*(1-g)*g*g},B4:function(g){return g*
|
|
39
|
+
g*g},getPos:function(){return(Z()-this.ts)/this.spd},getNow:function(){var g=(Z()-this.ts)/this.spd,r=this.B2(g)+this.B3(g)+this.B4(g);return 1<=g?this.ed:this.st+this.df*r|0},update:function(g,r){this.st=this.getNow();this.ed=g;this.spd=r;this.ts=Z();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};G.hastranslate3d&&G.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(g){if(!g){if(g=l())return 16==g.length?
|
|
40
|
+
-g[13]:-g[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(g){if(!g){if(g=l())return 16==g.length?-g[12]:-g[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x};this.notifyScrollEvent=function(g){var r=w.createEvent("UIEvents");r.initUIEvent("scroll",!1,!1,K,1);r.niceevent=!0;g.dispatchEvent(r)};var la=this.isrtlmode?1:-1;G.hastranslate3d&&x.enabletranslate3d?(this.setScrollTop=
|
|
41
|
+
function(g,r){b.doc.translate.y=g;b.doc.translate.ty=-1*g+"px";b.doc.css(G.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");r||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(g,r){b.doc.translate.x=g;b.doc.translate.tx=g*la+"px";b.doc.css(G.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");r||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(g,r){b.doc.translate.y=g;b.doc.translate.ty=-1*g+"px";b.doc.css(G.trstyle,"translate("+b.doc.translate.tx+
|
|
42
|
+
","+b.doc.translate.ty+")");r||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(g,r){b.doc.translate.x=g;b.doc.translate.tx=g*la+"px";b.doc.css(G.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");r||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(g){b.docscroll.scrollTop(g)},this.getScrollLeft=function(){return b.hasreversehr?b.detected.ismozilla?b.page.maxw-Math.abs(b.docscroll.scrollLeft()):
|
|
43
|
+
b.page.maxw-b.docscroll.scrollLeft():b.docscroll.scrollLeft()},this.setScrollLeft=function(g){return setTimeout(function(){if(b)return b.hasreversehr&&(g=b.detected.ismozilla?-(b.page.maxw-g):b.page.maxw-g),b.docscroll.scrollLeft(g)},1)};this.getTarget=function(g){return g?g.target?g.target:g.srcElement?g.srcElement:!1:!1};this.hasParent=function(g,r){if(!g)return!1;for(g=g.target||g.srcElement||g||!1;g&&g.id!=r;)g=g.parentNode||!1;return!1!==g};var d={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=
|
|
44
|
+
function(){return{top:K.pageYOffset||w.documentElement.scrollTop,left:K.pageXOffset||w.documentElement.scrollLeft}};this.getOffset=function(){if(b.isfixed){var g=b.win.offset(),r=b.getDocumentScrollOffset();g.top-=r.top;g.left-=r.left;return g}g=b.win.offset();if(!b.viewport)return g;r=b.viewport.offset();return{top:g.top-r.top,left:g.left-r.left}};this.updateScrollBar=function(g){var r;if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()-(x.railpadding.top+x.railpadding.bottom)}),b.railh&&b.railh.css({width:b.win.innerWidth()-
|
|
45
|
+
(x.railpadding.left+x.railpadding.right)});else{var t=b.getOffset();var f=t.top;var p=t.left-(x.railpadding.left+x.railpadding.right);f+=c(b.win,"border-top-width",!0);p+=b.rail.align?b.win.outerWidth()-c(b.win,"border-right-width")-b.rail.width:c(b.win,"border-left-width");if(r=x.railoffset)r.top&&(f+=r.top),r.left&&(p+=r.left);g=(g?g.h:b.win.innerHeight())-(x.railpadding.top+x.railpadding.bottom);r="left";var D=p;"number"===typeof x.rightdock&&(r="right",D=x.rightdock);b.railslocked||b.rail.css({top:f,
|
|
46
|
+
[r]:D,height:g});b.zoom&&b.zoom.css({top:f+1,left:1==b.rail.align?p-20:p+b.rail.width+4});if(b.railh&&!b.railslocked){f=t.top;p=t.left;if(r=x.railhoffset)r.top&&(f+=r.top),r.left&&(p+=r.left);f=b.railh.align?f+c(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:f+c(b.win,"border-top-width",!0);p+=c(b.win,"border-left-width");b.railh.css({top:f-(x.railpadding.top+x.railpadding.bottom),left:p,width:b.railh.width})}}};this.doRailClick=function(g,r,t){if(!b.railslocked)if(b.cancelEvent(g),
|
|
47
|
+
"pageY"in g||(g.pageX=g.clientX+w.documentElement.scrollLeft,g.pageY=g.clientY+w.documentElement.scrollTop),r){r=t?b.doScrollLeft:b.doScrollTop;var f=t?(g.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(g.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y;b.unsynched("relativexy");r(f|0)}else r=t?b.doScrollLeftBy:b.doScrollBy,f=t?b.scroll.x:b.scroll.y,g=t?g.pageX-b.railh.offset().left:g.pageY-b.rail.offset().top,t=t?b.view.w:b.view.h,r(f>=g?t:-t)};b.newscrolly=b.newscrollx=
|
|
48
|
+
0;b.hasanimationframe="requestAnimationFrame"in K;b.hascancelanimationframe="cancelAnimationFrame"in K;b.hasborderbox=!1;this.init=function(){b.saved.css=[];if(G.isoperamini||G.isandroid&&!("hidden"in w))return!0;x.emulatetouch=x.emulatetouch||x.touchbehavior;b.hasborderbox=K.getComputedStyle&&"border-box"===K.getComputedStyle(w.body)["box-sizing"];var g={"overflow-y":"hidden"};if(G.isie11||G.isie10)g["-ms-overflow-style"]="none";b.ishwscroll&&(this.doc.css(G.transitionstyle,G.prefixstyle+"transform 0ms ease-out"),
|
|
49
|
+
G.transitionend&&b.bind(b.doc,G.transitionend,b.onScrollTransitionEnd,!1));b.zindex="auto";b.zindex=b.ispage||"auto"!=x.zindex?x.zindex:m()||"auto";!b.ispage&&"auto"!=b.zindex&&b.zindex>J&&(J=b.zindex);b.isie&&0===b.zindex&&"auto"==x.zindex&&(b.zindex="auto");if(!b.ispage||!G.isieold){var r=b.docscroll;b.ispage&&(r=b.haswrapper?b.win:b.doc);b.css(r,g);b.ispage&&(G.isie11||G.isie)&&b.css(n("html"),g);!G.isios||b.ispage||b.haswrapper||b.css(O,{"-webkit-overflow-scrolling":"touch"});var t=n(w.createElement("div"));
|
|
50
|
+
t.css({position:"relative",top:0,"float":"right",width:x.cursorwidth,height:0,"background-color":x.cursorcolor,border:x.cursorborder,"background-clip":"padding-box","-webkit-border-radius":x.cursorborderradius,"-moz-border-radius":x.cursorborderradius,"border-radius":x.cursorborderradius});t.addClass("nicescroll-cursors");b.cursor=t;var f=n(w.createElement("div"));f.attr("id",b.id);f.addClass("nicescroll-rails nicescroll-rails-vr");x.scrollCLass&&f.addClass(x.scrollCLass);var p,D=["left","right",
|
|
51
|
+
"top","bottom"],R;for(R in D){var ea=D[R];(p=x.railpadding[ea]||0)&&f.css("padding-"+ea,p+"px")}f.append(t);f.width=Math.max(parseFloat(x.cursorwidth),t.outerWidth());f.css({width:f.width+"px",zIndex:b.zindex,background:x.background,cursor:"default"});f.visibility=!0;f.scrollable=!0;f.align="left"==x.railalign?0:1;b.rail=f;t=b.rail.drag=!1;!x.boxzoom||b.ispage||G.isieold||(t=w.createElement("div"),b.bind(t,"click",b.doZoom),b.bind(t,"mouseenter",function(){b.zoom.css("opacity",x.cursoropacitymax)}),
|
|
52
|
+
b.bind(t,"mouseleave",function(){b.zoom.css("opacity",x.cursoropacitymin)}),b.zoom=n(t),b.zoom.css({cursor:"pointer",zIndex:b.zindex,backgroundImage:"url("+x.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),x.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),G.cantouch&&x.gesturezoom&&(b.ongesturezoom=function(E){1.5<E.scale&&b.doZoomIn(E);.8>E.scale&&b.doZoomOut(E);return b.cancelEvent(E)},b.bind(b.win,"gestureend",b.ongesturezoom)));b.railh=!1;if(x.horizrailenabled){b.css(r,
|
|
53
|
+
{overflowX:"hidden"});t=n(w.createElement("div"));t.css({position:"absolute",top:0,height:x.cursorwidth,width:0,backgroundColor:x.cursorcolor,border:x.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":x.cursorborderradius,"-moz-border-radius":x.cursorborderradius,"border-radius":x.cursorborderradius});G.isieold&&t.css("overflow","hidden");t.addClass("nicescroll-cursors");b.cursorh=t;var da=n(w.createElement("div"));da.attr("id",b.id+"-hr");da.addClass("nicescroll-rails nicescroll-rails-hr");
|
|
54
|
+
x.scrollCLass&&da.addClass(x.scrollCLass);da.height=Math.max(parseFloat(x.cursorwidth),t.outerHeight());da.css({height:da.height+"px",zIndex:b.zindex,background:x.background});da.append(t);da.visibility=!0;da.scrollable=!0;da.align="top"==x.railvalign?0:1;b.railh=da;b.railh.drag=!1}b.ispage?(f.css({position:"fixed",top:0,height:"100%"}),f.css(f.align?{right:0}:{left:0}),b.body.append(f),b.railh&&(da.css({position:"fixed",left:0,width:"100%"}),da.css(da.align?{bottom:0}:{top:0}),b.body.append(da))):
|
|
55
|
+
(b.ishwscroll?("static"==b.win.css("position")&&b.css(b.win,{position:"relative"}),r="HTML"==b.win[0].nodeName?b.body:b.win,n(r).scrollTop(0).scrollLeft(0),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":f.width+4}),r.append(b.zoom)),f.css({position:"absolute",top:0}),f.css(f.align?{right:0}:{left:0}),r.append(f),da&&(da.css({position:"absolute",left:0,bottom:0}),da.css(da.align?{bottom:0}:{top:0}),r.append(da))):(b.isfixed="fixed"==b.win.css("position"),r=b.isfixed?"fixed":
|
|
56
|
+
"absolute",b.isfixed||(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,/fixed|absolute/.test(b.viewport.css("position"))||b.css(b.viewport,{position:"relative"})),f.css({position:r}),b.zoom&&b.zoom.css({position:r}),b.updateScrollBar(),b.body.append(f),b.zoom&&b.body.append(b.zoom),b.railh&&(da.css({position:r}),b.body.append(da))),G.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),x.disableoutline&&(G.isie&&b.win.attr("hideFocus",
|
|
57
|
+
"true"),G.iswebkit&&b.win.css("outline","none")));!1===x.autohidemode?(b.autohidedom=!1,b.rail.css({opacity:x.cursoropacitymax}),b.railh&&b.railh.css({opacity:x.cursoropacitymax})):!0===x.autohidemode||"leave"===x.autohidemode?(b.autohidedom=n().add(b.rail),G.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&G.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"scroll"==x.autohidemode?(b.autohidedom=n().add(b.rail),b.railh&&(b.autohidedom=
|
|
58
|
+
b.autohidedom.add(b.railh))):"cursor"==x.autohidemode?(b.autohidedom=n().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"hidden"==x.autohidemode&&(b.autohidedom=!1,b.hide(),b.railslocked=!1);if(G.cantouch||b.istouchcapable||x.emulatetouch||G.hasmstouch){b.scrollmom=new ia(b);b.ontouchstart=function(E){if(b.locked||E.pointerType&&("mouse"===E.pointerType||E.pointerType===E.MSPOINTER_TYPE_MOUSE))return!1;b.hasmoving=!1;b.scrollmom.timer&&(b.triggerScrollEnd(),b.scrollmom.stop());
|
|
59
|
+
if(!b.railslocked){var X=b.getTarget(E);if(X&&/INPUT/i.test(X.nodeName)&&/range/i.test(X.type))return b.stopPropagation(E);var oa="mousedown"===E.type;!("clientX"in E)&&"changedTouches"in E&&(E.clientX=E.changedTouches[0].clientX,E.clientY=E.changedTouches[0].clientY);if(b.forcescreen){var ra=E;E={original:E.original?E.original:E};E.clientX=ra.screenX;E.clientY=ra.screenY}b.rail.drag={x:E.clientX,y:E.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1,tg:X};if(b.ispage||
|
|
60
|
+
!x.directionlockdeadzone)b.rail.drag.dl="f";else{ra=I.width();var sa=I.height(),Ea=b.getContentSize();sa=Ea.h-sa;ra=Ea.w-ra;b.rail.drag.ck=b.rail.scrollable&&!b.railh.scrollable?0<sa?"v":!1:!b.rail.scrollable&&b.railh.scrollable?0<ra?"h":!1:!1}x.emulatetouch&&b.isiframe&&G.isie&&(ra=b.win.position(),b.rail.drag.x+=ra.left,b.rail.drag.y+=ra.top);b.hasmoving=!1;b.lastmouseup=!1;b.scrollmom.reset(E.clientX,E.clientY);if(X&&oa){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(X.nodeName))return G.hasmousecapture&&
|
|
61
|
+
X.setCapture(),x.emulatetouch?(X.onclick&&!X._onclick&&(X._onclick=X.onclick,X.onclick=function(va){if(b.hasmoving)return!1;X._onclick.call(this,va)}),b.cancelEvent(E)):b.stopPropagation(E);/SUBMIT|CANCEL|BUTTON/i.test(n(X).attr("type"))&&(b.preventclick={tg:X,click:!1})}}};b.ontouchend=function(E){if(!b||!b.rail.drag)return!0;if(2==b.rail.drag.pt){if(E.pointerType&&("mouse"===E.pointerType||E.pointerType===E.MSPOINTER_TYPE_MOUSE))return!1;b.rail.drag=!1;var X="mouseup"===E.type;if(b.hasmoving&&(b.scrollmom.doMomentum(),
|
|
62
|
+
b.lastmouseup=!0,b.hideCursor(),G.hasmousecapture&&w.releaseCapture(),X))return b.cancelEvent(E)}else if(1==b.rail.drag.pt)return b.onmouseup(E)};var wa=x.emulatetouch&&b.isiframe&&!G.hasmousecapture,ta=.3*x.directionlockdeadzone|0;b.ontouchmove=function(E,X){if(!b||!b.rail.drag||E.targetTouches&&x.preventmultitouchscrolling&&1<E.targetTouches.length||E.pointerType&&("mouse"===E.pointerType||E.pointerType===E.MSPOINTER_TYPE_MOUSE))return!0;if(2==b.rail.drag.pt){"changedTouches"in E&&(E.clientX=E.changedTouches[0].clientX,
|
|
63
|
+
E.clientY=E.changedTouches[0].clientY);var oa;var ra=oa=0;wa&&!X&&(X=b.win.position(),ra=-X.left,oa=-X.top);var sa=E.clientY+oa;X=sa-b.rail.drag.y;var Ea=E.clientX+ra;oa=Ea-b.rail.drag.x;var va=b.rail.drag.st-X;if(b.ishwscroll&&x.bouncescroll)0>va?va=Math.round(va/2):va>b.page.maxh&&(va=b.page.maxh+Math.round((va-b.page.maxh)/2));else if(0>va?sa=va=0:va>b.page.maxh&&(va=b.page.maxh,sa=0),0===sa&&!b.hasmoving)return b.ispage||(b.rail.drag=!1),!0;var xa=b.getScrollLeft();b.railh&&b.railh.scrollable&&
|
|
64
|
+
(xa=b.isrtlmode?oa-b.rail.drag.sl:b.rail.drag.sl-oa,b.ishwscroll&&x.bouncescroll?0>xa?xa=Math.round(xa/2):xa>b.page.maxw&&(xa=b.page.maxw+Math.round((xa-b.page.maxw)/2)):(0>xa&&(Ea=xa=0),xa>b.page.maxw&&(xa=b.page.maxw,Ea=0)));if(!b.hasmoving){if(b.rail.drag.y===E.clientY&&b.rail.drag.x===E.clientX)return b.cancelEvent(E);ra=Math.abs(X);X=Math.abs(oa);oa=x.directionlockdeadzone;b.rail.drag.ck?"v"==b.rail.drag.ck?X>oa&&ra<=ta?b.rail.drag=!1:ra>oa&&(b.rail.drag.dl="v"):"h"==b.rail.drag.ck&&(ra>oa&&
|
|
65
|
+
X<=ta?b.rail.drag=!1:X>oa&&(b.rail.drag.dl="h")):ra>oa&&X>oa?b.rail.drag.dl="f":ra>oa?b.rail.drag.dl=X>ta?"f":"v":X>oa&&(b.rail.drag.dl=ra>ta?"f":"h");if(!b.rail.drag.dl)return b.cancelEvent(E);b.triggerScrollStart(E.clientX,E.clientY,0,0,0);b.hasmoving=!0}b.preventclick&&!b.preventclick.click&&(b.preventclick.click=b.preventclick.tg.onclick||!1,b.preventclick.tg.onclick=b.onpreventclick);b.rail.drag.dl&&("v"==b.rail.drag.dl?xa=b.rail.drag.sl:"h"==b.rail.drag.dl&&(va=b.rail.drag.st));b.synched("touchmove",
|
|
66
|
+
function(){b.rail.drag&&2==b.rail.drag.pt&&(b.prepareTransition&&b.resetTransition(),b.rail.scrollable&&b.setScrollTop(va),b.scrollmom.update(Ea,sa),b.railh&&b.railh.scrollable?(b.setScrollLeft(xa),b.showCursor(va,xa)):b.showCursor(va),G.isie10&&w.selection.clear())});return b.cancelEvent(E)}if(1==b.rail.drag.pt)return b.onmousemove(E)};b.ontouchstartCursor=function(E,X){if(!b.rail.drag||3==b.rail.drag.pt){if(b.locked)return b.cancelEvent(E);b.cancelScroll();b.rail.drag={x:E.touches[0].clientX,y:E.touches[0].clientY,
|
|
67
|
+
sx:b.scroll.x,sy:b.scroll.y,pt:3,hr:!!X};X=b.getTarget(E);!b.ispage&&G.hasmousecapture&&X.setCapture();b.isiframe&&!G.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));return b.cancelEvent(E)}};b.ontouchendCursor=function(E){if(b.rail.drag&&(G.hasmousecapture&&w.releaseCapture(),b.isiframe&&!G.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),3==b.rail.drag.pt))return b.rail.drag=!1,b.cancelEvent(E)};b.ontouchmoveCursor=
|
|
68
|
+
function(E){if(b.rail.drag&&3==b.rail.drag.pt){b.cursorfreezed=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(E.touches[0].clientX-b.rail.drag.x);0>b.scroll.x&&(b.scroll.x=0);var X=b.scrollvaluemaxw;b.scroll.x>X&&(b.scroll.x=X)}else b.scroll.y=b.rail.drag.sy+(E.touches[0].clientY-b.rail.drag.y),0>b.scroll.y&&(b.scroll.y=0),X=b.scrollvaluemax,b.scroll.y>X&&(b.scroll.y=X);b.synched("touchmove",function(){b.rail.drag&&3==b.rail.drag.pt&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*
|
|
69
|
+
b.scrollratio.x),x.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),x.cursordragspeed))});return b.cancelEvent(E)}}}b.onmousedown=function(E,X){if(!b.rail.drag||1==b.rail.drag.pt){if(b.railslocked)return b.cancelEvent(E);b.cancelScroll();b.rail.drag={x:E.clientX,y:E.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:X||!1};X=b.getTarget(E);G.hasmousecapture&&X.setCapture();b.isiframe&&!G.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));
|
|
70
|
+
b.hasmoving=!1;return b.cancelEvent(E)}};b.onmouseup=function(E){if(b.rail.drag){if(1!=b.rail.drag.pt)return!0;G.hasmousecapture&&w.releaseCapture();b.isiframe&&!G.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents);b.rail.drag=!1;b.cursorfreezed=!1;b.hasmoving&&b.triggerScrollEnd();return b.cancelEvent(E)}};b.onmousemove=function(E){if(b.rail.drag){if(1===b.rail.drag.pt){if(G.ischrome&&0===E.which)return b.onmouseup(E);b.cursorfreezed=!0;b.hasmoving||b.triggerScrollStart(E.clientX,
|
|
71
|
+
E.clientY,0,0,0);b.hasmoving=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(E.clientX-b.rail.drag.x);0>b.scroll.x&&(b.scroll.x=0);var X=b.scrollvaluemaxw;b.scroll.x>X&&(b.scroll.x=X)}else b.scroll.y=b.rail.drag.sy+(E.clientY-b.rail.drag.y),0>b.scroll.y&&(b.scroll.y=0),X=b.scrollvaluemax,b.scroll.y>X&&(b.scroll.y=X);b.synched("mousemove",function(){b.cursorfreezed&&(b.showCursor(),b.rail.drag.hr?b.scrollLeft(Math.round(b.scroll.x*b.scrollratio.x)):b.scrollTop(Math.round(b.scroll.y*b.scrollratio.y)))});
|
|
72
|
+
return b.cancelEvent(E)}}else b.checkarea=0};if(G.cantouch||x.emulatetouch)b.onpreventclick=function(E){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(E)},b.onclick=G.isios?!1:function(E){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(E)):!0},x.grabcursorenabled&&G.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:G.cursorgrabvalue}),b.css(b.rail,{cursor:G.cursorgrabvalue}));else{var ua=function(E){if(b.selectiondrag){if(E){var X=b.win.outerHeight();
|
|
73
|
+
E=E.pageY-b.selectiondrag.top;0<E&&E<X&&(E=0);E>=X&&(E-=X);b.selectiondrag.df=E}0!==b.selectiondrag.df&&(b.doScrollBy(-(2*b.selectiondrag.df/6)|0),b.debounced("doselectionscroll",function(){ua()},50))}};b.hasTextSelected="getSelection"in w?function(){return 0<w.getSelection().rangeCount}:"selection"in w?function(){return"None"!=w.selection.type}:function(){return!1};b.onselectionstart=function(E){b.ispage||(b.selectiondrag=b.win.offset())};b.onselectionend=function(E){b.selectiondrag=!1};b.onselectiondrag=
|
|
74
|
+
function(E){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){ua(E)},250)}}G.hasw3ctouch?(b.css(b.ispage?n("html"):b.win,{"touch-action":"none"}),b.css(b.rail,{"touch-action":"none"}),b.css(b.cursor,{"touch-action":"none"}),b.bind(b.win,"pointerdown",b.ontouchstart),b.bind(w,"pointerup",b.ontouchend),b.delegate(w,"pointermove",b.ontouchmove)):G.hasmstouch?(b.css(b.ispage?n("html"):b.win,{"-ms-touch-action":"none"}),b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,
|
|
75
|
+
{"-ms-touch-action":"none"}),b.bind(b.win,"MSPointerDown",b.ontouchstart),b.bind(w,"MSPointerUp",b.ontouchend),b.delegate(w,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(E){E.preventDefault()}),b.bind(b.cursor,"contextmenu",function(E){E.preventDefault()})):G.cantouch&&(b.bind(b.win,"touchstart",b.ontouchstart,!1,!0),b.bind(w,"touchend",b.ontouchend,!1,!0),b.bind(w,"touchcancel",b.ontouchend,!1,!0),b.delegate(w,"touchmove",b.ontouchmove,!1,!0));x.emulatetouch&&(b.bind(b.win,
|
|
76
|
+
"mousedown",b.ontouchstart,!1,!0),b.bind(w,"mouseup",b.ontouchend,!1,!0),b.bind(w,"mousemove",b.ontouchmove,!1,!0));if(x.cursordragontouch||!G.cantouch&&!x.emulatetouch)b.rail.css({cursor:"default"}),b.railh&&b.railh.css({cursor:"default"}),b.jqbind(b.rail,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),x.sensitiverail&&(b.bind(b.rail,
|
|
77
|
+
"click",function(E){b.doRailClick(E,!1,!1)}),b.bind(b.rail,"dblclick",function(E){b.doRailClick(E,!0,!1)}),b.bind(b.cursor,"click",function(E){b.cancelEvent(E)}),b.bind(b.cursor,"dblclick",function(E){b.cancelEvent(E)})),b.railh&&(b.jqbind(b.railh,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),x.sensitiverail&&(b.bind(b.railh,"click",
|
|
78
|
+
function(E){b.doRailClick(E,!1,!0)}),b.bind(b.railh,"dblclick",function(E){b.doRailClick(E,!0,!0)}),b.bind(b.cursorh,"click",function(E){b.cancelEvent(E)}),b.bind(b.cursorh,"dblclick",function(E){b.cancelEvent(E)})));x.cursordragontouch&&(this.istouchcapable||G.cantouch)&&(b.bind(b.cursor,"touchstart",b.ontouchstartCursor),b.bind(b.cursor,"touchmove",b.ontouchmoveCursor),b.bind(b.cursor,"touchend",b.ontouchendCursor),b.cursorh&&b.bind(b.cursorh,"touchstart",function(E){b.ontouchstartCursor(E,!0)}),
|
|
79
|
+
b.cursorh&&b.bind(b.cursorh,"touchmove",b.ontouchmoveCursor),b.cursorh&&b.bind(b.cursorh,"touchend",b.ontouchendCursor));x.emulatetouch||G.isandroid||G.isios?(b.bind(G.hasmousecapture?b.win:w,"mouseup",b.ontouchend),b.onclick&&b.bind(w,"click",b.onclick),x.cursordragontouch?(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.cursorh&&b.bind(b.cursorh,"mousedown",function(E){b.onmousedown(E,!0)}),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onmouseup)):(b.bind(b.rail,"mousedown",
|
|
80
|
+
function(E){E.preventDefault()}),b.railh&&b.bind(b.railh,"mousedown",function(E){E.preventDefault()}))):(b.bind(G.hasmousecapture?b.win:w,"mouseup",b.onmouseup),b.bind(w,"mousemove",b.onmousemove),b.onclick&&b.bind(w,"click",b.onclick),b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.railh&&(b.bind(b.cursorh,"mousedown",function(E){b.onmousedown(E,!0)}),b.bind(b.cursorh,"mouseup",b.onmouseup)),!b.ispage&&x.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),
|
|
81
|
+
b.bind(w,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(w,"mousemove",b.onselectiondrag)),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()})));x.enablemousewheel&&(b.isiframe||b.mousewheel(G.isie&&b.ispage?w:b.win,b.onmousewheel),b.mousewheel(b.rail,b.onmousewheel),b.railh&&
|
|
82
|
+
b.mousewheel(b.railh,b.onmousewheelhr));b.ispage||G.cantouch||/HTML|^BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:++y}),b.bind(b.win,"focus",function(E){B=b.getTarget(E).id||b.getTarget(E)||!1;b.hasfocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"blur",function(E){B=!1;b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(E){u=b.getTarget(E).id||b.getTarget(E)||!1;b.hasmousefocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(E){u=
|
|
83
|
+
!1;b.hasmousefocus=!1;b.rail.drag||b.hideCursor()}));b.onkeypress=function(E){if(b.railslocked&&0===b.page.maxh)return!0;E=E||K.event;var X=b.getTarget(E);if(X&&/INPUT|TEXTAREA|SELECT|OPTION/.test(X.nodeName)&&(!X.getAttribute("type")&&!X.type||!/submit|button|cancel/i.tp)||n(X).attr("contenteditable"))return!0;if(b.hasfocus||b.hasmousefocus&&!B||b.ispage&&!B&&!u){X=E.keyCode;if(b.railslocked&&27!=X)return b.cancelEvent(E);var oa=E.ctrlKey||!1,ra=E.shiftKey||!1,sa=!1;switch(X){case 38:case 63233:b.doScrollBy(72);
|
|
84
|
+
sa=!0;break;case 40:case 63235:b.doScrollBy(-72);sa=!0;break;case 37:case 63232:b.railh&&(oa?b.doScrollLeft(0):b.doScrollLeftBy(72),sa=!0);break;case 39:case 63234:b.railh&&(oa?b.doScrollLeft(b.page.maxw):b.doScrollLeftBy(-72),sa=!0);break;case 33:case 63276:b.doScrollBy(b.view.h);sa=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h);sa=!0;break;case 36:case 63273:b.railh&&oa?b.doScrollPos(0,0):b.doScrollTo(0);sa=!0;break;case 35:case 63275:b.railh&&oa?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh);
|
|
85
|
+
sa=!0;break;case 32:x.spacebarenabled&&(ra?b.doScrollBy(b.view.h):b.doScrollBy(-b.view.h),sa=!0);break;case 27:b.zoomactive&&(b.doZoom(),sa=!0)}if(sa)return b.cancelEvent(E)}};x.enablekeyboard&&b.bind(w,G.isopera&&!G.isopera12?"keypress":"keydown",b.onkeypress);b.bind(w,"keydown",function(E){E.ctrlKey&&(b.wheelprevented=!0)});b.bind(w,"keyup",function(E){E.ctrlKey||(b.wheelprevented=!1)});b.bind(K,"blur",function(E){b.wheelprevented=!1});b.bind(K,"resize",b.onscreenresize);b.bind(K,"orientationchange",
|
|
86
|
+
b.onscreenresize);b.bind(K,"load",b.lazyResize);if(G.ischrome&&!b.ispage&&!b.haswrapper){var Aa=b.win.attr("style");f=parseFloat(b.win.css("width"))+1;b.win.css("width",f);b.synched("chromefix",function(){b.win.attr("style",Aa)})}b.onAttributeChange=function(E){b.lazyResize(b.isieold?250:30)};if(x.enableobserver&&(b.isie11||!1===ba||(b.observerbody=new ba(function(E){E.forEach(function(X){if("attributes"==X.type)return O.hasClass("modal-open")&&O.hasClass("modal-dialog")&&!n.contains(n(".modal-dialog")[0],
|
|
87
|
+
b.doc[0])?b.hide():b.show()});if(b.me.clientWidth!=b.page.width||b.me.clientHeight!=b.page.height)return b.lazyResize(30)}),b.observerbody.observe(w.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var ya=b.win[0];!1!==ba?(b.observer=new ba(function(E){E.forEach(b.onAttributeChange)}),b.observer.observe(ya,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new ba(function(E){E.forEach(function(X){if(0<X.removedNodes.length)for(var oa in X.removedNodes)if(b&&
|
|
88
|
+
X.removedNodes[oa]===ya)return b.remove()})}),b.observerremover.observe(ya.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(ya,G.isie&&!G.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),G.isie9&&ya.attachEvent("onpropertychange",b.onAttributeChange),b.bind(ya,"DOMNodeRemoved",function(E){E.target===ya&&b.remove()}))}!b.ispage&&x.boxzoom&&b.bind(K,"resize",b.resizeZoom);b.istextarea&&(b.bind(b.win,"keydown",b.lazyResize),b.bind(b.win,"mouseup",b.lazyResize));
|
|
89
|
+
b.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var za=function(){b.iframexd=!1;try{var E="contentDocument"in this?this.contentDocument:this.contentWindow._doc}catch(oa){b.iframexd=!0,E=!1}if(b.iframexd)return"console"in K&&console.log("NiceScroll error: policy restriced iframe"),!0;b.forcescreen=!0;b.isiframe&&(b.iframe={doc:n(E),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getContentSize=function(){return{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),
|
|
90
|
+
h:Math.max(b.iframe.html.scrollHeight,b.iframe.body.scrollHeight)}},b.docscroll=n(b.iframe.body));if(!G.isios&&x.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);b.doc.height("");var X=Math.max(E.getElementsByTagName("html")[0].scrollHeight,E.body.scrollHeight);b.doc.height(X)}b.lazyResize(30);b.css(n(b.iframe.body),g);G.isios&&b.haswrapper&&b.css(n(E.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(E,"scroll",b.onscroll);
|
|
91
|
+
x.enablemousewheel&&b.mousewheel(E,b.onmousewheel);x.enablekeyboard&&b.bind(E,G.isopera?"keypress":"keydown",b.onkeypress);G.cantouch?(b.bind(E,"touchstart",b.ontouchstart),b.bind(E,"touchmove",b.ontouchmove)):x.emulatetouch&&(b.bind(E,"mousedown",b.ontouchstart),b.bind(E,"mousemove",function(oa){return b.ontouchmove(oa,!0)}),x.grabcursorenabled&&G.cursorgrabvalue&&b.css(n(E.body),{cursor:G.cursorgrabvalue}));b.bind(E,"mouseup",b.ontouchend);b.zoom&&(x.dblclickzoom&&b.bind(E,"dblclick",b.doZoom),
|
|
92
|
+
b.ongesturezoom&&b.bind(E,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&"complete"===this.doc[0].readyState&&setTimeout(function(){za.call(b.doc[0],!1)},500);b.bind(this.doc,"load",za)}};this.showCursor=function(g,r){b.cursortimeout&&(clearTimeout(b.cursortimeout),b.cursortimeout=0);b.rail&&(b.autohidedom&&(b.autohidedom.stop().css({opacity:x.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&1==b.rail.drag.pt||(void 0!==g&&!1!==g&&(b.scroll.y=g/b.scrollratio.y|0),void 0!==r&&(b.scroll.x=
|
|
93
|
+
r/b.scrollratio.x|0)),b.cursor.css({height:b.cursorheight,top:b.scroll.y}),b.cursorh&&(g=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x,b.cursorh.css({width:b.cursorwidth,left:!b.rail.align&&b.rail.visibility?g+b.rail.width:g}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:x.cursoropacitymax}))};this.hideCursor=function(g){b.cursortimeout||!b.rail||!b.autohidedom||b.hasmousefocus&&"leave"===x.autohidemode||(b.cursortimeout=setTimeout(function(){b.rail.active&&b.showonmouseevent||(b.autohidedom.stop().animate({opacity:x.cursoropacitymin}),
|
|
94
|
+
b.zoom&&b.zoom.stop().animate({opacity:x.cursoropacitymin}),b.cursoractive=!1);b.cursortimeout=0},g||x.hidecursordelay))};this.noticeCursor=function(g,r,t){b.showCursor(r,t);b.rail.active||b.hideCursor(g)};this.getContentSize=b.ispage?function(){return{w:Math.max(w.body.scrollWidth,w.documentElement.scrollWidth),h:Math.max(w.body.scrollHeight,w.documentElement.scrollHeight)}}:b.haswrapper?function(){return{w:b.doc[0].offsetWidth,h:b.doc[0].offsetHeight}}:function(){return{w:b.docscroll[0].scrollWidth,
|
|
95
|
+
h:b.docscroll[0].scrollHeight}};this.onResize=function(g,r){if(!b||!b.win)return!1;g=b.page.maxh;var t=b.page.maxw,f=b.view.h,p=b.view.w;b.view={w:b.ispage?b.win.width():b.win[0].clientWidth,h:b.ispage?b.win.height():b.win[0].clientHeight};b.page=r?r:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==g&&b.page.maxw==t&&b.view.w==p&&b.view.h==f){if(b.ispage)return b;r=b.win.offset();if(b.lastposition&&(g=b.lastposition,g.top==r.top&&
|
|
96
|
+
g.left==r.left))return b;b.lastposition=r}0===b.page.maxh?(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setScrollTop(0),b.rail&&(b.rail.scrollable=!1)):(b.page.maxh-=x.railpadding.top+x.railpadding.bottom,b.rail.scrollable=!0);0===b.page.maxw?(b.hideRailHr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setScrollLeft(0),b.railh&&(b.railh.scrollable=!1)):(b.page.maxw-=x.railpadding.left+x.railpadding.right,b.railh&&(b.railh.scrollable=x.horizrailenabled));
|
|
97
|
+
b.railslocked=b.locked||0===b.page.maxh&&0===b.page.maxw;if(b.railslocked)return b.ispage||b.updateScrollBar(b.view),!1;b.hidden||(b.rail.visibility||b.showRail(),b.railh&&!b.railh.visibility&&b.showRailHr());b.istextarea&&b.win.css("resize")&&"none"!=b.win.css("resize")&&(b.view.h-=20);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h/b.page.h*b.view.h));b.cursorheight=x.cursorfixedheight?x.cursorfixedheight:Math.max(x.cursorminheight,b.cursorheight);b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w/
|
|
98
|
+
b.page.w*b.view.w));b.cursorwidth=x.cursorfixedheight?x.cursorfixedheight:Math.max(x.cursorminheight,b.cursorwidth);b.scrollvaluemax=b.view.h-b.cursorheight-(x.railpadding.top+x.railpadding.bottom);b.hasborderbox||(b.scrollvaluemax-=b.cursor[0].offsetHeight-b.cursor[0].clientHeight);b.railh&&(b.railh.width=0<b.page.maxh?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-(x.railpadding.left+x.railpadding.right));b.ispage||b.updateScrollBar(b.view);b.scrollratio={x:b.page.maxw/
|
|
99
|
+
b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=b.getScrollTop()/b.scrollratio.y|0,b.scroll.x=b.getScrollLeft()/b.scrollratio.x|0,b.cursoractive&&b.noticeCursor());b.scroll.y&&0===b.getScrollTop()&&b.doScrollTo(b.scroll.y*b.scrollratio.y|0);return b};this.resize=b.onResize;var h=0;this.onscreenresize=function(g){clearTimeout(h);var r=!b.ispage&&!b.haswrapper;r&&b.hideRails();h=setTimeout(function(){b&&(r&&b.showRails(),b.resize());
|
|
100
|
+
h=0},120)};this.lazyResize=function(g){clearTimeout(h);g=isNaN(g)?240:g;h=setTimeout(function(){b&&b.resize();h=0},g);return b};this.jqbind=function(g,r,t){b.events.push({e:g,n:r,f:t,q:!0});n(g).on(r,t)};this.mousewheel=function(g,r,t){g="jquery"in g?g[0]:g;if("onwheel"in w.createElement("div"))b._bind(g,"wheel",r,t||!1);else{var f=void 0!==w.onmousewheel?"mousewheel":"DOMMouseScroll";v(g,f,r,t||!1);"DOMMouseScroll"==f&&v(g,"MozMousePixelScroll",r,t||!1)}};var q=!1;if(G.haseventlistener){try{var C=
|
|
101
|
+
Object.defineProperty({},"passive",{get:function(){q=!0}});K.addEventListener("test",null,C)}catch(g){}this.stopPropagation=function(g){if(!g)return!1;g=g.original?g.original:g;g.stopPropagation();return!1};this.cancelEvent=function(g){g.cancelable&&g.preventDefault();g.stopImmediatePropagation();g.preventManipulation&&g.preventManipulation();return!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},K.constructor.prototype.addEventListener=
|
|
102
|
+
w.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(g,r,t){this.attachEvent("on"+g,r)},K.constructor.prototype.removeEventListener=w.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(g,r,t){this.detachEvent("on"+g,r)},this.cancelEvent=function(g){if(g=g||K.event)g.cancelBubble=!0,g.cancel=!0,g.returnValue=!1;return!1},this.stopPropagation=function(g){if(g=g||K.event)g.cancelBubble=!0;return!1};this.delegate=function(g,r,t,f,p){var D=
|
|
103
|
+
L[r]||!1;D?b.events.push({e:g,n:r,f:t,b:f,q:!1}):(D={a:[],l:[],f:function(R){for(var ea=D.l,da=!1,wa=ea.length-1;0<=wa;wa--)if(da=ea[wa].call(R.target,R),!1===da)return!1;return da}},b.bind(g,r,D.f,f,p),L[r]=D);b.ispage?(D.a=[b.id].concat(D.a),D.l=[t].concat(D.l)):(D.a.push(b.id),D.l.push(t))};this.undelegate=function(g,r,t,f,p){if((t=L[r]||!1)&&t.l)for(f=0,p=t.l.length;f<p;f++)t.a[f]===b.id&&(t.a.splice(f),t.l.splice(f),0===t.a.length&&(b._unbind(g,r,t.l.f),L[r]=null))};this.bind=function(g,r,t,
|
|
104
|
+
f,p){b._bind("jquery"in g?g[0]:g,r,t,f||!1,p||!1)};this._bind=function(g,r,t,f,p){b.events.push({e:g,n:r,f:t,b:f,q:!1});q&&(p||g==K.document||g==K.document.body||g==K)?g.addEventListener(r,t,{passive:!1,capture:f}):g.addEventListener(r,t,f||!1)};this._unbind=function(g,r,t,f){L[r]?b.undelegate(g,r,t,f):g.removeEventListener(r,t,f)};this.unbindAll=function(){for(var g=0;g<b.events.length;g++){var r=b.events[g];r.q?r.e.unbind(r.n,r.f):b._unbind(r.e,r.n,r.f,r.b)}};this.showRails=function(){return b.showRail().showRailHr()};
|
|
105
|
+
this.showRail=function(){0===b.page.maxh||!b.ispage&&"none"==b.win.css("display")||(b.rail.visibility=!0,b.rail.css("display","block"));return b};this.showRailHr=function(){b.railh&&0!==b.page.maxw&&(b.ispage||"none"!=b.win.css("display"))&&(b.railh.visibility=!0,b.railh.css("display","block"));return b};this.hideRails=function(){return b.hideRail().hideRailHr()};this.hideRail=function(){b.rail.visibility=!1;b.rail.css("display","none");return b};this.hideRailHr=function(){b.railh&&(b.railh.visibility=
|
|
106
|
+
!1,b.railh.css("display","none"));return b};this.show=function(){b.hidden=!1;b.railslocked=!1;return b.showRails()};this.hide=function(){b.hidden=!0;b.railslocked=!0;return b.hideRails()};this.toggle=function(){return b.hidden?b.show():b.hide()};this.remove=function(){b.stop();b.cursortimeout&&clearTimeout(b.cursortimeout);for(var g in b.delaylist)b.delaylist[g]&&Q(b.delaylist[g].h);b.doZoomOut();G.hasw3ctouch?b.undelegate(w,"pointermove",b.ontouchmove):G.hasmstouch?b.undelegate(w,"MSPointerMove",
|
|
107
|
+
b.ontouchmove):G.cantouch&&b.undelegate(w,"touchmove",b.ontouchmove,!1,!0);b.unbindAll();G.isie9&&b.win[0].detachEvent("onpropertychange",b.onAttributeChange);!1!==b.observer&&b.observer.disconnect();!1!==b.observerremover&&b.observerremover.disconnect();!1!==b.observerbody&&b.observerbody.disconnect();b.events=null;b.cursor&&b.cursor.remove();b.cursorh&&b.cursorh.remove();b.rail&&b.rail.remove();b.railh&&b.railh.remove();b.zoom&&b.zoom.remove();for(g=0;g<b.saved.css.length;g++){var r=b.saved.css[g];
|
|
108
|
+
r[0].css(r[1],void 0===r[2]?"":r[2])}b.saved=!1;b.me.data("__nicescroll","");var t=n.nicescroll;t.each(function(p){if(this&&this.id===b.id){delete t[p];for(var D=++p;D<t.length;D++,p++)t[p]=t[D];t.length--;t.length&&delete t[t.length]}});for(var f in b)b[f]=null,delete b[f];b=null};this.scrollstart=function(g){this.onscrollstart=g;return b};this.scrollend=function(g){this.onscrollend=g;return b};this.scrollcancel=function(g){this.onscrollcancel=g;return b};this.zoomin=function(g){this.onzoomin=g;
|
|
109
|
+
return b};this.zoomout=function(g){this.onzoomout=g;return b};this.isScrollable=function(g){g=g.target?g.target:g;if("OPTION"==g.nodeName)return!0;for(;g&&1==g.nodeType&&g!==this.me[0]&&!/^BODY|HTML/.test(g.nodeName);){var r=n(g);r=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"";if(/scroll|auto/.test(r))return g.clientHeight!=g.scrollHeight;g=g.parentNode?g.parentNode:!1}return!1};this.getViewport=function(g){for(g=g&&g.parentNode?g.parentNode:!1;g&&1==g.nodeType&&!/^BODY|HTML/.test(g.nodeName);){var r=
|
|
110
|
+
n(g);if(/fixed|absolute/.test(r.css("position")))return r;var t=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"";if(/scroll|auto/.test(t)&&g.clientHeight!=g.scrollHeight||0<r.getNiceScroll().length)return r;g=g.parentNode?g.parentNode:!1}return!1};this.triggerScrollStart=function(g,r,t,f,p){b.onscrollstart&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:g,y:r},request:{x:t,y:f},end:{x:b.newscrollx,y:b.newscrolly},speed:p})};this.triggerScrollEnd=function(){if(b.onscrollend){var g=
|
|
111
|
+
b.getScrollLeft(),r=b.getScrollTop();b.onscrollend.call(b,{type:"scrollend",current:{x:g,y:r},end:{x:g,y:r}})}};var H=0,P=0,N=0,V=1,S=!1;this.onmousewheel=function(g){if(b.wheelprevented||b.locked)return!1;if(b.railslocked)return b.debounced("checkunlock",b.resize,250),!1;if(b.rail.drag)return b.cancelEvent(g);"auto"===x.oneaxismousemode&&0!==g.deltaX&&(x.oneaxismousemode=!1);if(x.oneaxismousemode&&0===g.deltaX&&!b.rail.scrollable)return b.railh&&b.railh.scrollable?b.onmousewheelhr(g):!0;var r=Z(),
|
|
112
|
+
t=!1;x.preservenativescrolling&&b.checkarea+600<r&&(b.nativescrollingarea=b.isScrollable(g),t=!0);b.checkarea=r;if(b.nativescrollingarea)return!0;if(g=A(g,!1,t))b.checkarea=0;return g};this.onmousewheelhr=function(g){if(!b.wheelprevented){if(b.railslocked||!b.railh.scrollable)return!0;if(b.rail.drag)return b.cancelEvent(g);var r=Z(),t=!1;x.preservenativescrolling&&b.checkarea+600<r&&(b.nativescrollingarea=b.isScrollable(g),t=!0);b.checkarea=r;return b.nativescrollingarea?!0:b.railslocked?b.cancelEvent(g):
|
|
113
|
+
A(g,!0,t)}};this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=!1;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this.getTransitionSpeed=function(g){return 80+g/72*x.scrollspeed|0};if(x.smoothscroll)if(b.ishwscroll&&G.hastransition&&x.usetransition&&x.smoothscroll){var U="";this.resetTransition=function(){U="";b.doc.css(G.prefixstyle+"transition-duration","0ms")};this.prepareTransition=function(g,r){g=r?g:b.getTransitionSpeed(g);
|
|
114
|
+
r=g+"ms";U!==r&&(U=r,b.doc.css(G.prefixstyle+"transition-duration",r));return g};this.doScrollLeft=function(g,r){var t=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(g,t,r)};this.doScrollTop=function(g,r){var t=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(t,g,r)};this.cursorupdate={running:!1,start:function(){var g=this;if(!g.running){g.running=!0;var r=function(){g.running&&M(r);b.showCursor(b.getScrollTop(),b.getScrollLeft());b.notifyScrollEvent(b.win[0])};M(r)}},stop:function(){this.running=
|
|
115
|
+
!1}};this.doScrollPos=function(g,r,t){t=b.getScrollTop();var f=b.getScrollLeft();(0>(b.newscrolly-t)*(r-t)||0>(b.newscrollx-f)*(g-f))&&b.cancelScroll();x.bouncescroll?(0>r?r=r/2|0:r>b.page.maxh&&(r=b.page.maxh+(r-b.page.maxh)/2|0),0>g?g=g/2|0:g>b.page.maxw&&(g=b.page.maxw+(g-b.page.maxw)/2|0)):(0>r?r=0:r>b.page.maxh&&(r=b.page.maxh),0>g?g=0:g>b.page.maxw&&(g=b.page.maxw));if(b.scrollrunning&&g==b.newscrollx&&r==b.newscrolly)return!1;b.newscrolly=r;b.newscrollx=g;t=b.getScrollTop();f=b.getScrollLeft();
|
|
116
|
+
var p=g-f;var D=r-t;p=b.prepareTransition(Math.sqrt(p*p+D*D)|0);b.scrollrunning||(b.scrollrunning=!0,b.triggerScrollStart(f,t,g,r,p),b.cursorupdate.start());b.scrollendtrapped=!0;G.transitionend||(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),b.scrollendtrapped=setTimeout(b.onScrollTransitionEnd,p));b.setScrollTop(b.newscrolly);b.setScrollLeft(b.newscrollx)};this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;var g=b.getScrollTop(),r=b.getScrollLeft();b.scrollrunning=!1;G.transitionend||
|
|
117
|
+
clearTimeout(G.transitionend);b.scrollendtrapped=!1;b.resetTransition();b.setScrollTop(g);b.railh&&b.setScrollLeft(r);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=!1;b.cursorfreezed=!1;b.cursorupdate.stop();b.showCursor(g,r);return b};this.onScrollTransitionEnd=function(){if(b.scrollendtrapped){var g=b.getScrollTop(),r=b.getScrollLeft();0>g?g=0:g>b.page.maxh&&(g=b.page.maxh);0>r?r=0:r>b.page.maxw&&(r=b.page.maxw);if(g!=b.newscrolly||r!=b.newscrollx)return b.doScrollPos(r,
|
|
118
|
+
g,x.snapbackspeed);b.scrollrunning&&b.triggerScrollEnd();b.scrollrunning=!1;b.scrollendtrapped=!1;b.resetTransition();b.timerscroll=!1;b.setScrollTop(g);b.railh&&b.setScrollLeft(r);b.cursorupdate.stop();b.noticeCursor(!1,g,r);b.cursorfreezed=!1}}}else this.doScrollLeft=function(g,r){var t=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(g,t,r)},this.doScrollTop=function(g,r){var t=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(t,g,r)},this.doScrollPos=function(g,r,t){t=b.getScrollTop();
|
|
119
|
+
var f=b.getScrollLeft();(0>(b.newscrolly-t)*(r-t)||0>(b.newscrollx-f)*(g-f))&&b.cancelScroll();var p=!1;b.bouncescroll&&b.rail.visibility||(0>r?(r=0,p=!0):r>b.page.maxh&&(r=b.page.maxh,p=!0));b.bouncescroll&&b.railh.visibility||(0>g?(g=0,p=!0):g>b.page.maxw&&(g=b.page.maxw,p=!0));if(b.scrollrunning&&b.newscrolly===r&&b.newscrollx===g)return!0;b.newscrolly=r;b.newscrollx=g;b.dst={};b.dst.x=g-f;b.dst.y=r-t;b.dst.px=f;b.dst.py=t;var D=b.getTransitionSpeed(Math.sqrt(b.dst.x*b.dst.x+b.dst.y*b.dst.y)|0);
|
|
120
|
+
b.bzscroll={};p=p?1:.58;b.bzscroll.x=new ja(f,b.newscrollx,D,0,0,p,1);b.bzscroll.y=new ja(t,b.newscrolly,D,0,0,p,1);Z();var R=function(){if(b.scrollrunning){var ea=b.bzscroll.y.getPos();b.setScrollLeft(b.bzscroll.x.getNow());b.setScrollTop(b.bzscroll.y.getNow());1>=ea?b.timer=M(R):(b.scrollrunning=!1,b.timer=0,b.triggerScrollEnd())}};b.scrollrunning||(b.triggerScrollStart(f,t,g,r,D),b.scrollrunning=!0,b.timer=M(R))},this.cancelScroll=function(){b.timer&&Q(b.timer);b.timer=0;b.bzscroll=!1;b.scrollrunning=
|
|
121
|
+
!1;return b};else this.doScrollLeft=function(g,r){var t=b.getScrollTop();b.doScrollPos(g,t,r)},this.doScrollTop=function(g,r){var t=b.getScrollLeft();b.doScrollPos(t,g,r)},this.doScrollPos=function(g,r,t){var f=g>b.page.maxw?b.page.maxw:g;0>f&&(f=0);var p=r>b.page.maxh?b.page.maxh:r;0>p&&(p=0);b.synched("scroll",function(){b.setScrollTop(p);b.setScrollLeft(f)})},this.cancelScroll=function(){};this.doScrollBy=function(g,r){z(0,g)};this.doScrollLeftBy=function(g,r){z(g,0)};this.doScrollTo=function(g,
|
|
122
|
+
r){b.cursorfreezed=!1;b.doScrollTop(g)};this.checkContentSize=function(){var g=b.getContentSize();g.h==b.page.h&&g.w==b.page.w||b.resize(!1,g)};b.onscroll=function(g){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()/b.scrollratio.y);b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()/b.scrollratio.x));b.noticeCursor()})};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(g){if(!b.zoomactive){b.zoomactive=!0;b.zoomrestore={style:{}};var r=
|
|
123
|
+
"position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),t=b.win[0].style,f;for(f in r){var p=r[f];b.zoomrestore.style[p]=void 0!==t[p]?t[p]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};G.isios4&&(b.zoomrestore.scrollTop=I.scrollTop(),I.scrollTop(0));b.win.css({position:G.isios4?"absolute":"fixed",top:0,left:0,
|
|
124
|
+
zIndex:J+100,margin:0});r=b.win.css("backgroundColor");(""===r||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(r))&&b.win.css("backgroundColor","#fff");b.rail.css({zIndex:J+101});b.zoom.css({zIndex:J+102});b.zoom.css("backgroundPosition","0 -18px");b.resizeZoom();b.onzoomin&&b.onzoomin.call(b);return b.cancelEvent(g)}};this.doZoomOut=function(g){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),G.isios4&&I.scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),
|
|
125
|
+
b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0 0"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(g)};this.doZoom=function(g){return b.zoomactive?b.doZoomOut(g):b.doZoomIn(g)};this.resizeZoom=function(){if(b.zoomactive){var g=b.getScrollTop();b.win.css({width:I.width()-b.zoomrestore.padding.w+"px",height:I.height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,g))}};this.init();n.nicescroll.push(this)},ia=function(T){var e=
|
|
126
|
+
this;this.nc=T;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.reset=function(l,m){e.stop();e.steptime=0;e.lasttime=Z();e.speedx=0;e.speedy=0;e.lastx=l;e.lasty=m;e.lastscrollx=-1;e.lastscrolly=-1};this.update=function(l,m){var c=Z();e.steptime=c-e.lasttime;e.lasttime=c;c=m-e.lasty;var v=l-e.lastx,z=e.nc.getScrollTop(),A=e.nc.getScrollLeft();z+=c;
|
|
127
|
+
A+=v;e.snapx=0>A||A>e.nc.page.maxw;e.snapy=0>z||z>e.nc.page.maxh;e.speedx=v;e.speedy=c;e.lastx=l;e.lasty=m};this.stop=function(){e.nc.unsynched("domomentum2d");e.timer&&clearTimeout(e.timer);e.timer=0;e.lastscrollx=-1;e.lastscrolly=-1};this.doSnapy=function(l,m){var c=!1;0>m?(m=0,c=!0):m>e.nc.page.maxh&&(m=e.nc.page.maxh,c=!0);0>l?(l=0,c=!0):l>e.nc.page.maxw&&(l=e.nc.page.maxw,c=!0);c?e.nc.doScrollPos(l,m,e.nc.opt.snapbackspeed):e.nc.triggerScrollEnd()};this.doMomentum=function(l){var m=Z(),c=l?m+
|
|
128
|
+
l:e.lasttime;l=e.nc.getScrollLeft();var v=e.nc.getScrollTop(),z=e.nc.page.maxh,A=e.nc.page.maxw;e.speedx=0<A?Math.min(60,e.speedx):0;e.speedy=0<z?Math.min(60,e.speedy):0;c=c&&60>=m-c;if(0>v||v>z||0>l||l>A)c=!1;l=e.speedx&&c?e.speedx:!1;if(e.speedy&&c&&e.speedy||l){var b=Math.max(16,e.steptime);50<b&&(l=b/50,e.speedx*=l,e.speedy*=l,b=50);e.demulxy=0;e.lastscrollx=e.nc.getScrollLeft();e.chkx=e.lastscrollx;e.lastscrolly=e.nc.getScrollTop();e.chky=e.lastscrolly;var O=e.lastscrollx,x=e.lastscrolly,ca=
|
|
129
|
+
function(){var G=600<Z()-m?.04:.02;e.speedx&&(O=Math.floor(e.lastscrollx-e.speedx*(1-e.demulxy)),e.lastscrollx=O,0>O||O>A)&&(G=.1);e.speedy&&(x=Math.floor(e.lastscrolly-e.speedy*(1-e.demulxy)),e.lastscrolly=x,0>x||x>z)&&(G=.1);e.demulxy=Math.min(1,e.demulxy+G);e.nc.synched("domomentum2d",function(){e.speedx&&(e.nc.getScrollLeft(),e.chkx=O,e.nc.setScrollLeft(O));e.speedy&&(e.nc.getScrollTop(),e.chky=x,e.nc.setScrollTop(x));e.timer||(e.nc.hideCursor(),e.doSnapy(O,x))});1>e.demulxy?e.timer=setTimeout(ca,
|
|
130
|
+
b):(e.stop(),e.nc.hideCursor(),e.doSnapy(O,x))};ca()}else e.doSnapy(e.nc.getScrollLeft(),e.nc.getScrollTop())}},qa=n.fn.scrollTop;"object"===typeof n.cssHooks&&(n.cssHooks.pageYOffset={get:function(T,e,l){return(e=n.data(T,"__nicescroll")||!1)&&e.ishwscroll?e.getScrollTop():qa.call(T)},set:function(T,e){var l=n.data(T,"__nicescroll")||!1;l&&l.ishwscroll?l.setScrollTop(parseInt(e)):qa.call(T,e);return this}});n.fn.scrollTop=function(T){if(void 0===T){var e=this[0]?n.data(this[0],"__nicescroll")||!1:
|
|
131
|
+
!1;return e&&e.ishwscroll?e.getScrollTop():qa.call(this)}return this.each(function(){var l=n.data(this,"__nicescroll")||!1;l&&l.ishwscroll?l.setScrollTop(parseInt(T)):qa.call(n(this),T)})};var fa=n.fn.scrollLeft;"object"===typeof n.cssHooks&&(n.cssHooks.pageXOffset={get:function(T,e,l){return(e=n.data(T,"__nicescroll")||!1)&&e.ishwscroll?e.getScrollLeft():fa.call(T)},set:function(T,e){var l=n.data(T,"__nicescroll")||!1;l&&l.ishwscroll?l.setScrollLeft(parseInt(e)):fa.call(T,e);return this}});n.fn.scrollLeft=
|
|
132
|
+
function(T){if(void 0===T){var e=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return e&&e.ishwscroll?e.getScrollLeft():fa.call(this)}return this.each(function(){var l=n.data(this,"__nicescroll")||!1;l&&l.ishwscroll?l.setScrollLeft(parseInt(T)):fa.call(n(this),T)})};var aa=function(T){var e=this;this.length=0;this.name="nicescrollarray";this.each=function(c){n.each(e,c);return e};this.push=function(c){e[e.length]=c;e.length++};this.eq=function(c){return e[c]};if(T)for(var l=0;l<T.length;l++){var m=
|
|
133
|
+
n.data(T[l],"__nicescroll")||!1;m&&(this[this.length]=m,this.length++)}return this};(function(T,e,l){for(var m=0,c=e.length;m<c;m++)l(T,e[m])})(aa.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(T,e){T[e]=function(){var l=arguments;return this.each(function(){this[e].apply(this,l)})}});n.fn.getNiceScroll=function(T){return void 0===T?new aa(this):this[T]&&n.data(this[T],"__nicescroll")||!1};if("object"===typeof n.expr){var na=n.expr.pseudos||n.expr[":"];na&&
|
|
134
|
+
(na.nicescroll=function(T){return void 0!==n.data(T,"__nicescroll")})}n.fn.niceScroll=function(T,e){void 0!==e||"object"!=typeof T||"jquery"in T||(e=T,T=!1);var l=new aa;this.each(function(){var m=n(this),c=n.extend({},e);if(T){var v=n(T);c.doc=1<v.length?n(T,m):v;c.win=m}"doc"in c&&!("win"in c)&&(c.win=m);v=m.data("__nicescroll")||!1;v||(c.doc=c.doc||m,v=new ka(c,m),m.data("__nicescroll",v));l.push(v)});return 1===l.length?l[0]:l};K.NiceScroll={getjQuery:function(){return n}};n.nicescroll||(n.nicescroll=
|
|
135
|
+
new aa,n.nicescroll.options=ha)})(function(n){var B=function(){function u(f){return null==f?String(f):H[P.call(f)]||"object"}function y(f){return"function"==u(f)}function F(f){return null!=f&&f==f.window}function J(f){return"object"==u(f)}function w(f){return J(f)&&!F(f)&&Object.getPrototypeOf(f)==Object.prototype}function I(f){var p=!!f&&"length"in f&&f.length,D=t.type(f);return"function"!=D&&!F(f)&&("array"==D||0===p||"number"==typeof p&&0<p&&p-1 in f)}function L(f){return l.call(f,function(p){return null!=
|
|
136
|
+
p})}function M(f){return f.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function Q(f){return f in z?z[f]:z[f]=new RegExp("(^|\\s)"+f+"(\\s|$)")}function Y(f,p){return"number"!=typeof p||A[M(f)]?p:p+"px"}function ba(f){return"children"in f?m.call(f.children):t.map(f.childNodes,function(p){if(1==p.nodeType)return p})}function Z(f,p){var D,R=f?f.length:0;for(D=0;D<R;D++)this[D]=f[D];this.length=R;this.selector=p||""}
|
|
137
|
+
function ha(f,p,D){for(aa in p)D&&(w(p[aa])||U(p[aa]))?(w(p[aa])&&!w(f[aa])&&(f[aa]={}),U(p[aa])&&!U(f[aa])&&(f[aa]=[]),ha(f[aa],p[aa],D)):p[aa]!==fa&&(f[aa]=p[aa])}function ma(f,p){return null==p?t(f):t(f).filter(p)}function W(f,p,D,R){return y(p)?p.call(f,D,R):p}function ka(f,p){var D=f.className||"",R=D&&D.baseVal!==fa;if(p===fa)return R?D.baseVal:D;R?D.baseVal=p:f.className=p}function ia(f){try{return f?"true"==f||("false"==f?!1:"null"==f?null:+f+""==f?+f:/^[\[\{]/.test(f)?t.parseJSON(f):f):f}catch(p){return f}}
|
|
138
|
+
function qa(f,p){p(f);for(var D=0,R=f.childNodes.length;D<R;D++)qa(f.childNodes[D],p)}var fa,aa,na,T=[],e=T.concat,l=T.filter,m=T.slice,c=n.document,v={},z={},A={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},b=/^\s*<(\w+|!)[^>]*>/,O=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,x=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ca=/^(?:body|html)$/i,G=/([A-Z])/g,ja="val css html text data width height offset".split(" "),la=c.createElement("table"),
|
|
139
|
+
d=c.createElement("tr"),h={tr:c.createElement("tbody"),tbody:la,thead:la,tfoot:la,td:d,th:d,"*":c.createElement("div")},q=/complete|loaded|interactive/,C=/^[\w-]*$/,H={},P=H.toString,N={},V=c.createElement("div"),S={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},U=Array.isArray||function(f){return f instanceof
|
|
140
|
+
Array};N.matches=function(f,p){if(!p||!f||1!==f.nodeType)return!1;var D=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.matchesSelector;if(D)return D.call(f,p);var R=f.parentNode;(D=!R)&&(R=V).appendChild(f);p=~N.qsa(R,p).indexOf(f);D&&V.removeChild(f);return p};var g=function(f){return f.replace(/-+(.)?/g,function(p,D){return D?D.toUpperCase():""})};var r=function(f){return l.call(f,function(p,D){return f.indexOf(p)==D})};N.fragment=function(f,p,D){var R;O.test(f)&&
|
|
141
|
+
(R=t(c.createElement(RegExp.$1)));if(!R){f.replace&&(f=f.replace(x,"<$1></$2>"));p===fa&&(p=b.test(f)&&RegExp.$1);p in h||(p="*");var ea=h[p];ea.innerHTML=""+f;R=t.each(m.call(ea.childNodes),function(){ea.removeChild(this)})}if(w(D)){var da=t(R);t.each(D,function(wa,ta){if(-1<ja.indexOf(wa))da[wa](ta);else da.attr(wa,ta)})}return R};N.Z=function(f,p){return new Z(f,p)};N.isZ=function(f){return f instanceof N.Z};N.init=function(f,p){if(f)if("string"==typeof f)if(f=f.trim(),"<"==f[0]&&b.test(f))p=N.fragment(f,
|
|
142
|
+
RegExp.$1,p),f=null;else{if(p!==fa)return t(p).find(f);p=N.qsa(c,f)}else{if(y(f))return t(c).ready(f);if(N.isZ(f))return f;if(U(f))p=L(f);else if(J(f))p=[f],f=null;else if(b.test(f))p=N.fragment(f.trim(),RegExp.$1,p),f=null;else{if(p!==fa)return t(p).find(f);p=N.qsa(c,f)}}else return N.Z();return N.Z(p,f)};var t=function(f,p){return N.init(f,p)};t.extend=function(f){var p=m.call(arguments,1);if("boolean"==typeof f){var D=f;f=p.shift()}p.forEach(function(R){ha(f,R,D)});return f};N.qsa=function(f,p){var D,
|
|
143
|
+
R="#"==p[0],ea=!R&&"."==p[0],da=R||ea?p.slice(1):p,wa=C.test(da);return f.getElementById&&wa&&R?(D=f.getElementById(da))?[D]:[]:1!==f.nodeType&&9!==f.nodeType&&11!==f.nodeType?[]:m.call(wa&&!R&&f.getElementsByClassName?ea?f.getElementsByClassName(da):f.getElementsByTagName(p):f.querySelectorAll(p))};t.contains=c.documentElement.contains?function(f,p){return f!==p&&f.contains(p)}:function(f,p){for(;p&&=p.parentNode;)if(p===f)return!0;return!1};t.type=u;t.isFunction=y;t.isWindow=F;t.isArray=U;t.isPlainObject=
|
|
144
|
+
w;t.isEmptyObject=function(f){for(var p in f)return!1;return!0};t.isNumeric=function(f){var p=Number(f),D=typeof f;return null!=f&&"boolean"!=D&&("string"!=D||f.length)&&!isNaN(p)&&isFinite(p)||!1};t.inArray=function(f,p,D){return T.indexOf.call(p,f,D)};t.camelCase=g;t.trim=function(f){return null==f?"":String.prototype.trim.call(f)};t.uuid=0;t.support={};t.expr={};t.noop=function(){};t.map=function(f,p){var D=[],R;if(I(f))for(R=0;R<f.length;R++){var ea=p(f[R],R);null!=ea&&D.push(ea)}else for(R in f)ea=
|
|
145
|
+
p(f[R],R),null!=ea&&D.push(ea);return 0<D.length?t.fn.concat.apply([],D):D};t.each=function(f,p){var D;if(I(f))for(D=0;D<f.length&&!1!==p.call(f[D],D,f[D]);D++);else for(D in f)if(!1===p.call(f[D],D,f[D]))break;return f};t.grep=function(f,p){return l.call(f,p)};n.JSON&&(t.parseJSON=JSON.parse);t.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(f,p){H["[object "+p+"]"]=p.toLowerCase()});t.data=function(f,p,D){if(D===fa)return"undefined"!==typeof f[p]?f[p]:fa;
|
|
146
|
+
null===D?delete f[p]:f[p]=D};t.fn={jquery:"1.2.0",constructor:N.Z,length:0,forEach:T.forEach,reduce:T.reduce,push:T.push,sort:T.sort,splice:T.splice,indexOf:T.indexOf,concat:function(){var f,p=[];for(f=0;f<arguments.length;f++){var D=arguments[f];p[f]=N.isZ(D)?D.toArray():D}return e.apply(N.isZ(this)?this.toArray():this,p)},map:function(f){return t(t.map(this,function(p,D){return f.call(p,D,p)}))},slice:function(){return t(m.apply(this,arguments))},ready:function(f){q.test(c.readyState)&&c.body?f(t):
|
|
147
|
+
c.addEventListener("DOMContentLoaded",function(){f(t)},!1);return this},get:function(f){return f===fa?m.call(this):this[0<=f?f:f+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(f){T.every.call(this,function(p,D){return!1!==f.call(p,D,p)});return this},filter:function(f){return y(f)?this.not(this.not(f)):t(l.call(this,function(p){return N.matches(p,
|
|
148
|
+
f)}))},add:function(f,p){return t(r(this.concat(t(f,p))))},is:function(f){return":visible"===f?0<this.length?"none"!==this.css("display"):!1:J(f)?this[0]===f?!0:!1:0<this.length&&N.matches(this[0],f)},not:function(f){var p=[];if(y(f)&&f.call!==fa)this.each(function(R){f.call(this,R)||p.push(this)});else{var D="string"==typeof f?this.filter(f):I(f)&&y(f.item)?m.call(f):t(f);this.forEach(function(R){0>D.indexOf(R)&&p.push(R)})}return t(p)},has:function(f){return this.filter(function(){return J(f)?t.contains(this,
|
|
149
|
+
f):t(this).find(f).size()})},eq:function(f){return-1===f?this.slice(f):this.slice(f,+f+1)},first:function(){var f=this[0];return f&&!J(f)?f:t(f)},last:function(){var f=this[this.length-1];return f&&!J(f)?f:t(f)},find:function(f){var p=this;return f?"object"==typeof f?t(f).filter(function(){var D=this;return T.some.call(p,function(R){return t.contains(R,D)})}):1==this.length?t(N.qsa(this[0],f)):this.map(function(){return N.qsa(this,f)}):t()},closest:function(f,p){var D=[],R="object"==typeof f&&t(f);
|
|
150
|
+
this.each(function(ea,da){for(;da&&!(R?0<=R.indexOf(da):N.matches(da,f));)da=da!==p&&!(null!=da&&da.nodeType==da.DOCUMENT_NODE)&&da.parentNode;da&&0>D.indexOf(da)&&D.push(da)});return t(D)},parents:function(f){for(var p=[],D=this;0<D.length;)D=t.map(D,function(R){if((R=R.parentNode)&&(null==R||R.nodeType!=R.DOCUMENT_NODE)&&0>p.indexOf(R))return p.push(R),R});return ma(p,f)},parent:function(f){return ma(r(this.pluck("parentNode")),f)},children:function(f){return ma(this.map(function(){return ba(this)}),
|
|
151
|
+
f)},contents:function(){return this.map(function(){return this.contentDocument||m.call(this.childNodes)})},siblings:function(f){return ma(this.map(function(p,D){return l.call(ba(D.parentNode),function(R){return R!==D})}),f)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(f){return t.map(this,function(p){return p[f]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display="");if("none"==getComputedStyle(this,"").getPropertyValue("display")){var f=
|
|
152
|
+
this.style,p=this.nodeName;if(!v[p]){var D=c.createElement(p);c.body.appendChild(D);var R=getComputedStyle(D,"").getPropertyValue("display");D.parentNode.removeChild(D);"none"==R&&(R="block");v[p]=R}f.display=v[p]}})},replaceWith:function(f){return this.before(f).remove()},wrap:function(f){var p=y(f);if(this[0]&&!p)var D=t(f).get(0),R=D.parentNode||1<this.length;return this.each(function(ea){t(this).wrapAll(p?f.call(this,ea):R?D.cloneNode(!0):D)})},wrapAll:function(f){if(this[0]){t(this[0]).before(f=
|
|
153
|
+
t(f));for(var p;(p=f.children()).length;)f=p.first();t(f).append(this)}return this},wrapInner:function(f){var p=y(f);return this.each(function(D){var R=t(this),ea=R.contents();D=p?f.call(this,D):f;ea.length?ea.wrapAll(D):R.append(D)})},unwrap:function(){this.parent().each(function(){t(this).replaceWith(t(this).children())});return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(f){return this.each(function(){var p=
|
|
154
|
+
t(this);(f===fa?"none"==p.css("display"):f)?p.show():p.hide()})},prev:function(f){return t(this.pluck("previousElementSibling")).filter(f||"*")},next:function(f){return t(this.pluck("nextElementSibling")).filter(f||"*")},html:function(f){return 0 in arguments?this.each(function(p){var D=this.innerHTML;t(this).empty().append(W(this,f,p,D))}):0 in this?this[0].innerHTML:null},text:function(f){return 0 in arguments?this.each(function(p){p=W(this,f,p,this.textContent);this.textContent=null==p?"":""+p}):
|
|
155
|
+
0 in this?this.pluck("textContent").join(""):null},attr:function(f,p){var D;return"string"!=typeof f||1 in arguments?this.each(function(R){if(1===this.nodeType)if(J(f))for(aa in f){var ea=aa;R=f[aa];null==R?this.removeAttribute(ea):this.setAttribute(ea,R)}else ea=f,R=W(this,p,R,this.getAttribute(f)),null==R?this.removeAttribute(ea):this.setAttribute(ea,R)}):0 in this&&1==this[0].nodeType&&null!=(D=this[0].getAttribute(f))?D:fa},removeAttr:function(f){return this.each(function(){1===this.nodeType&&
|
|
156
|
+
f.split(" ").forEach(function(p){this.removeAttribute(p)},this)})},prop:function(f,p){f=S[f]||f;return 1 in arguments?this.each(function(D){this[f]=W(this,p,D,this[f])}):this[0]&&this[0][f]},removeProp:function(f){f=S[f]||f;return this.each(function(){delete this[f]})},data:function(f,p){if("object"===typeof p)this.length&&(this[0][f]=p);else{if("undefined"===typeof p){if(this.length&&"undefined"!==typeof this[0][f])return this[0][f]}else this.length&&("undefined"!==typeof this[0][f]&&delete this[0][f],
|
|
157
|
+
p&&(this[0][f]=p));var D="data-"+f.replace(G,"-$1").toLowerCase();D=1 in arguments?this.attr(D,p):this.attr(D);return null!==D?ia(D):fa}},val:function(f){return 0 in arguments?(null==f&&(f=""),this.each(function(p){this.value=W(this,f,p,this.value)})):this[0]&&(this[0].multiple?t(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(f){if(f)return this.each(function(D){var R=t(this);D=W(this,f,D,R.offset());var ea=R.offsetParent().offset();
|
|
158
|
+
D={top:D.top-ea.top,left:D.left-ea.left};"static"==R.css("position")&&(D.position="relative");R.css(D)});if(!this.length)return null;if(c.documentElement!==this[0]&&!t.contains(c.documentElement,this[0]))return{top:0,left:0};var p=this[0].getBoundingClientRect();return{left:p.left+n.pageXOffset,top:p.top+n.pageYOffset,width:Math.round(p.width),height:Math.round(p.height)}},css:function(f,p){if(2>arguments.length){var D=this[0];if("string"==typeof f)return D?D.style[g(f)]||getComputedStyle(D,"").getPropertyValue(f):
|
|
159
|
+
void 0;if(U(f)){if(!D)return;var R={},ea=getComputedStyle(D,"");t.each(f,function(wa,ta){R[ta]=D.style[g(ta)]||ea.getPropertyValue(ta)});return R}}var da="";if("string"==u(f))p||0===p?da=M(f)+":"+Y(f,p):this.each(function(){this.style.removeProperty(M(f))});else for(aa in f)f[aa]||0===f[aa]?da+=M(aa)+":"+Y(aa,f[aa])+";":this.each(function(){this.style.removeProperty(M(aa))});return this.each(function(){this.style.cssText+=";"+da})},index:function(f){return f?this.indexOf(t(f)[0]):this.parent().children().indexOf(this[0])},
|
|
160
|
+
hasClass:function(f){return f?T.some.call(this,function(p){return this.test(ka(p))},Q(f)):!1},addClass:function(f){return f?this.each(function(p){if("className"in this){na=[];var D=ka(this);W(this,f,p,D).split(/\s+/g).forEach(function(R){t(this).hasClass(R)||na.push(R)},this);na.length&&ka(this,D+(D?" ":"")+na.join(" "))}}):this},removeClass:function(f){return this.each(function(p){if("className"in this){if(f===fa)return ka(this,"");na=ka(this);W(this,f,p,na).split(/\s+/g).forEach(function(D){na=
|
|
161
|
+
na.replace(Q(D)," ")});ka(this,na.trim())}})},toggleClass:function(f,p){return f?this.each(function(D){var R=t(this);W(this,f,D,ka(this)).split(/\s+/g).forEach(function(ea){(p===fa?!R.hasClass(ea):p)?R.addClass(ea):R.removeClass(ea)})}):this},scrollTop:function(f){if(this.length){var p="scrollTop"in this[0];return f===fa?p?this[0].scrollTop:this[0].pageYOffset:this.each(p?function(){this.scrollTop=f}:function(){this.scrollTo(this.scrollX,f)})}},scrollLeft:function(f){if(this.length){var p="scrollLeft"in
|
|
162
|
+
this[0];return f===fa?p?this[0].scrollLeft:this[0].pageXOffset:this.each(p?function(){this.scrollLeft=f}:function(){this.scrollTo(f,this.scrollY)})}},position:function(){if(this.length){var f=this[0],p=this.offsetParent(),D=this.offset(),R=ca.test(p[0].nodeName)?{top:0,left:0}:p.offset();D.top-=parseFloat(t(f).css("margin-top"))||0;D.left-=parseFloat(t(f).css("margin-left"))||0;R.top+=parseFloat(t(p[0]).css("border-top-width"))||0;R.left+=parseFloat(t(p[0]).css("border-left-width"))||0;return{top:D.top-
|
|
163
|
+
R.top,left:D.left-R.left}}},offsetParent:function(){return this.map(function(){for(var f=this.offsetParent||c.body;f&&!ca.test(f.nodeName)&&"static"==t(f).css("position");)f=f.offsetParent;return f})}};t.fn.detach=t.fn.remove;["width","height"].forEach(function(f){var p=f.replace(/./,function(D){return D[0].toUpperCase()});t.fn[f]=function(D){var R,ea=this[0];return D===fa?F(ea)?ea["inner"+p]:null!=ea&&ea.nodeType==ea.DOCUMENT_NODE?ea.documentElement["scroll"+p]:(R=this.offset())&&R[f]:this.each(function(da){ea=
|
|
164
|
+
t(this);ea.css(f,W(this,D,da,ea[f]()))})}});t.fn.innerWidth=function(){return this.width()};t.fn.innerHeight=function(){return this.height()};["after","prepend","before","append"].forEach(function(f,p){var D=p%2;t.fn[f]=function(){var R,ea=t.map(arguments,function(ta){var ua=[];R=u(ta);return"array"==R?(ta.forEach(function(Aa){if(Aa.nodeType!==fa)return ua.push(Aa);if(t.zepto.isZ(Aa))return ua=ua.concat(Aa.get());ua=ua.concat(N.fragment(Aa))}),ua):"object"==R||null==ta?ta:N.fragment(ta)}),da,wa=1<
|
|
165
|
+
this.length;return 1>ea.length?this:this.each(function(ta,ua){da=D?ua:ua.parentNode;ua=0==p?ua.nextSibling:1==p?ua.firstChild:2==p?ua:null;var Aa=t.contains(c.documentElement,da);ea.forEach(function(ya){if(wa)ya=ya.cloneNode(!0);else if(!da)return t(ya).remove();da.insertBefore(ya,ua);Aa&&qa(ya,function(za){if(!(null==za.nodeName||"SCRIPT"!==za.nodeName.toUpperCase()||za.type&&"text/javascript"!==za.type||za.src)){var E=za.ownerDocument?za.ownerDocument.defaultView:n;E.eval.call(E,za.innerHTML)}})})})};
|
|
166
|
+
t.fn[D?f+"To":"insert"+(p?"Before":"After")]=function(R){t(R)[f](this);return this}});N.Z.prototype=Z.prototype=t.fn;N.uniq=r;N.deserializeValue=ia;t.zepto=N;return t}();n.mQuery=B;void 0===n.$$&&(n.$$=B);(function(u){function y(l){return l._zid||(l._zid=Y++)}function F(l,m,c,v){m=J(m);if(m.ns)var z=new RegExp("(?:^| )"+m.ns.replace(" "," .* ?")+"(?: |$)");return(W[y(l)]||[]).filter(function(A){return A&&(!m.e||A.e==m.e)&&(!m.ns||z.test(A.ns))&&(!c||y(A.fn)===y(c))&&(!v||A.sel==v)})}function J(l){l=
|
|
167
|
+
(""+l).split(".");return{e:l[0],ns:l.slice(1).sort().join(" ")}}function w(l){return fa[l]||ia&&qa[l]||l}function I(l,m,c,v,z,A,b){var O=y(l),x=W[O]||(W[O]=[]);m.split(/\s/).forEach(function(ca){if("ready"==ca)return u(document).ready(c);var G=J(ca);G.fn=c;G.sel=z;G.e in fa&&(c=function(la){var d=la.relatedTarget;if(!d||d!==this&&!u.contains(this,d))return G.fn.apply(this,arguments)});var ja=(G.del=A)||c;G.proxy=function(la){la=M(la);if(!la.isImmediatePropagationStopped()){la.data=v;var d=ja.apply(l,
|
|
168
|
+
la._args==ba?[la]:[la].concat(la._args));!1===d&&(la.preventDefault(),la.stopPropagation());return d}};G.i=x.length;x.push(G);"addEventListener"in l&&l.addEventListener(w(G.e),G.proxy,G.del&&!ia&&G.e in qa||!!b)})}function L(l,m,c,v,z){var A=y(l);(m||"").split(/\s/).forEach(function(b){F(l,b,c,v).forEach(function(O){delete W[A][O.i];"removeEventListener"in l&&l.removeEventListener(w(O.e),O.proxy,O.del&&!ia&&O.e in qa||!!z)})})}function M(l,m){if(m||!l.isDefaultPrevented)if(m||=l,u.each(e,function(c,
|
|
169
|
+
v){var z=m[c];l[c]=function(){this[v]=aa;return z&&z.apply(m,arguments)};l[v]=na}),l.timeStamp||(l.timeStamp=Date.now()),m.defaultPrevented!==ba?m.defaultPrevented:"returnValue"in m?!1===m.returnValue:m.getPreventDefault&&m.getPreventDefault())l.isDefaultPrevented=aa;return l}function Q(l){var m,c={originalEvent:l};for(m in l)T.test(m)||l[m]===ba||(c[m]=l[m]);return M(c,l)}var Y=1,ba,Z=Array.prototype.slice,ha=u.isFunction,ma=function(l){return"string"==typeof l},W={},ka={},ia="onfocusin"in n,qa=
|
|
170
|
+
{focus:"focusin",blur:"focusout"},fa={mouseenter:"mouseover",mouseleave:"mouseout"};ka.click=ka.mousedown=ka.mouseup=ka.mousemove="MouseEvents";u.event={add:I,remove:L};u.proxy=function(l,m){var c=2 in arguments&&Z.call(arguments,2);if(ha(l)){var v=function(){return l.apply(m,c?c.concat(Z.call(arguments)):arguments)};v._zid=y(l);return v}if(ma(m))return c?(c.unshift(l[m],l),u.proxy.apply(null,c)):u.proxy(l[m],l);throw new TypeError("expected function");};u.fn.bind=function(l,m,c){return this.on(l,
|
|
171
|
+
m,c)};u.fn.unbind=function(l,m){return this.off(l,m)};u.fn.one=function(l,m,c,v){return this.on(l,m,c,v,1)};var aa=function(){return!0},na=function(){return!1},T=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,e={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};u.fn.delegate=function(l,m,c){return this.on(m,l,c)};u.fn.undelegate=function(l,m,c){return this.off(m,l,c)};u.fn.live=function(l,m){u(document.body).delegate(this.selector,
|
|
172
|
+
l,m);return this};u.fn.die=function(l,m){u(document.body).undelegate(this.selector,l,m);return this};u.fn.on=function(l,m,c,v,z){var A,b,O=this;if(l&&!ma(l))return u.each(l,function(x,ca){O.on(x,m,c,ca,z)}),O;ma(m)||ha(v)||!1===v||(v=c,c=m,m=ba);if(v===ba||!1===c)v=c,c=ba;!1===v&&(v=na);return O.each(function(x,ca){z&&(A=function(G){L(ca,G.type,v);return v.apply(this,arguments)});m&&(b=function(G){var ja=u(G.target).closest(m,ca).get(0);if(ja&&ja!==ca){var la=u.extend(Q(G),{currentTarget:ja,liveFired:ca});
|
|
173
|
+
return(A||v).apply(ja,[la].concat(Z.call(arguments,1)))}});I(ca,l,v,c,m,b||A)})};u.fn.off=function(l,m,c){var v=this;if(l&&!ma(l))return u.each(l,function(z,A){v.off(z,m,A)}),v;ma(m)||ha(c)||!1===c||(c=m,m=ba);!1===c&&(c=na);return v.each(function(){L(this,l,c,m)})};u.fn.trigger=function(l,m){l=ma(l)||u.isPlainObject(l)?u.Event(l):M(l);l._args=m;return this.each(function(){if(l.type in qa&&"function"==typeof this[l.type])this[l.type]();else"dispatchEvent"in this?this.dispatchEvent(l):u(this).triggerHandler(l,
|
|
174
|
+
m)})};u.fn.triggerHandler=function(l,m){var c,v;this.each(function(z,A){c=Q(ma(l)?u.Event(l):l);c._args=m;c.target=A;u.each(F(A,l.type||l),function(b,O){v=O.proxy(c);if(c.isImmediatePropagationStopped())return!1})});return v};"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(l){u.fn[l]=function(m){return 0 in arguments?this.bind(l,m):this.trigger(l)}});
|
|
175
|
+
u.Event=function(l,m){ma(l)||(m=l,l=m.type);var c=document.createEvent(ka[l]||"Events"),v=!0;if(m)for(var z in m)"bubbles"==z?v=!!m[z]:c[z]=m[z];c.initEvent(l,v,!0);return M(c)}})(B);(function(u){["width","height"].forEach(function(y){var F=y.replace(/./,function(J){return J[0].toUpperCase()});u.fn["outer"+F]=function(J){var w=this;if(w){var I=w[y]();({width:["left","right"],height:["top","bottom"]})[y].forEach(function(L){J&&(I+=parseInt(w.css("margin-"+L),10))});return I}return null}})})(B);(function(u){function y(l,
|
|
176
|
+
m,c,v){if(l.global)return l=m||W,c=u.Event(c),u(l).trigger(c,v),!c.isDefaultPrevented()}function F(l){l.global&&0===u.active++&&y(l,null,"ajaxStart")}function J(l,m){var c=m.context;if(!1===m.beforeSend.call(c,l,m)||!1===y(m,c,"ajaxBeforeSend",[l,m]))return!1;y(m,c,"ajaxSend",[l,m])}function w(l,m,c,v){var z=c.context;c.success.call(z,l,"success",m);v&&v.resolveWith(z,[l,"success",m]);y(c,z,"ajaxSuccess",[m,c,l]);L("success",m,c)}function I(l,m,c,v,z){var A=v.context;v.error.call(A,c,m,l);z&&z.rejectWith(A,
|
|
177
|
+
[c,m,l]);y(v,A,"ajaxError",[c,v,l||m]);L(m,c,v)}function L(l,m,c){var v=c.context;c.complete.call(v,m,l);y(c,v,"ajaxComplete",[m,c]);c.global&&!--u.active&&y(c,null,"ajaxStop")}function M(){}function Q(l){l&&=l.split(";",2)[0];return l&&("text/html"==l?"html":"application/json"==l?"json":fa.test(l)?"script":aa.test(l)&&"xml")||"text"}function Y(l,m){return""==m?l:(l+"&"+m).replace(/[&?]{1,2}/,"?")}function ba(l){l.processData&&l.data&&"string"!=u.type(l.data)&&(l.data=u.param(l.data,l.traditional));
|
|
178
|
+
!l.data||l.type&&"GET"!=l.type.toUpperCase()&&"jsonp"!=l.dataType||(l.url=Y(l.url,l.data),l.data=void 0)}function Z(l,m,c,v){u.isFunction(m)&&(v=c,c=m,m=void 0);u.isFunction(c)||(v=c,c=void 0);return{url:l,data:m,success:c,dataType:v}}function ha(l,m,c,v){var z,A=u.isArray(m),b=u.isPlainObject(m);u.each(m,function(O,x){z=u.type(x);v&&(O=c?v:v+"["+(b||"object"==z||"array"==z?O:"")+"]");!v&&A?l.add(x.name,x.value):"array"==z||!c&&"object"==z?ha(l,x,c,O):l.add(O,x)})}var ma=+new Date,W=n.document,ka,
|
|
179
|
+
ia,qa=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,fa=/^(?:text|application)\/javascript/i,aa=/^(?:text|application)\/xml/i,na=/^\s*$/,T=W.createElement("a");T.href=n.location.href;u.active=0;u.ajaxJSONP=function(l,m){if(!("type"in l))return u.ajax(l);var c=l.jsonpCallback,v=(u.isFunction(c)?c():c)||"Zepto"+ma++,z=W.createElement("script"),A=n[v],b,O=function(G){u(z).triggerHandler("error",G||"abort")},x={abort:O},ca;m&&m.promise(x);u(z).on("load error",function(G,ja){clearTimeout(ca);u(z).off().remove();
|
|
180
|
+
"error"!=G.type&&b?w(b[0],x,l,m):I(null,ja||"error",x,l,m);n[v]=A;b&&u.isFunction(A)&&A(b[0]);A=b=void 0});if(!1===J(x,l))return O("abort"),x;n[v]=function(){b=arguments};z.src=l.url.replace(/\?(.+)=\?/,"?$1="+v);W.head.appendChild(z);0<l.timeout&&(ca=setTimeout(function(){O("timeout")},l.timeout));return x};u.ajaxSettings={type:"GET",beforeSend:M,success:M,error:M,complete:M,context:null,global:!0,xhr:function(){return new n.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",
|
|
181
|
+
json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:M};u.ajax=function(l){var m=u.extend({},l||{}),c=u.Deferred&&u.Deferred();for(ka in u.ajaxSettings)void 0===m[ka]&&(m[ka]=u.ajaxSettings[ka]);F(m);if(!m.crossDomain){var v=W.createElement("a");v.href=m.url;v.href=v.href;m.crossDomain=T.protocol+"//"+T.host!==v.protocol+"//"+v.host}m.url||(m.url=n.location.toString());-1<(v=m.url.indexOf("#"))&&(m.url=
|
|
182
|
+
m.url.slice(0,v));ba(m);var z=m.dataType;(v=/\?.+=\?/.test(m.url))&&(z="jsonp");!1!==m.cache&&(l&&!0===l.cache||"script"!=z&&"jsonp"!=z)||(m.url=Y(m.url,"_="+Date.now()));if("jsonp"==z)return v||(m.url=Y(m.url,m.jsonp?m.jsonp+"=?":!1===m.jsonp?"":"callback=?")),u.ajaxJSONP(m,c);l=m.accepts[z];var A={};v=function(G,ja){A[G.toLowerCase()]=[G,ja]};var b=/^([\w-]+:)\/\//.test(m.url)?RegExp.$1:n.location.protocol,O=m.xhr(),x=O.setRequestHeader,ca;c&&c.promise(O);m.crossDomain||v("X-Requested-With","XMLHttpRequest");
|
|
183
|
+
v("Accept",l||"*/*");if(l=m.mimeType||l)-1<l.indexOf(",")&&(l=l.split(",",2)[0]),O.overrideMimeType&&O.overrideMimeType(l);(m.contentType||!1!==m.contentType&&m.data&&"GET"!=m.type.toUpperCase())&&v("Content-Type",m.contentType||"application/x-www-form-urlencoded");if(m.headers)for(ia in m.headers)v(ia,m.headers[ia]);O.setRequestHeader=v;O.onreadystatechange=function(){if(4==O.readyState){O.onreadystatechange=M;clearTimeout(ca);var G=!1;if(200<=O.status&&300>O.status||304==O.status||0==O.status&&
|
|
184
|
+
"file:"==b){z=z||Q(m.mimeType||O.getResponseHeader("content-type"));if("arraybuffer"==O.responseType||"blob"==O.responseType)var ja=O.response;else{ja=O.responseText;try{ja=m.dataFilter==M?ja:m.dataFilter.call(m.context,ja,z),"script"==z?(0,eval)(ja):"xml"==z?ja=O.responseXML:"json"==z&&(ja=na.test(ja)?null:u.parseJSON(ja))}catch(la){G=la}if(G)return I(G,"parsererror",O,m,c)}w(ja,O,m,c)}else I(O.statusText||null,O.status?"error":"abort",O,m,c)}};if(!1===J(O,m))return O.abort(),I(null,"abort",O,m,
|
|
185
|
+
c),O;O.open(m.type,m.url,"async"in m?m.async:!0,m.username,m.password);if(m.xhrFields)for(ia in m.xhrFields)O[ia]=m.xhrFields[ia];for(ia in A)x.apply(O,A[ia]);0<m.timeout&&(ca=setTimeout(function(){O.onreadystatechange=M;O.abort();I(null,"timeout",O,m,c)},m.timeout));O.send(m.data?m.data:null);return O};u.get=function(){return u.ajax(Z.apply(null,arguments))};u.post=function(){var l=Z.apply(null,arguments);l.type="POST";return u.ajax(l)};u.getJSON=function(){var l=Z.apply(null,arguments);l.dataType=
|
|
186
|
+
"json";return u.ajax(l)};u.fn.load=function(l,m,c){if(!this.length)return this;var v=this,z=l.split(/\s/);l=Z(l,m,c);var A=l.success;if(1<z.length){l.url=z[0];var b=z[1]}l.success=function(O){v.html(b?u("<div>").html(O.replace(qa,"")).find(b):O);A&&A.apply(v,arguments)};u.ajax(l);return this};var e=encodeURIComponent;u.param=function(l,m){var c=[];c.add=function(v,z){u.isFunction(z)&&(z=z());null==z&&(z="");this.push(e(v)+"="+e(z))};ha(c,l,m);return c.join("&").replace(/%20/g,"+")}})(B);(function(u){u.fn.serializeArray=
|
|
187
|
+
function(){var y,F,J=[],w=function(I){if(I.forEach)return I.forEach(w);J.push({name:y,value:I})};this[0]&&u.each(this[0].elements,function(I,L){F=L.type;(y=L.name)&&"fieldset"!=L.nodeName.toLowerCase()&&!L.disabled&&"submit"!=F&&"reset"!=F&&"button"!=F&&"file"!=F&&("radio"!=F&&"checkbox"!=F||L.checked)&&w(u(L).val())});return J};u.fn.serialize=function(){var y=[];this.serializeArray().forEach(function(F){y.push(encodeURIComponent(F.name)+"="+encodeURIComponent(F.value))});return y.join("&")};u.fn.submit=
|
|
188
|
+
function(y){if(0 in arguments)this.bind("submit",y);else if(this.length){var F=u.Event("submit");this.eq(0).trigger(F);F.isDefaultPrevented()||this.get(0).submit()}return this}})(B);(function(u,y){function F(fa){return w?w+fa:fa.toLowerCase()}var J="",w,I={Webkit:"webkit",Moz:"",O:"o"},L=document.createElement("div"),M=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,Q,Y,ba,Z,ha,ma,W,ka,ia={};L.style.transform===y&&u.each(I,function(fa,aa){if(L.style[fa+"TransitionProperty"]!==
|
|
189
|
+
y)return J="-"+fa.toLowerCase()+"-",w=aa,!1});var qa=J+"transform";ia[Q=J+"transition-property"]=ia[Y=J+"transition-duration"]=ia[Z=J+"transition-delay"]=ia[ba=J+"transition-timing-function"]=ia[ha=J+"animation-name"]=ia[ma=J+"animation-duration"]=ia[ka=J+"animation-delay"]=ia[W=J+"animation-timing-function"]="";u.fx={off:w===y&&L.style.transitionProperty===y,speeds:{_default:400,fast:200,slow:600},cssPrefix:J,transitionEnd:F("TransitionEnd"),animationEnd:F("AnimationEnd")};u.fn.animate=function(fa,
|
|
190
|
+
aa,na,T,e){u.isFunction(aa)&&(T=aa,aa=na=y);u.isFunction(na)&&(T=na,na=y);u.isPlainObject(aa)&&(na=aa.easing,T=aa.complete,e=aa.delay,aa=aa.duration);aa&&=("number"==typeof aa?aa:u.fx.speeds[aa]||u.fx.speeds._default)/1E3;e&&=parseFloat(e)/1E3;return this.anim(fa,aa,na,T,e)};u.fn.anim=function(fa,aa,na,T,e){var l,m={},c="",v=this,z=u.fx.transitionEnd,A=!1;aa===y&&(aa=u.fx.speeds._default/1E3);e===y&&(e=0);u.fx.off&&(aa=0);if("string"==typeof fa)m[ha]=fa,m[ma]=aa+"s",m[ka]=e+"s",m[W]=na||"linear",
|
|
191
|
+
z=u.fx.animationEnd;else{var b=[];for(l in fa)M.test(l)?c+=l+"("+fa[l]+") ":(m[l]=fa[l],b.push(l.replace(/([A-Z])/g,"-$1").toLowerCase()));c&&(m[qa]=c,b.push(qa));0<aa&&"object"===typeof fa&&(m[Q]=b.join(", "),m[Y]=aa+"s",m[Z]=e+"s",m[ba]=na||"linear")}var O=function(x){if("undefined"!==typeof x){if(x.target!==x.currentTarget)return;u(x.target).unbind(z,O)}else u(this).unbind(z,O);A=!0;u(this).css(ia);T&&T.call(this)};0<aa&&(this.bind(z,O),setTimeout(function(){A||O.call(v)},1E3*(aa+e)+25));this.size()&&
|
|
192
|
+
this.get(0).clientLeft;this.css(m);0>=aa&&setTimeout(function(){v.each(function(){O.call(this)})},0);return this};u.fn.stop=function(fa,aa){return this};L=null})(B);(function(){try{getComputedStyle(void 0)}catch(y){var u=getComputedStyle;n.getComputedStyle=function(F,J){try{return u(F,J)}catch(w){return null}}}})();return B}(K));var Da=function(){if(document.currentScript)var n=document.currentScript.src;else{n=document.scripts;for(var B=n.length-1,u,y=B;0<y;y--)if("interactive"===n[y].readyState){u=
|
|
193
|
+
n[y].src;break}n=u||n[B].src}B=n.indexOf("v=");B=0<B?n.substr(B+2):2023;n=n.substring(0,n.lastIndexOf("/")+1);n.endsWith("zwplayer/")||(n+="js/");return{path:n,v:B}}(),Ia=Da.path+"plugins/",Ja=function(n,B,u){var y=document.getElementsByTagName("head");if(0==y.length){y=document.createElement("head");var F=document.getElementsByTagName("body");if(0<F.length)F=F[0],document.insertBefore(y,F);else return alert("Invalid html document: no HEAD tag"),!1}else{y=y[0];F=y.childNodes;for(var J=0;J<F.length;J++){var w=
|
|
194
|
+
F[J];if("SCRIPT"===w.nodeName.toUpperCase()&&w.id&&w.id==n){if("true"!=w.getAttribute("loadstate")){var I=function(){"true"!=w.getAttribute("loadstate")?setTimeout(I,50):"function"==typeof u&&u(n)};setTimeout(I,50);return!1}"function"==typeof u&&u(n);return!0}}}var L=document.createElement("script");L.type="text/javascript";L.readyState?L.onreadystatechange=function(){if("loaded"==L.readyState||"complete"==L.readyState)L.onreadystatechange=null,L.setAttribute("loadstate","true"),"function"==typeof u&&
|
|
195
|
+
u(n)}:L.onload=function(){L.setAttribute("loadstate","true");"function"==typeof u&&u(n)};L.id=n;L.src=B;y.appendChild(L);return!1};(function(n,B,u){var y=document.getElementsByTagName("head");if(0==y.length){y=document.createElement("head");var F=document.getElementsByTagName("body");if(0<F.length)F=F[0],document.insertBefore(y,F);else return alert("Invalid html document: no HEAD tag found"),!1}else{y=y[0];F=y.childNodes;for(var J=0;J<F.length;J++){var w=F[J];if("link"===w.nodeName.toUpperCase()&&
|
|
196
|
+
w.id&&w.id==n){if("true"!==w.getAttribute("loadstate")){var I=function(){"true"!==w.getAttribute("loadstate")?setTimeout(I,50):"function"===typeof u&&u(n)};setTimeout(I,50);return!1}"function"===typeof u&&u(n);return!0}}}var L=document.createElement("link");L.type="text/css";L.setAttribute("rel","stylesheet");L.readyState?L.onreadystatechange=function(){if("loaded"==L.readyState||"complete"==L.readyState)L.onreadystatechange=null,L.setAttribute("loadstate","true"),"function"==typeof u&&u(n)}:L.onload=
|
|
197
|
+
function(){L.setAttribute("loadstate","true");"function"==typeof u&&u(n)};L.id=n;L.href=B;y.appendChild(L);return!1})("zwplayer-css",Da.path+"css/zwplayer.css?v="+Da.v,function(n){console.log("zwplayer.css["+n+"] is loaded")});var Ua=function(n){return"object"===typeof HTMLElement?n instanceof HTMLElement:!(!n||"object"!==typeof n||1!==n.nodeType&&9!==n.nodeType||"string"!==typeof n.nodeName)};Array.isArray||(Array.isArray=function(n){return"[object Array]"===Object.prototype.toString.call(n)});var Va=
|
|
198
|
+
/iPhone|iPad|iPod/.test(navigator.userAgent);(function(n){n+="=";for(var B=document.cookie.split(";"),u=0;u<B.length;u++){var y=B[u].trim();if(0==y.indexOf(n))return y.substring(n.length,y.length)}return""})("ZWPlayer")||bb("ZWPlayer","V1.0",365);var ib=function(n){for(var B=navigator.languages&&navigator.languages.length?navigator.languages:[navigator.language],u=0;u<n.length;u++)for(var y=0;y<B.length;y++)if(n[u].lang&&B[y]&&-1<B[y].indexOf(n[u].lang))return n[u].text;return 1===n.length?n[0].text:
|
|
199
|
+
null};HUAYI={};HUAYI.Danmu=function(){var n={playerObj:null,opacity:70,onInit:null,onClose:null,onResize:null};return{create:function(B){var u={};for(k in n)u[k]=n[k];for(k in B)u[k]=B[k];"undefined"==typeof u.playerId&&(u.playerId="video-body");return new function(y){y=y.playerId;this.rows=[];this.timerId=this.rowCount=0;this.frameDuration=40;this.Danmulayer=null;this.danmuMargin=50;this.speedX=100;this.hasTransition=!0;this.rowHeight=28;this.topMargin=10;this.layerHeight=this.layerWidth=0;this.fontSize=
|
|
200
200
|
"25px";if("string"==typeof y)this.vPlayer=document.getElementById(y);else if("object"==typeof y)this.vPlayer=y;else return;this.vPlayer||(this.vPlayer=document.getElementById("video-body"));if(this.vPlayer&&(y=this.vPlayer.childNodes,0<y.length))for(var F=0;F<y.length;F++){var J=y[F];if("DIV"==J.nodeName&&Qa(J.className,"danmuplayer")){this.wrapObj=J;break}}if(this.wrapObj){if(y=this.wrapObj.childNodes,0<y.length)for(F=0;F<y.length;F++)if(J=y[F],"DIV"==J.nodeName&&Qa(J.className,"danmu-layer")){this.Danmulayer=
|
|
201
201
|
J;break}}else this.wrapObj=document.createElement("div"),this.wrapObj.className="danmuplayer",this.vPlayer.appendChild(this.wrapObj),this.Danmulayer=document.createElement("div"),this.Danmulayer.className="danmu-layer",this.wrapObj.appendChild(this.Danmulayer),Ka.ie&&9>Ka.ver&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");if(this.Danmulayer){this.hasTransition="undefined"!=typeof this.Danmulayer.style.transition;this.rowCount=Math.floor(Math.floor(2*(this.Danmulayer.offsetHeight-this.topMargin)/
|
|
202
|
-
3)/this.rowHeight);if(0<this.rowCount)for(F=0;F<this.rowCount;F++)this.rows.push({top:this.topMargin+this.rowHeight*F,count:0,last:null,idx:F});this.layerWidth=this.Danmulayer.offsetWidth;this.layerHeight=this.Danmulayer.offsetHeight;Ba.addElement(this.Danmulayer);this.Danmulayer.addEventListener("resize",function(w){this.reCalcLayout()}.bind(this))}this.start=function(w){this.timerId&&(clearInterval(this.timerId),this.timerId=0);if(!this.hasTransition){var
|
|
203
|
-
|
|
204
|
-
if(0<w.length)for(var
|
|
205
|
-
typeof w.border&&(
|
|
206
|
-
|
|
207
|
-
"rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px";
|
|
208
|
-
this&&(ba.rows[this.rowIdx].last=null),ba.rows[this.rowIdx].count--);ba.Danmulayer.removeChild(this)}),w=
|
|
209
|
-
if(w!=this.layerHeight){this.rowCount=Math.floor(Math.floor(2*(w-this.topMargin)/3)/this.rowHeight);if(0<this.rowCount)if(this.rowCount>this.rows.length)for(var
|
|
210
|
-
this.Danmulayer.offsetWidth}}};this.hasTransition||this.start()}(u)}}}();var Ba={_onResize:function(
|
|
211
|
-
B,u){var y=
|
|
212
|
-
F.type="text/html";F.data="about:blank";F.onload=function(J){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__;this.contentDocument.defaultView.addEventListener("resize",this.resizer._onResize)};
|
|
213
|
-
this._onResize),
|
|
214
|
-
|
|
202
|
+
3)/this.rowHeight);if(0<this.rowCount)for(F=0;F<this.rowCount;F++)this.rows.push({top:this.topMargin+this.rowHeight*F,count:0,last:null,idx:F});this.layerWidth=this.Danmulayer.offsetWidth;this.layerHeight=this.Danmulayer.offsetHeight;Ba.addElement(this.Danmulayer);this.Danmulayer.addEventListener("resize",function(w){this.reCalcLayout()}.bind(this))}this.start=function(w){this.timerId&&(clearInterval(this.timerId),this.timerId=0);if(!this.hasTransition){var I=this;this.timerId=setInterval(function(){var L=
|
|
203
|
+
I.Danmulayer,M=L.childNodes;if(0<M.length){for(var Q=[],Y=0;Y<M.length;Y++){var ba=M[Y];if("DIV"==ba.tagName){var Z=parseFloat(ba.style.left);0>Z+ba.offsetWidth?Q.push(ba):ba.style.left=Z-4.5+"px"}}if(0<Q.length){for(Y=0;Y<Q.length;Y++)M=Q[Y],M.rowIdx&&(I.rows[M.rowIdx].last==this&&(I.rows[M.rowIdx].last=null),I.rows[M.rowIdx].count--),L.removeChild(Q[Y]);Q.splice(0,Q.length)}}},this.frameDuration)}};this.stop=function(){this.timerId&&(clearInterval(this.timerId),this.timerId=0);var w=this.Danmulayer.childNodes;
|
|
204
|
+
if(0<w.length)for(var I=0;I<w.length;I++)w[I].style.display="none";this.Danmulayer.style.display="none"};this.destroy=function(){this.Danmulayer&&(Ba.removeElement(this.Danmulayer),delete this.Danmulayer);this.timerId&&(clearInterval(this.timerId),this.timerId=0);this.wrapObj&&this.vPlayer&&this.vPlayer.removeChild(this.wrapObj)};this.addDanmu=function(w,I){I||={};var L=document.createElement("div");L.className="danmu";"undefined"==typeof w.color||I.isFilterColorFont||(L.style.color=w.color);"undefined"!=
|
|
205
|
+
typeof w.border&&(L.style.border="1px solid #666");L.style.fontSize=I.forcedFontSizeValue?parseInt(25*I.forcedFontSizeValue/100)+"px":"25px";this.fontSize!=L.style.fontSize&&(this.rowHeight=parseInt(L.style.fontSize)+3,this.layerHeight=0,this.reCalcLayout(),this.fontSize=L.style.fontSize);w.outlineColor&&(L.style.outlineStyle="solid",L.style.outlineWidth="2px",L.style.outlineColor=w.outlineColor);L.style.opacity=I.opacityValue?I.opacityValue/100:"0.9";L.innerHTML="function"==typeof K.replaceSmileDanmu?
|
|
206
|
+
K.replaceSmileDanmu(w.text,this.rowHeight,I):w.text;var M=w=0,Q=999999;this.rowCount>this.rows.length&&(this.rowCount=this.rows.length);for(;w<this.rowCount;w++)if(0==this.rows[w].count){M=w;Q=this.layerWidth;break}else if(this.rows[w].last){var Y=this.rows[w].last;Y=Y.getBoundingClientRect().left+Y.offsetWidth+this.danmuMargin;if(Y<Q&&(M=w,Q=Y,Q<this.layerWidth))break}Q<this.layerWidth&&(Q=this.layerWidth);L.style.fontFamily='SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif';L.style.textShadow=
|
|
207
|
+
"rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px";L.style.cursor="pointer";L.style.left=Q+"px";L.style.top=this.rows[M].top+"px";L.rowIdx=M;this.rows[M].last=L;this.rows[M].count++;this.Danmulayer.appendChild(L);var ba=this;L.onmouseover=function(Z){this.pause||(this.pause=!0)};L.onmouseout=function(Z){this.pause&&(this.pause=!1)};this.hasTransition&&(L.addEventListener("transitionend",function(){"number"==typeof this.rowIdx&&(ba.rows[this.rowIdx].last==
|
|
208
|
+
this&&(ba.rows[this.rowIdx].last=null),ba.rows[this.rowIdx].count--);ba.Danmulayer.removeChild(this)}),w=Q+L.offsetWidth,I.speedValue?(I=parseInt(this.speedX*parseFloat(I.speedValue)),0==I&&(I=1),I=w/I+4*Math.random()):I=w/this.speedX+4*Math.random(),L.style.transition="transform "+I+"s linear",L.style.transform="translateX(-"+w+"px)")};this.reCalcLayout=function(){if(this.Danmulayer){Ka.ie&&9>Ka.ver&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");var w=this.Danmulayer.offsetHeight;
|
|
209
|
+
if(w!=this.layerHeight){this.rowCount=Math.floor(Math.floor(2*(w-this.topMargin)/3)/this.rowHeight);if(0<this.rowCount)if(this.rowCount>this.rows.length)for(var I=this.rows.length;I<this.rowCount;I++)this.rows.push({top:this.topMargin+this.rowHeight*I,count:0,last:null,idx:I});else for(I=0;I<this.rowCount;I++)this.rows[I].top=this.topMargin+this.rowHeight*I;this.layerHeight=w}if(this.Danmulayer.offsetWidth!=this.layerWidth){w=this.Danmulayer.childNodes;if(0<w.length)for(I=0;I<w.length;I++);this.layerWidth=
|
|
210
|
+
this.Danmulayer.offsetWidth}}};this.hasTransition||this.start()}(u)}}}();var Ba={_onResize:function(n){var B=n.target||n.srcElement;if(B=B.__resizeTrigger__?B.__resizeTrigger__:B){var u=B.__z_resizeListeners;if(u)for(var y=u.length,F=0;F<y;F++){var J=u[F],w=J.handler;(J=J.context)||(J=B);if(w)w.apply(J,[n]);else if("resize"===n.type||"[object ResizeObserverEntry]"===Object.prototype.toString.call(n))w=document.createEvent("Event"),w.initEvent("resize",!1,!1),B.dispatchEvent(w)}}},addElement:function(n,
|
|
211
|
+
B,u){var y=n.__z_resizeListeners;if(!y)if(y=[],n.__z_resizeListeners=y,"function"===typeof K.ResizeObserver)this.resizeObserver||(this.resizeObserver=new ResizeObserver(function(J){for(var w=0;w<J.length;w++)this._onResize(J[w])}.bind(this))),this.resizeObserver.observe(n);else{"static"===getComputedStyle(n,null).position&&(n.style.position="relative");var F=document.createElement("object");F.resizer=this;F.__resizeElement__=n;F.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; opacity: 0; pointer-events: none; z-index: -9999;");
|
|
212
|
+
F.type="text/html";F.data="about:blank";F.onload=function(J){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__;this.contentDocument.defaultView.addEventListener("resize",this.resizer._onResize)};n.appendChild(F);n.__resizeDetector__=F}y.push({handler:B,context:u})},removeElement:function(n,B,u){var y=n.__z_resizeListeners;if(y){for(var F=y.length,J=0;J<F;J++){var w=y[J];if(w.handler===B&&w.context===u){y.splice(J,1);break}}if(0===y.length){if(B=n.__resizeDetector__)B.contentDocument.defaultView.removeEventListener("resize",
|
|
213
|
+
this._onResize),n.removeChild(B),delete n.__resizeDetector__;delete n.__z_resizeListeners;this.resizeObserver&&this.resizeObserver.unobserve(n)}}}},Ka=function(){var n,B,u,y,F,J,w=navigator.userAgent.toLowerCase(),I;(I=w.match(/chrome\/([\d.]+)/),I)?n=I[1]:(I=w.match(/firefox\/([\d.]+)/),I)?B=I[1]:(I=w.match(/edge\/([\d.]+)/),I)?u=I[1]:(I=w.match(/rv:([\d.]+)\) like gecko/),I)?y=I[1]:(I=w.match(/msie ([\d.]+)/),I)?y=I[1]:(I=w.match(/opera.([\d.]+)/),I)?F=I[1]:(I=w.match(/version\/([\d.]+).*safari/),
|
|
214
|
+
I)?J=I[1]:J=!1;return n?{broswer:"Chrome",version:n,chrome:!0,ver:parseInt(n)}:B?{broswer:"Firefox",version:B,firefox:!0,ver:parseInt(B)}:J?{broswer:"Safari",version:J,ver:parseInt(J)}:u?{broswer:"Edge",version:u,edge:!0,ver:parseInt(u)}:y?{broswer:"IE",version:y,ie:!0,ver:parseInt(y)}:F?{broswer:"Opera",version:F,opera:!0,ver:parseInt(F)}:{broswer:"",version:"0",ver:0}}(),Fa={about:"\u5173\u4e8e",current:"\u5f53\u524d","qs-auto":"\u81ea\u52a8\u5207\u6362",enterFullScreen:"\u8fdb\u5165\u5168\u5c4f",
|
|
215
215
|
exitFullScreen:"\u9000\u51fa\u5168\u5c4f",subtitleOff:"\u5b57\u5e55\u5173\u95ed",FULL_HD1:"\u539f\u753b",allSubtitle:"\u5b57\u5e55\u603b\u5f00\u5173",closeSmallWindow:"\u5173\u95ed\u5c0f\u7a97\u53e3\u6a21\u5f0f",mainSubtitle:"\u9ed8\u8ba4\u5b57\u5e55",secondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",speed:"\u500d\u901f",muted:"\u9759\u97f3",unmuted:"\u53d6\u6d88\u9759\u97f3",level:"\u7ea7\u522b","media-prop":"\u5a92\u4f53\u6d41\u5c5e\u6027","player-help":"\u4f7f\u7528\u8bf4\u660e","version-update":"\u7248\u672c\u66f4\u65b0",
|
|
216
|
-
HD1:"\u8d85\u6e05",SD1:"\u9ad8\u6e05",SD2:"\u6807\u6e05",HD:"\u9ad8\u6e05",FHD:"\u5168\u9ad8\u6e05",BD:"\u84dd\u5149","BD 4M":"\u84dd\u51494M","BD 8M":"\u84dd\u51498M"},Ha={},Wa={FULL_HD1:"RAW",HD1:"FHD",SD1:"HD",SD2:"SD"},Xa="en",jb={"zh-CN":Fa,zh:Fa,"zh-HK":Ha,"zh-TW":Ha,"en-US":Wa,en:Wa};Fa="en";
|
|
217
|
-
u[
|
|
218
|
-
|
|
219
|
-
Ca("","subtitleSecond")+"</div></div>"},lb=function(
|
|
220
|
-
(B+'"><i class="switch_inner"></i></div> </div> <div class="zwp_dmconfig zwp_dmicon" id="danmu-config-btn-')+(B+'" title="\u5f39\u5e55\u8bbe\u7f6e"><i class="xicon xicon-subtitles"></i></div> <div class="zwp-barrage_form" id="barrage_form-')+(B+'"> <div class="zwp-barrage_inp logined"> <input id="barrage_inp_text-')+
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"";if("undefined"!==typeof J.duration){var
|
|
224
|
-
Za=function(B){return B.replace(/[<>&"]/g,function(u){return{"<":"<",">":">","&":"&",'"':"""}[u]})},pb=function(B){if(!B||!Array.isArray(B)||0===B.length)return null;var u='<div class="zwp-button zwp-chapterButton"><button class="zwpbtn zwp-chapterBtn" data-action="showChapterListview" data-name="chapterbtn"><i class="xicon xicon-chapter"></i> \u7ae0\u8282</button><div class="zwp-chapterPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">\u7ae0\u8282\u5217\u8868</div><div class="zwp-list-inner"><ul class="zwp-chapterlist">';
|
|
225
|
-
for(var y=0,F=0;F<B.length;F++){var J=B[F],w=J.title||J.text||J.time+"";w=Za(w);a:{var
|
|
226
|
-
J.desc&&(
|
|
227
|
-
document.all)B.createTextRange&&B.caretPos?(B=B.caretPos,B.text=" "==B.text.charAt(B.text.length-1)?u+" ":u):B.value=u;else if(B.setSelectionRange){var y=B.selectionEnd,F=B.value.substring(0,B.selectionStart);y=B.value.substring(y);B.value=F+u+y}else alert("This version of Mozilla based browser does not support setSelectionRange")};
|
|
228
|
-
var J=Da.path+"widgets/smiles/p",w="",
|
|
229
|
-
if(0!=B.length){if("1"!=B.attr("data-render")){var F=u.zwplayer,J=B.get(0);y.get(Da.path+"widgets/danmu_setting.html?v="+Da.v,{},function(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
y("#bfBox_tab").find("a.zwp-barrage-icons").each(function(ba,
|
|
235
|
-
!
|
|
236
|
-
B.value)},Ma=function(B,u){B=B||$a("zwp_slider-");return'<input type="range" id="'+B+'" name="slider'+B+'" data-action="'+u+'" class="zwp-slider" value="0" min="-100" max="100"/><span class="zwp-slider-value">0</span>'},rb=function(B){var u="";B.infoButton&&(u='<div class="zwp-button zwp-infoButton"><button class="zwpbtn zwp-infoBtn" data-action="showMediainfo" data-name="infobtn"><i class="xicon xicon-info"></i></button></div>');var y="",F="",J="",w="",
|
|
216
|
+
HD1:"\u8d85\u6e05",SD1:"\u9ad8\u6e05",SD2:"\u6807\u6e05",HD:"\u9ad8\u6e05",FHD:"\u5168\u9ad8\u6e05",BD:"\u84dd\u5149","BD 4M":"\u84dd\u51494M","BD 8M":"\u84dd\u51498M",waitStreamToReady:"\u6b63\u5728\u7b49\u5f85\u8282\u76ee..."},Ha={},Wa={FULL_HD1:"RAW",HD1:"FHD",SD1:"HD",SD2:"SD"},Xa="en",jb={"zh-CN":Fa,zh:Fa,"zh-HK":Ha,"zh-TW":Ha,"en-US":Wa,en:Wa};Fa="en";K.navigator&&(Ha=(K.navigator.language||K.navigator.browserLanguage).toLowerCase(),-1!=Ha.indexOf("zh")?Fa="zh-CN":-1!=Ha.indexOf("zh-tw")&&(Fa=
|
|
217
|
+
"zh-Hant"));Xa=Fa;var pa=function(n,B){var u=jb[Xa]||B;return u?u[n]||B:B},kb=function(){for(var n='<div class="zwp-button zwp-speedButton"><button class="zwpbtn zwp-speedBtn" data-action="showSpeedMenu" data-name="speedbtn">'+pa("speed","Speed")+'</button><ul class="zwp-speedMenu">',B="2.0x 1.5x 1.25x 1.0x 0.75x 0.5x 0.25x".split(" "),u="",y=0;y<B.length;y++)u=3===y?u+('<li class="zwp-speed-item active">'+B[y]+"</li>"):u+('<li class="zwp-speed-item">'+B[y]+"</li>");return n+u+"</ul></div>"},Ya=function(){var n=
|
|
218
|
+
'<div class="zwp-option-item main"><label class="zwp-option-item-label">'+pa("allSubtitle","All subtitle")+'</label><div class="zwp-option-item-value">'+Ca("","subtitleOn")+"</div></div>";n+='<div class="zwp-option-item sub1" style="display: none;"><label class="zwp-option-item-label">'+pa("mainSubtitle","Main subtitle")+'</label><div class="zwp-option-item-value">'+Ca("","subtitleDefault")+"</div></div>";return n+='<div class="zwp-option-item sub2" style="display: none;"><label class="zwp-option-item-label">'+
|
|
219
|
+
pa("secondSubtitle","Second subtitle")+'</label><div class="zwp-option-item-value">'+Ca("","subtitleSecond")+"</div></div>"},lb=function(n){var B='<li class="zwp-subtitles-item" data-id="-1">'+pa("subtitleOff","Captions off")+"</li>";for(var u=0;u<n.length;u++)B=0===u?B+('<li class="zwp-subtitles-item active" data-id="'+n[u].id+'">'+n[u].name+"</li>"):B+('<li class="zwp-subtitles-item" data-id="'+n[u].id+'">'+n[u].name+"</li>");return'<ul class="zwp-subtitlesMenu">'+B+"</ul>"},mb=function(){var n=
|
|
220
|
+
"",B=(new Date).getTime();n=n+'<div class="zwp-toolbox-ground-right zwp-dmform zwp_danmu-controlbar"> <div class="zwp_switch_group"> <div class="zwp_switch_text">\u5f39\u5e55</div> <div class="zwp_switch" id="danmuSwitch-'+(B+'"><i class="switch_inner"></i></div> </div> <div class="zwp_dmconfig zwp_dmicon" id="danmu-config-btn-')+(B+'" title="\u5f39\u5e55\u8bbe\u7f6e"><i class="xicon xicon-subtitles"></i></div> <div class="zwp-barrage_form" id="barrage_form-')+(B+'"> <div class="zwp-barrage_inp logined"> <input id="barrage_inp_text-')+
|
|
221
|
+
(B+'" type="text" class="barrage_inp_text" maxlength="40" disabled="disabled" readonly="readonly"> <div class="barrage_login" href="#login"><span class="barrage_text">\u767b\u5f55</span>\u540e\u53ef\u4ee5\u53c2\u4e0e\u5f39\u5e55</div> </div>');n+=' <a class="btn_bubble disabled" href="javascript:void(0);" title="\u9009\u62e9\u8868\u60c5" data-viewid="smilesFaces-view-'+B+'"><i class="xicon xicon-smile"></i></a> <button type="submit" class="btn_submit vtb_disabled" title="\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u53d1\u9001\u5f39\u5e55\u54e6" disabled="disabled">\u53d1\u9001</button> </div>';
|
|
222
|
+
n+=' <div class="zwp-barrage-set hidden" data-barrage-panel="panel" data-render="0"></div>';return n+="</div>"},La=function(n){if("number"===typeof n)return n;n=n.split(":");return 2===n.length?60*parseInt(n[0])+parseInt(n[1]):3===n.length?3600*parseInt(n[0])+60*parseInt(n[1])+parseInt(n[2]):1===n.length?parseFloat(n[0]):3<n.length?9.999999999999999E8:0},nb=function y(B,u){var F=(y.canvas||(y.canvas=document.createElement("canvas"))).getContext("2d");F.font=u;return F.measureText(B).width},ob=function(B,
|
|
223
|
+
u){var y="";if(!u||!Array.isArray(u))return"";for(var F=0;F<u.length;F++){var J=u[F],w=La(J.time);if(!(w>=B)){var I=100*w/B+"%",L=J.title||J.text||J.time+"";if("undefined"!==typeof J.duration){var M="red";J.style&&"undefined"!==typeof J.style.background&&(M=J.style.background);var Q=La(J.duration);w+Q>B&&(Q=B-w);y+='<span class="zwp__chapter_dot zwp_bar" style="left: '+I+"; width: "+(100*Q/B+"%; border-radius: 3px; background-color: ")+M+';" title="'+L+'" data-time="'+J.time+'" data-desc="'+J.desc+
|
|
224
|
+
'"> </span>'}else y+='<span class="zwp__chapter_dot" style="left: '+I+'" title="'+L+'" data-time="'+J.time+'" data-desc="'+J.desc+'"> </span>'}}return y},Za=function(B){return B.replace(/[<>&"]/g,function(u){return{"<":"<",">":">","&":"&",'"':"""}[u]})},pb=function(B){if(!B||!Array.isArray(B)||0===B.length)return null;var u='<div class="zwp-button zwp-chapterButton"><button class="zwpbtn zwp-chapterBtn" data-action="showChapterListview" data-name="chapterbtn"><i class="xicon xicon-chapter"></i> \u7ae0\u8282</button><div class="zwp-chapterPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">\u7ae0\u8282\u5217\u8868</div><div class="zwp-list-inner"><ul class="zwp-chapterlist">';
|
|
225
|
+
for(var y=0,F=0;F<B.length;F++){var J=B[F],w=J.title||J.text||J.time+"";w=Za(w);a:{var I=J.time;if("string"===typeof I){if(0<=I.indexOf(":")){var L=I;break a}I=parseInt(I)}L=parseInt(I/3600);var M=parseInt(I%3600/60);I=parseInt(I%60);var Q="";0<L&&(Q+=L+":");0<=M?(10<M||0<L&&(Q+="0"),Q+=M+":"):Q+="0:";L=Q=10<=I?Q+I:Q+("0"+I)}M='<li class="chapter-item" data-time="'+J.time+'">';M+='<div class="item-title"><span class="item-time">'+L+"</span>";M+='<span class="title" title="'+w+'">'+w+"</span></div>";
|
|
226
|
+
J.desc&&(M+='<div class="item-content"><span class="desc">'+Za(J.desc)+"</span></div>");M+="</li>";u+=M;J=nb(w,'bold 16px "Microsoft YaHei", "Segoe UI","PingFang SC","Hiragino Sans GB","Helvetica Neue",Helvetica,Arial,sans-serif,-apple-system,BlinkMacSystemFont');J>y&&(y=J)}return{html:u+"</ul></div></div></div>",titleWidth:y}};K.insertSmile=function(B,u){B=$$(B).closest("div.zwp-smileview");if(0<B.length&&(B=B.get(0).inputbox))if(B.createTextRange&&(B.caretPos=document.selection.createRange().duplicate()),
|
|
227
|
+
document.all)B.createTextRange&&B.caretPos?(B=B.caretPos,B.text=" "==B.text.charAt(B.text.length-1)?u+" ":u):B.value=u;else if(B.setSelectionRange){var y=B.selectionEnd,F=B.value.substring(0,B.selectionStart);y=B.value.substring(y);B.value=F+u+y}else alert("This version of Mozilla based browser does not support setSelectionRange")};K.replaceSmileDanmu=function(B,u,y){if("string"!=typeof B)return"";0<=B.indexOf("<")&&(B=B.replace(/</g,"<").replace(/>/g,">"));var F=B.indexOf("[sm-");if(0>F)return B;
|
|
228
|
+
var J=Da.path+"widgets/smiles/p",w="",I=B.substring(0,F);for(""!=I&&(w+=I);0<=F;){I=B.indexOf("]",F+4);if(0>I){I=B.substring(F);""!=I&&(w+=I);break}F=B.substring(F+4,I);""!=F&&(y.isFilterImage||(w+='<img style="opacity: 1;" src="'+J+F+'.png" height="'+u+'">'));F=B.indexOf("[sm-",I+1);0>F?(I=B.substring(I+1),""!=I&&(w+=I)):F>I+1&&(w+=B.substring(I+1,F))}return w};var Oa=function(B){hasClass(B,"switch_on")?removeClass(B,"switch_on"):addClass(B,"switch_on")},qb=function(B,u){var y=$$;B=y(u).closest("div.zwp-dmform").children(".zwp-barrage-set");
|
|
229
|
+
if(0!=B.length){if("1"!=B.attr("data-render")){var F=u.zwplayer,J=B.get(0);y.get(Da.path+"widgets/danmu_setting.html?v="+Da.v,{},function(L){var M=y(J);M.html(L);M.find("a.barrage-tab-link").click(function(Q){Q.preventDefault();Q=y(this).parent();Q.hasClass("selected")||(Q.addClass("selected").siblings().removeClass("selected"),Q=y(Q.attr("data-tab")),Q.hasClass("hidden")&&(Q.removeClass("hidden"),Q.siblings().addClass("hidden")))});L=y("#fsBox_tab");L.find("div.color-box").children("a").click(function(Q){Q.preventDefault();
|
|
230
|
+
Q=y(this);Q.hasClass("selected")||(Q.siblings().removeClass("selected"),Q.addClass("selected"),F&&(F.danmuSetting.color=Q.attr("data-color")))});L.find("div.other-box").children("a.checkbox-wrap").click(function(Q){Q.preventDefault();var Y=y(this);Y.toggleClass("selected");Q=Y.attr("data-content");Y=Y.hasClass("selected");F&&(F.danmuSetting[Q]=Y)});y("#bfBox_tab").find("a.zwp-barrage-icons").mousedown(function(Q){if(0==Q.button){this.isMousePressed=!0;var Y=y(this).position().left,ba=Q.clientX-Y,
|
|
231
|
+
Z=this,ha=function(W){W=W.clientX-ba;0>W?W=0:134<W&&(W=134);y(Z).css({left:W+"px"});var ka=y(Z).siblings("div.bar-t");0<ka.length&&ka.width(W+3);Z.valuePanel||(Z.valuePanel=y(Z).parent().siblings("div.set-rol-right").get(0));if("object"==typeof Z.valuePanel){ka=y(Z.valuePanel);var ia=ka.attr("data-barrage-content");"opacityValue"==ia?(W=parseInt(100*W/138),F&&(F.danmuSetting.opacityValue=W),ka.html(W+"%")):"forcedFontSizeValue"==ia?(W=50+parseInt(150*W/138),F&&(F.danmuSetting.forcedFontSizeValue=
|
|
232
|
+
W),ka.html(W+"%")):"speedValue"==ia?(W=(.5+parseFloat(W/69)).toFixed(1),F&&(F.danmuSetting.speedValue=W),ka.html(W+"x")):"densityValue"==ia&&(W=parseInt(100*W/46),F&&(F.danmuSetting.densityValue=W),ka.html(W+"\u6761"))}return!1},ma=function(W){y(document).unbind("mousemove",ha).unbind("mouseup",ma)};y(document).bind("mousemove",ha).bind("mouseup",ma)}return!1});y("#pbBox_tab").find("a.pb-link").click(function(Q){Q.preventDefault();var Y=y(this).parent();Y.toggleClass("selected");Q=y(this).attr("data-content");
|
|
233
|
+
Y=Y.hasClass("selected");F&&(F.danmuSetting[Q]=Y)});y("#barrage-set-bot").children("a").click(function(Q){Q.preventDefault();if("reset"==y(this).attr("data-content")){if(F)for(a in F.danmuSetting)delete F.danmuSetting[a];y("#fsBox_tab").find(".color-box a").removeClass("selected").eq(0).addClass("selected");y("#fsBox_tab").find(".other-box a").removeClass("selected");var Y={opacityTrigger:[128,124,"90%"],forcedFontSizeTrigger:[50,46,"100%"],speedTrigger:[39,35,"1.0x"],densityTrigger:[18,14,"30\u6761"]};
|
|
234
|
+
y("#bfBox_tab").find("a.zwp-barrage-icons").each(function(ba,Z){ba=y(Z).attr("data-barrage-content");if(Y[ba]){var ha=Y[ba];ba=ha[1];var ma=ha[0];ha=ha[2];Z=y(Z);Z.css({left:ba+"px"});Z.siblings(".bar-t").width(ma+"px");Z.parent().siblings(".set-rol-right").text(ha)}});y("#pbBox_tab").find("li.selected").removeClass("selected")}})},"html");B.attr("data-render","1")}if(B.hasClass("hidden")){J=B.get(0);var w=this,I=function(L){var M=y(J);if(L.target==w)w=null;else if(hasClass(L.target,"xicon-close")||
|
|
235
|
+
!M.is(L.target)&&0===M.has(L.target).length)M.addClass("hidden"),y(document).off("click",I),delete u.zwplayer};B.removeClass("hidden");y(document).on("click",I)}}},$a=function(B){K.ctrlInitId||(K.ctrlInitId=(new Date).getTime());var u=K.ctrlInitId++;return B+u},Ca=function(B,u){return'<div class="zwp_switch action-item" id="'+(B||$a("switch-"))+'" data-action="'+(u||"none")+'"><i class="switch_inner"></i></div>'},ab=function(B){var u=B.parentNode;u&&(u=u.querySelector(".zwp-slider-value"))&&(u.innerHTML=
|
|
236
|
+
B.value)},Ma=function(B,u){B=B||$a("zwp_slider-");return'<input type="range" id="'+B+'" name="slider'+B+'" data-action="'+u+'" class="zwp-slider" value="0" min="-100" max="100"/><span class="zwp-slider-value">0</span>'},rb=function(B){var u="";B.infoButton&&(u='<div class="zwp-button zwp-infoButton"><button class="zwpbtn zwp-infoBtn" data-action="showMediainfo" data-name="infobtn"><i class="xicon xicon-info"></i></button></div>');var y="",F="",J="",w="",I="",L="",M="",Q=B.defVolume||61.25;B.speedButton&&
|
|
237
237
|
!B.isLive&&(y="");B.optionButton&&(J='<div class="zwp-button zwp-optionButton"><button class="zwpbtn zwp-optionBtn" data-action="showConfigPanel" data-name="optionbtn" title="\u8bbe\u7f6e"><i class="xicon xicon-config"></i></button><div class="zwp-optionPanel"><div class="zwp-option-item"><label class="zwp-option-item-label">\u5de6\u53f3\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+(Ca("","mirror")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u4e0a\u4e0b\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+
|
|
238
238
|
Ca("","flip")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u987a90\u5ea6\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+Ca("","rotated90")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u900690\u5ea6\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+Ca("","rotated270")+'</div></div><div class="zwp-option-h-separator"><hr/></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u5faa\u73af\u64ad\u653e</label><div class="zwp-option-item-value">'+
|
|
239
|
-
Ca("","loop")+'</div></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-hue"></i></span> <button class="zwp-option-button action-item" data-action="showColorConfig">\u89c6\u9891\u8272\u5ea6\u8c03\u8282...</button></div></div></div>'));B.disableVolumeControl||(
|
|
240
|
-
|
|
241
|
-
B.disablePicInPic||document.pictureInPictureEnabled&&(
|
|
242
|
-
Ya()+"</div></div>";
|
|
243
|
-
|
|
244
|
-
F};(function(B,u){"function"===typeof
|
|
245
|
-
performance.now&&(y=function(){return performance.now()});var F=y(),J=function(e){var
|
|
246
|
-
(A=A.substring(0,
|
|
247
|
-
e.user_query.schema?(e.port=443,
|
|
248
|
-
port:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
{};"undefined"===typeof c._config.controlbar&&(c._config.controlbar=!0);c._config.hideControlbarTimeout||(c._config.hideControlbarTimeout=1E4);"undefined"===typeof c._config.defVolume&&(c._config.defVolume=61.25);c.setRtcstream=function(d){this.videoEl&&(this.videoEl.srcObject=d,this.videoEl.play(),this.setplaystate(!0),this.startHideControlbar(this))};c.onfullscrchange=function(d){Na()?(this.isFullscr=!0,this.setupFullscrBtn&&this.setupFullscrBtn.setAttribute("title",
|
|
252
|
-
(this.setupFullscrBtn&&(
|
|
239
|
+
Ca("","loop")+'</div></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-hue"></i></span> <button class="zwp-option-button action-item" data-action="showColorConfig">\u89c6\u9891\u8272\u5ea6\u8c03\u8282...</button></div></div></div>'));B.disableVolumeControl||(M='<div class="zwp-button zwp-volume-docker"><button class="zwpbtn zwp-muteBtn" data-action="mute" data-name="mutebtn"><i class="xicon xicon-speaker"></i></button><div class="zwp-volume-slider"><div class="zwp-volume-total"><div class="zwp-volume-current" style="bottom: 0px; height: '+
|
|
240
|
+
Q+'%;"></div><div class="zwp-volume-handle" style="bottom: '+Q+'%; margin-bottom: -7px;"></div></div></div></div>');B.disableFullscreenWin||(w='<div class="zwp-button zwp-fullscrWinButton"><button class="zwpbtn zwp-fullscrWinBtn" data-action="enterfullscreenWin" data-name="fullscrWinbtn" title="\u7f51\u9875\u5168\u5c4f"><i class="xicon xicon-fullScreen-win"></i></button></div>');B.snapshotButton&&(I='<div class="zwp-button zwp-snapshotButton"><button class="zwpbtn zwp-snapshotBtn" data-action="snapshot" data-name="snapshotbtn" title="\u6293\u53d6\u56fe\u50cf"><i class="xicon xicon-camera"></i></button></div>');
|
|
241
|
+
B.disablePicInPic||document.pictureInPictureEnabled&&(L='<div class="zwp-button zwp-picInPicButton"><button class="zwpbtn zwp-picInPicBtn" data-action="pictureInPicture" data-name="picInPicbtn" title="\u753b\u4e2d\u753b\u6a21\u5f0f"><i class="xicon xicon-pic-in-pic"></i></button></div>');B.isLive||(F='<div class="zwp__time-rail"></div>');B='<div class="zwp-button zwp-subtitleButton" style="display: none;"><button class="zwpbtn zwp-subtitleBtn" data-action="showSubtitleMenu" data-name="subtitlebtn" title="\u5916\u6302\u5b57\u5e55"><i class="xicon xicon-cc"></i></button><div class="zwp-subtitleMenu">'+
|
|
242
|
+
Ya()+"</div></div>";Q=["1920","1280","720","480"];for(var Y="",ba=0;ba<Q.length;ba++)Y=3===ba?Y+('<li class="zwp-quality-item active">'+Q[ba]+"</li>"):Y+('<li class="zwp-quality-item">'+Q[ba]+"</li>");return'<div class="zwp-button zwp_playbtn"><button class="zwpbtn zwp-playbtn" data-action="play" data-name="playbtn"><i class="xicon xicon-play"></i></button></div><div class="zwp__time zwp__currenttime-container" role="timer" aria-live="on"><span class="zwp__currenttime">00:00</span></div><div class="zwp__time zwp__duration-container" style="display: none;"><span class="zwp__time_divider">/</span> <span class="zwp__duration">0:00:00</span></div><div class="zwp__time-info "></div>'+
|
|
243
|
+
I+B+('<div class="zwp-button zwp-qualityButton" style="display: none;"><button class="zwpbtn zwp-qualityBtn" data-action="showQualityMenu" data-name="qualitybtn" title="\u6e05\u6670\u5ea6\u9009\u62e9"><i class="xicon xicon-hd"></i></button><ul class="zwp-qualityMenu">'+Y+"</ul></div>")+y+u+J+M+L+w+'<div class="zwp-button"><button class="zwpbtn zwp-fullscrBtn" data-action="enterfullscreen" data-name="fullscrbtn" title="'+pa("enterFullScreen","\u8fdb\u5165\u5168\u5c4f")+'"><i class="xicon xicon-fullScreen"></i></button></div>'+
|
|
244
|
+
F};(function(B,u){"function"===typeof K.define&&K.define.amd?K.define([],u):"object"===typeof exports?module.exports=u():B.ZWPlayer=u()})(K,function(){function B(e){e=e.getBoundingClientRect();return{top:e.top+(K.pageYOffset||document.documentElement.scrollTop),left:e.left+(K.pageXOffset||document.documentElement.scrollLeft)}}function u(e){var l=e.offsetTop;for(e=e.offsetParent;null!==e;)l+=e.offsetTop,e=e.offsetParent;return l}var y=function(){return(new Date).getTime()};"undefined"!=typeof performance&&
|
|
245
|
+
performance.now&&(y=function(){return performance.now()});var F=y(),J=function(e){var l="";e.startsWith("webrtc://")&&(l="/rtc/v1/play/");var m=e.indexOf("://");if(-1==m)return!1;var c="";if(0<=e.indexOf("?")){var v=e.indexOf("?");c=e.substr(v+1);e=e.substr(0,v)}var z=e.indexOf("/",m+3);v=e.substr(0,m);m=e.substring(m+3,z);var A=e.substring(z),b=A.lastIndexOf("/");z="";var O=m.indexOf(":");0<O&&(z=m.substring(O+1),m=m.substring(0,O));O=A.substring(1,b);A=A.substring(b+1);b=A.lastIndexOf(".");0<b&&
|
|
246
|
+
(A=A.substring(0,b));b="";0<c.indexOf("vhost=")&&(b=c.substr(c.indexOf("vhost=")+6),0<b.indexOf("&")&&(b=b.substr(0,b.indexOf("&"))));m===b&&/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(m)&&(b="_default_vhost_");e={url:e,schema:v,server:m,port:z,vhost:b,app:O,stream:A};e.user_query={};if(0!==c.length){0<=c.indexOf("?")&&(c=c.split("?")[1]);c=c.split("&");for(z=0;z<c.length;z++)b=c[z].split("="),e[b[0]]=b[1],e.user_query[b[0]]=b[1];e.domain&&(e.vhost=e.domain)}if("webrtc"===v||"rtc"===v)v="",e.port||("https"===
|
|
247
|
+
e.user_query.schema?(e.port=443,v=e.user_query.schema||"https"):0===K.location.href.indexOf("https://")?(e.port=443,v=e.user_query.schema||"https"):e.port=1985);m="rtmp://"+m+"/"+O+"/"+A;v=v?v+":":K.location.protocol;(z=e.port)||(z="https:"===v?z||443:z||1985);l=l||"/live/webrtc/play/";l.lastIndexOf("/")!==l.length-1&&(l+="/");c=v+"//"+e.server+":"+z+l;for(var x in e.user_query)"api"!==x&&"play"!==x&&(c+="&"+x+"="+e.user_query[x]);c=c.replace(l+"&",l+"?");x={apiUrl:c,streamUrl:m,schema:v,urlObject:e,
|
|
248
|
+
port:z};x.tid=Number(parseInt((new Date).getTime()*Math.random()*100)).toString(16).slice(0,7);return x},w=function(e,l,m,c){let v=null;v=K.XMLHttpRequest?new K.XMLHttpRequest:new K.ActiveXObject("Microsoft.XMLHTTP");v.addEventListener("error",function(z){c&&c("REQUEST:"+z.type)});v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status){var z=JSON.parse(v.responseText);m&&m(z)}else c&&c("STATUS:"+v.status+":"+v.statusText)};v.open("POST",e,!0);v.setRequestHeader("Content-Type","application/json");
|
|
249
|
+
v.send(l);return v},I=function(e){var l=e.lastIndexOf("/"),m=e.indexOf("?");l=e.indexOf(".",l+1);var c="";0<l&&(0<m?l>m||(c=e.substring(l,m).toLowerCase()):c=e.substring(l).toLowerCase(),l=c.lastIndexOf("."),0<l&&(c=c.substring(l)));return c},L=void 0,M=void 0,Q=void 0;"classList"in document.documentElement?(L=function(e,l){return void 0!==e.classList&&e.classList.contains(l)},M=function(e,l){return e.classList.add(l)},Q=function(e,l){return e.classList.remove(l)}):(L=function(e,l){return(new RegExp("\\b"+
|
|
250
|
+
l+"\\b")).test(e.className)},M=function(e,l){L(e,l)||(e.className+=" "+l)},Q=function(e,l){e.className=e.className.replace(new RegExp("\\b"+l+"\\b","g"),"")});K.hasClass=L;K.addClass=M;K.removeClass=Q;/MSIE 8\.0/.test(navigator.userAgent);var Y=function(e){e=parseInt(e);var l=parseInt(e/3600),m=parseInt(e%3600/60);e=parseInt(e%60);var c="";0<l&&(c+=l+":");c=10<=m?c+(m+":"):0<m?c+("0"+m+":"):c+"00:";return 10<=e?c+e:c+("0"+e)},ba=function(e){var l=!1,m=!1,c=this;c._config=e||{};c.peer_conn=null;c.danmuSetting=
|
|
251
|
+
{};"undefined"===typeof c._config.controlbar&&(c._config.controlbar=!0);c._config.hideControlbarTimeout||(c._config.hideControlbarTimeout=1E4);"undefined"===typeof c._config.defVolume&&(c._config.defVolume=61.25);c.setRtcstream=function(d){this.videoEl&&(this.videoEl.srcObject=d,this.videoEl.play(),this.setplaystate(!0),this.startHideControlbar(this))};c.onfullscrchange=function(d){Na()?(this.isFullscr=!0,this.setupFullscrBtn&&this.setupFullscrBtn.setAttribute("title",pa("exitFullScreen","Exit full screen"))):
|
|
252
|
+
(this.setupFullscrBtn&&(Q(this.playerElm,"zwp-fullscreen"),this.setupFullscrBtn.setAttribute("data-action","enterfullscreen"),this.setupFullscrBtn.setAttribute("title",pa("enterFullScreen","Enter full screen"))),this.isFullscr=!1);this.isFullscrWin||this.reposDanmuToolbar(this.isFullscr);console.log("fullscrchange:"+d.type)}.bind(c);c.on_btnclick=function(d){if(d.currentTarget&&this.btnBindZwp){d=d.currentTarget;var h=d.getAttribute("data-action");"play"===h?this._config.disablePlayBtn||(this.isPlaying?
|
|
253
253
|
this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.videoEl.play(),this.setplaystate(!0)):this._config.url&&this.play(this._config.url)):"pause"===h?this._config.disablePlayBtn||!this.videoEl||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1)):"mute"===h?this.videoEl&&(this.videoEl.muted||this.setMuted(!0)):"unmute"===h?this.videoEl&&this.videoEl.muted&&this.setMuted(!1):"enterfullscreen"===h?this.setFullscreen(!0,d):"exitfullscreen"===h?this.setFullscreen(!1,
|
|
254
254
|
d):"enterfullscreenWin"===h?this.setFullscreenWin(!0,d):"exitfullscreenWin"===h?this.setFullscreenWin(!1,d):"showMediainfo"===h?this.showMediainfo():"snapshot"===h?this.doSnapshot():"pictureInPicture"===h&&this.togglePictureInPicture()}}.bind(c);c.setFullscreen=function(d,h){if(d){if(!Na()&&this.playerElm){d=this.playerElm;var q=this.videoEl;d.requestFullscreen?d.requestFullscreen():d.webkitRequestFullscreen?d.webkitRequestFullScreen():d.mozRequestFullScreen?d.mozRequestFullScreen():d.msRequestFullscreen?
|
|
255
255
|
d.msRequestFullscreen():d.oRequestFullscreen?d.oRequestFullscreen():q.webkitEnterFullScreen?q.webkitEnterFullScreen():(q=document.documentElement,q.requestFullscreen?q.requestFullscreen():q.mozRequestFullScreen?q.mozRequestFullScreen():q.webkitRequestFullScreen?q.webkitRequestFullScreen():(q=document.body,document.documentElement.style.cssText="width:100%;height:100%;overflow:hidden;",q.style.cssText="width:100%;height:100%;overflow:hidden;",d.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",
|
|
256
|
-
document.IsFullScreen=!0));
|
|
256
|
+
document.IsFullScreen=!0));M(this.playerElm,"zwp-fullscreen");h.setAttribute("data-action","exitfullscreen");if(!this.setupFullscrBtn){d=this.onfullscrchange;q=this.videoEl;var C=document.webkitExitFullscreen||document.webkitCancelFullScreen?"webkitfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":document.msExitFullscreen?"MSFullscreenChange":"webkitfullscreenchange";document.addEventListener("fullscreenchange",d,!1);C&&document.addEventListener(C,d,!1);q&&Va&&(q.addEventListener("webkitbeginfullscreen",
|
|
257
257
|
d),q.addEventListener("webkitendfullscreen",d));this.setupFullscrBtn=h}}}else Na()&&this.playerElm&&(d=this.playerElm,q=document.documentElement,q.exitFullscreen?q.exitFullscreen():q.mozCancelFullScreen?q.mozCancelFullScreen():q.webkitCancelFullScreen?q.webkitCancelFullScreen():document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():
|
|
258
|
-
document.oRequestFullscreen?document.oCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():(q=document.body,document.documentElement.style.cssText="",q.style.cssText="",d.style.cssText="",document.IsFullScreen=!1),
|
|
259
|
-
!0,this.reposDanmuToolbar(!0),(d=this.playerElm.parentNode)&&"BODY"!==d.tagName&&(this.oldWrapZIndex=d.style.zIndex,d.style.zIndex=99999999)):this.isFullscrWin&&("undefined"!==typeof this.oldWrapZIndex&&(d=this.playerElm.parentNode,d.style.zIndex=this.oldWrapZIndex,delete this.oldWrapZIndex),
|
|
260
|
-
d)&&(this.oldVolume=this.videoEl.volume);d?(
|
|
261
|
-
function(d){d.controlbar&&!d._config.fixedControlbar&&(d.hideControlbarTime=(new Date).getTime()+d._config.hideControlbarTimeout,d.hideControlbarTimer||(d.hideControlbarTimer=
|
|
262
|
-
1E3)))}.bind(c);c.buildProgressBar=function(){var d={};if(this.controlbar){var h=this.controlbar;d.rail=h.querySelector(".zwp__time-rail");d.timeInfo=h.querySelector(".zwp__time-info");if(this._config.isLive)d.rail&&(
|
|
263
|
-
this.progressBar.streamtype?this.progressBar.streamtype.innerHTML="VOD":(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">VOD</div>',d.streamtype=h.querySelector(".zwp-streamtype"))),d.rail||(h.insertAdjacentHTML("beforeend",'<div class="zwp__time-rail"></div>'),d.rail=h.querySelector(".zwp__time-rail")),
|
|
264
|
-
(h=this.progressBar.rail.querySelector(".zwp__time-float"))&&(q=h.querySelector(".zwp__time-thumbnail"),q||(h.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),q=h.querySelector(".zwp__time-thumbnail"),this.progressBar.thumbnails=q),this._config.thumbnails?(
|
|
265
|
-
"px",h.style.height=4+
|
|
266
|
-
if(this._config.useProgressTooltip){var C="",
|
|
267
|
-
|
|
268
|
-
d.timefloat=h.querySelector(".zwp__time-float");d.timefloatcurrent=h.querySelector(".zwp__time-float-current");d.thumbnails=h.querySelector(".zwp__time-thumbnail");d.slider=h.querySelector(".zwp__time-slider");d.hovered=h.querySelector(".zwp__time-hovered");d.chapters=h.querySelector(".zwp__time-chapter");d.newTime=0;d.forcedHandlePause=!1;d.buffering.style.display="none";d.slider.addEventListener("dragstart",function(){return!1});this.progressBar=d;this.showTimefloat=function(
|
|
269
|
-
|
|
270
|
-
"-"+g
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
function(
|
|
274
|
-
this.seekTimeProgress(
|
|
275
|
-
this.controlbar.querySelector(".zwp__time-rail");this._config.isLive?(d&&(
|
|
276
|
-
c.updateDuration=function(d){if(d.controlbar){var h=d.controlbar.querySelector(".zwp__duration-container"),q=d.videoEl.duration;if(isNaN(q)||Infinity===q)h.style.display="none",d._config.isLive=!0;else{h.style.display="block";h=h.querySelector(".zwp__duration");var C=parseInt(q/3600),
|
|
258
|
+
document.oRequestFullscreen?document.oCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():(q=document.body,document.documentElement.style.cssText="",q.style.cssText="",d.style.cssText="",document.IsFullScreen=!1),Q(this.playerElm,"zwp-fullscreen"),h.setAttribute("data-action","enterfullscreen"))}.bind(c);c.setFullscreenWin=function(d,h){this.playerElm&&(d?this.isFullscrWin||(M(this.playerElm,"zwp-fullscreen-win"),h.setAttribute("data-action","exitfullscreenWin"),this.isFullscrWin=
|
|
259
|
+
!0,this.reposDanmuToolbar(!0),(d=this.playerElm.parentNode)&&"BODY"!==d.tagName&&(this.oldWrapZIndex=d.style.zIndex,d.style.zIndex=99999999)):this.isFullscrWin&&("undefined"!==typeof this.oldWrapZIndex&&(d=this.playerElm.parentNode,d.style.zIndex=this.oldWrapZIndex,delete this.oldWrapZIndex),Q(this.playerElm,"zwp-fullscreen-win"),h.setAttribute("data-action","enterfullscreenWin"),delete this.isFullscrWin,this.reposDanmuToolbar(!1)))}.bind(c);c.setMuted=function(d){this.videoEl&&(this.videoEl.muted=
|
|
260
|
+
d)&&(this.oldVolume=this.videoEl.volume);d?(M(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","unmute")):(this.oldVolume&&(this.videoEl.volume=this.oldVolume,delete this.oldVolume),Q(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","mute"));this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),this.popup_layers.style.display=null,delete this.mutedTipBox)}.bind(c);c.setVolume=function(d){this.videoEl&&(this.videoEl.volume=
|
|
261
|
+
d)}.bind(c);c.startHideControlbar=function(d){d.controlbar&&!d._config.fixedControlbar&&(d.hideControlbarTime=(new Date).getTime()+d._config.hideControlbarTimeout,d.hideControlbarTimer||(d.hideControlbarTimer=K.setInterval(function(){(new Date).getTime()>=d.hideControlbarTime&&(K.clearInterval(d.hideControlbarTimer),delete d.hideControlbarTimer,Ga(d.controlbar,1E3,function(h){h.style.display="none";M(d.playerElm,"hide-cursor");d.isControlbarhidden=!0;"function"==typeof d._config.onhideControlbar&&
|
|
262
|
+
d._config.onhideControlbar.call(d)}))},1E3)))}.bind(c);c.buildProgressBar=function(){var d={};if(this.controlbar){var h=this.controlbar;d.rail=h.querySelector(".zwp__time-rail");d.timeInfo=h.querySelector(".zwp__time-info");if(this._config.isLive)d.rail&&(Q(d.rail,"has-duration"),M(d.rail,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype||(d.timeInfo&&(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">Live</div>',d.streamtype=h.querySelector(".zwp-streamtype")),this.progressBar=
|
|
263
|
+
d);else if(d.timeInfo&&(this.progressBar&&this.progressBar.streamtype?this.progressBar.streamtype.innerHTML="VOD":(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">VOD</div>',d.streamtype=h.querySelector(".zwp-streamtype"))),d.rail||(h.insertAdjacentHTML("beforeend",'<div class="zwp__time-rail"></div>'),d.rail=h.querySelector(".zwp__time-rail")),Q(d.rail,"zwp-hidden"),M(d.rail,"has-duration"),this._config.disableSeek&&M(d.rail,"zwp_disabled"),this.progressBar&&this.progressBar.total)this.progressBar.rail&&
|
|
264
|
+
this._config.useProgressTooltip&&(h=this.progressBar.rail.querySelector(".zwp__time-float"))&&(q=h.querySelector(".zwp__time-thumbnail"),q||(h.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),q=h.querySelector(".zwp__time-thumbnail"),this.progressBar.thumbnails=q),this._config.thumbnails?(N=this._config.thumbnails,q&&(N.rowsize="number"==typeof N.row?N.row:Math.ceil(Math.sqrt(N.total)),q.style.width=N.width+"px",q.style.height=N.height+"px",q.style.backgroundImage="url("+
|
|
265
|
+
N.url+")"),h.style.width=4+N.width+"px",h.style.height=4+N.height+"px",M(h,"zwp__thumbnail")):(h.style.width=null,h.style.height=null,q&&(q.style.width="0px",q.style.height="0px",q.style.backgroundImage=null),Q(h,"zwp__thumbnail")));else{var q='<span class="zwp__time-total zwp__time-slider"><span class="zwp__bar zwp__time-buffering"></span><span class="zwp__bar zwp__time-loaded"></span><span class="zwp__bar zwp__time-current"></span><span class="zwp__time-chapter"></span><span class="zwp__time-hovered no-hover"></span><span class="zwp__time-thumb"><span class="zwp__time-thumb-content"></span></span>';
|
|
266
|
+
if(this._config.useProgressTooltip){var C="",H="",P="";if("object"===typeof this._config.thumbnails&&null!=this._config.thumbnails){var N=this._config.thumbnails;"number"==typeof N.width&&"number"==typeof N.height&&"number"==typeof N.total&&(N.rowsize="number"==typeof N.row?N.row:Math.ceil(Math.sqrt(N.total)),P=' style="width: '+(4+N.width)+"px; height: "+(4+N.height)+'px;"',H=" zwp__thumbnail",C='<div class="zwp__time-thumbnail" style="width: '+N.width+"px;height: "+N.height+"px; background-image: url("+
|
|
267
|
+
N.url+');"></div>')}q+='<div class="zwp__time-float'+H+'"'+P+">"+C+'<span class="zwp__time-float-current">0:00</span><span class="zwp__time-float-corner corner_external"></span><span class="zwp__time-float-corner corner_internal"></span></div>'}d.rail.innerHTML=q+"</span>";d.buffering=h.querySelector(".zwp__time-buffering");d.total=h.querySelector(".zwp__time-total");d.loaded=h.querySelector(".zwp__time-loaded");d.current=h.querySelector(".zwp__time-current");d.thumb=h.querySelector(".zwp__time-thumb");
|
|
268
|
+
d.timefloat=h.querySelector(".zwp__time-float");d.timefloatcurrent=h.querySelector(".zwp__time-float-current");d.thumbnails=h.querySelector(".zwp__time-thumbnail");d.slider=h.querySelector(".zwp__time-slider");d.hovered=h.querySelector(".zwp__time-hovered");d.chapters=h.querySelector(".zwp__time-chapter");d.newTime=0;d.forcedHandlePause=!1;d.buffering.style.display="none";d.slider.addEventListener("dragstart",function(){return!1});this.progressBar=d;this.showTimefloat=function(S){if(this._config.useProgressTooltip){var U=
|
|
269
|
+
S.originalEvent&&S.originalEvent.changedTouches?S.originalEvent.changedTouches[0].pageX:S.changedTouches?S.changedTouches[0].pageX:S.pageX;S=this.progressBar;var g=this.videoEl.duration;var r=B(S.total);var t=S.total.offsetWidth;U<r.left?U=r.left:U>t+r.left&&(U=t+r.left);U-=r.left;r=U/t;S=this.progressBar;S.timefloatcurrent.innerHTML=Y(g*r);S.thumbnails&&this._config.thumbnails?(g=this._config.thumbnails,r=Math.floor(r*g.total),r>=g.total&&(r=g.total-1),0!=g.rowsize&&(S.thumbnails.style.backgroundPosition=
|
|
270
|
+
"-"+r%g.rowsize*g.width+"px -"+g.height*Math.floor(r/g.rowsize)+"px")):(g=7*S.timefloatcurrent.innerHTML.length+10,40>g&&(g=40),S.timefloat.style.width=g+"px");g=S.timefloat.offsetWidth/2;S.timefloat.style.left=(U<g?g:U>t-g?t-g:U)+"px";S.timefloat.style.display="block"}}.bind(this);d.slider.addEventListener("mouseenter",function(S){var U=this;if(U.videoEl){var g=U.videoEl.duration;isNaN(g)||Infinity===g||S.target!==d.slider||(d.bindMouseMoveEvent||(d.slider.addEventListener("mousemove",function(r){var t=
|
|
271
|
+
r.target;(t===d.slider||t.closest(".zwp__time-slider"))&&U.showTimefloat(r)}),d.bindMouseMoveEvent=!0),d.timefloat&&(d.timefloat.style.display="block"))}}.bind(this));d.slider.addEventListener("mouseleave",function(){if(this.videoEl){var S=this.videoEl.duration;isNaN(S)||Infinity===S||l||!d.timefloat||(d.timefloat.style.display="none")}}.bind(this));var V=function(S,U){var g=this,r=d.slider.offsetWidth,t=B(d.slider);t=S.pageX-t.left;0>t?t=0:t>r&&(t=r);r=(100*t/r).toFixed(4);d.thumb.style.left=r+"%";
|
|
272
|
+
U?(g.seekTimeProgress(r),g.lastSeekProgress=r):"undefined"!=typeof g.lastSeekProgress&&1<Math.abs(r-g.lastSeekProgress)&&(g.lastSeekProgress=r,g.seekTimer||(g.seekTimer=setTimeout(function(){g.seekTimeProgress(g.lastSeekProgress);delete g.seekTimer},1E3)));S.preventDefault();S.stopPropagation()}.bind(this);this.on_progressbar_mousemove=function(S){var U=S.target,g;if(g=l)a:if(g=d.slider,U===g)g=!0;else{for(;U.parentNode;){if(U.parentNode===g){g=!0;break a}U=U.parentNode}g=!1}g&&V(S)}.bind(this);this.on_progressbar_mouseup=
|
|
273
|
+
function(S){if(l){document.removeEventListener("mousemove",this.on_progressbar_mousemove);document.removeEventListener("mouseup",this.on_progressbar_mouseup);l=!1;delete this.isTrackingProgress;this.seekTimer&&(clearTimeout(this.seekTimer),delete this.seekTimer);if(S.target&&(S.target.parentNode==d.thumb||S.target==d.thumb)){var U=d.slider.offsetWidth,g=B(d.slider);S=S.pageX-g.left;0>S?S=0:S>U&&(S=U);U=(100*S/U).toFixed(4);"undefined"!=typeof this.lastSeekProgress?1<Math.abs(U-this.lastSeekProgress)&&
|
|
274
|
+
this.seekTimeProgress(U):this.seekTimeProgress(U)}delete this.lastSeekProgress}}.bind(this);this.on_progressbar_mousedown=function(S){l||this._config.disableSeek||(c.isTrackingProgress=!0,V(S,!0),document.addEventListener("mousemove",this.on_progressbar_mousemove),document.addEventListener("mouseup",this.on_progressbar_mouseup),l=!0,S.preventDefault(),S.stopPropagation())}.bind(this);d.slider.addEventListener("mousedown",this.on_progressbar_mousedown)}}}.bind(c);c.updateProgressBarType=function(){if(this.controlbar){var d=
|
|
275
|
+
this.controlbar.querySelector(".zwp__time-rail");this._config.isLive?(d&&(Q(d,"has-duration"),M(d,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="Live",this.progressBar.streamtype.style.display="block")):(d&&(Q(d,"zwp-hidden"),M(d,"has-duration"),this._config.disableSeek&&M(d,"zwp_disabled")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="VOD",this.progressBar.streamtype.style.display="block"))}}.bind(c);
|
|
276
|
+
c.updateDuration=function(d){if(d.controlbar){var h=d.controlbar.querySelector(".zwp__duration-container"),q=d.videoEl.duration;if(isNaN(q)||Infinity===q)h.style.display="none",d._config.isLive=!0;else{h.style.display="block";h=h.querySelector(".zwp__duration");var C=parseInt(q/3600),H=parseInt(q%3600/60);q=parseInt(q%60);var P="";0<C&&(P+=C+":");P=10<=H?P+(H+":"):0<H?P+("0"+H+":"):P+"00:";h.innerHTML=10<=q?P+q:P+("0"+q);d.chapters&&setTimeout(function(){this.loadChapters()}.bind(d),1E3)}d.updateProgressBarType();
|
|
277
277
|
d.syncUI()}}.bind(c);c.setProgressRail=function(d){var h=void 0!==d?d.target||d.detail.target:this.videoEl,q=null;h&&h.buffered&&0<h.buffered.length&&h.buffered.end&&this.videoEl.duration?q=h.buffered.end(h.buffered.length-1)/this.videoEl.duration:h&&void 0!==h.bytesTotal&&0<h.bytesTotal&&void 0!==h.bufferedBytes?q=h.bufferedBytes/h.bytesTotal:d&&d.lengthComputable&&0!==d.total&&(q=d.loaded/d.total);null!==q&&(q=Math.min(1,Math.max(0,q)),this.progressBar&&this.progressBar.loaded&&(this.progressBar.loaded.style.width=
|
|
278
278
|
100*q+"%"))}.bind(c);c.updateProgress=function(d){if(!this.isTrackingProgress&&this.progressBar&&this.progressBar.thumb){var h=this.videoEl.duration;!isNaN(h)&&Infinity!==h&&0<h&&(d+.3>=h&&(d=h),d=d/h*100,this.progressBar.thumb.style.left=d+"%",this.progressBar.current&&(this.progressBar.current.style.width=d/100*100+"%"))}}.bind(c);c.seekTimeProgress=function(d){if(this.videoEl){var h=this.videoEl.duration;isNaN(h)||Infinity===h||(this.videoEl.currentTime=h*d/100,this.progressBar.current&&(this.progressBar.current.style.width=
|
|
279
|
-
d+"%"))}}.bind(c);c.seekTimeProgressByTime=function(d){if(this.videoEl){var h=this.videoEl.duration;isNaN(h)||Infinity===h||(this.videoEl.currentTime=d,this.progressBar.current&&(this.progressBar.current.style.width=d/h*100+"%"))}}.bind(c);c.on_speedItemclick=function(d){d.stopPropagation();d=d.currentTarget;if(!
|
|
280
|
-
1==h?
|
|
281
|
-
"active");break}}}}.bind(c);c.syncUI=function(){if(this._config.isLive){var d=this.controlbar.querySelector(".zwp-speedButton");d&&this.controlbar.removeChild(d);
|
|
282
|
-
h);d.outerHTML=q;d=this.controlbar.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");0<d.length&&d.forEach(function(C){C.addEventListener("click",c.on_speedItemclick)})}}
|
|
283
|
-
d.preventDefault())}}else 13!==d.keyCode&&(38===d.keyCode?(d.preventDefault(),this.videoEl&&(d=this.videoEl.volume,d+=.05,1<d&&(d=1),this.setVolume(d),this.setMuted(!1),h=parseInt(100*d)+"%",h={icon:"speaker",text:h},this.toast(h,1200,!1),this.positionVolumeThumb&&this.positionVolumeThumb(d))):40===d.keyCode?(d.preventDefault(),this.videoEl&&(d=this.videoEl.volume,d-=.05,0>d&&(d=0),this.setVolume(d),this.setMuted(0===d),h=parseInt(100*d)+"%",0===d&&(h=
|
|
284
|
-
this.toast(h,1200,!1),this.positionVolumeThumb&&this.positionVolumeThumb(d))):32===d.keyCode?(d.preventDefault(),this._config.isLive||this._config.disablePlayBtn||!this.videoEl||(this.videoEl.paused||this.videoEl.ended?(this.videoEl.play(),this.setplaystate(!0)):(this.videoEl.pause(),this.setplaystate(!1)))):77!==d.keyCode&&109!==d.keyCode||!this.videoEl||(this.videoEl.muted?(this.toast(
|
|
279
|
+
d+"%"))}}.bind(c);c.seekTimeProgressByTime=function(d){if(this.videoEl){var h=this.videoEl.duration;isNaN(h)||Infinity===h||(this.videoEl.currentTime=d,this.progressBar.current&&(this.progressBar.current.style.width=d/h*100+"%"))}}.bind(c);c.on_speedItemclick=function(d){d.stopPropagation();d=d.currentTarget;if(!L(d,"active")){var h=parseFloat(d.innerText),q=d.parentNode.querySelector(".active");q&&Q(q,"active");M(d,"active");this.videoEl&&(this.videoEl.playbackRate=h);if(q=this.controlbar.querySelector(".zwp-speedBtn"))q.innerHTML=
|
|
280
|
+
1==h?pa("speed","Speed"):d.innerText}var C=d.parentNode;C.style.display="none";setTimeout(function(){C.style.display=null},1E3)}.bind(c);c.resetSpeedMenu=function(){if(this.controlbar){var d=this.controlbar.querySelector(".zwp-speed-item.active");if(d&&"1.0x"!==d.innerText){var h=this.controlbar.querySelector(".zwp-speedBtn");h&&(h.innerHTML=pa("speed","Speed"));Q(d,"active");d=d.parentNode.querySelectorAll("li.zwp-speed-item");if(0<d.length)for(h=0;h<d.length;h++)if("1.0x"===d[h].innerText){M(d[h],
|
|
281
|
+
"active");break}}}}.bind(c);c.syncUI=function(){if(this._config.isLive){var d=this.controlbar.querySelector(".zwp-speedButton");d&&this.controlbar.removeChild(d);Q(this.controlbar,"zwp-vodplayer")}else{if(this._config.speedButton&&(d=this.controlbar.querySelector(".zwp-speedButton"),!d)){var h=this.controlbar.querySelector(".zwp-infoButton")||this.controlbar.querySelector(".zwp-optionButton")||this.controlbar.querySelector(".zwp-volume-docker");if(h){var q=kb();d=document.createElement("div");this.controlbar.insertBefore(d,
|
|
282
|
+
h);d.outerHTML=q;d=this.controlbar.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");0<d.length&&d.forEach(function(C){C.addEventListener("click",c.on_speedItemclick)})}}M(this.controlbar,"zwp-vodplayer")}}.bind(c);c.onKeydown=function(d){if(d)if(27===d.keyCode)if(this.contextMenu)this.hideContextMenu(),d.stopPropagation(),d.preventDefault();else{if(this.isFullscrWin&&this.controlbar){var h=this.controlbar.querySelector(".zwp-fullscrWinBtn");h&&(this.setFullscreenWin(!1,h),d.stopPropagation(),
|
|
283
|
+
d.preventDefault())}}else 13!==d.keyCode&&(38===d.keyCode?(d.preventDefault(),this.videoEl&&(d=this.videoEl.volume,d+=.05,1<d&&(d=1),this.setVolume(d),this.setMuted(!1),h=parseInt(100*d)+"%",h={icon:"speaker",text:h},this.toast(h,1200,!1),this.positionVolumeThumb&&this.positionVolumeThumb(d))):40===d.keyCode?(d.preventDefault(),this.videoEl&&(d=this.videoEl.volume,d-=.05,0>d&&(d=0),this.setVolume(d),this.setMuted(0===d),h=parseInt(100*d)+"%",0===d&&(h=pa("muted","Muted")),h={icon:"speaker",text:h},
|
|
284
|
+
this.toast(h,1200,!1),this.positionVolumeThumb&&this.positionVolumeThumb(d))):32===d.keyCode?(d.preventDefault(),this._config.isLive||this._config.disablePlayBtn||!this.videoEl||(this.videoEl.paused||this.videoEl.ended?(this.videoEl.play(),this.setplaystate(!0)):(this.videoEl.pause(),this.setplaystate(!1)))):77!==d.keyCode&&109!==d.keyCode||!this.videoEl||(this.videoEl.muted?(this.toast(pa("unmuted","Unmuted"),1E3,!1,!0),this.setMuted(!1)):(this.toast(pa("muted","Muted"),1E3,!1,!0),this.setMuted(!0))))}.bind(c);
|
|
285
285
|
c.on_colorSliderChange=function(d){var h=d.currentTarget;d=h.getAttribute("data-action");this.colors||(this.colors={brightness:0,contrast:0,saturation:0,hue:0});ab(h);if("undefined"!==typeof this.colors[d]&&(h=parseInt(h.value),"hue"===d?this.colors.hue=parseInt(180*h/100):this.colors[d]=h,this.videoEl)){d=null;h=this.colors;h.brightness&&(d="brightness("+(100+h.brightness)+"%)");if(h.contrast){var q=100+h.contrast;d=(d?d+" ":"")+("contrast("+q+"%)")}h.saturation&&(q=100+h.saturation,d=(d?d+" ":"")+
|
|
286
286
|
("saturate("+q+"%)"));h.hue&&(h=h.hue,d=(d?d+" ":"")+("hue-rotate("+h+"deg)"));this.videoEl.style.filter=d}}.bind(c);c.createColorSettingPanel=function(){var d=this,h='<div class="zwp-colorSettingPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">\u89c6\u9891\u8272\u5f69\u8c03\u6574</div><div class="form-row"><label class="row-label">\u4eae\u5ea6</label><div class="row-content">'+Ma("","brightness")+'</div></div><div class="form-row"><label class="row-label">\u5bf9\u6bd4\u5ea6</label><div class="row-content">'+
|
|
287
287
|
Ma("","contrast")+'</div></div><div class="form-row"><label class="row-label">\u9971\u548c\u5ea6</label><div class="row-content">'+Ma("","saturation")+'</div></div><div class="form-row"><label class="row-label">\u8272\u8c03</label><div class="row-content">'+Ma("","hue")+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetcolors">\u91cd\u7f6e</button></div></div>';d.overlay_layers.insertAdjacentHTML("beforeend",h);h=d.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");
|
|
288
|
-
var q=h.querySelector(".closeBtn");q&&q.addEventListener("click",function(C){C.stopPropagation();var
|
|
289
|
-
h.addEventListener("dblclick",function(C){C.stopPropagation()});h.addEventListener("click",function(C){C.stopPropagation()});(q=h.querySelector(".zwp-form-button"))&&q.addEventListener("click",function(C){C.preventDefault();C.stopPropagation();C=C.currentTarget.closest(".zwp-colorSettingPanel").querySelectorAll('input[type="range"]');0<C.length&&C.forEach(function(
|
|
290
|
-
|
|
291
|
-
d&&(this._config.video_rotated=0,
|
|
292
|
-
h)this.videoEl&&(d=
|
|
288
|
+
var q=h.querySelector(".closeBtn");q&&q.addEventListener("click",function(C){C.stopPropagation();var H=C.currentTarget.closest(".zwp-colorSettingPanel");Ga(H,500,function(){H.remove()});delete d.colorSettingPanel});q=h.querySelectorAll('input[type="range"]');0<q.length&&q.forEach(function(C){C.addEventListener("input",c.on_colorSliderChange);if(d.colors){var H=C.getAttribute("data-action");"undefined"!==typeof d.colors[H]&&(C.value=d.colors[H],ab(C))}});h.addEventListener("mousedown",function(C){C.stopPropagation()});
|
|
289
|
+
h.addEventListener("dblclick",function(C){C.stopPropagation()});h.addEventListener("click",function(C){C.stopPropagation()});(q=h.querySelector(".zwp-form-button"))&&q.addEventListener("click",function(C){C.preventDefault();C.stopPropagation();C=C.currentTarget.closest(".zwp-colorSettingPanel").querySelectorAll('input[type="range"]');0<C.length&&C.forEach(function(H){if(0!==parseInt(H.value))if(H.value=0,document.createEvent){const P=document.createEvent("HTMLEvents");P.initEvent("input",!0,!1);H.dispatchEvent(P)}else document.createEventObject&&
|
|
290
|
+
H.fireEvent("input")})});return d.colorSettingPanel=h}.bind(c);var v=function(d,h){if(d=d.querySelector(".zwp-optionPanel"))d=d.querySelectorAll(".zwp_switch"),0<d.length&&d.forEach(function(q){var C=q.getAttribute("data-action");-1!==h.indexOf(C)&&L(q,"switch_on")&&Q(q,"switch_on")})};c.on_optionItemclick=function(d){d.stopPropagation();d=d.currentTarget;L(d,"zwp_switch")&&Oa(d);var h=d.getAttribute("data-action");if("mirror"===h)this.videoEl&&(d=L(d,"switch_on"),this._config.video_mirror=d,this.flipMirrorVideo(),
|
|
291
|
+
d&&(this._config.video_rotated=0,v(this.controlbar,["rotated270","rotated90"])));else if("flip"===h)this.videoEl&&(d=L(d,"switch_on"),this._config.video_flip=d,this.flipMirrorVideo(),d&&(this._config.video_rotated=0,v(this.controlbar,["rotated270","rotated90"])));else if("rotated90"===h)this.videoEl&&(d=L(d,"switch_on"),this._config.video_rotated=d?90:0,this.rotateVideo(),d&&(this._config.video_mirror=!1,this._config.video_flip=!1,v(this.controlbar,["mirror","flip","rotated270"])));else if("rotated270"===
|
|
292
|
+
h)this.videoEl&&(d=L(d,"switch_on"),this._config.video_rotated=d?270:0,this.rotateVideo(),d&&(this._config.video_mirror=!1,this._config.video_flip=!1,v(this.controlbar,["mirror","flip","rotated90"])));else if("loop"===h)d=L(d,"switch_on"),this._config.loop=d;else if("showColorConfig"===h){var q=d.closest(".zwp-optionPanel");if(q&&q.closest(".zwp-optionButton")){d=this.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");if(!d&&(d=this.createColorSettingPanel(),!d))return;d.style.display=
|
|
293
293
|
"block";q.style.display="none";setTimeout(function(){q.style.display=null},1E3)}}}.bind(c);c.flipMirrorVideo=function(){var d=null;this._config.video_flip&&(d="rotateX(180.00deg)");this._config.video_mirror&&(d=d?d+" rotateY(180.00deg)":" rotateY(180.00deg)");this.videoEl.style.width="100%";this.videoEl.style.height="100%";this.videoEl.style.transform=d}.bind(c);c.rotateVideo=function(){var d=null,h=this.videoEl.parentNode;if(h&&h===this.videoWrapper)if(this._config.video_rotated){var q=h.offsetHeight;
|
|
294
294
|
h=h.offsetWidth;var C=this.videoEl.videoHeight;this.videoEl.videoWidth&&C&&(this.videoEl.style.width=q+"px",this.videoEl.style.height=h+"px",this.videoEl.style.transformOrigin="center center",C=(h-q)/2,q=(q-h)/2,90===this._config.video_rotated?d="translate("+C+"px, "+q+"px) rotate(0.25turn)":270===this._config.video_rotated&&(d="translate("+C+"px, "+q+"px) rotate(0.75turn)"),this.videoEl.style.transform=d)}else this.videoEl.style.transform&&(this.videoEl.style.transform=null,this.videoEl.style.width=
|
|
295
|
-
"100%",this.videoEl.style.height="100%")}.bind(c);c.setupEventsHandler=function(){var d=this,h=function(
|
|
296
|
-
|
|
297
|
-
typeof d.postSeekTime&&(d.seekTimeProgressByTime(d.postSeekTime),delete d.postSeekTime)):"pause"===
|
|
298
|
-
this.currentTime;"undefined"!==typeof d.postSeekTime&&(
|
|
299
|
-
C);q.addEventListener("seeking",C);q.addEventListener("waiting",C);q.addEventListener("timeupdate",
|
|
300
|
-
|
|
301
|
-
(
|
|
295
|
+
"100%",this.videoEl.style.height="100%")}.bind(c);c.setupEventsHandler=function(){var d=this,h=function(P){d.loadingOverlay&&(d.loadingOverlay.style.display="none");d.videoEl.play();d.setplaystate(!0);d.updateDuration(d);d._config.isLive&&d.controlbar&&(d.controlbar.querySelector(".zwp__duration-container").style.display="none");d._config.fluid&&(P=d.videoEl,M(d.playerElm,"zwp-fluid"),d.playerElm.style.maxWidth="100%",d.playerElm.style.width="100%",d.playerElm.style.height="0",d.playerElm.style.paddingTop=
|
|
296
|
+
P.videoHeight&&P.videoWidth?100*P.videoHeight/P.videoWidth+"%":"64px");d.buildProgressBar()};d.videoEl.addEventListener("loadedmetadata",h);var q=d.videoEl,C=function(P){var N=!0;"ended"===P.type?!d._config.isLive&&d._config.loop?(K.setTimeout(function(){d.videoEl.currentTime=0;d.videoEl.play()},1E3),N=!1):(d.isEnded=!0,d.setplaystate(!1),d._config.reconnect&&d.mpegtsPlayer&&(setTimeout(function(){d.lastDecodedFrames=0;d.closecall(d);d.openMpegts()},1E3),N=!1)):"play"===P.type?(delete d.isEnded,"undefined"!==
|
|
297
|
+
typeof d.postSeekTime&&(d.seekTimeProgressByTime(d.postSeekTime),delete d.postSeekTime)):"pause"===P.type?d.setplaystate(!1):"playing"===P.type&&d.setplaystate(!0);d.progressBar&&d.progressBar.buffering&&("play playing pause seeked ended error".split(" ").includes(P.type)?d.progressBar.buffering.style.display="none":["seeking","waiting","loadeddata"].includes(P.type)&&(d.progressBar.buffering.style.display=""));N&&"function"===typeof d._config.onmediaevent&&d._config.onmediaevent.call(d,P)},H=function(P){var N=
|
|
298
|
+
this.currentTime;"undefined"!==typeof d.postSeekTime&&(N=d.postSeekTime);if("function"===typeof d._config.ontimeupdate)d._config.ontimeupdate(N);!d.timeSpan&&d.controlbar&&(d.timeSpan=d.controlbar.querySelector(".zwp__currenttime"));d.timeSpan&&(d.timeSpan.innerHTML=Y(N));d.updateProgress(N);d.setProgressRail(P);d.renderSubtitles(N)};q.addEventListener("play",C);q.addEventListener("playing",C);q.addEventListener("pause",C);q.addEventListener("seeked",C);q.addEventListener("ended",C);q.addEventListener("error",
|
|
299
|
+
C);q.addEventListener("seeking",C);q.addEventListener("waiting",C);q.addEventListener("timeupdate",H);document.addEventListener("keydown",d.onKeydown);c.videoEventsSetuped=!0;c.removeVideoEventHandlers=function(){if(this.videoEventsSetuped){var P=this.videoEl;P.removeEventListener("loadedmetadata",h);P.removeEventListener("play",C);P.removeEventListener("playing",C);P.removeEventListener("pause",C);P.removeEventListener("seeked",C);P.removeEventListener("ended",C);P.removeEventListener("error",C);
|
|
300
|
+
P.removeEventListener("seeking",C);P.removeEventListener("waiting",C);P.removeEventListener("timeupdate",H);document.removeEventListener("keydown",this.onKeydown);delete this.videoEventsSetuped}}}.bind(c);c.showMediainfo=function(d){var h=this;if(h.overlay_layers){var q=h.overlay_layers.querySelector(".zwp__mediainfo-viewer");if(q){if(!d){d=q.querySelector(".closeBtn");var C=document.createEvent("Event");C.initEvent("click",!0,!0);d.dispatchEvent(C)}}else{d='<button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+
|
|
301
|
+
(pa("media-prop","Media properties")+"</div>");h.mediaInfo?(C=h.mediaInfo,C.hasVideo&&(d+='<div class="info-item"><span class="info-label">Video</span><span class="info-value">'+C.vCodec+"</span></div>",d+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+C.width+"</span></div>",d+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+C.height+"</span></div>",d+='<div class="info-item"><span class="info-label">FPS</span><span class="info-value">'+
|
|
302
302
|
C.fps+"</span></div>",d+='<div class="info-item"><span class="info-label">Profile</span><span class="info-value">'+C.profile+"</span></div>",d+='<div class="info-item"><span class="info-label">Level</span><span class="info-value">'+C.level+"</span></div>"),C.hasAudio&&(d+='<div class="info-item"><span class="info-label">Audio</span><span class="info-value">'+C.aCodec+"</span></div>",d+='<div class="info-item"><span class="info-label">SampRate</span><span class="info-value">'+C.sampleRate+"</span></div>",
|
|
303
303
|
d+='<div class="info-item"><span class="info-label">Channel</span><span class="info-value">'+C.channels+"</span></div>")):h.videoEl?(C=h.videoEl,C.videoWidth&&(d+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+C.videoWidth+"</span></div>",d+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+C.videoHeight+"</span></div>"),C.duration&&(d+='<div class="info-item"><span class="info-label">Duration</span><span class="info-value">'+
|
|
304
|
-
|
|
305
|
-
d.addEventListener("click",
|
|
306
|
-
"MP3":"Unknown",d.aCodec=q,d.sampleRate=h.audioSampleRate,d.channels=h.audioChannelCount);this.mediaInfo=d}.bind(c);c.loadChapters=function(){var d=this;if(d.chapters){if("string"===typeof d.chapters)if("["===d.chapters.charAt(0))d.chapters=JSON.parse(d.chapters);else{if("http"===d.chapters.substr(0,4))Ra(d.chapters,function(
|
|
307
|
-
" failed!")});else if("WEBVTT"===d.chapters.substr(0,6)){var h=Sa(d.chapters);if(h){for(var q=[],C=0;C<h.body.length;C++){var
|
|
308
|
-
0<h.length&&h.forEach(function(
|
|
309
|
-
q=h.querySelectorAll(".chapter-item"),0<q.length&&q.forEach(function(
|
|
310
|
-
|
|
304
|
+
Y(C.duration)+"</span></div>")):d+='<div class="info-item"><div class="row-text">No More Media Info</div></div>';q=document.createElement("div");q.setAttribute("class","zwp__mediainfo-viewer zwp-popupwindow");q.innerHTML=d;h.overlay_layers.appendChild(q);q.addEventListener("click",function(P){P.stopPropagation()});var H=function(P){P.preventDefault();P.stopPropagation();Ga(q,500,function(){q.remove()});h.overlay_layers.removeEventListener("click",H);delete h.infoViewer};d=q.querySelector(".closeBtn");
|
|
305
|
+
d.addEventListener("click",H);h.infoViewer=q}}}.bind(c);c.setMediainfo=function(d,h){d={engine:d,hasVideo:h.hasVideo,hasAudio:h.hasAudio};if(h.hasVideo){var q=h.videoCodec;q=0<=q.indexOf("avc1")?"H264/AVC":0<=q.indexOf("hvc")?"H265/HEVC":"Unknown";d.vCodec=q;d.width=h.width;d.height=h.height;d.fps=h.fps;"number"===typeof d.fps&&(d.fps=d.fps.toFixed(2));d.profile=h.profile;d.level=h.level}h.hasAudio&&(q=h.audioCodec,q=0<=q.indexOf("mp4a.40.2")?"AAC-LC":0<=q.indexOf("mp4a.40.5")?"HE-AAC":0<=q.indexOf("mp3")?
|
|
306
|
+
"MP3":"Unknown",d.aCodec=q,d.sampleRate=h.audioSampleRate,d.channels=h.audioChannelCount);this.mediaInfo=d}.bind(c);c.loadChapters=function(){var d=this;if(d.chapters){if("string"===typeof d.chapters)if("["===d.chapters.charAt(0))d.chapters=JSON.parse(d.chapters);else{if("http"===d.chapters.substr(0,4))Ra(d.chapters,function(V){if("WEBVTT"===V.substr(0,6))d.chapters=V,d.loadChapters();else if(V=JSON.parse(V))d.chapters=V,d.loadChapters()},function(V){console.warn("get chapter list from "+d.chapters+
|
|
307
|
+
" failed!")});else if("WEBVTT"===d.chapters.substr(0,6)){var h=Sa(d.chapters);if(h){for(var q=[],C=0;C<h.body.length;C++){var H=h.body[C];q.push({title:H.content,time:Y(H.from),desc:"no desc",image:null})}d.chapters=q;d.loadChapters()}else delete d.chapters}else delete d.chapters;return}else if(!Array.isArray(d.chapters))return;h=d.videoEl.duration;if(!isNaN(h)&&Infinity!==h){if(h=ob(h,d.chapters))if(q=d.controlbar.querySelector(".zwp__time-chapter"))q.innerHTML=h,h=q.querySelectorAll(".zwp__chapter_dot"),
|
|
308
|
+
0<h.length&&h.forEach(function(V){V.addEventListener("mousedown",function(S){S.stopPropagation();S=La(this.getAttribute("data-time"));d.seekTimeProgressByTime(S)})});if(d._config.chapterButton&&(h=d.controlbar.querySelector(".zwp__time-info"))){var P=h.querySelector(".zwp-chapterButton");P&&P.remove();var N=pb(d.chapters);N&&((q=h.querySelector(".zwp_danmuBarDock"))?q.insertAdjacentHTML("beforebegin",N.html):h.insertAdjacentHTML("beforeend",N.html),P=h.querySelector(".zwp-chapterButton"),h=P.querySelector(".zwp-chapterlist"),
|
|
309
|
+
q=h.querySelectorAll(".chapter-item"),0<q.length&&q.forEach(function(V){V.addEventListener("click",function(S){S.stopPropagation();S=La(this.getAttribute("data-time"));d.seekTimeProgressByTime(S)})}),h.addEventListener("mousedown",function(V){V.stopPropagation()}),h.addEventListener("dblclick",function(V){V.stopPropagation()}),P.querySelector(".zwp-chapterBtn").addEventListener("click",function(V){V.stopPropagation();if(V=P.querySelector(".zwp-chapterPanel")){var S=d.overlay_layers.offsetHeight;if(!(100>
|
|
310
|
+
S)){S-=100;400<S&&(S=400);var U=N.titleWidth;200<U&&(U=200);V.style.height=S+"px";V.style.width=80+U+10+"px";"block"!==V.style.display?(S=V.querySelector(".zwp-list-inner"),$$(S).niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4}),V.style.opacity=1,V.style.display="block"):V.style.display="none"}}}),(h=P.querySelector(".closeBtn"))&&h.addEventListener("click",function(V){V.stopPropagation();var S=V.currentTarget.closest(".zwp-chapterPanel");Ga(S,500,function(){S.style.display=
|
|
311
311
|
"none"})}))}}}}.bind(c);c.removeChapters=function(){if(this.chapters){if(this.controlbar){var d=this.controlbar.querySelector(".zwp__time-chapter");d&&(d.innerHTML="")}(d=this.controlbar.querySelector(".zwp__time-info"))&&(d=d.querySelector(".zwp-chapterButton"))&&d.remove();delete this.chapters}}.bind(c);c.doSnapshot=function(){if(this.videoEl&&this.videoEl.videoWidth){if(!this.snapCanvas&&(this.snapCanvas=document.createElement("canvas"),!this.snapCanvas))return;var d=this.videoEl,h=this.snapCanvas;
|
|
312
|
-
h.width=this.videoEl.videoWidth;h.height=this.videoEl.videoHeight;var q=h.getContext("2d");q.fillStyle="#000000";q.beginPath();q.fillRect(0,0,d.videoWidth,d.videoHeight);q.closePath();q.drawImage(d,0,0,d.videoWidth,d.videoHeight);if("function"==typeof h.toBlob){var C="SNAP-"+eb();try{h.toBlob(function(
|
|
313
|
-
c.togglePictureInPicture=function(){var d=this;if(d.videoEl)if(document.pictureInPictureElement)document.exitPictureInPicture();else{var h=d.videoEl;d.smallWindowMode||(h.bindPicInPicEvent||(h.addEventListener("enterpictureinpicture",function(q){console.log(q.width,q.height);
|
|
314
|
-
(q=d.overlay_layers.querySelector(".zwp-pipExitButton"))&&q.addEventListener("click",function(C){C.stopPropagation();document.pictureInPictureElement&&document.exitPictureInPicture()});d.isInPicInPic=!0}),h.addEventListener("leavepictureinpicture",function(){
|
|
312
|
+
h.width=this.videoEl.videoWidth;h.height=this.videoEl.videoHeight;var q=h.getContext("2d");q.fillStyle="#000000";q.beginPath();q.fillRect(0,0,d.videoWidth,d.videoHeight);q.closePath();q.drawImage(d,0,0,d.videoWidth,d.videoHeight);if("function"==typeof h.toBlob){var C="SNAP-"+eb();try{h.toBlob(function(H){const P=document.createElement("a");P.download=`${C}.jpg`;P.href=URL.createObjectURL(H);P.click();db(H)},"image/jpg",.99)}catch(H){console.error("\u89c6\u9891\u6e90\u53d7CORS\u6807\u8bc6\u9650\u5236\uff0c\u65e0\u6cd5\u76f4\u63a5\u4e0b\u8f7d\u622a\u56fe\uff0c\u89c1\uff1a\n https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS")}}else console.error("\u6d4f\u89c8\u5668\u529f\u80fd\u9650\u5236\uff0c\u65e0\u6cd5\u622a\u53d6\u56fe\u50cf")}}.bind(c);
|
|
313
|
+
c.togglePictureInPicture=function(){var d=this;if(d.videoEl)if(document.pictureInPictureElement)document.exitPictureInPicture();else{var h=d.videoEl;d.smallWindowMode||(h.bindPicInPicEvent||(h.addEventListener("enterpictureinpicture",function(q){console.log(q.width,q.height);M(d.playerElm,"zwp-picInPic");d.overlay_layers.insertAdjacentHTML("beforeEnd",'<div class="zwp-pipPlaceHolder">\t<div class="zwp-pipControl">\t\t<div class="zwp-pipTiptext">\u6b63\u5728\u300c\u753b\u4e2d\u753b\u300d\u6a21\u5f0f\u4e0b\u64ad\u653e</div>\t\t<div class="zwp-pipExitButton">\u9000\u51fa\u753b\u4e2d\u753b</div>\t</div></div>');
|
|
314
|
+
(q=d.overlay_layers.querySelector(".zwp-pipExitButton"))&&q.addEventListener("click",function(C){C.stopPropagation();document.pictureInPictureElement&&document.exitPictureInPicture()});d.isInPicInPic=!0}),h.addEventListener("leavepictureinpicture",function(){Q(d.playerElm,"zwp-picInPic");var q=d.overlay_layers.querySelector(".zwp-pipPlaceHolder");q&&d.overlay_layers.removeChild(q);setTimeout(function(){},500);delete d.isInPicInPic}),h.bindPicInPicEvent=!0),h.requestPictureInPicture())}}.bind(c);c.showSubtitle=
|
|
315
315
|
function(d){var h=this;if(h.overlay_layers){var q=h.overlay_layers.querySelector(".zwp-subtitles-show");if(q){if(d?"block"!==q.style.display&&(q.style.opacity=0,q.style.display="block",Pa(q,500,function(){})):Ga(q,500,function(){Ba.removeElement(q);q.remove();delete h.subtitleShow;delete h.subtitle1;delete h.subtitle2}),h.controlbar){var C=h.controlbar.querySelector(".zwp-subtitleButton");C&&(C.style.display=d?"block":"none")}}else if(d){q=document.createElement("div");q.setAttribute("class","zwp-subtitles-show");
|
|
316
|
-
q.innerHTML='<div class="zwp-subtitles-viever"><div class="zwp-subtitle subtitle-1"><span class="subtitle-text"></span></div><div class="zwp-subtitle subtitle-2"><span class="subtitle-text"></span></div></div>';h.overlay_layers.appendChild(q);q.addEventListener("click",function(
|
|
317
|
-
q.querySelector(".subtitle-2 > .subtitle-text");h.subtitle2.style.display="none";var
|
|
318
|
-
|
|
319
|
-
this.on_subtitle_mousemove),document.removeEventListener("mouseup",this.on_subtitle_mouseup)),
|
|
320
|
-
document.addEventListener("mouseup",this.on_subtitle_mouseup));
|
|
321
|
-
(delete this.subtitles["1"].hidden,this.subtitle1.style.display="block"):(this.subtitles["1"].hidden=!0,this.subtitle1.style.display="none")):"subtitleSecond"===
|
|
322
|
-
h.on_subtitle_mousedown);if(h.controlbar){if(C=h.controlbar.querySelector(".zwp-subtitleButton"))C.style.display="block";(d=
|
|
316
|
+
q.innerHTML='<div class="zwp-subtitles-viever"><div class="zwp-subtitle subtitle-1"><span class="subtitle-text"></span></div><div class="zwp-subtitle subtitle-2"><span class="subtitle-text"></span></div></div>';h.overlay_layers.appendChild(q);q.addEventListener("click",function(U){U.preventDefault();U.stopPropagation()});Ba.addElement(q);q.addEventListener("resize",function(U){this.updateSubtitlePosition()}.bind(h));h.subtitleShow=q;h.subtitle1=q.querySelector(".subtitle-1 > .subtitle-text");h.subtitle2=
|
|
317
|
+
q.querySelector(".subtitle-2 > .subtitle-text");h.subtitle2.style.display="none";var H=q.querySelector(".zwp-subtitles-viever"),P=!1,N=0,V=0;d="onpointerout"in document;var S="ontouchstart"in document.documentElement||"ontouchstart"in K;h.on_subtitle_mousemove=function(U){var g=U.target;if(!P||g!==this.subtitle1&&g!==this.subtitle2)console.log("out subtitle");else{g=U.pageY;var r=!0;"touchmove"==U.type&&(U.changedTouches&&(g=U.changedTouches[0].pageY),r=!1);r&&U.preventDefault();U.stopPropagation();
|
|
318
|
+
U=N-g;54>=H.offsetTop&&0<U||(U=V+U,54>U&&(console.log("mouse move 0"),U=54),H.style.bottom=U+"px",console.log("move x: ",U))}}.bind(h);h.on_subtitle_mouseup=function(U){P&&("onpointerout"in document?(document.removeEventListener("pointermove",this.on_subtitle_mousemove),document.removeEventListener("pointerup",this.on_subtitle_mouseup)):S?(document.removeEventListener("touchmove",this.on_subtitle_mousemove),document.removeEventListener("touchend",this.on_subtitle_mouseup)):(document.removeEventListener("mousemove",
|
|
319
|
+
this.on_subtitle_mousemove),document.removeEventListener("mouseup",this.on_subtitle_mouseup)),P=!1)}.bind(h);h.on_subtitle_mousedown=function(U){"onpointerout"in document?(document.addEventListener("pointermove",this.on_subtitle_mousemove),document.addEventListener("pointerup",this.on_subtitle_mouseup)):S?(document.addEventListener("touchmove",this.on_subtitle_mousemove),document.addEventListener("touchend",this.on_subtitle_mouseup)):(document.addEventListener("mousemove",this.on_subtitle_mousemove),
|
|
320
|
+
document.addEventListener("mouseup",this.on_subtitle_mouseup));P=!0;N=U.pageY;var g=parseInt(H.offsetTop+H.offsetHeight);V=this.subtitleShow.offsetHeight-g;U.stopPropagation();U.preventDefault()}.bind(h);h.on_subtitleItemclick=function(U){U.stopPropagation();var g=U.currentTarget;L(g,"zwp_switch")&&Oa(g);U=g.getAttribute("data-action");g=L(g,"switch_on");"subtitleOn"===U?this.subtitleShow&&(this.subtitleShow.style.display=g?"block":"none"):"subtitleDefault"===U?this.subtitles["1"]&&(g?this.subtitles["1"].hidden&&
|
|
321
|
+
(delete this.subtitles["1"].hidden,this.subtitle1.style.display="block"):(this.subtitles["1"].hidden=!0,this.subtitle1.style.display="none")):"subtitleSecond"===U&&this.subtitles["2"]&&(g?this.subtitles["2"].hidden&&(delete this.subtitles["2"].hidden,this.subtitle2.style.display="block"):(this.subtitles["2"].hidden=!0,this.subtitle2.style.display="none"))}.bind(h);d?H.addEventListener("pointerdown",h.on_subtitle_mousedown):canTouch?H.addEventListener("touchstart",h.on_subtitle_mousedown):H.addEventListener("mousedown",
|
|
322
|
+
h.on_subtitle_mousedown);if(h.controlbar){if(C=h.controlbar.querySelector(".zwp-subtitleButton"))C.style.display="block";(d=x.querySelector(".zwp-subtitleMenu"))&&!d.bindSwitchEvent&&(C=d.querySelectorAll(".action-item"),0<C.length&&C.forEach(function(U){U.addEventListener("click",h.on_subtitleItemclick);var g=U.getAttribute("data-action");"subtitleOn"!==g&&"subtitleDefault"!==g||M(U,"switch_on")}),d.bindSwitchEvent=!0)}}}}.bind(c);c.getSimpleSubtitleRenderer=function(){if(!this.overlay_layers)return null;
|
|
323
323
|
var d=this.overlay_layers.querySelector(".zwp-subtitles-show");if(d){var h=d.querySelector(".zwp-simple-subtitles-viever");h||(d.innerHTML='<div class="zwp-simple-subtitles-viever"></div>',h=d.querySelector(".zwp-simple-subtitles-viever"));return h}d=document.createElement("div");d.setAttribute("class","zwp-subtitles-show");d.innerHTML='<div class="zwp-simple-subtitles-viever"></div>';this.overlay_layers.appendChild(d);d.addEventListener("click",function(q){q.preventDefault();q.stopPropagation()});
|
|
324
|
-
Ba.addElement(d);d.addEventListener("resize",function(q){this.updateSubtitlePosition()}.bind(this));this.subtitleShow=d;return d.querySelector(".zwp-simple-subtitles-viever")}.bind(c);c.loadSubtitle=function(d,h,q){var C=this;"1"!==h&&"2"!==h||Ra(d,function(
|
|
325
|
-
(
|
|
326
|
-
setTimeout(function(){this.showSubtitle(!0);delete this.showSubtitleTimer}.bind(C),300))}else console.warn("Invalid subtitle file from "+d)},function(
|
|
327
|
-
C.current.to)continue;this[
|
|
328
|
-
(
|
|
324
|
+
Ba.addElement(d);d.addEventListener("resize",function(q){this.updateSubtitlePosition()}.bind(this));this.subtitleShow=d;return d.querySelector(".zwp-simple-subtitles-viever")}.bind(c);c.loadSubtitle=function(d,h,q){var C=this;"1"!==h&&"2"!==h||Ra(d,function(H){var P=I(d);if(".srt"===P)var N=fb(H);else if(".vtt"===P)N=Sa(H);else if(".json"===P||".bcc"===P)N=JSON.parse(H);if(N){C.subtitles||(C.subtitles={});q&&(N.title=q);"2"===h&&C._config.secondSubtitleHidden&&(N.hidden=!0);if(C.controlbar&&(P=C.controlbar.querySelector(".zwp-subtitleMenu"))){P.querySelector(".main")||
|
|
325
|
+
(P.innerHTML=Ya(),Q(P,"zwp-autosize"));if("1"===h&&(H=P.querySelector(".sub1"))){q||=pa("mainSubtitle","Main subtitle");var V=H.querySelector(".zwp-option-item-label");V&&(V.innerHTML=q);H.style.display="block"}if("2"===h&&(H=P.querySelector(".sub2"))){q||=pa("secondSubtitle","Second subtitle");if(V=H.querySelector(".zwp-option-item-label"))V.innerHTML=q;N.hidden||(P=H.querySelector(".zwp_switch"))&&M(P,"switch_on");H.style.display="block"}}C.subtitles[h]=N;C.showSubtitleTimer||(C.showSubtitleTimer=
|
|
326
|
+
setTimeout(function(){this.showSubtitle(!0);delete this.showSubtitleTimer}.bind(C),300))}else console.warn("Invalid subtitle file from "+d)},function(H){console.warn("get subtitle from "+d+" failed!")})}.bind(c);c.renderSubtitles=function(d){if(this.subtitleShow&&this.subtitles&&"none"!==this.subtitleShow.style.display)for(var h=["1","2"],q=0;q<h.length;q++){var C=h[q];if(this.subtitles[C]){var H="subtitle"+C;C=this.subtitles[C];var P=!1;if(!C.hidden){if(C.current){if(d<C.current.from)P=!0;else if(d<
|
|
327
|
+
C.current.to)continue;this[H]&&(this[H].innerHTML="",this[H].style.display="none");C.current=null}var N=C.nextSubtitleIdx||0,V=!0;if(P){var S=N-4;0>S&&(S=0);for(var U=N-2;U>=S;U--)if(P=C.body[U],d<=P.to){if(d>=P.from){C.current=P;C.nextSubtitleIdx=U+1;V=!1;break}}else{C.nextSubtitleIdx=N;V=!1;break}if(V&&0<S){N=0;for(U=S-1;N<=U;)if(S=parseInt((N+U)/2),P=C.body[S],d<P.from)U=S-1;else if(d>P.to)N=S+1;else{C.current=P;C.nextSubtitleIdx=S+1;V=!1;break}V&&(C.nextSubtitleIdx=N)}}else{S=N+2;S>C.body.length&&
|
|
328
|
+
(S=C.body.length);for(U=N;U<S;U++)if(P=C.body[U],d>=P.from){if(d<=P.to){C.current=P;C.nextSubtitleIdx=U+1;V=!1;break}}else{C.nextSubtitleIdx=N;V=!1;break}if(V){N=S;U=C.body.length-1;for(S>=C.body.length?d<C.body[C.body.length-1].from&&(N=0):d<C.body[S].from&&(N=0);N<=U;)if(S=parseInt((N+U)/2),P=C.body[S],d<P.from)U=S-1;else if(d>P.to)N=S+1;else{C.current=P;C.nextSubtitleIdx=S+1;V=!1;break}V&&(C.nextSubtitleIdx=N)}}C.current&&this[H]&&(this[H].innerHTML=C.current.content,this[H].style.display="block")}}}}.bind(c);
|
|
329
329
|
c.updateSubtitlePosition=function(){if(this.subtitleShow&&this.subtitles){var d=["1","2"],h=this.subtitleShow.offsetWidth,q=this.subtitleShow.offsetHeight;if(h&&q)for(h/=1024,q/=576,q=32*(h>q?q:h),h=0;h<d.length;h++){var C=d[h];this.subtitles[C]&&(C="subtitle"+C,this[C]&&(this[C].style.fontSize=q.toFixed(2)+"px"))}}}.bind(c);c.resetQualitiesMenu=function(){if(this&&!this.multiStreams&&this.controlbar){var d=this.controlbar.querySelector(".zwp-qualityButton");if(d){var h=d.querySelector(".zwp-qualityMenu");
|
|
330
|
-
h&&(h.innerHTML='<li class="zwp-quality-item zwp-disabled" data-index="-1">No quality</li>');d.style.display="none"}}}.bind(c);c.createQualitiesMenu=function(d){var h=this;if(1>=d.length)h.resetQualitiesMenu();else{var q=h.controlbar.querySelector(".zwp-qualityButton");if(q){var C="",
|
|
331
|
-
"x"+d[
|
|
332
|
-
"function"===typeof h.switchQualityLevel&&h.switchQualityLevel(
|
|
333
|
-
(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
d&&(d.style.display="none")}}.bind(c);c.__getDanmuBarDock=function(){var d=this.progressBar.timeInfo.querySelector(".zwp_danmuBarDock");d||(d=document.createElement("DIV"),d.setAttribute("class","zwp_danmuBarDock"),this.progressBar.timeInfo.appendChild(d),Ba.addElement(d),d.addEventListener("resize",function(h){var q=this;q.resizeTimer||(q.resizeTimer=
|
|
338
|
-
return d}.bind(c);c.buildDanmuToolbar=function(d,h){var q=this,C;if(!q.danmuToolbar){d&&(C=document.querySelector("#"+d));if(!C){if(!q.overlay_layers)return;h=null;C=q.progressBar&&q.progressBar.timeInfo?q.__getDanmuBarDock():q.overlay_layers}d=mb();C.insertAdjacentHTML("beforeend",d);q.danmuToolbar=C.querySelector(".zwp_danmu-controlbar");h&&
|
|
339
|
-
|
|
340
|
-
this.setEnableDanmu(!1),
|
|
341
|
-
|
|
342
|
-
-1!=
|
|
330
|
+
h&&(h.innerHTML='<li class="zwp-quality-item zwp-disabled" data-index="-1">No quality</li>');d.style.display="none"}}}.bind(c);c.createQualitiesMenu=function(d){var h=this;if(1>=d.length)h.resetQualitiesMenu();else{var q=h.controlbar.querySelector(".zwp-qualityButton");if(q){var C="",H=pa("level","Level")+" ";C+='<li class="zwp-quality-item active" data-idx="-1">'+pa("qs-auto","AUTO SWITCH")+"</li>";for(var P=0;P<d.length;P++){var N="";"undefined"!==typeof d[P]&&(N=d[P].width&&d[P].height?d[P].width+
|
|
331
|
+
"x"+d[P].height:H+(P+1));"undefined"!==typeof d[P].bitrate&&(N+=" ("+parseInt(d[P].bitrate/1E3)+"kbps)");C+='<li class="zwp-quality-item" data-br="'+d[P].bitrate+'" data-idx="'+d[P].qualityIndex+'" data-vh="'+d[P].height+'">'+N+"</li>"}if(d=q.querySelector(".zwp-qualityMenu"))d.innerHTML=C,K.mQuery(d).find(".zwp-quality-item").click(function(V){V.preventDefault();V.stopPropagation();V=K.mQuery(this);V.hasClass("active")||(V.siblings().removeClass("active"),V.addClass("active"),V=this.getAttribute("data-idx"),
|
|
332
|
+
"function"===typeof h.switchQualityLevel&&h.switchQualityLevel(V))});q.style.display="block"}}}.bind(c);c.updateQualityLevel=function(d,h){if(this&&this.controlbar){var q=this.controlbar.querySelector(".zwp-qualityButton");q&&(q=q.querySelector(".zwp-qualityMenu"))&&K.mQuery(q).children(".zwp-quality-item").each(function(C,H){C=parseInt(H.getAttribute("data-idx"));H=K.mQuery(H);-1===C?h&&!H.hasClass("active")&&(H.siblings(".active").removeClass("active"),H.addClass("active")):d===C?(h||H.hasClass("active")||
|
|
333
|
+
(H.siblings(".active").removeClass("active"),H.addClass("active")),H.hasClass("current")||(H.siblings(".current").removeClass("current"),H.addClass("current"))):H.hasClass("current")&&H.removeClass("current")})}}.bind(c);c.buildStreamSelector=function(){var d=this;if(d.multiStreams&&d.controlbar){var h=d.controlbar.querySelector(".zwp-qualityButton");if(h){var q="",C=d.multiStreams.murls;if(!Array.isArray(C)||1!==C.length){for(var H in C){var P=C[H];P="object"===typeof P?P.name:H;q+='<li class="zwp-quality-item" data-stream="'+
|
|
334
|
+
P+'">'+pa(P,P)+"</li>"}if(C=h.querySelector(".zwp-qualityMenu"))C.innerHTML=q,q=K.mQuery(C).find(".zwp-quality-item"),q.click(function(N){N.preventDefault();N.stopPropagation();N=this.getAttribute("data-stream");if(d.multiStreams.curStream!==N){var V=d.multiStreams.murls;if(Array.isArray(V))for(var S in V){var U=V[S];if(U.name===N){var g=U.url;break}}else g=V[N];d.__switchStream(g);d.multiStreams.curStream=N;g=K.mQuery(this);g.hasClass("active")||(g.siblings(".active").removeClass("active"),g.addClass("active"));
|
|
335
|
+
N=pa(N,N);d.toast("\u5df2\u7ecf\u4e3a\u60a8\u5207\u6362\u5230"+N+"\u753b\u8d28")}}),q.each(function(N,V){N=this.getAttribute("data-stream");if(d.multiStreams.curStream===N&&(N=K.mQuery(this),!N.hasClass("active")))return N.siblings(".active").removeClass("active"),N.addClass("active"),!1});h.style.display="block"}}}}.bind(c);c.createSubtitlesMenu=function(d,h){var q=this;q.controlbar&&(h=q.controlbar.querySelector(".zwp-subtitleMenu"),d=lb(d),h.innerHTML=d,delete h.bindSwitchEvent,M(h,"zwp-autosize"),
|
|
336
|
+
K.mQuery(h).find(".zwp-subtitles-item").click(function(C){C.preventDefault();C.stopPropagation();C=K.mQuery(this);C.hasClass("active")||(C.siblings().removeClass("active"),C.addClass("active"),C=this.getAttribute("data-id"),"function"===typeof q.switchSubtitleTrack&&q.switchSubtitleTrack(C))}),d=q.controlbar.querySelector(".zwp-subtitleButton"))&&(d.style.display="block")}.bind(c);c.updateSubtitleTrack=function(d){}.bind(c);c.resetSubtitleMenu=function(){if(this.controlbar){var d=this.controlbar.querySelector(".zwp-subtitleButton");
|
|
337
|
+
d&&(d.style.display="none")}}.bind(c);c.__getDanmuBarDock=function(){var d=this.progressBar.timeInfo.querySelector(".zwp_danmuBarDock");d||(d=document.createElement("DIV"),d.setAttribute("class","zwp_danmuBarDock"),this.progressBar.timeInfo.appendChild(d),Ba.addElement(d),d.addEventListener("resize",function(h){var q=this;q.resizeTimer||(q.resizeTimer=K.setTimeout(function(){console.log("danmuBarDock resize");350>d.clientWidth?M(d,"zwp-mini"):Q(d,"zwp-mini");delete q.resizeTimer},50))}.bind(this)));
|
|
338
|
+
return d}.bind(c);c.buildDanmuToolbar=function(d,h){var q=this,C;if(!q.danmuToolbar){d&&(C=document.querySelector("#"+d));if(!C){if(!q.overlay_layers)return;h=null;C=q.progressBar&&q.progressBar.timeInfo?q.__getDanmuBarDock():q.overlay_layers}d=mb();C.insertAdjacentHTML("beforeend",d);q.danmuToolbar=C.querySelector(".zwp_danmu-controlbar");h&&M(q.danmuToolbar,h);C.appendChild(q.danmuToolbar);(h=q.danmuToolbar.querySelector(".zwp_switch"))&&h.addEventListener("click",function(H){H.stopPropagation();
|
|
339
|
+
H=H.currentTarget;if(L(H,"zwp_switch")){Oa(H);var P=L(H,"switch_on");H=K.$$(this.danmuToolbar);if(P){var N=H.find("button.btn_submit");N.removeClass("vtb_disabled").removeAttr("disabled");this.setEnableDanmu(!0);P=H.find(".barrage_inp_text");P.removeAttr("readonly").removeAttr("disabled").removeClass("disabled");"on"!=P.attr("keydown")&&(P.keydown(function(V){13==V.which&&0<N.length&&N.trigger("click")}),P.attr("keydown","on"));H.find(".zwp-barrage_form").css("background-color","#28303db3").children("a.btn_bubble").toggleClass("disabled")}else H.find("button.btn_submit").addClass("vtb_disabled").attr({disabled:"disabled"}),
|
|
340
|
+
this.setEnableDanmu(!1),H.find(".barrage_inp_text").attr("readonly","readonly").attr("disabled","disabled").addClass("disabled"),H.find(".zwp-barrage_form").css("background-color","#202020b3").children("a.btn_bubble").toggleClass("disabled")}}.bind(q));(h=q.danmuToolbar.querySelector(".barrage_login"))&&h.addEventListener("click",function(H){H.preventDefault();H.stopPropagation();alert("login")});(h=q.danmuToolbar.querySelector(".zwp_dmconfig"))&&h.addEventListener("click",function(H){H.preventDefault();
|
|
341
|
+
H.stopPropagation();this.zwplayer=q;qb(H,this)});(h=q.danmuToolbar.querySelector(".btn_bubble"))&&h.addEventListener("click",function(H){H.preventDefault();H.stopPropagation();gb(this,H)});(h=q.danmuToolbar.querySelector(".btn_submit"))&&h.addEventListener("click",function(H){H.preventDefault();H.stopPropagation();a:{if(!this.inpbox){$inpbox=$$(this).parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");if(!$inpbox)break a;this.inpbox=$inpbox}if(q){H=this.inpbox.val();if(""==H)break a;
|
|
342
|
+
-1!=H.indexOf("&")&&(H=H.replace(/&/g,"&"));-1!=H.indexOf("<")&&(H=H.replace(/</g,"<"));-1!=H.indexOf(">")&&(H=H.replace(/>/g,">"));-1!=H.indexOf('"')&&(H=H.replace(/"/g,"""));-1!=H.indexOf("'")&&(H=H.replace(/'/g,"'"));if(!q.sendDanmu(H))break a}this.inpbox.val("")}})}}.bind(c);c.reposDanmuToolbar=function(d){if(this.danmuToolbar&&this.progressBar&&this.progressBar.timeInfo){var h=this.__getDanmuBarDock(),q=this.danmuToolbar.parentNode;q&&(d?q!==h&&(q.removeChild(this.danmuToolbar),
|
|
343
343
|
h.appendChild(this.danmuToolbar),this.oldDanmuParentNode=q):this.oldDanmuParentNode&&(h.removeChild(this.danmuToolbar),this.oldDanmuParentNode.appendChild(this.danmuToolbar),delete this.oldDanmuParentNode))}}.bind(c);c.sendDanmu=function(d){if("function"===typeof this._config.sendDanmu){var h="";this.danmuSetting.border&&(h+=',"border":"1"');this.danmuSetting.color&&(h+=',"color":"#'+this.danmuSetting.color+'"');this._config.sendDanmu('{"type":"danmu","text":"'+d+'"'+h+"}");return!0}alert("No danmu send function is setup");
|
|
344
|
-
return!1}.bind(c);c.showContextMenu=function(d){var h=this,q=d.offsetX;d=d.offsetY;var C=h.playerContainer.getBoundingClientRect(),
|
|
345
|
-
(
|
|
346
|
-
(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
delete
|
|
350
|
-
h.innerHTML='<span class="zwp-toast-text">\u56e0<a href="#mutemore" class="mutemore">\u6d4f\u89c8\u5668\u9650\u5236</a>\uff0c\u9700\u8981\u70b9\u51fb<a href="#openaudio" class="openaudio">\u6253\u5f00\u58f0\u97f3</a><button class="closeBtn" title="\u5173\u95ed\u63d0\u793a"><i class="xicon xicon-close"></i></button></span>';d.popup_layers.appendChild(h);d.mutedTipBox=h;var q=h.querySelector(".closeBtn");
|
|
351
|
-
d.popup_layers.style.display=null,delete d.mutedTipBox);
|
|
352
|
-
(h.insertAdjacentHTML("beforeend",'<div class="moreInfoBox"><div class="info-text">\u5f53\u4f60\u8bbf\u95ee\u672c\u7f51\u7ad9\u7684\u6b21\u6570\u8f83\u5c11\uff0c\u6216\u7ecf\u5e38\u9759\u97f3\u64ad\u653e\u65f6\uff0c\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a\u9650\u5236\u7f51\u7ad9\u97f3\u91cf\uff0c\u4f7f\u7f51\u7ad9\u65e0\u6cd5\u81ea\u52a8\u6267\u884c\u6709\u58f0\u64ad\u653e</div><div class="info-control"><button class="info-btn">\u6211\u77e5\u9053\u4e86</button></div></div>'),
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
c.playerContainer=document.createElement("DIV");c.playerContainer.setAttribute("class","zwp-container");c.playerElm.appendChild(c.playerContainer);"string"==typeof c._config.videoElm?(e=c._config.videoElm,"#"!=e.charAt(0)&&(e="#"+e),c.videoEl=document.querySelector(e)):Ua(c._config.videoElm)&&(c.videoEl=c._config.videoElm);if(!c.videoEl){var
|
|
356
|
-
this.rotateVideo()}.bind(c));c.videoWrapper=
|
|
357
|
-
"");c.videoEl.setAttribute("webkit-playsinline","");c.videoEl.setAttribute("autoplay","");
|
|
358
|
-
c.playerContainer.appendChild(e),c.overlay_layers=e,c.bigPlayOverlay=e.querySelector(".zwp__overlay-play"),c.bigPlayBtn=c.bigPlayOverlay.querySelector(".zwp__overlay-button"),c.loadingOverlay=e.querySelector(".zwp_loadingicon"),c._config.disablePlayBtn?
|
|
359
|
-
function(d){d.preventDefault();d.stopPropagation();Va||this.showContextMenu(d)}.bind(c)),e.addEventListener("click",function(d){var h=this;d=function(q){q=q.querySelector(".closeBtn");var C=document.createEvent("Event");C.initEvent("click",!0,!0);q.dispatchEvent(C)};h.infoViewer?d(h.infoViewer):h.colorSettingPanel?d(h.colorSettingPanel):h.contextMenu?h.hideContextMenu():h._config.disableClickPause||h._config.disablePlayBtn||h._config.isLive||(h.overlayLayerClickTimer&&(
|
|
360
|
-
delete h.overlayLayerClickTimer),h.videoEl&&(h.overlayLayerClickTimer=
|
|
361
|
-
"";"dock"in c._config.logo?
|
|
362
|
-
"controls"),c.overlay_layers&&(c.overlay_layers.style.bottom="70px"),c.videoEl.addEventListener("fullscreenchange",function(d){return!1}.bind(c));else if(c._config.controlbar){var
|
|
363
|
-
!0,A.forEach(function(d){d.addEventListener("click",c.on_btnclick)}));c._config.disablePlayBtn&&(A=
|
|
364
|
-
c.volcurrent=c.volslider.querySelector(".zwp-volume-current");c.volthumb=c.volslider.querySelector(".zwp-volume-handle");var
|
|
365
|
-
d+"%";var C=getComputedStyle(h);q.style.bottom=0;q.style.height=d;h.style.bottom=d;h.style.marginBottom=-parseFloat(C.height)/2+"px"}},
|
|
366
|
-
|
|
367
|
-
document.removeEventListener("mouseup",c.on_volthumb_mouseup)),
|
|
368
|
-
c.on_volthumb_mousemove),document.addEventListener("mouseup",c.on_volthumb_mouseup));
|
|
369
|
-
"none"});
|
|
370
|
-
function(){m=!1;
|
|
371
|
-
document.body.scrollTop)>=d+this.playerElm.offsetHeight-100){if(!this.smallWindowMode){var h=this.playerContainer;hb(h,function(){
|
|
372
|
-
c._config.clientip||(c._config.clientip="");c.videoEl&&(c._config.muted?c.setMuted(!0):"undefined"===typeof
|
|
373
|
-
d=d||
|
|
374
|
-
(
|
|
375
|
-
document.addEventListener("visibilitychange",function(){this._config.isLive||this.isInPicInPic||("visible"===document.visibilityState?this.focusPaused&&this.videoEl.paused&&!this.videoEl.ended&&(this.videoEl.play(),this.setplaystate(!0),delete this.focusPaused):this.focusPaused||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1),this.focusPaused=!0))}.bind(c));c._config.fluid?c._config.autoplay||(
|
|
344
|
+
return!1}.bind(c);c.showContextMenu=function(d){var h=this,q=d.offsetX;d=d.offsetY;var C=h.playerContainer.getBoundingClientRect(),H=C.width;C=C.height;var P="left",N="top",V=q,S=d;q+180>H&&(P="right",V=H-q);d+148>C&&(N="bottom",S=C-d);if(h.contextMenu)h.contextMenu.style["left"===P?"right":"left"]=null,h.contextMenu.style["top"===N?"bottom":"top"]=null,h.contextMenu.style[P]=V+"px",h.contextMenu.style[N]=S+"px";else{q='<div class="zwp-popupmenu" style="'+P+": "+V+"px; "+N+":"+S+'px;"><a class="zwp-menuitem" data-action="document" href="https://www.zwplayer.com/docment" target="zwplayer-doc"><span class="zwp-menucaption">'+
|
|
345
|
+
(pa("player-help","Help and document")+"</span></a>");q+='<a class="zwp-menuitem" data-action="version" href="https://www.zwplayer.com/version?v=3.1.2" title="Build: 20240507" target="zwplayer-version"><span class="zwp-menucaption">'+pa("version-update","Version update")+' (<span class="zwp-version">'+pa("current")+": v3.1.2</span>) </span></a>";q=q+'<span class="zwp-menuseperator" action="version"></span><a class="zwp-menuitem" data-action="about" href="https://www.zwplayer.com/about"><span class="zwp-menucaption">'+
|
|
346
|
+
(pa("about","About")+" zwplayer</span></a>");h.playerContainer.insertAdjacentHTML("beforeEnd",q+"</div>");h.contextMenu=h.playerContainer.querySelector(".zwp-popupmenu");var U=function(g){g.stopPropagation();g.preventDefault();var r=this.getAttribute("data-action");this.getAttribute("target");var t=this.getAttribute("href");h.hideContextMenu();setTimeout(function(){"about"===r?K.open(t,"zwplayer-about"):"version"===r?K.open(t,"zwplayer-version"):"document"===r&&K.open(t,"zwplayer-doc")},10)};h.contextMenu.querySelectorAll("a.zwp-menuitem").forEach(function(g){g.addEventListener("click",
|
|
347
|
+
U,!1)});document.addEventListener("click",h.hideContextMenu)}}.bind(c);c.hideContextMenu=function(){this.contextMenu&&(this.playerContainer.removeChild(this.contextMenu),delete this.contextMenu,document.removeEventListener("click",this.hideContextMenu))}.bind(c);c.toast=function(d,h,q,C){var H=this;h=h||2E3;H.toastTimerId&&(clearTimeout(H.toastTimerId),H.toastBox&&(H.overlay_layers.removeChild(H.toastBox),delete H.toastBox));if("closetoast"!==d){if("object"===typeof d){if("icon"in d)var P=d.icon;
|
|
348
|
+
d=d.text}var N=document.createElement("div"),V="",S="zwp-toast zwp-center";P&&(S+=" zwp-toast-icon",V='<i class="xicon xicon-'+P+'"></i>');q&&(V+='<a href="javascript:void(0)" class="zwp-toast-closebtn"><i class="xicon xicon-close"></i></a>',S+=" zwp-use-close");C&&(S+=" zwp-lite");V+='<span class="zwp-toast-text">'+d+"</span>";N.setAttribute("class",S);N.innerHTML=V;H.overlay_layers.appendChild(N);H.toastBox=N;var U=function(g){if(H.toastBox){var r=H.toastBox.querySelector(".zwp-toast-closebtn");
|
|
349
|
+
r&&r.removeEventListener("click",U);H.overlay_layers.removeChild(H.toastBox);delete H.toastBox}H.toastTimerId&&(g&&"click"===g.type&&clearTimeout(H.toastTimerId),delete H.toastTimerId)};H.toastTimerId=K.setTimeout(U,h);q&&(q=N.querySelector(".zwp-toast-closebtn"))&&q.addEventListener("click",U)}}.bind(c);c.mutedConfirmBox=function(){var d=this;d.popup_layers||(d.popup_layers=document.createElement("div"),d.popup_layers.setAttribute("class","zwp__popup_layers"),d.playerContainer.appendChild(d.popup_layers));
|
|
350
|
+
var h=document.createElement("div");h.setAttribute("class","zwp-toast zwp-confirm zwp-center");h.innerHTML='<span class="zwp-toast-text">\u56e0<a href="#mutemore" class="mutemore">\u6d4f\u89c8\u5668\u9650\u5236</a>\uff0c\u9700\u8981\u70b9\u51fb<a href="#openaudio" class="openaudio">\u6253\u5f00\u58f0\u97f3</a><button class="closeBtn" title="\u5173\u95ed\u63d0\u793a"><i class="xicon xicon-close"></i></button></span>';d.popup_layers.appendChild(h);d.mutedTipBox=h;var q=h.querySelector(".closeBtn");
|
|
351
|
+
q&&q.addEventListener("click",function(C){C.preventDefault();d.mutedTipBox&&(d.popup_layers.removeChild(d.mutedTipBox),d.popup_layers.style.display=null,delete d.mutedTipBox);K.allowAutoAudioPlay=!0});(q=h.querySelector(".openaudio"))&&q.addEventListener("click",function(C){C.preventDefault();C.stopPropagation();d.mutedTipBox&&(d.popup_layers.removeChild(d.mutedTipBox),d.popup_layers.style.display=null,delete d.mutedTipBox);d.setMuted(!1);K.allowAutoAudioPlay=!0});(q=h.querySelector(".mutemore"))&&
|
|
352
|
+
q.addEventListener("click",function(C){C.preventDefault();C.stopPropagation();var H=h.querySelector(".moreInfoBox");H||(h.insertAdjacentHTML("beforeend",'<div class="moreInfoBox"><div class="info-text">\u5f53\u4f60\u8bbf\u95ee\u672c\u7f51\u7ad9\u7684\u6b21\u6570\u8f83\u5c11\uff0c\u6216\u7ecf\u5e38\u9759\u97f3\u64ad\u653e\u65f6\uff0c\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a\u9650\u5236\u7f51\u7ad9\u97f3\u91cf\uff0c\u4f7f\u7f51\u7ad9\u65e0\u6cd5\u81ea\u52a8\u6267\u884c\u6709\u58f0\u64ad\u653e</div><div class="info-control"><button class="info-btn">\u6211\u77e5\u9053\u4e86</button></div></div>'),
|
|
353
|
+
H=h.querySelector(".moreInfoBox"),H.querySelector(".info-btn").addEventListener("click",function(P){P.preventDefault();P.stopPropagation();H.style.display="none"}));H&&(H.style.display="block");K.allowAutoAudioPlay=!0});d.popup_layers.style.display="block"}.bind(c);"string"==typeof c._config.playerElm?(e=c._config.playerElm,"#"!=e.charAt(0)&&(e="#"+e),c.playerElm=document.querySelector(e)):Ua(c._config.playerElm)&&(c.playerElm=c._config.playerElm);c.playerElm?L(c.playerElm,"zwp-wrap")||(c.playerElmOldClass=
|
|
354
|
+
c.playerElm.getAttribute("class"),M(c.playerElm,"zwp-wrap"),c.doRemovePlayerClass=!0):(e="","string"==typeof c._config.playerElm?(e=c._config.playerElm,"#"==e.charAt(0)&&(e=e.substr(1))):e="ZWP-"+(new Date).getTime(),c.playerElm=document.createElement("DIV"),c.playerElm.id=e,c.playerElm.style.position="absolute",c.playerElm.style.left=0,c.playerElm.style.top=0,c.playerElm.style.width="640px",c.playerElm.style.height="360px",document.body.appendChild(c.playerElm),c.playerElm.setAttribute("class","zwp-wrap"),
|
|
355
|
+
c.doDeletePlayerElm=!0);c.playerContainer=document.createElement("DIV");c.playerContainer.setAttribute("class","zwp-container");c.playerElm.appendChild(c.playerContainer);"string"==typeof c._config.videoElm?(e=c._config.videoElm,"#"!=e.charAt(0)&&(e="#"+e),c.videoEl=document.querySelector(e)):Ua(c._config.videoElm)&&(c.videoEl=c._config.videoElm);if(!c.videoEl){var z=document.createElement("DIV");z.setAttribute("class","zwp-videoWrapper");c.playerContainer.appendChild(z);Ba.addElement(z);z.addEventListener("resize",
|
|
356
|
+
function(d){this._config.video_rotated&&this.rotateVideo()}.bind(c));c.videoWrapper=z;c.videoEl=document.createElement("VIDEO");"string"==typeof c._config.videostyle&&c.videoEl.setAttribute("style",c._config.videostyle);"string"==typeof c._config.videoclass&&c.videoEl.setAttribute("class",c._config.videoclass);c._config.videostyle||c._config.videoclass||c.videoEl.setAttribute("style","width:100%;height:100%;");"string"==typeof c._config.videoElm&&(e=c._config.videoElm,"#"==e.charAt(0)&&(e=e.substr(1)),
|
|
357
|
+
c.videoEl.id=e);c.videoEl.setAttribute("playsinline","");c.videoEl.setAttribute("webkit-playsinline","");c.videoEl.setAttribute("autoplay","");z.appendChild(c.videoEl);c.videoRemoveWhenClose=!0}c.videoEl.volume=c._config.defVolume/100;c._config.poster&&c.videoEl.setAttribute("poster",c._config.poster);if(!c._config.disableOverlayLayer&&(e=document.createElement("div"),e.setAttribute("class","zwp__layers"),e.innerHTML='<div class="zwp__overlay zwp__layer zwp_loadingicon" style="width: 100%; height: 100%; display: none;"><div class="zwp__overlay-loading"><span class="zwp__overlay-loading-bg-img"><svg width="80px" height="80px" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg></span></div></div><div class="zwp__overlay zwp__layer zwp__overlay-play" style="width: 100%; height: 100%; display: none;"><div class="zwp__overlay-button" role="button" tabindex="0" aria-label="play" aria-pressed="false" data-action="play"><svg class="icon" width="96px" height="96px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#c2c2c2" d="M512.61025 48.820024a463.790226 463.790226 0 1 0 463.790227 463.790226A463.790226 463.790226 0 0 0 512.61025 48.820024z m0 854.350417a390.560191 390.560191 0 1 1 390.560191-390.560191 390.560191 390.560191 0 0 1-390.560191 390.560191z m166.720382-414.970203l-120.341359-70.300834-127.908463-74.694636a22.945411 22.945411 0 0 0-32.465315 24.410011v288.526341a22.945411 22.945411 0 0 0 32.465315 24.410012l127.908463-74.694636 120.341359-70.056734a28.559714 28.559714 0 0 0 0-47.599524z" /></svg></div></div>',
|
|
358
|
+
c.playerContainer.appendChild(e),c.overlay_layers=e,c.bigPlayOverlay=e.querySelector(".zwp__overlay-play"),c.bigPlayBtn=c.bigPlayOverlay.querySelector(".zwp__overlay-button"),c.loadingOverlay=e.querySelector(".zwp_loadingicon"),c._config.disablePlayBtn?M(c.bigPlayBtn,"zwp_disabled"):c.bigPlayBtn.addEventListener("click",function(d){d.preventDefault();d.stopPropagation();this.on_btnclick(d)}.bind(c)),c._config.enableDanmu&&(c.danmuPlayer=HUAYI.Danmu.create({playerId:e})),e.addEventListener("contextmenu",
|
|
359
|
+
function(d){d.preventDefault();d.stopPropagation();Va||this.showContextMenu(d)}.bind(c)),e.addEventListener("click",function(d){var h=this;d=function(q){q=q.querySelector(".closeBtn");var C=document.createEvent("Event");C.initEvent("click",!0,!0);q.dispatchEvent(C)};h.infoViewer?d(h.infoViewer):h.colorSettingPanel?d(h.colorSettingPanel):h.contextMenu?h.hideContextMenu():h._config.disableClickPause||h._config.disablePlayBtn||h._config.isLive||(h.overlayLayerClickTimer&&(K.clearTimeout(h.overlayLayerClickTimer),
|
|
360
|
+
delete h.overlayLayerClickTimer),h.videoEl&&(h.overlayLayerClickTimer=K.setTimeout(function(){h.videoEl.paused||h.videoEl.ended?(h.videoEl.play(),h.setplaystate(!0)):(h.videoEl.pause(),h.setplaystate(!1));delete h.overlayLayerClickTimer},300)))}.bind(c)),c._config.logo)){if("object"===typeof c._config.logo){if("string"===typeof c._config.logo.icon)var A=c._config.logo.icon}else"string"===typeof c._config.logo&&(A=c._config.logo);if(A){z='<div class="zwp-logo"';if("object"===typeof c._config.logo){var b=
|
|
361
|
+
"";"dock"in c._config.logo?b+=("left"===c._config.logo.dock?"left":"right")+": "+(c._config.logo.x||"5%")+";":"x"in c._config.logo&&(b+="right: "+c._config.logo.x+";");"y"in c._config.logo&&(b+="top: "+c._config.logo.y+";");"width"in c._config.logo&&(b+="width: "+c._config.logo.width+";");if("opacity"in c._config.logo){var O=c._config.logo.opacity/100;1<O&&(O=1);b+="opacity: "+O+";"}b&&(z+=' style="'+b+'"')}e.insertAdjacentHTML("afterbegin",z+('><img src="'+A+'"></div>'))}}if(c._config.nativecontrols)c.videoEl.setAttribute("controls",
|
|
362
|
+
"controls"),c.overlay_layers&&(c.overlay_layers.style.bottom="70px"),c.videoEl.addEventListener("fullscreenchange",function(d){return!1}.bind(c));else if(c._config.controlbar){var x=document.createElement("div");x.setAttribute("class","zwp-controlbar");c._config.isLive||M(x,"zwp-vodplayer");x.innerHTML=rb(c._config);c.playerContainer.appendChild(x);c.controlbar=x;if(c.controlbar){x.addEventListener("dblclick",function(d){d.stopPropagation()});A=x.querySelectorAll("button.zwpbtn");0<A.length&&(c.btnBindZwp=
|
|
363
|
+
!0,A.forEach(function(d){d.addEventListener("click",c.on_btnclick)}));c._config.disablePlayBtn&&(A=x.querySelector(".zwp_playbtn"),M(A,"zwp_disabled"),A.setAttribute("disabled","disabled"));A=x.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");0<A.length&&A.forEach(function(d){d.addEventListener("click",c.on_speedItemclick)});var ca=x.querySelector(".zwp-volume-docker");if(ca){c.muteBtn=ca.querySelector("button.zwp-muteBtn");c.volslider=ca.querySelector(".zwp-volume-slider");c.voltotal=ca.querySelector(".zwp-volume-total");
|
|
364
|
+
c.volcurrent=c.volslider.querySelector(".zwp-volume-current");c.volthumb=c.volslider.querySelector(".zwp-volume-handle");var G=function(d){if(null!==d&&!isNaN(d)&&void 0!==d){d=Math.max(0,d);d=Math.min(d,1);if(0===d){Q(ca,"zwp__mute");M(ca,"zwp__unmute");var h=c.muteBtn;h.setAttribute("title","unmute");h.setAttribute("aria-label","unmute")}else Q(ca,"zwp__unmute"),M(ca,"zwp__mute"),h=c.muteBtn,h.setAttribute("title","muted"),h.setAttribute("aria-label","muted");h=c.volthumb;var q=c.volcurrent;d=100*
|
|
365
|
+
d+"%";var C=getComputedStyle(h);q.style.bottom=0;q.style.height=d;h.style.bottom=d;h.style.marginBottom=-parseFloat(C.height)/2+"px"}},ja=function(d){var h=B(c.voltotal),q=getComputedStyle(c.voltotal),C=!0;"touchmove"==d.type&&(d.changedTouches&&(C=d.changedTouches[0],d.pageX=C.pageX,d.pageY=C.pageY),C=!1);q=parseFloat(q.height);q=(q-(d.pageY-h.top))/q;0!==h.top&&0!==h.left&&(q=Math.max(0,q),q=Math.min(q,1),G(q),c.setMuted(0===q),c.setVolume(q),C&&d.preventDefault(),d.stopPropagation())};c.positionVolumeThumb=
|
|
366
|
+
G;c.on_volthumb_mousemove=function(d){var h=d.target;l&&(h===c.volslider||h.closest(".zwp-volume-slider"))&&ja(d)}.bind(c);c.on_volthumb_mouseup=function(d){l&&("onpointerout"in document?(document.removeEventListener("pointermove",c.on_volthumb_mousemove),document.removeEventListener("pointerup",c.on_volthumb_mouseup),document.removeEventListener("touchmove",c.on_volthumb_mousemove),document.removeEventListener("touchend",c.on_volthumb_mouseup)):(document.removeEventListener("mousemove",c.on_volthumb_mousemove),
|
|
367
|
+
document.removeEventListener("mouseup",c.on_volthumb_mouseup)),l=!1);m||(c.volslider.style.display="none");console.log("volthumb_mouseup:"+d.type)}.bind(c);c.on_volthumb_mousedown=function(d){ja(d);"onpointerout"in document?(document.addEventListener("pointermove",c.on_volthumb_mousemove),document.addEventListener("pointerup",c.on_volthumb_mouseup),document.addEventListener("touchmove",c.on_volthumb_mousemove),document.addEventListener("touchend",c.on_volthumb_mouseup)):(document.addEventListener("mousemove",
|
|
368
|
+
c.on_volthumb_mousemove),document.addEventListener("mouseup",c.on_volthumb_mouseup));l=!0;d.preventDefault();d.stopPropagation()}.bind(c);var la=c.volslider;ca.addEventListener("mouseenter",function(d){d.target===ca&&(la.style.display="block",m=!0,d.preventDefault(),d.stopPropagation())});ca.addEventListener("focusin",function(){la.style.display="block";m=!0});ca.addEventListener("focusout",function(d){if(!d.relatedTarget||d.relatedTarget&&!d.relatedTarget.matches(".zwp-volume-slider"))la.style.display=
|
|
369
|
+
"none"});ca.addEventListener("mouseleave",function(){m=!1;l||(la.style.display="none")});ca.addEventListener("focusout",function(){m=!1});ca.addEventListener("keydown",function(d){var h=d.which||d.keyCode||0;d.preventDefault();d.stopPropagation();32==h&&(c.videoEl.muted?c.setMuted(!1):c.setMuted(!0))});la.addEventListener("dragstart",function(){return!1});la.addEventListener("mouseover",function(){m=!0});la.addEventListener("focusin",function(){la.style.display="block";m=!0});la.addEventListener("focusout",
|
|
370
|
+
function(){m=!1;l||(la.style.display="none")});la.addEventListener("mousedown",c.on_volthumb_mousedown)}if(A=x.querySelector(".zwp-optionPanel"))A=A.querySelectorAll(".action-item"),0<A.length&&A.forEach(function(d){d.addEventListener("click",c.on_optionItemclick)})}}c._config.autoSmallWindow&&!c.windowScrollHandler&&(c.windowScrollHandler=function(d){if(!this.isFullscr&&!this.isFullscrWin&&this.videoEl&&this.playerElm&&this.isPlaying&&!this.isInPicInPic)if(d=u(this.playerElm),(document.documentElement.scrollTop||
|
|
371
|
+
document.body.scrollTop)>=d+this.playerElm.offsetHeight-100){if(!this.smallWindowMode){var h=this.playerContainer;hb(h,function(){Q(h,"zwp-smallwindow");h.style.left=null;h.style.top=null;h.style.width=null;h.style.height=null});M(h,"zwp-smallwindow");this.smallWindowMode=!0}}else this.smallWindowMode&&(h=this.playerContainer,Q(h,"zwp-smallwindow"),h.style.left=null,h.style.top=null,h.style.width=null,h.style.height=null,delete this.smallWindowMode)}.bind(c),K.addEventListener("scroll",c.windowScrollHandler));
|
|
372
|
+
c._config.clientip||(c._config.clientip="");c.videoEl&&(c._config.muted?c.setMuted(!0):"undefined"===typeof K.allowAutoAudioPlay?(c.setMuted(!0),cb(function(d){d?c.setMuted(!1):c.mutedConfirmBox();K.allowAutoAudioPlay=d})):K.allowAutoAudioPlay||(c.setMuted(!0),c.mutedConfirmBox()),(c._config.snapshotButton||c._config.allowSnapshot)&&c.videoEl.setAttribute("crossorigin","Anonymous"));A=function(d){var h=this;if(h.controlbar)if(h.isControlbarhidden){h.controlbar.style.display="flex";Q(h.playerElm,"hide-cursor");
|
|
373
|
+
d=d||K.event;if(d.srcElement!=h.controlbar&&h.overlay_layers){var q=h.overlay_layers.offsetHeight,C=0;"undefined"!==typeof d.offsetY?C=q-d.offsetY:"undefined"!==typeof d.layerY&&(C=q-d.layerY);if(80<C)return}Pa(h.controlbar,500,function(H){H&&h.startHideControlbar(h)});h.isControlbarhidden=!1}else h.startHideControlbar(h)}.bind(c);c.playerElm.addEventListener("mousemove",A);c.playerElm.addEventListener("touchmove",A);c.playerElm.addEventListener("dblclick",function(d){this.overlayLayerClickTimer&&
|
|
374
|
+
(K.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);if(this.controlbar&&(d={},d.currentTarget=this.controlbar.querySelector(".zwp-fullscrBtn"),d.currentTarget))this.on_btnclick(d)}.bind(c));"undefined"==typeof c._config.autoplay&&(c._config.autoplay=!0);c._config.url&&c._config.autoplay&&c.play(c._config.url);"function"==typeof c._config.onready&&c._config.onready.call(c);c._config.chapters&&(c.chapters=c._config.chapters);c._config.lostFocusPause&&"undefined"!==typeof document.visibilityState&&
|
|
375
|
+
document.addEventListener("visibilitychange",function(){this._config.isLive||this.isInPicInPic||("visible"===document.visibilityState?this.focusPaused&&this.videoEl.paused&&!this.videoEl.ended&&(this.videoEl.play(),this.setplaystate(!0),delete this.focusPaused):this.focusPaused||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1),this.focusPaused=!0))}.bind(c));c._config.fluid?c._config.autoplay||(M(c.playerElm,"zwp-fluid"),c.playerElm.style.maxWidth="100%",c.playerElm.style.width=
|
|
376
376
|
"100%",c.playerElm.style.height="0",e=56.25,"number"===typeof c._config.ratio?e=100*c._config.ratio:"string"===typeof c._config.ratio?(A=c._config.ratio.split(":"),2===A.length&&(e=parseFloat(A[0]),A=parseFloat(A[1]),0===e&&(e=1),e=100*A/e)):"number"===typeof c._config.width&&"number"===typeof c._config.height&&(e=c._config.width,0===e&&(e=1),e=100*c._config.height/e),c.playerElm.style.paddingTop=e+"%"):c._config.width&&c._config.height&&(c.playerElm.style.width="number"===typeof c._config.width?
|
|
377
|
-
c._config.width+"px":c._config.width,c.playerElm.style.height="number"===typeof c._config.height?c._config.height+"px":c._config.height)},
|
|
378
|
-
rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}:null);e.mediaStream=new MediaStream;e.peer_conn.ontrack=function(c){if(!this.hasTracks){this.setRtcstream(e.mediaStream);var
|
|
379
|
-
{
|
|
380
|
-
await e.peer_conn.addTransceiver("video",{direction:"recvonly"});var m=await e.peer_conn.createOffer()}else m=await e.peer_conn.createOffer({offerToReceiveAudio:"undefined"===typeof e._config.hasAudio||e._config.hasAudio,offerToReceiveVideo:!0});await e.peer_conn.setLocalDescription(m);(new Promise(function(c,
|
|
381
|
-
JSON.stringify(
|
|
382
|
-
(
|
|
383
|
-
m.onopen=function(){var c="undefined"===typeof e._config.rtspOverTcp?1:e._config.rtspOverTcp,
|
|
384
|
-
if("object"==typeof c&&"onresult"===c.type&&"playurl"===c.event&&"object"===typeof c.streaminfo)if(e.closecall2=function(
|
|
385
|
-
|
|
386
|
-
stashInitialSize:0,lazyLoad:!1,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:0,isLive:!0};e.openFlv=function(){var
|
|
387
|
-
(this.lastDecodedFrames?this.lastDecodedFrames!=A.decodedFrames?this.lastDecodedFrames=A.decodedFrames:(this.lastDecodedFrames=0,this.flvPlayer&&(this.closecall(this),this.openFlv(),this.setplaystate(!0))):this.lastDecodedFrames=A.decodedFrames)}.bind(e);e.onFlvError=function(A){"NetworkError"!==A||e.reconnectTimer||(e.reconnectTimer=
|
|
388
|
-
A)}.bind(e);
|
|
389
|
-
|
|
390
|
-
delete A.reconnectTimer);
|
|
391
|
-
c=mpegts.createPlayer({type:"mse",isLive:!0,hasAudio:c,hasVideo:
|
|
392
|
-
e.onMetadataCb=function(
|
|
393
|
-
this.openMpegts()))):this.lastDecodedFrames=
|
|
394
|
-
|
|
395
|
-
1.5,
|
|
396
|
-
e,
|
|
397
|
-
|
|
398
|
-
parseInt(
|
|
399
|
-
|
|
400
|
-
typeof this.zwplayer&&(this.play(),this.zwplayer.setplaystate(!0))},A=function(){"object"==typeof this.zwplayer&&console.log("HLS fatal media error encountered, try to recover")};c.videoEl.addEventListener("loadedmetadata",
|
|
401
|
-
c.videoEl.src=c.murl}else return e.toast("player cannot play hls media"),!1});return!0},ia=function(e){Ja("dash_js",Ia+"dash.all.min.js",function(
|
|
402
|
-
e.onDashQualityChanged=function(
|
|
403
|
-
!0,c.updateSettings(A))}.bind(this),this.createQualitiesMenu(
|
|
404
|
-
"none";var
|
|
405
|
-
e.onDashStreamInitialized,e);c.on(m.MediaPlayer.events.STREAM_ACTIVATED,e.onDashStreamActivated,e);c.on(m.MediaPlayer.events.STREAM_DEACTIVATED,e.onDashStreamDeactivated,e);c.on(m.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e);e.dashPlayer=c;e.closecall=function(
|
|
406
|
-
|
|
407
|
-
delete
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
e=
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
377
|
+
c._config.width+"px":c._config.width,c.playerElm.style.height="number"===typeof c._config.height?c._config.height+"px":c._config.height)},Z=async function(e){if("undefined"==typeof K.RTCPeerConnection)return alert("This browser does not support the stream.\r\nPlease play this stream in chrome!"),!1;var l=J(e.murl);if(!l)return e.toast("Invalid url"),!1;e.peer_conn=new RTCPeerConnection("function"==typeof RTCPeerConnection.prototype.addTransceiver?{iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",
|
|
378
|
+
rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}:null);e.mediaStream=new MediaStream;e.peer_conn.ontrack=function(c){if(!this.hasTracks){this.setRtcstream(e.mediaStream);var v=y();console.log("start usetime:"+(F-v))}this.hasTracks++;this.mediaStream.addTrack(c.track);e.baseTrack&&"video"!=c.track.kind||(e.baseTrack=c.track);e.rtcstatsTimerId||(e.packetsReceived=0,e.framesDecoded=0,e.emptyCount=0,e.rtcstatsTimerId=K.setInterval(function(){e.baseTrack&&e.peer_conn.getStats(e.baseTrack).then(z=>
|
|
379
|
+
{z.forEach(A=>{"inbound-rtp"==A.type&&"video"==A.kind&&(A.framesDecoded!=e.framesDecoded?(e.framesDecoded=A.framesDecoded,e.packetsReceived=A.packetsReceived,e.emptyCount=0):0<e.framesDecoded&&(e.emptyCount++,3<e.emptyCount&&(console.warn("Rtp Data break for "+e.emptyCount),e.closecall(e),Z(e))))})})},1E3))}.bind(e);e.hasTracks=0;if("function"==typeof e.peer_conn.addTransceiver){("undefined"===typeof e._config.hasAudio||e._config.hasAudio)&&await e.peer_conn.addTransceiver("audio",{direction:"recvonly"});
|
|
380
|
+
await e.peer_conn.addTransceiver("video",{direction:"recvonly"});var m=await e.peer_conn.createOffer()}else m=await e.peer_conn.createOffer({offerToReceiveAudio:"undefined"===typeof e._config.hasAudio||e._config.hasAudio,offerToReceiveVideo:!0});await e.peer_conn.setLocalDescription(m);(new Promise(function(c,v){var z={api:l.apiUrl,rtcstream:l.streamUrl,clientip:null,sdp:m.sdp};"webrtc"===l.urlObject.schema&&(delete z.rtcstream,z.streamurl=l.streamUrl);console.log("Generated offer: ",z);w(l.apiUrl,
|
|
381
|
+
JSON.stringify(z),function(A){console.log("Got answer: ",A);A.code?v(A):c(A)},function(A){"REQUEST:error"==A&&(e.tryStartPlayTimer=K.setTimeout(function(){delete e.tryStartPlayTimer;e.closecall(e);Z(e)},1E3));v(A)})})).then(c=>{e.peer_conn.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:c.sdp}))}).catch(c=>{console.log(c);e.peer_conn.close();e.peer_conn=null});e.closecall=function(c){c.rtcstatsTimerId&&(K.clearInterval(c.rtcstatsTimerId),delete c.rtcstatsTimerId);c.tryStartPlayTimer&&
|
|
382
|
+
(K.clearTimeout(c.tryStartPlayTimer),delete c.tryStartPlayTimer);"undefined"!=typeof c.baseTrack&&delete c.baseTrack;c.peer_conn&&(c.videoEl&&(c.videoEl.srcObject=null),c.mediaStream&&delete c.mediaStream,c.peer_conn.close(),c.peer_conn=null)};return!0},ha=async function(e){var l=e._config.xmc_url||K.xmc_url;if(!l)return e.toast("The rtsp protocol is not supported without setting XMC."),!1;l+="play";e.wsclient&&(e.wsclient.close(),delete e.wsclient);l=l.replace("http","ws");var m=new WebSocket(l);
|
|
383
|
+
m.onopen=function(){var c="undefined"===typeof e._config.rtspOverTcp?1:e._config.rtspOverTcp,v="boolean"===typeof e._config.rtsp_bypass?e._config.rtsp_bypass:0,z="undefined"===typeof e._config.use_audio?0:e._config.use_audio,A="MediaSource"in K&&K.MediaSource.isTypeSupported("video/mp4;codecs=hvc1.1.1.L93.B0")?1:0;c=JSON.stringify({msgtype:"playurl",data:{sourceurl:e.murl,rtsp_over_tcp:c,has_audio:z,has_hevc:A,rtsp_bypass:v}});m.send(c)};m.onmessage=function(c){console.log(c.data);c=JSON.parse(c.data);
|
|
384
|
+
if("object"==typeof c&&"onresult"===c.type&&"playurl"===c.event&&"object"===typeof c.streaminfo)if(e.closecall2=function(z){z.waitSignTimer&&(K.clearTimeout(z.waitSignTimer),delete z.waitSignTimer);z.wsclient&&(z.wsclient.close(),z.wsclient=null,delete z.wsclient)},c.snapshot&&e.videoEl&&e.videoEl.setAttribute("poster",c.snapshot),e._config.useFlv||"string"!==typeof c.streaminfo.rtc_playurl)"string"===typeof c.streaminfo.http_playurl?(v=c.streaminfo.http_playurl+c.streaminfo.stream+".flv",e.murl=
|
|
385
|
+
v,W(e)):e.closecall2(e);else{var v=c.streaminfo.rtc_playurl+c.streaminfo.stream+".rtc";c.first?e.waitSignTimer=setTimeout(function(){e.murl=v;Z(e);delete e.waitSignTimer},1E3):(e.murl=v,Z(e))}};m.onclose=function(){e.wsclient&&delete e.wsclient};m.onerror=function(){};e.wsclient=m;return!0},ma=function(e){Ja("flv_js",Ia+"flv.min.js",function(l){console.log("js:"+l+" is load!");var m=K.flvjs;if(!m.isSupported())return!1;var c={type:"flv",isLive:!0,url:e.murl};var v={enableWorker:!1,enableStashBuffer:!1,
|
|
386
|
+
stashInitialSize:0,lazyLoad:!1,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:0,isLive:!0};e.openFlv=function(){var z=m.createPlayer(c,v);z.on(m.Events.METADATA_ARRIVED,function(A){e.loadingOverlay&&(e.loadingOverlay.style.display="none");"object"==typeof A&&console.log("flvplayer:"+A.type)});z.on(m.Events.ERROR,function(A){"object"==typeof A?console.log("flvplayer:"+A.type):console.log("flvplayer:"+A)});z.attachMediaElement(e.videoEl);e.videoEl.playbackRate=1;e.onFlvStaticInfo=function(A){this.videoEl.paused||
|
|
387
|
+
(this.lastDecodedFrames?this.lastDecodedFrames!=A.decodedFrames?this.lastDecodedFrames=A.decodedFrames:(this.lastDecodedFrames=0,this.flvPlayer&&(this.closecall(this),this.openFlv(),this.setplaystate(!0))):this.lastDecodedFrames=A.decodedFrames)}.bind(e);e.onFlvError=function(A){"NetworkError"!==A||e.reconnectTimer||(e.reconnectTimer=K.setTimeout(function(){e.flvPlayer&&(e.closecall(e),e.openFlv(),e.setplaystate(!0));delete e.reconnectTimer},1E3))}.bind(e);e.onMediainfoCb=function(A){A&&this.setMediainfo("flvjs",
|
|
388
|
+
A)}.bind(e);z.on(m.Events.ERROR,e.onFlvError);z.on(m.Events.STATISTICS_INFO,e.onFlvStaticInfo);z.on(m.Events.MEDIA_INFO,e.onMediainfoCb);e.delayCheckTimerId=K.setInterval(function(){if(this.flvPlayer&&!this.videoEl.paused){var A=this.flvPlayer;if(A.buffered.length){let b=A.buffered.end(0)-A.currentTime;6<=b?A.currentTime=A.buffered.end(0)-.2:3<b&&(e.videoEl.playbackRate=1.5,e.fastForwardTimerId=setTimeout(function(){e.videoEl.playbackRate=1;delete e.fastForwardTimerId},2E3*b))}}}.bind(e),2E3);z.load();
|
|
389
|
+
z.play();e.flvPlayer=z;e.closecall=function(A){if(A.flvPlayer){var b=A.flvPlayer;b.off(m.Events.ERROR,A.onFlvError);b.off(m.Events.STATISTICS_INFO,A.onFlvStaticInfo);b.off(m.Events.MEDIA_INFO,A.onMediainfoCb);delete A.onFlvError;delete A.onFlvStaticInfo;delete A.onMediainfoCb;A.delayCheckTimerId&&(K.clearInterval(A.delayCheckTimerId),delete A.delayCheckTimerId);A.fastForwardTimerId&&(K.clearTimeout(A.fastForwardTimerId),delete A.fastForwardTimerId);A.reconnectTimer&&(K.clearTimeout(A.reconnectTimer),
|
|
390
|
+
delete A.reconnectTimer);b.pause();b.unload();b.detachMediaElement();b.destroy();delete A.flvPlayer}}};e.openFlv();e.setplaystate(!0)});return!0},W=function(e){Ja("mpeg_js",Ia+"mpeg.min.js?v=2",function(l){console.log("js:"+l+" is load!");l=mpegts.getFeatureList();if(!mpegts.isSupported()||!l.mseLivePlayback)return!1;e.openMpegts=function(){var m=e.videoEl,c=void 0,v=void 0;"boolean"===typeof e._config.hasAudio&&(c=e._config.hasAudio);"boolean"===typeof e._config.hasVideo&&(v=e._config.hasVideo);
|
|
391
|
+
c=mpegts.createPlayer({type:"mse",isLive:!0,hasAudio:c,hasVideo:v,url:e.murl},{autoCleanupSourceBuffer:!0,stashInitialSize:128,autoCleanupMaxBackwardDuration:20,autoCleanupMinBackwardDuration:10,enableWorker:!0,enableStashBuffer:!1});e.onErrorCb=function(z){var A=this;z!==mpegts.ErrorTypes.NETWORK_ERROR||A.reconnectTimer||(A.reconnectTimer=K.setTimeout(function(){A.mpegtsPlayer&&(A.closecall(A),A.openMpegts());delete A.reconnectTimer},1E3))}.bind(e);e.onEventCb=function(z){console.log(z)}.bind(e);
|
|
392
|
+
e.onMetadataCb=function(z){console.log(z)}.bind(e);e.onMediaInfoCb=function(z){z&&this.setMediainfo("mpegts",z)}.bind(e);e.onStatisCb=function(z){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=z.decodedFrames?(this.lastDecodedFrames=z.decodedFrames,delete this.waitDecodedFrames):("undefined"===typeof this.waitDecodedFrames?this.waitDecodedFrames=0:this.waitDecodedFrames++,1<this.waitDecodedFrames&&(this.lastDecodedFrames=0,delete this.waitDecodedFrames,this.mpegtsPlayer&&(this.closecall(this),
|
|
393
|
+
this.openMpegts()))):this.lastDecodedFrames=z.decodedFrames)}.bind(e);e.closecall=function(z){z.checkDelayTimerId&&(K.clearInterval(z.checkDelayTimerId),delete z.checkDelayTimerId);z.reconnectTimer||(K.clearTimeout(z.reconnectTimer),delete z.reconnectTimer);z.fastForwardTimerId&&(K.clearTimeout(z.fastForwardTimerId),delete z.fastForwardTimerId);if(z.mpegtsPlayer){var A=z.mpegtsPlayer;A.pause();A.off(mpegts.Events.ERROR,z.onErrorCb);A.off(mpegts.Events.MEDIA_INFO,z.onMediaInfoCb);A.off(mpegts.Events.METADATA_ARRIVED,
|
|
394
|
+
z.onMetadataCb);A.off(mpegts.Events.STATISTICS_INFO,z.onStatisCb);A.unload();A.detachMediaElement();A.destroy();delete z.onErrorCb;delete z.onMediaInfoCb;delete z.onMetadataCb;delete z.onStatisCb;delete z.onEventCb;delete z.mpegtsPlayer}};e.checkDelayTimerId=K.setInterval(function(){var z=this;if(z.mpegtsPlayer&&!z.videoEl.paused&&z.mpegtsPlayer.buffered.length){var A=z.mpegtsPlayer.buffered.end(0)-z.mpegtsPlayer.currentTime;6<=A?z.mpegtsPlayer.currentTime=z.mpegtsPlayer.buffered.end(0)-.2:3<A&&(z.videoEl.playbackRate=
|
|
395
|
+
1.5,z.fastForwardTimerId=setTimeout(function(){z.videoEl.playbackRate=1;delete z.fastForwardTimerId},2E3*A))}}.bind(e),2E3);c.on(mpegts.Events.ERROR,e.onErrorCb);c.on(mpegts.Events.MEDIA_INFO,e.onMediaInfoCb);c.on(mpegts.Events.METADATA_ARRIVED,e.onMetadataCb);c.on(mpegts.Events.STATISTICS_INFO,e.onStatisCb);c.attachMediaElement(m);c.load();c.play();e.mpegtsPlayer=c};e.openMpegts()});return!0},ka=function(e){Ja("hls_js",Ia+"hls.min.js",function(l){console.log("js:"+l+" is load!");var m=K.Hls;if(m.isSupported()){var c=
|
|
396
|
+
e,v=new m;v.attachMedia(e.videoEl);v.on(m.Events.MEDIA_ATTACHED,function(){console.log("video and hlsPlayer are now bound together !");v.loadSource(e.murl);v.on(m.Events.MANIFEST_PARSED,function(b,O){console.log("HLSPlayer manifest loaded, found "+O.levels.length+" quality level");c.loadingOverlay&&(c.loadingOverlay.style.display="none");c.videoEl.play();c.setplaystate(!0)})});v.on(m.Events.ERROR,function(b,O){if(O.fatal)switch(O.type){case m.ErrorTypes.NETWORK_ERROR:console.log("fatal network error encountered, try to recover");
|
|
397
|
+
v.startLoad();break;case m.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");v.recoverMediaError();break;default:v.destroy(),delete e.hlsPlayer,c.setplaystate(!1)}});c.onHlsManifestParsed=function(b,O){var x=this;if(1<O.levels.length){var ca=[];for(b=0;b<O.levels.length;b++){var G={mediaType:"video",bitrate:O.levels[b].bitrate,height:O.levels[b].height,width:O.levels[b].width,qualityIndex:b,name:O.levels[b].name||"q"+b};ca.push(G)}x.switchQualityLevel=function(ja){v.nextLevel=
|
|
398
|
+
parseInt(ja)}.bind(x);x.createQualitiesMenu(ca);v.on(m.Events.LEVEL_SWITCHED,function(ja,la){x.updateQualityLevel(v.currentLevel,v.autoLevelEnabled)},x)}else x.resetQualitiesMenu();if(O.subtitleTracks&&0<O.subtitleTracks.length){ca=[];for(b=0;b<O.subtitleTracks.length;b++)G=O.subtitleTracks[b],G.forced||(G={"default":G.default,id:G.id,lang:G.lang,name:G.name,url:G.url},ca.push(G));x.switchSubtitleTrack=function(ja){ja=parseInt(ja);-1===ja?v.subtitleDisplay=!1:(v.subtitleDisplay=!0,v.subtitleTrack=
|
|
399
|
+
ja)};x.createSubtitlesMenu(ca);v.on(m.Events.SUBTITLE_TRACK_SWITCH,function(ja,la){x.updateSubtitleTrack(la.id)})}}.bind(c);v.on(m.Events.MANIFEST_PARSED,c.onHlsManifestParsed);c.hlsPlayer=v;c.closecall=function(b){b.hlsPlayer&&(b.hlsPlayer.off(m.Events.MANIFEST_PARSED,b.onHlsManifestParsed),b.hlsPlayer.detachMedia(),b.hlsPlayer.destroy(),delete b.hlsPlayer,delete b.onHlsManifestParsed)}}else if(e.videoEl.canPlayType("application/vnd.apple.mpegurl")){c=e;e.videoEl.zwplayer=e;var z=function(){"object"==
|
|
400
|
+
typeof this.zwplayer&&(this.play(),this.zwplayer.setplaystate(!0))},A=function(){"object"==typeof this.zwplayer&&console.log("HLS fatal media error encountered, try to recover")};c.videoEl.addEventListener("loadedmetadata",z);c.videoEl.addEventListener("error",A);c.closecall=function(b){"object"===typeof b.videoEl&&(b.videoEl.pause(),b.videoEl.src="",b.videoEl.removeEventListener("loadedmetadata",z),b.videoEl.removeEventListener("error",A),"object"==typeof b.videoEl.zwplayer&&delete b.videoEl.zwplayer)};
|
|
401
|
+
c.videoEl.src=c.murl}else return e.toast("player cannot play hls media"),!1});return!0},ia=function(e){Ja("dash_js",Ia+"dash.all.min.js",function(l){console.log("js:"+l+" is load!");var m=K.dashjs,c=m.MediaPlayer().create();c.initialize(e.videoEl,e.murl,!0);l=e.getSimpleSubtitleRenderer();c.attachTTMLRenderingDiv(l);e.dashTextTrackList={};e.onDashMetadata=function(v){v&&console.log(v);this.loadingOverlay&&(this.loadingOverlay.style.display="none");this.videoEl.play();this.setplaystate(!0)}.bind(e);
|
|
402
|
+
e.onDashQualityChanged=function(v){v=c.getQualityFor("video");var z=c.getSettings().streaming.abr.autoSwitchBitrate.video||!1;e.updateQualityLevel(v,z)}.bind(e);e.onDashStreamInitialized=function(v){c.getBitrateInfoListFor("audio");v=c.getBitrateInfoListFor("video")||[];1<v.length?(this.switchQualityLevel=function(z){z=parseInt(z);var A={streaming:{abr:{autoSwitchBitrate:{}}}};0<=z?(A.streaming.abr.autoSwitchBitrate.video=!1,c.updateSettings(A),c.setQualityFor("video",z,!1)):(A.streaming.abr.autoSwitchBitrate.video=
|
|
403
|
+
!0,c.updateSettings(A))}.bind(this),this.createQualitiesMenu(v),c.on(m.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.onDashQualityChanged,this)):this.resetQualitiesMenu()}.bind(e);e.onDashTracksAdded=function(v){var z=this.dashTextTrackList;z[v.streamId]||(z[v.streamId]=[]);z[v.streamId]=z[v.streamId].concat(v.tracks)};e.onDashStreamDeactivated=function(v){var z=this.dashTextTrackList;v.streamInfo&&z[v.streamInfo.id]&&delete z[v.streamInfo.id]}.bind(e);e.onDashStreamActivated=function(v){v=v.streamInfo.id||
|
|
404
|
+
"none";var z=this.dashTextTrackList;if(z[v]&&(v=z[v],!(1>v.length))){z=[];for(var A=0;A<v.length;A++){var b=v[A],O=ib(b.labels);O?O+=" : "+b.type:(O=b.label||b.lang,O+=" : "+b.kind);z.push({"default":b.defaultTrack,id:A,lang:b.lang,name:O,url:b.url||""})}this.switchSubtitleTrack=function(x){var ca=this.dashPlayer||null;ca&&(parseInt(x),ca.setTextTrack(x))}.bind(this);this.createSubtitlesMenu(z)}}.bind(e);c.on(m.MediaPlayer.events.PLAYBACK_METADATA_LOADED,e.onDashMetadata,e);c.on(m.MediaPlayer.events.STREAM_INITIALIZED,
|
|
405
|
+
e.onDashStreamInitialized,e);c.on(m.MediaPlayer.events.STREAM_ACTIVATED,e.onDashStreamActivated,e);c.on(m.MediaPlayer.events.STREAM_DEACTIVATED,e.onDashStreamDeactivated,e);c.on(m.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e);e.dashPlayer=c;e.closecall=function(v){v.dashPlayer&&(v.dashPlayer.pause(),v.dashPlayer.off(m.MediaPlayer.events.PLAYBACK_METADATA_LOADED,v.onDashMetadata,v),v.dashPlayer.off(m.MediaPlayer.events.STREAM_INITIALIZED,v.onDashStreamInitialized,v),v.dashPlayer.off(m.MediaPlayer.events.STREAM_ACTIVATED,
|
|
406
|
+
v.onDashStreamActivated,v),v.dashPlayer.off(m.MediaPlayer.events.STREAM_DEACTIVATED,v.onDashStreamDeactivated,v),v.dashPlayer.on(m.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e),v.switchQualityLevel&&(v.dashPlayer.off(m.MediaPlayer.events.QUALITY_CHANGE_RENDERED,v.onDashQualityChanged,v),delete v.switchQualityLevel),v.dashPlayer.destroy(),delete v.dashPlayer,delete v.onDashMetadata,delete v.onDashStreamInitialized,delete v.onDashStreamActivated,delete v.onDashStreamDeactivated,delete v.onDashTracksAdded,
|
|
407
|
+
delete v.switchSubtitleTrack)}});return!0},qa=function(e,l){var m=e._config.cdn_addr||K.cdn_addr;if(!m)return e.toast("The webcdn protocol is not supported due without setting cdn server address url."),!1;m.endsWith("/")||(m+="/");m+="cdnplay";e.wcdnClient&&(e.wcdnClient.close(),delete e.wcdnClient);m=m.replace("http","ws");"https:"==K.location.protocol&&(m=m.replace("ws:","wss:"));var c=l.indexOf("://");if(0>c)return e.toast("Invalid wcdn url:"+l),!1;l=l.substr(c+3);(c=e._config.userInfo||K.userInfo)||
|
|
408
|
+
(c={userid:"0",username:"Visitor",nickname:"Visitor"});var v={msgtype:"startplay",data:{userid:c.userid||"0",username:c.username||"Visitor",nickname:c.nickname||"Visitor",avatar:c.avatar||"",streamurl:l}},z=function(A){var b=new WebSocket(m);b.onopen=function(O){O=JSON.stringify(v);b.send(O)};b.onmessage=function(O){if("string"===typeof O.data)try{var x=JSON.parse(O.data),ca=x.msgtype||"none",G=x.event||"none";if("onresult"===ca)if("startplay"===G){var ja=x.data||null;if(ja&&"object"===typeof ja){O=
|
|
409
|
+
void 0;"function"===typeof A.closecall2&&(O=A.closecall2,A.closecall2=null);x={msgtype:"playstatus",data:{status:"playing"}};A.play(ja,!0)||(x.data.status="error");var la=JSON.stringify(x);b.send(la);"function"===typeof O&&(A.closecall2=O)}else{var d=x.msg||"Unknown error";"StreamNotExist"===d?(A.toast(pa("waitStreamToReady","Waiting for stream")),A.errorHandleTimerId=K.setTimeout(function(){delete A.errorHandleTimerId;A.toast("closetoast");var h=JSON.stringify(v);b.send(h)},3E3)):(A.toast(G+" error:"+
|
|
410
|
+
d),A.errorHandleTimerId=K.setTimeout(function(){delete A.errorHandleTimerId;A.stop()},2E3))}}else"endplay"===G&&(console.log("Receive endplay result"),A.stop());else"error"===ca?A.toast(G+" error:"+x.msg||"Unknown error"):"command"===ca&&"stopplay"===(x.action||"none")&&(A.toast("Server is close, player is stop."),A.errorHandleTimerId=K.setTimeout(function(){delete A.errorHandleTimerId;A.stop()},100),A.wcdnClient&&(A.wcdnClient.ws.close(),A.wcdnClient=null))}catch(h){console.warn("JSON.parse failed:",
|
|
411
|
+
h)}};b.onerror=function(O){console.error("Web CDN websocket Error:",O)};b.onclose=function(O){this.wsVersionId===A.wsVersionId&&A.wcdnClient&&!A.cdnReconnectTimerId&&A.wcdnClient===this&&(A.cdnReconnectTimerId=setTimeout(function(){z(A)},1E3),delete A.wcdnClient)};b.wsVersionId=(new Date).getTime();A.wcdnClient=b;A.wsVersionId=b.wsVersionId;"undefined"!==typeof A.cdnReconnectTimerId&&delete A.cdnReconnectTimerId};e.closecall2=function(A){e.cdnReconnectTimerId&&(clearTimeout(e.cdnReconnectTimerId),
|
|
412
|
+
delete e.cdnReconnectTimerId);e.errorHandleTimerId&&(clearTimeout(e.errorHandleTimerId),delete e.errorHandleTimerId);e.wcdnClient?(A=e.wcdnClient,delete e.wcdnClient,A.close()):(e.toast("The wcdn connection has been passively closed."),console.log("Websocket connection is abnormally closed."))};z(e);return!0},fa=function(e){var l=e.videoEl;e.closecall=function(m){if(m.isPlayVideo){var c=m.videoEl;c.paused||c.pause();c.src="";delete m.isPlayVideo}};e.isPlayVideo=!0;l.src=e.murl;return!0},aa=function(e){var l=
|
|
413
|
+
e.videoEl;e.closecall=function(m){if(m.isPlayAudio){var c=m.videoEl;c.paused||c.pause();c.src="";delete m.isPlayAudio}};e.isPlayAudio=!0;l.src=e.murl;return!0},na=function(e){var l=e.murl;if("dvr"===(l.type||"")&&l.http)return e.murl=l.http,fa(e);if(K.MediaSource&&K.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')){var m=K.RTCPeerConnection||K.webkitRTCPeerConnection||K.mozRTCPeerConnection||K.RTCIceGatherer;if(l.rtc&&m)return e.murl=l.rtc,Z(e);if(l["httpflv-n"])return e.murl=
|
|
414
|
+
l["httpflv-n"],e._config.useOldFlv?ma(e):W(e);if(l.httpflv)return e.murl=l.httpflv,e._config.useOldFlv?ma(e):W(e);if(l["wsflv-n"])return e.murl=l["wsflv-n"],e._config.useOldFlv?ma(e):W(e);if(l.wsflv)return e.murl=l.wsflv,e._config.useOldFlv?ma(e):W(e);if(l.hls)return e.murl=l.hls,ka(e);if(l.dash)return e.murl=l.dash,ia(e);if(l.ts)return e.murl=l.ts,W(e)}else if(e.murl.hls)return e.murl=e.murl.hls,ka(e);return!1},T=function(e){var l=[];var m=String.fromCharCode(107)+"u"+String.fromCharCode(97)+"ishou";
|
|
415
|
+
var c=String.fromCharCode(46)+"co"+String.fromCharCode(109)+"/",v=String.fromCharCode(100)+"ou"+String.fromCharCode(121)+"i"+String.fromCharCode(110);l.push("https://live."+m+c+"u/");l.push("https://live."+v+c);if("string"===typeof e&&23<e.length)for(c=0;c<l.length;c++)if(m=l[c],0===e.indexOf(m))return!0;return!1};ba.prototype={play:function(e,l,m){var c=this;if(e){c.murl&&c.stop();if("string"===typeof e&&(e.startsWith("wcdn://")||e.startsWith("wcdns://")))return e=qa(c,e);if("object"===typeof e){"object"===
|
|
416
|
+
typeof e.thumbnails&&(c._config.thumbnails=JSON.parse(JSON.stringify(e.thumbnails)));if("object"===typeof e.murls){c.multiStreams=JSON.parse(JSON.stringify(e));var v=e.murls}else Array.isArray(e)?(c.multiStreams={},v=e):(c.multiStreams={},v=[e]),c.multiStreams.murls=v;var z=!0,A="",b=[],O;for(O in v){var x=v[O];if("object"===typeof x)if(Array.isArray(x)){var ca="";var G=x[0];if(2<x.length){var ja=x[2];ca=x[1]}else ja=1<x.length?x[1]:O;b.push({url:G,name:ja,mime:ca});z&&(e=G,A=ja,z=!1)}else{if(G=!1,
|
|
417
|
+
"default"in x&&x["default"]&&(G=x["default"]),z||G)"url"in x&&(e=x.url),A=z="name"in x?x.name:O,z=!1}else"string"===typeof x&&z&&(z=O,e=x,A=z,z=!1)}0<b.length&&(c.multiStreams.murls=b);c.multiStreams.curStream=A;console.log(e)}c.murl=e}if(!c.murl)return!1;c.force_stopped=!1;c.isPlaying=!0;c.loadingOverlay&&(c.loadingOverlay.style.display="flex");"undefined"!=typeof l&&(l?c._config.isLive=l:delete c._config.isLive);"undefined"!=typeof m&&(m?c._config.useOldFlv=m:delete c._config.useOldFlv);e=!1;if("object"==
|
|
418
|
+
typeof c.murl)e=na(c);else if("string"==typeof c.murl){e=I(c.murl);e||(l=c.murl.indexOf("mime_type="),0<l&&(l+=10,v=c.murl.indexOf("&",l),0>v&&(v=c.murl.length),l=c.murl.substring(l,v),"video_mp4"===l?e=".mp4":"video_flv"===l?e=".flv":"video_hls"===l?e=".m3u8":"video_rtc"===l?e=".rtc":"video_dash"===l&&(e=".mpd")));if(!e&&("string"===typeof c._config.streamtype&&("httpflv"===c._config.streamtype?e=".flv":"hls"===c._config.streamtype?e=".m3u8":"dash"===c._config.streamtype?e=".mpd":"mpegts"===c._config.streamtype?
|
|
419
|
+
e=".ts":"webrtc"===c._config.streamtype&&(e=".rtc")),!e&&T(c.murl))){var la=function(){setTimeout(function(){c.loadingOverlay&&(c.loadingOverlay.style.display="none")},1E3)};if(!c._config.url_proxy)return c.toast("Sorry, the player cannot play this media address",5E3,!0),la(),!1;var d=d;w(c._config.url_proxy,JSON.stringify({roomUrl:c.murl,token:c._config.proxy_token||"12345678"}),function(h){if("object"===typeof h&&h.result){h={murls:h.flvStreams||h.hlsStreams,multistream:1};if(!h.murls)return c.toast("Sorry, missing valid address for this room.",
|
|
420
|
+
5E3,!0),la(),!1;c.play(h,d,m)}else c.toast("Sorry, unable to obtain a valid address for this room.",5E3,!0),la()},function(h){c.toast("Sorry, failed to get address due to network!",5E3,!0);la()});return!1}e=0===c.murl.indexOf("rtsp")?ha(c):".rtc"===e||c.murl.startsWith("webrtc://")?Z(c):".flv"===e?c._config.useOldFlv?ma(c):W(c):".m3u8"===e?ka(c):".mpd"===e?ia(c):".mp4"===e?fa(c):".mp3"===e||".m4a"===e||".aac"===e||".mp4a"===e||".ogg"===e?aa(c):".ts"===e?W(c):fa(c)}e?(c.setupEventsHandler(),c.startHideControlbar(c),
|
|
421
|
+
c.multiStreams&&K.setTimeout(function(){c.buildStreamSelector()},1E3)):(c.isPlaying=!1,c.loadingOverlay&&(c.loadingOverlay.style.display="none"),c.toast("Play media failed, unsupported media type",5E3,!0));return e},__switchStream:function(e){if("string"!==typeof e)this.toast("Switch stream methon does not support "+e);else{this.murl=e;e=I(this.murl);if(!e){var l=this.murl.indexOf("mime_type=");if(0<l){l+=10;var m=this.murl.indexOf("&",l);0>m&&(m=this.murl.length);l=this.murl.substring(l,m);"video_mp4"===
|
|
422
|
+
l?e=".mp4":"video_flv"===l?e=".flv":"video_hls"===l?e=".m3u8":"video_rtc"===l?e=".rtc":"video_dash"===l&&(e=".mpd")}}e||"string"===typeof this._config.streamtype&&("httpflv"===this._config.streamtype?e=".flv":"hls"===this._config.streamtype?e=".m3u8":"dash"===this._config.streamtype?e=".mpd":"mpegts"===this._config.streamtype?e=".ts":"webrtc"===this._config.streamtype&&(e=".rtc"));!this._config.isLive&&this.videoEl&&(this.postSeekTime=this.videoEl.currentTime);this.closecall&&(this.closecall(this),
|
|
423
|
+
delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load());(0===this.murl.indexOf("rtsp")?ha(this):".rtc"===e||this.murl.startsWith("webrtc://")?Z(this):".flv"===e?this._config.useOldFlv?ma(this):W(this):".m3u8"===e?ka(this):".mpd"===e?ia(this):".mp4"===e?fa(this):".mp3"===e||".m4a"===e||".aac"===e||".mp4a"===e||".ogg"===e?aa(this):".ts"===e?W(this):fa(this))||this.toast("Switch stream failed, unsupported media type")}},
|
|
424
|
+
stop:function(){this.closecall&&(this.closecall(this),this.removeVideoEventHandlers(),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load());this.isPlaying=!1;this.setplaystate(!1);this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none");this.updateProgress(0);this.timeSpan&&(this.timeSpan.innerHTML="");this.controlbar&&(this.controlbar.querySelector(".zwp__duration-container").style.display=
|
|
425
|
+
"none");this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.style.display="none");this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML="");this.subtitles&&delete this.subtitles;this.subtitleShow&&(this.subtitleShow.style.display="none");this.toastTimerId&&(clearTimeout(this.toastTimerId),delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),
|
|
426
|
+
this.popup_layers.style.display=null,delete this.mutedTipBox);this.overlayLayerClickTimer&&(K.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);delete this.multiStreams;this.resetSpeedMenu();this.resetQualitiesMenu();this.removeChapters();this.resetSubtitleMenu()},pause:function(){this.isPlaying&&this.videoEl&&!this.videoEl.paused&&!this.videoEl.ended&&(this.videoEl.pause(),this.setplaystate(!1))},resume:function(){this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&
|
|
427
|
+
(this.videoEl.play(),this.setplaystate(!0)):this._config.url&&this.play(this._config.url)},seekTime:function(e){if(this.isPlaying&&this.videoEl&&!(0>e)){var l=this.videoEl.duration;isNaN(l)||Infinity===l||(e>l&&(e=l),this.videoEl.currentTime=e)}},getDuration:function(){if(this.isPlaying&&this.videoEl)return this.videoEl.duration},destroy:function(){this.closecall&&(this.closecall(this),this.removeVideoEventHandlers(),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);
|
|
428
|
+
this.videoRemoveWhenClose&&(this.videoEl&&this.videoWrapper&&(this.videoWrapper.removeChild(this.videoEl),this.playerContainer.removeChild(this.videoWrapper),delete this.videoWrapper),delete this.videoRemoveWhenClose);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load(),this.videoEl=null,delete this.videoEl);this.snapCanvas&&delete this.snapCanvas;this.controlbar&&(this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML=""),this.playerContainer.removeChild(this.controlbar),
|
|
429
|
+
delete this.controlbar);this.danmuToolbar&&(this.danmuToolbar.remove(),delete this.danmuToolbar);this.subtitles&&delete this.subtitles;this.toastTimerId&&(clearTimeout(this.toastTimerId),delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.overlayLayerClickTimer&&(K.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);this.overlay_layers&&(this.subtitle1&&delete this.subtitle1,this.subtitle2&&delete this.subtitle2,
|
|
424
430
|
this.subtitleShow&&(Ba.removeElement(this.subtitleShow),delete this.subtitleShow),this.danmuPlayer&&(this.danmuPlayer.destroy(),delete this.danmuPlayer),this.playerContainer.removeChild(this.overlay_layers),delete this.overlay_layers);this.popup_layers&&(this.playerContainer.removeChild(this.popup_layers),delete this.popup_layers);this.playerElm&&(delete this.playerContainer.zwpDragable,this.playerElm.removeChild(this.playerContainer),delete this.playerContainer,this.doDeletePlayerElm?(document.removeChild(this.playerElm),
|
|
425
|
-
delete this.playerElm):this.doRemovePlayerClass&&(
|
|
426
|
-
(this.playbtn.setAttribute("data-action","play"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="flex"))),this.playerElm&&(e?(
|
|
427
|
-
delete this.danmuPlayer)},appendDanmu:function(e,
|
|
428
|
-
typeof e&&("number"===typeof e&&(e+="px"),this.playerElm.style.width=e),"undefined"!==typeof
|
|
429
|
-
|
|
431
|
+
delete this.playerElm):this.doRemovePlayerClass&&(Q(this.playerElm,"zwp-wrap"),this.playerElm.setAttribute("class",this.playerElmOldClass)));this.windowScrollHandler&&(K.removeEventListener("scroll",this.windowScrollHandler),delete this.windowScrollHandler)},setplaystate:function(e){this.controlbar&&(this.playbtn||(this.playbtn=this.controlbar.querySelector(".zwp-playbtn")),this.playbtn&&(e?(this.playbtn.setAttribute("data-action","pause"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none")):
|
|
432
|
+
(this.playbtn.setAttribute("data-action","play"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="flex"))),this.playerElm&&(e?(Q(this.playerElm,"zwp-pause"),M(this.playerElm,"zwp-playing")):(Q(this.playerElm,"zwp-playing"),M(this.playerElm,"zwp-pause"))),this.loadingOverlay&&(this.loadingOverlay.style.display="none"))},setEnableDanmu:function(e){e?this.overlay_layers&&!this.danmuPlayer&&(this.danmuPlayer=HUAYI.Danmu.create({playerId:this.overlay_layers})):this.danmuPlayer&&(this.danmuPlayer.destroy(),
|
|
433
|
+
delete this.danmuPlayer)},appendDanmu:function(e,l){this.danmuPlayer&&(l||(l=this.danmuSetting),this.danmuPlayer.addDanmu(e,l))},setChapters:function(e){null===e?this.removeChapters():(this.chapters=e,this.videoEl&&setTimeout(function(){this.loadChapters()}.bind(this),1E3))},addSubtitle:function(e,l,m){this.loadSubtitle(e,l,m)},removeSubtitle:function(){this.showSubtitle(!1)},buildDanmuControlbar:function(e,l){this.buildDanmuToolbar(e,l)},notifyResize:function(e,l){this.playerElm&&("undefined"!==
|
|
434
|
+
typeof e&&("number"===typeof e&&(e+="px"),this.playerElm.style.width=e),"undefined"!==typeof l&&("number"===typeof l&&(l+="px"),this.playerElm.style.height=l))},lightOff:function(){this.playerElm&&M(this.playerElm,"zwp-state-light-off")},lightOn:function(){this.playerElm&&Q(this.playerElm,"zwp-state-light-off")},get CurrentTime(){return this.isPlaying&&this.videoEl?this.videoEl.currentTime:-1},set CurrentTime(e){if(this.isPlaying&&this.videoEl&&!(0>e)){var l=this.videoEl.duration;isNaN(l)||Infinity===
|
|
435
|
+
l||(e>l&&(e=l),this.videoEl.currentTime=e)}}};return ba})})(window);
|