=0&&(r[r.t++]=1,r.subTo(b,r)),t.ONE.dlShiftTo(p,b),b.subTo(l,l);l.t=0;){var T=r[--v]==d?this.DM:Math.floor(r[v]*g+(r[v-1]+m)*y);if((r[v]+=l.am(0,T,r,_,0,p))0&&r.rShiftTo(h,r),c<0&&t.ZERO.subTo(r,r)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,i){if(e>4294967295||e<1)return t.ONE;var r=n(),o=n(),s=i.convert(this),l=a(e)-1;for(s.copyTo(r);--l>=0;)if(i.sqrTo(r,o),(e&1<0)i.mulTo(o,s,r);else{var c=r;r=o,o=c}return i.revert(r)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=s(i),o=n(),a=n(),l="";for(this.divRemTo(r,o,a);o.signum()>0;)l=(i+a.intValue()).toString(t).substr(1)+l,o.divRemTo(r,o,a);return a.intValue().toString(t)+l},t.prototype.fromRadix=function(e,i){this.fromInt(0),null==i&&(i=10);for(var n=this.chunkSize(i),r=Math.pow(i,n),s=!1,a=0,l=0,c=0;c=n&&(this.dMultiply(r),this.dAddOffset(l,0),a=0,l=0))}a>0&&(this.dMultiply(Math.pow(i,a)),this.dAddOffset(l,0)),s&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,i,n){if("number"==typeof i)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),c.op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var r=[],o=7&e;r.length=1+(e>>3),i.nextBytes(r),o>0?r[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;i>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;for(var r=i.t-this.t;n=0;)i[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},t.prototype.millerRabin=function(e){var i=this.subtract(t.ONE),r=i.getLowestSetBit();if(r<=0)return!1;var o=i.shiftRight(r);(e=e+1>>1)>u.length&&(e=u.length);for(var s=n(),a=0;a0&&(i.rShiftTo(s,i),n.rShiftTo(s,n));var a=function t(){(o=i.getLowestSetBit())>0&&i.rShiftTo(o,i),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),i.compareTo(n)>=0?(i.subTo(n,i),i.rShiftTo(1,i)):(n.subTo(i,n),n.rShiftTo(1,n)),i.signum()>0?setTimeout(t,0):(s>0&&n.lShiftTo(s,n),setTimeout((function(){e(n)}),0))};setTimeout(a,10)}},t.prototype.fromNumberAsync=function(e,i,n,r){if("number"==typeof i)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),c.op_or,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function n(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(t.ONE.shiftLeft(e-1),o),o.isProbablePrime(i)?setTimeout((function(){r()}),0):setTimeout(n,0)};setTimeout(s,0)}else{var a=[],l=7&e;a.length=1+(e>>3),i.nextBytes(a),l>0?a[0]&=(1<=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),g=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),y=function(){function t(t){this.m=t,this.r2=n(),this.q3=n(),p.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),m="undefined"!=typeof navigator;m&&"Microsoft Internet Explorer"==navigator.appName?(p.prototype.am=function(t,e,i,n,r,o){for(var s=32767&e,a=e>>15;--o>=0;){var l=32767&this[t],c=this[t++]>>15,u=a*l+c*s;l=s*l+((32767&u)<<15)+i[n]+(1073741823&r),r=(l>>>30)+(u>>>15)+a*c+(r>>>30),i[n++]=1073741823&l}return r},l=30):m&&"Netscape"!=navigator.appName?(p.prototype.am=function(t,e,i,n,r,o){for(;--o>=0;){var s=e*this[t++]+i[n]+r;r=Math.floor(s/67108864),i[n++]=67108863&s}return r},l=26):(p.prototype.am=function(t,e,i,n,r,o){for(var s=16383&e,a=e>>14;--o>=0;){var l=16383&this[t],c=this[t++]>>14,u=a*l+c*s;l=s*l+((16383&u)<<14)+i[n]+r,r=(l>>28)+(u>>14)+a*c,i[n++]=268435455&l}return r},l=28),p.prototype.DB=l,p.prototype.DM=(1<=256||o>=s.rng_psize)window.removeEventListener?window.removeEventListener("mousemove",t,!1):window.detachEvent&&window.detachEvent("onmousemove",t);else try{var n=e.x+e.y;a[o++]=255&n,u+=1}catch(i){}};window.addEventListener?window.addEventListener("mousemove",h,!1):window.attachEvent&&window.attachEvent("onmousemove",h)}var p=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e=0&&e>0;){var r=t.charCodeAt(n--);r<128?i[--e]=r:r>127&&r<2048?(i[--e]=63&r|128,i[--e]=r>>6|192):(i[--e]=63&r|128,i[--e]=r>>6&63|128,i[--e]=r>>12|224)}i[--e]=0;for(var o=new c.SecureRandom,s=[];e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);i[--e]=s[0]}return i[--e]=2,i[--e]=0,new l.BigInteger(i)}function o(t,e){for(var i=t.toByteArray(),n=0;n=i.length)return null;for(var r="";++n191&&o<224?(r+=String.fromCharCode((31&o)<<6|63&i[n+1]),++n):(r+=String.fromCharCode((15&o)<<12|(63&i[n+1])<<6|63&i[n+2]),n+=2)}return r}function s(t){return h[t]||""}function a(t){for(var e in h)if(h.hasOwnProperty(e)){var i=h[e],n=i.length;if(t.substr(0,n)==i)return t.substr(n)}return t}i.r(e),i.d(e,{RSAKey:function(){return u}});var l=i("./node_modules/jsencrypt/lib/lib/jsbn/jsbn.js"),c=i("./node_modules/jsencrypt/lib/lib/jsbn/rng.js"),u=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=(0,l.parseBigInt)(t,16),this.e=parseInt(e,16))},t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,i=r(t,e);if(null==i)return null;var n=this.doPublic(i);if(null==n)return null;for(var o=n.toString(16),s=o.length,a=0;a<2*e-s;a++)o="0"+o;return o},t.prototype.setPrivate=function(t,e,i){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=(0,l.parseBigInt)(t,16),this.e=parseInt(e,16),this.d=(0,l.parseBigInt)(i,16))},t.prototype.setPrivateEx=function(t,e,i,n,r,o,s,a){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=(0,l.parseBigInt)(t,16),this.e=parseInt(e,16),this.d=(0,l.parseBigInt)(i,16),this.p=(0,l.parseBigInt)(n,16),this.q=(0,l.parseBigInt)(r,16),this.dmp1=(0,l.parseBigInt)(o,16),this.dmq1=(0,l.parseBigInt)(s,16),this.coeff=(0,l.parseBigInt)(a,16))},t.prototype.generate=function(t,e){var i=new c.SecureRandom,n=t>>1;this.e=parseInt(e,16);for(var r=new l.BigInteger(e,16);;){for(;this.p=new l.BigInteger(t-n,1,i),0!=this.p.subtract(l.BigInteger.ONE).gcd(r).compareTo(l.BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new l.BigInteger(n,1,i),0!=this.q.subtract(l.BigInteger.ONE).gcd(r).compareTo(l.BigInteger.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(l.BigInteger.ONE),a=this.q.subtract(l.BigInteger.ONE),u=s.multiply(a);if(0==u.gcd(r).compareTo(l.BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=r.modInverse(u),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=(0,l.parseBigInt)(t,16),i=this.doPrivate(e);return null==i?null:o(i,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,i){var n=new c.SecureRandom,r=t>>1;this.e=parseInt(e,16);var o=new l.BigInteger(e,16),s=this,a=function e(){var a=function(){if(s.p.compareTo(s.q)<=0){var t=s.p;s.p=s.q,s.q=t}var n=s.p.subtract(l.BigInteger.ONE),r=s.q.subtract(l.BigInteger.ONE),a=n.multiply(r);0==a.gcd(o).compareTo(l.BigInteger.ONE)?(s.n=s.p.multiply(s.q),s.d=o.modInverse(a),s.dmp1=s.d.mod(n),s.dmq1=s.d.mod(r),s.coeff=s.q.modInverse(s.p),setTimeout((function(){i()}),0)):setTimeout(e,0)},c=function t(){s.q=(0,l.nbi)(),s.q.fromNumberAsync(r,1,n,(function(){s.q.subtract(l.BigInteger.ONE).gcda(o,(function(e){0==e.compareTo(l.BigInteger.ONE)&&s.q.isProbablePrime(10)?setTimeout(a,0):setTimeout(t,0)}))}))},u=function e(){s.p=(0,l.nbi)(),s.p.fromNumberAsync(t-r,1,n,(function(){s.p.subtract(l.BigInteger.ONE).gcda(o,(function(t){0==t.compareTo(l.BigInteger.ONE)&&s.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(e,0)}))}))};setTimeout(u,0)};setTimeout(a,0)},t.prototype.sign=function(t,e,i){var r=s(i),o=r+e(t).toString(),a=n(o,this.n.bitLength()/4);if(null==a)return null;var l=this.doPrivate(a);if(null==l)return null;var c=l.toString(16);return 0==(1&c.length)?c:"0"+c},t.prototype.verify=function(t,e,i){var n=(0,l.parseBigInt)(e,16),r=this.doPublic(n);return null==r?null:a(r.toString(16).replace(/^1f+00/,""))==i(t).toString()},t}(),h={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"}},"./node_modules/jsencrypt/lib/lib/jsbn/util.js":function(t,e,i){"use strict";function n(t){return u.charAt(t)}function r(t,e){return t&e}function o(t,e){return t|e}function s(t,e){return t^e}function a(t,e){return t&~e}function l(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function c(t){for(var e=0;0!=t;)t&=t-1,++e;return e}i.r(e),i.d(e,{int2char:function(){return n},op_and:function(){return r},op_or:function(){return o},op_xor:function(){return s},op_andnot:function(){return a},lbit:function(){return l},cbit:function(){return c}});var u="0123456789abcdefghijklmnopqrstuvwxyz"},"./node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js":function(t,e,i){"use strict";i.r(e),i.d(e,{KJUR:function(){return o}});var n=i("./node_modules/jsencrypt/lib/lib/jsbn/jsbn.js"),r=i("./node_modules/jsencrypt/lib/lib/jsrsasign/yahoo.js"),o={};"undefined"!=typeof o.asn1&&o.asn1||(o.asn1={}),o.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var i=e.substr(1),r=i.length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var o="",s=0;s15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},o.asn1.DERAbstractString=function(t){o.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):"undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex&&this.setStringHex(t.hex))},r.YAHOO.lang.extend(o.asn1.DERAbstractString,o.asn1.ASN1Object),o.asn1.DERAbstractTime=function(t){o.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,i){var n=this.zeroPadding,r=this.localDateToUTC(t),o=String(r.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=n(String(r.getMonth()+1),2),a=n(String(r.getDate()),2),l=n(String(r.getHours()),2),c=n(String(r.getMinutes()),2),u=n(String(r.getSeconds()),2),h=o+s+a+l+c+u;if(!0===i){var p=r.getMilliseconds();if(0!=p){var d=n(String(p),3);d=d.replace(/[0]+$/,""),h=h+"."+d}}return h+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,i,n,r,o){var s=new Date(Date.UTC(t,e-1,i,n,r,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},r.YAHOO.lang.extend(o.asn1.DERAbstractTime,o.asn1.ASN1Object),o.asn1.DERAbstractStructured=function(t){o.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&"undefined"!=typeof t.array&&(this.asn1Array=t.array)},r.YAHOO.lang.extend(o.asn1.DERAbstractStructured,o.asn1.ASN1Object),o.asn1.DERBoolean=function(){o.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},r.YAHOO.lang.extend(o.asn1.DERBoolean,o.asn1.ASN1Object),o.asn1.DERInteger=function(t){o.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=o.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new n.BigInteger(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("undefined"!=typeof t.bigint?this.setByBigInteger(t.bigint):"undefined"!=typeof t["int"]?this.setByInteger(t["int"]):"number"==typeof t?this.setByInteger(t):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))},r.YAHOO.lang.extend(o.asn1.DERInteger,o.asn1.ASN1Object),o.asn1.DERBitString=function(t){if(void 0!==t&&"undefined"!=typeof t.obj){var e=o.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}o.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7>>24)|4278255360&(a[d]<<24|a[d]>>>8);a[l>>>5]|=128<>>9<<4)]=l;var f=t._ff,g=t._gg,y=t._hh,m=t._ii;for(d=0;d>>0,u=u+_>>>0,h=h+b>>>0,p=p+T>>>0}return e.endian([c,u,h,p])};s._ff=function(t,e,i,n,r,o,s){var a=t+(e&i|~e&n)+(r>>>0)+s;return(a<>>32-o)+e},s._gg=function(t,e,i,n,r,o,s){var a=t+(e&n|i&~n)+(r>>>0)+s;return(a<>>32-o)+e},s._hh=function(t,e,i,n,r,o,s){var a=t+(e^i^n)+(r>>>0)+s;return(a<>>32-o)+e},s._ii=function(t,e,i,n,r,o,s){var a=t+(i^(e|~n))+(r>>>0)+s;return(a<>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,i){if(void 0===t||null===t)throw new Error("Illegal argument "+t);var n=e.wordsToBytes(s(t,i));return i&&i.asBytes?n:i&&i.asString?o.bytesToString(n):e.bytesToHex(n)}}()}},__webpack_module_cache__={};!function(){__webpack_require__.d=function(t,e){for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})}}(),function(){__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}();var __webpack_exports__={};return function(){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i0})).join("&"):""},parseUrl$1=function(t,e){return{url:t.split("?")[0]||"",query:parse(extract(t),e)}},queryString={extract:extract_1,parse:parse_1,stringify:stringify,parseUrl:parseUrl$1},count=0,MediaAsyncLoader=function(t){function e(i,n,r){classCallCheck(this,e),log$2("MediaAsyncLoader initializing");var o=mergeOptions({createEl:!1},n),s=possibleConstructorReturn(this,t.call(this,i,o,r));s.enModule=new Enc;var a=o.playerOptions||o;return s.getInfo(a),i.loadVideoByID=bind(s,s.loadVideoByID),log$2("MediaAsyncLoader initialized"),s}return inherits(e,t),e.prototype.getInfo=function(t){t&&t.fileID&&t.appID&&(performance&&"function"==typeof performance.mark&&performance.mark("firstFrameStart"),t.playDefinition?this.getInfoV3(t):t.sign||t.ssign?this.getInfoV2(t):this.getInfoV4(t))},e.prototype.getInfoV2=function(t){var e=this.player(),i=this.assemblyPath("getplayinfo",t.appID,t.fileID),n=t.t,r=t.us,o=t.exper,s=t.sign,a={};t.ssign?a.super_sign=t.ssign:s&&(a={t:n,sign:s},(r||0==r)&&(a.us=r),(o||0==o)&&(a.exper=o,e.trigger({type:"feature",data:"exper"})),e.trigger({type:"feature",data:"key"})),t.playerID&&(a.playerid=t.playerID),this.requestTimestamp=+(new Date).getTime(),e.trigger({type:"playcgistart",data:{time:this.requestTimestamp,url:i}}),log$2("playcgi loading");var l=queryString.stringify(a);l&&(i+=(~i.indexOf("?")?"&":"?")+l,i=i.replace("?&","?")),this.getInfoRetryTimes=0,this.getInfoRequest=function(t){t&&(i=i.replace(SERVER_PATH,SERVER_PATH_BACKUP)),IE_VERSION&&IE_VERSION<10?jsonp(i,{param:a,timeout:3e3,prefix:"TcCallBack"},bind(this,this.onResult)):xhr({url:i,timeout:3e3},bind(this,this.onResult))},this.getInfoRequest()},e.prototype.onResult=function(t,e,i){try{i?e=JSON.parse(i):t||e||(t=new Error("ServerError"))}catch(l){t=new Error("ServerError")}var n=this.player();if(t){if(log$2("playcgi loaded failure"),this.getInfoRetryTimes<3)return this.getInfoRetryTimes++,void this.getInfoRequest();if(this.getInfoRetryTimes<6)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0});n.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}});var r=12;switch(t.message){case"XMLHttpRequest timeout":case"Timeout":r=10;break;case"ServerError":r=11}this.player().error({code:r})}else{if(n.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}}),0!=e.code)return log$2("playcgi loaded failure"),void this.player().error({code:e.code});log$2("playcgi loaded success");var o=e.coverInfo,s=e.videoInfo,a=e.playerInfo;this.setPoster(o),this.setLogo(a),this.setSrc(e),this.setPatch(a),this.setVttThumbnail(e),this.setDots(e),this.setOriginDuration(s),this.setPlayList(a)}},e.prototype.getInfoV3=function(t){var e=this.player(),i=this.assemblyPathV3("getplayinfo",t.appID,t.fileID,t.playDefinition),n=t.t,r=t.us,o=t.rlimit,s=t.sign,a={};t.ssign?a.super_sign=t.ssign:s&&(a={t:n,sign:s},(r||0==r)&&(a.us=r),o&&(a.rlimit=o),e.trigger({type:"feature",data:"key"})),t.playerID&&(a.playerid=t.playerID),this.requestTimestamp=+(new Date).getTime(),e.trigger({type:"playcgistart",data:{time:this.requestTimestamp,url:i}}),log$2("playcgi v3 loading");var l=queryString.stringify(a);l&&(i+=(~i.indexOf("?")?"&":"?")+l,i=i.replace("?&","?")),this.getInfoRetryTimes=0,this.getInfoRequest=function(t){t&&(i=i.replace(SERVER_PATH_V3,SERVER_PATH_BACKUP)),IE_VERSION&&IE_VERSION<10?jsonp(i,{param:a,timeout:3e3,prefix:"TcCallBack"},bind(this,this.onResultV3)):xhr({url:i,timeout:3e3},bind(this,this.onResultV3))},this.getInfoRequest()},e.prototype.onResultV3=function(t,e,i){try{i?e=JSON.parse(i):t||e.body||(t=new Error("ServerError"))}catch(a){t=new Error("ServerError")}var n=this.player();if(t){if(log$2("playcgi v3 loaded failure"),this.getInfoRetryTimes<3)return this.getInfoRetryTimes++,void this.getInfoRequest();if(this.getInfoRetryTimes<6)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0});n.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}});var r=12;switch(t.message){case"XMLHttpRequest timeout":case"Timeout":r=10;break;case"ServerError":r=11}this.player().error({code:r})}else{if(n.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}}),0!=e.code)return log$2("playcgi v3 loaded failure"),void this.player().error({code:e.code});log$2("playcgi v3 loaded success");var o=e.mediaInfo,s=e.playerInfo;this.setPoster({coverUrl:o.basicInfo.coverUrl}),this.setLogo(s),this.setSrcV3(o),this.setPatch(s),this.setVttThumbnail(o),this.setDots(o)}},e.prototype.setSrcV3=function(t,e){var i=this,n=this.player(),r=n.options_.plugins,o=n.DRM().options||r.DRM,s=void 0,a=void 0,l=void 0,c=[],u={},h={};if(e=e||(o?o.skipPlan:""),t.previewStreamingInfo&&t.previewStreamingInfo.previewStreamingList.length>0)t.previewStreamingInfo.previewStreamingList.forEach((function(t,e){t.mineType=i.getMIMEType(t.url),u[getFileExtension(t.url)]=t}));else{if(!(t.dynamicStreamingInfo.adaptiveStreamingInfoList&&t.dynamicStreamingInfo.adaptiveStreamingInfoList.length>0))return void this.player().error({code:13,message:"no video stream"});if(t.dynamicStreamingInfo.adaptiveStreamingInfoList.forEach((function(t,e){t.mineType=i.getMIMEType(t.url),h[t.drmType.toLowerCase()||getFileExtension(t.url)]=t})),o&&o.token?(s=o.token,l=o.certificateUri,e=IS_SAFARI&&!l?"fairplay":e,a=window_1.encodeURIComponent(s)):e="all",(IS_CHROME||IS_FIREFOX)&&window_1.navigator.requestMediaKeySystemAccess&&h.widevine&&"widevine"!=e&&"all"!=e?(c.push({src:unifyProtocol(h.widevine.url),type:this.getMIMEType(h.widevine.url),keySystems:{"com.widevine.alpha":{serverURL:LICENSE_PATH+"?token="+a+"&drmType="+h.widevine.drmType}}}),log$2("DRM source widevine",c)):IS_SAFARI&&!IS_MQQB&&h.fairplay&&"fairplay"!=e&&"all"!=e&&(c.push({src:unifyProtocol(h.fairplay.url),type:this.getMIMEType(h.fairplay.url),keySystems:{"com.apple.fps.1_0":{certificateUri:l,licenseUri:LICENSE_PATH+"?token="+a+"&drmType="+h.fairplay.drmType}}}),log$2("DRM source fairplay",c)),h.simpleaes&&"all"!=e){var p=h.simpleaes.url.split("/");p[p.length-1]="voddrm.token."+a+"."+p[p.length-1],c.push({src:unifyProtocol(p.join("/")),type:this.getMIMEType(h.simpleaes.url)}),log$2("DRM source simpleaes",c)}h.m3u8&&c.push({src:unifyProtocol(h.m3u8.url),type:this.getMIMEType(h.m3u8.url)}),h.mpd&&c.push({src:unifyProtocol(h.mpd.url),type:this.getMIMEType(h.mpd.url)})}if(c.length>0){n.src(c);var d=function(e){return log$2("DRM init Error",c),5!==e.data.code&&2!==e.data.code||!c[0].keySystems["com.widevine.alpha"]?3===e.data.code&&c[0].keySystems["com.apple.fps.1_0"]?void i.setSrcV3(t,"fairplay"):14===e.data.code||3===e.data.code?void i.setSrcV3(t,"all"):void 0:void i.setSrcV3(t,"widevine")};"all"!==e&&(window_1.setTimeout((function(){n.one("error",d)}),0),n.one("playing",(function(t){})))}else this.player().error({code:4})},e.prototype.getInfoV4=function(t){var e=this.player(),i=this.assemblyPathV4("getplayinfo",t.appID,t.fileID),n=t.t,r=t.us,o=t.rlimit,s=t.psign,a=t.exper,l={};t.ssign?l.super_sign=t.ssign:s&&(l={t:n,psign:s},(r||0==r)&&(l.us=r),o&&(l.rlimit=o),a&&(l.exper=a)),t.playerConfig&&(l.pcfg=t.playerConfig),t.playerID&&(l.playerid=t.playerID),this.requestTimestamp=+(new Date).getTime(),e.trigger({type:"playcgistart",data:{time:this.requestTimestamp,url:i}}),log$2("playcgi v4 loading");var c=queryString.stringify(l);c?(i+=(~i.indexOf("?")?"&":"?")+c,i=i.replace("?&","?")):i+=~i.indexOf("?")?"":"?",i=this.enModule.generatePlayCgiUrl(i,browser),this.getInfoRetryTimes=0,this.getInfoRequest=function(t){t&&(i=i.replace(SERVER_PATH_V4,SERVER_PATH_BACKUP)),IE_VERSION&&IE_VERSION<10?jsonp(i,{param:l,timeout:3e3,prefix:"TcCallBack"},bind(this,this.onResultV4)):xhr({url:i,timeout:3e3},bind(this,this.onResultV4))},this.getInfoRequest()},e.prototype.onResultV4=function(t,e,i){var n=e,r=n.rawRequest;try{i?e=JSON.parse(i):t||e.body||(t=new Error("ServerError"))}catch(h){t=new Error("ServerError")}var o=this.player();if(t){if(log$2("playcgi v4 loaded failure"),this.getInfoRetryTimes<3)return this.getInfoRetryTimes++,void this.getInfoRequest();if(this.getInfoRetryTimes<6)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0});o.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}});var s=12;switch(t.message){case"XMLHttpRequest timeout":case"Timeout":s=10;break;case"ServerError":s=11}this.player().error({code:s})}else{if(o.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}}),0!=e.code){if(log$2("playcgi v4 loaded failure"),e.code>=2e3&&e.code<3e3){if(this.getInfoRetryTimes<3)return this.getInfoRetryTimes++,void this.getInfoRequest();if(this.getInfoRetryTimes<6)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0})}return void this.player().error({code:e.code})}if(log$2("playcgi v4 loaded success",e),!this.enModule.checksum(r,i))return this.player().error({code:1012}),!1;if(4===e.version){var a=e.media;this.setPoster({coverUrl:a.basicInfo.coverUrl}),this.setSrcV4(a),this.setVttThumbnailV4(a),this.setDots(a),this.setOriginDurationV4(a),this.setGhostContent(a.ghostWatermarkInfo)}else if(2===e.version){var l=e.coverInfo,c=e.videoInfo,u=e.playerInfo;this.setPoster(l),this.setLogo(u),this.setSrc(e),this.setPatch(u),this.setVttThumbnail(e),this.setDots(e),this.setOriginDuration(c)}}},e.prototype.setSrcV4=function(t,e){var i=this,n=this.player(),r=n.options_,o=void 0,s=n.options_.plugins,a=n.DRM().options||s.DRM,l=[],c="plain";e=e||(a?a.skipPlan:"");var u=[],h=[];if("Original"===t.audioVideoType||"Transcode"===t.audioVideoType)return this.setSrc(t),!1;if(t.streamingInfo){if(t.streamingInfo){if(t.streamingInfo.drmOutput&&Array.isArray(t.streamingInfo.drmOutput)){for(var p=t.streamingInfo.drmOutput,d=0;d0?n.src(u):0!==h.length?!e&&this.player().error({code:18}):this.player().error({code:13,message:"no stream info"}),this.setQualityLabelList(l[0])}var w=function(e){return log$2("DRM init Error",u),u[0].keySystems["com.widevine.alpha"]?void i.setSrcV4(t,"widevine"):u[0].keySystems["com.apple.fps.1_0"]?void i.setSrcV4(t,"fairplay"):14===e.data.code||3===e.data.code?void i.setSrcV4(t,"all"):void 0};"all"!==e&&window_1.setTimeout((function(){n.one("error",w)}),0)}else this.player().error({code:13,message:"no stream info"})},e.prototype.setHlsConfig=function(t,e,i){var n={};!IS_ENABLED_MSE||IS_TBS||IS_MQQB||IS_SAFARI||IE_VERSION&&IE_VERSION<11||(n={overlayKey:this.enModule&&this.enModule.overlayKey,overlayIv:this.enModule&&this.enModule.overlayIv}),t.hlsConfig?(t.hlsConfig.qualityLabelList=e,t.hlsConfig.startLevel||(t.hlsConfig.startLevel=e?e.length-1:5)):t.hlsConfig={qualityLabelList:e,startLevel:e?e.length-1:5},Object.assign(t.hlsConfig,n,{forbid:i})},e.prototype.setQualityLabelList=function(t){this.player().QualitySwitcher().setOptions({qualityLabelList:{video:t}})},e.prototype.setLogo=function(t){var e=this.player();t.logoPic?(e.logoImage.update({img:{url:unifyProtocol(t.logoPic),position:t.logoLocation},link:unifyProtocol(t.logoUrl)}),e.trigger({type:"feature",data:"logo"})):e.logoImage.reset()},e.prototype.setPoster=function(t){var e=this.player();t&&t.coverUrl?e.poster(unifyProtocol(t.coverUrl)):e.options_.playerOptions.poster||e.poster("")},e.prototype.setDots=function(t){var e=this.player();if(e.options_.dots=null,t.keyFrameDescInfo&&t.keyFrameDescInfo.keyFrameDescList&&t.keyFrameDescInfo.keyFrameDescList.length>0){var i=t.keyFrameDescInfo.keyFrameDescList;e.options_.dots=i}var n=e.options_.plugins;n&&n.ProgressMarker&&n.ProgressMarker.markers&&n.ProgressMarker.markers.length>0&&(e.options_.dots=e.options_.dots.concat(n.ProgressMarker.markers)),e.ProgressMarker().init()},e.prototype.setSrc=function(t){var e=this.player(),i=t.videoInfo||{};if("Original"===t.audioVideoType&&(i.sourceVideo=t.originalInfo),"Transcode"===t.audioVideoType&&(i.sourceVideo=t.transcodeInfo),(null!=e.options_.definition||void 0!=e.options_.definition)&&i.transcodeList&&i.transcodeList.length>0){e.trigger({type:"feature",data:"definition"});var n=this.getSrcByDefinition(i,e.options_.definition);if(n)return e.src({src:unifyProtocol(n.url),type:this.getMIMEType(n.url)}),!0}if(e.MultiResolution().reset(),i.masterPlayList){e.src(this.getMasterSouces(i));var r=e.options_.hlsConfig;r?r.forbid=!0:Object.assign(e.options_,{hlsConfig:{forbid:!0}}),this.setQualityLabelList([]),e.MultiResolution().store(this.getMultiResolutionData(t))}else if(i.transcodeList&&i.transcodeList.length>0){var o=this.getMultiResolutionData(t);if(o.showOrder.length>0)e.MultiResolution().init(o);else{var s=i.transcodeList[0].url;e.src({src:unifyProtocol(s),type:this.getMIMEType(s)})}}else i.sourceVideo&&this.getMIMEType(i.sourceVideo.url)?e.src({src:unifyProtocol(i.sourceVideo.url),type:this.getMIMEType(i.sourceVideo.url)}):this.player().error({code:13})},e.prototype.setPatch=function(t){var e=this.player();t.patchInfo?e.ImagePatch().init(t.patchInfo):e.ImagePatch().reset()},e.prototype.setVttThumbnail=function(t){var e=this.player();t.imageSpriteInfo&&t.imageSpriteInfo.imageSpriteList?e.ready(bind(this,(function(){e.VttThumbnail().init({vttUrl:unifyProtocol(t.imageSpriteInfo.imageSpriteList[0].webVttUrl)})}))):e.VttThumbnail().reset()},e.prototype.setVttThumbnailV4=function(t){var e=this.player();t.imageSpriteInfo&&t.imageSpriteInfo.webVttUrl?e.ready(bind(this,(function(){e.VttThumbnail().init({vttUrl:unifyProtocol(t.imageSpriteInfo.webVttUrl)})}))):e.VttThumbnail().reset()},e.prototype.setOriginDuration=function(t){var e=this.player();if(e.options_.exper>0){var i=t.sourceVideo?t.sourceVideo.floatDuration:t.transcodeList[0].floatDuration;e.one("play",(function(){e.duration(i)}))}},e.prototype.setOriginDurationV4=function(t){var e=this,i=this.player();i.cache_.originDuration=t.basicInfo.duration,i.off("durationchange",this.keepOriginDuration),i.one("durationchange",(function(t){(!i.duration()||i.duration()>0&&Math.floor(i.cache_.originDuration)!==Math.floor(i.duration()))&&(e.keepOriginDuration(t),i.on("durationchange",e.keepOriginDuration))}))},e.prototype.setGhostContent=function(t){if(t){var e=this.player(),i=e&&e.DynamicWatermark();i.options.content=t.text,i.options.keep=!0,i.init()}},e.prototype.keepOriginDuration=function(t){var e=this.player(),i=e.cache_.originDuration;Math.floor(i)!==Math.floor(e.duration())&&(log$2("试看视频"),e.duration(Math.round(i)))},e.prototype.getMasterSouces=function(t){var e=t.masterPlayList,i=[];return i.push({src:unifyProtocol(e.url),type:EXT_MIME.m3u8}),i},e.prototype.getMultiResolutionData=function(t){var e={sources:{},labels:{},showOrder:[],defaultRes:""},i=[],n=t.videoInfo.transcodeList,r=this;return t.playerInfo.videoClassification.forEach((function(t,o){n.length>0&&(n=n.filter((function(n){if(!(t.definitionList.indexOf(n.definition)>-1))return!0;i[t.id]||(e.showOrder.push(t.id),e.labels[t.id]=t.name,i[t.id]=[]),i[t.id].push({src:unifyProtocol(n.url),type:r.getMIMEType(n.url)})})))})),e.sources=i,e.defaultRes=t.playerInfo.defaultVideoClassification||Object.keys(i)[0],e},e.prototype.getSrcByDefinition=function(t,e){var i=t.transcodeList,n=t.sourceVideo;if(0==e)return n;for(var r=0;r0&&t.transcodeList.forEach((function(t,i){t.url=replaceHost(t.url,e.options_.customHost)})),e.trigger({type:"feature",data:"customHost"}))},e.prototype.loadVideoByID=function(t){var e=this.player();e.trigger({type:"loadnewvideo"}),e.hasStarted(!1),this.getInfo(t),e.duration(0),e.playbackRate(1),e.options_.appID=t.appID,e.options_.fileID=t.fileID,e.options_.psign=t.psign,t.definition&&(e.options_.definition=t.definition),e.bigPlayButton&&e.bigPlayButton.show(),e.options_.plugins.ContinuePlay&&e.ContinuePlay().init()},e.prototype.setPlayList=function(t){this.player().options_.plugins.PlayList||t.playlist&&t.playlist.data instanceof Array&&t.playlist.data.length>0&&this.player_.PlayList(t.playlist)},e}(Component);Component.registerComponent("MediaAsyncLoader",MediaAsyncLoader);var Component$2=videojs.getComponent("Component"),ClickableComponent$2=videojs.getComponent("ClickableComponent"),positionMap=["left-top","left-bottom","right-top","right-bottom"],LogoImage=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return i.on("logochange",videojs.bind(r,(function(t){this.update(t.data)}))),n.img&&r.update(n),r}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-logo vjs-hidden"}),e=videojs.dom.createEl("a",{className:"tcp-logo-link",target:"_blank"}),i=videojs.dom.createEl("img",{className:"tcp-logo-img"});return this.linkEl_=e,this.imgEl_=i,e.appendChild(i),t.appendChild(e),t},e.prototype.update=function(t){var e=t.img,i=t.link;this.setImg(e),this.setHref(i),this.options_=videojs.mergeOptions(this.options_,t),this.show()},e.prototype.setImg=function(t){if(this.imgEl_){this.imgEl_.src=t.url;var e=positionMap[t.position]||t.position||"left-top";videojs.dom.addClass(this.el_,e)}},e.prototype.setHref=function(t){this.linkEl_&&t&&(this.linkEl_.href=t)},e.prototype.reset=function(){this.hide(),this.imgEl_.removeAttribute("src"),this.linkEl_.removeAttribute("href")},e}(ClickableComponent$2);videojs.registerComponent("LogoImage",LogoImage);var Component$3=videojs.getComponent("Component"),Button$2=videojs.getComponent("Button"),ContinuePlayTips=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.init(n),r}return inherits(e,t),e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-continue-play-tips"})},e.prototype.close=function(){this.hide()},e.prototype.init=function(t){var e=this.addChild("closeButton",{controlText:"Close"});this.on(e,"close",this.close),this.addChild("ContinuePlayTipsContent",t);var i=this.addChild("ContinuePlayButton",t);this.on(i,["tap","click"],this.close),this.setTimeout((function(){this.close()}),3500)},e}(Component$3);videojs.registerComponent("ContinuePlayTips",ContinuePlayTips);var ContinuePlayTipsContent=function(t){function e(i,n){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,i,n))}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("span",{className:"tcp-continue-play-tips-content"}),e=videojs.dom.createEl("span",{className:"tcp-text",textContent:this.localize(this.options_.text||"Last time play at ")}),i=videojs.dom.createEl("span",{className:"tcp-time",textContent:videojs.formatTime(this.options_.time)});return this.textEl_=e,this.timeEl_=i,t.appendChild(e),t.appendChild(i),t},e}(Component$3);videojs.registerComponent("ContinuePlayTipsContent",ContinuePlayTipsContent);var ContinuePlayButton=function(t){function e(i,n){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,i,n))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"button",{className:"tcp-continue-play-buttom",textContent:this.localize(this.options_.btnText||"Resume play")})},e.prototype.handleClick=function(){this.options_.resumeCallback.call()},e}(Button$2);videojs.registerComponent("ContinuePlayButton",ContinuePlayButton);var Component$4=videojs.getComponent("Component"),LevelSwitchTips=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.playing=!1,r.timeoutID=void 0,r.levelSwitch=i.options_.plugins.ContextMenu.levelSwitch,r.init(),i.on("playing",videojs.bind(r,(function(){r.playing=!0}))),i.on("resolutionswitching",videojs.bind(r,(function(t){if(r.playing)if(t.data.label)r.switchHandler(r.createSwitching(t.data.label),2e3);else{var e=r.player().QualitySwitcher().options.qualityData;if(e){var i=e.video.filter((function(e){return t.data.newQuality===e.id}))[0];r.switchHandler(r.createSwitching(i.label),2e3)}}}))),i.on("resolutionswitched",videojs.bind(r,(function(){r.playing&&r.switchHandler(r.createSwitched(),2e3)}))),i.on("levelSwitchError",videojs.bind(r,(function(){r.switchHandler(r.createSwitchError(),2e3)}))),r}return inherits(e,t),e.prototype.switchHandler=function(t,e){var i=this;this.timeoutID&&clearTimeout(this.timeoutID),this.textNode.innerText=t,this.show(),this.timeoutID=setTimeout((function(){i.hide()}),e)},e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-switch vjs-hidden"});return this.textNode=videojs.dom.createEl("div",{innerText:""}),t.appendChild(this.textNode),t},e.prototype.init=function(){var t=this.addChild("closeButton",{controlText:"Close"});this.on(t,"close",this.hide)},e.prototype.createSwitching=function(t){return this.levelSwitch.switchingText?this.levelSwitch.switchingText+t:"正在为您切换至"+t},e.prototype.createSwitched=function(){return this.levelSwitch.switchedText?this.levelSwitch.switchedText:"切换成功"},e.prototype.createSwitchError=function(){return this.levelSwitch.switchErrorText?this.levelSwitch.switchErrorText:"切换失败"},e.prototype.show=function(){t.prototype.show.call(this),this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.popped=!1},e}(Component$4);videojs.registerComponent("LevelSwitchTips",LevelSwitchTips);var Component$7=videojs.getComponent("Component"),mapKey={fileID:"file ID",requestID:"request ID",mediaType:"media type",mimeType:"mime type",provider:"provider",resolution:"resolution",rate:"rate",frames:"frames",buffer:"buffer",connectionSpeed:"connection speed",info:"info"},VideoTextItem=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.display=!1,r.displayData="loading",r}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-statistic-line vjs-hidden"}),e=videojs.dom.createEl("span",{className:"tcp-statistic-title",innerText:mapKey[this.options_.key]+":"}),i=videojs.dom.createEl("span",{className:"tcp-statistic-data",innerText:this.options_.data});return t.appendChild(e),t.appendChild(i),t},e.prototype.updateTextNode_=function(){for(var t=this.el_.lastChild;t.firstChild;)t.removeChild(t.firstChild);this.displayData&&this.show(),this.textNode_=document_1.createTextNode(this.displayData||""),t.appendChild(this.textNode_)},e.prototype.updateContent=function(t){t!==this.displayData&&(this.displayData=t,this.requestAnimationFrame(this.updateTextNode_))},e.prototype.isDisplay=function(){return this.display},e.prototype.show=function(){t.prototype.show.call(this),this.display=!0,this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.display=!1,this.popped=!1},e.prototype.reset=function(){t.prototype.hide.call(this),this.display=!1,this.displayData=""},e}(Component$7);videojs.registerComponent("VideoTextItem",VideoTextItem);var defaultConfig={enableRecoverMediaError:!0,recoverMediaErrorMaxRetry:5,fragLoadingMaxRetry:3},Html5HlsJS=function(){function t(e,i,n){var r=this;classCallCheck(this,t);var o={};e.keySystems&&e.keySystems["com.widevine.alpha"]&&e.keySystems["com.widevine.alpha"].serverURL?(n.hlsConfig.widevineLicenseUrl=e.keySystems["com.widevine.alpha"].serverURL,n.hlsConfig.enableWorker=!0,n.hlsConfig.emeEnabled=!0,n.hlsConfig.startLevel=(n.hlsConfig.qualityLabelList||[]).length-1,o=n.hlsConfig):o=i.player_.options_.hlsConfig||n.hlsConfig||{},o.forbid&&(delete o.overlayKey,delete o.overlayIv),this.drmBackup=n.hlsConfig&&n.hlsConfig.drmBackup;var s=function(){var t=window.Hls,s=new t(videojs.mergeOptions(defaultConfig,o)),a=i.el();r.Hls=t,r.tech=i,r.hls=s,r.switchStatus="",r.manifests=[],r.subtitlesLoadedCount=0,r.audioTrackLoadedCount=0,r.subtitles=[],r.audioTracks=[],r.hlsjsErrorHandler=r.errorHandlerFactory(),s.on(t.Events.ERROR,r.onError.bind(r)),s.on(t.Events.MANIFEST_PARSED,videojs.bind(r,r.onMetaData)),s.on(t.Events.MANIFEST_LOADED,r.loadSubtiles.bind(r)),s.on(t.Events.MANIFEST_LOADED,r.loadAudioTracks.bind(r)),s.on(t.Events.LEVEL_LOADED,r.onLevelLoaded.bind(r));var l=r.tech.player();for(var c in l.on("ready",r.addHlsSubtitles.bind(r)),t.Events)s.on(t.Events[c],videojs.bind(r,r.onEvent));s.attachMedia(a),s.loadSource(e.src),window.Hls&&n.xp2pConfig&&n.xp2pConfig.useXP2P&&l.XP2PHlsjsPlugin&&l.XP2PHlsjsPlugin().startHLSP2P(r.hls,window.HLSP2P,(function(t){}))};Promise.all([function(){return n.xp2pConfig&&n.xp2pConfig.useXP2P&&"hls"===n.xp2pConfig.format&&!window.HLSP2P?new Promise((function(t){loadScript(XP2P_HLS_PATH,(function(){t()}))})):Promise.resolve()}(),function(){return window.Hls?Promise.resolve():new Promise((function(t){loadScript(HLS_PATH,(function(){t()}))}))}()]).then((function(){s()}))}return t.prototype.switchQuality=function(t){t.id!=this.hls.currentLevel&&(this.switchStatus="switching",this.switchData=t,this.tech.trigger({type:"hlsresolutionswitching",data:this.switchData}),this.hls.nextLevel=t.id)},t.prototype.dispose=function(){this.hls.destroy()},t.prototype.onSubtitleLoaded=function(t,e){var i=this,n=this.tech.player(),r=this.subtitlesLoadedCount,o=this.hls.subtitleTracks;this.subtitles[r].url=e.details.fragments[0].url,++this.subtitlesLoadedCount1){var o={id:-1,label:"auto",selected:-1===n.manualLevel};i.push(o),e.levels.forEach((function(t,e){var o={};o.id=e,o.selected=e===n.manualLevel,o.label=r.getLevelLabel(t),i.push(o)}));var s={qualityData:{video:i},callbacks:{video:videojs.bind(this,this.switchQuality)}};this.tech.setTimeout((function(){this.trigger({type:"masterplaylistchange",data:s})}),1)}},t.prototype.getLevelLabel=function(t){return t.height?t.height+"p":t.width?Math.round(9*t.width/16)+"p":t.bitrate?t.bitrate/1e3+"kbps":0},t.prototype.onLevelLoaded=function(t,e){this._duration=e.details.live?1/0:e.details.totalduration},t.prototype.onError=function(t,e){var i=this.tech.player();if(e.fatal)switch(e.type){case this.Hls.ErrorTypes.NETWORK_ERROR:i.error({code:14,source:e});break;case this.Hls.ErrorTypes.MEDIA_ERROR:this.hls.config.enableRecoverMediaError?this.hlsjsErrorHandler(e):i.error({code:15,source:e});break;case this.Hls.ErrorTypes.MUX_ERROR:i.error({code:16,source:e});break;case this.Hls.ErrorTypes.OTHER_ERROR:default:i.error({code:17,source:e}),this.drmBackup&&"keySystemError"===e.type&&i.error(null)}else switch(e.details){case this.Hls.ErrorDetails.KEY_LOAD_ERROR:}},t.prototype.errorHandlerFactory=function(){var t=this.hls,e=this.tech.player(),i=null,n=null,r=0;return function(o){var s=Date.now();r==t.config.recoverMediaErrorMaxRetry?e.error({code:15,source:o}):(!i||s-i>2e3?(i=s,t.recoverMediaError()):(!n||s-n>2e3)&&(n=s,t.swapAudioCodec(),t.recoverMediaError()),r++)}},t.prototype.duration=function(){return this._duration},t}(),hlsTypeRE=/^application\/(x-mpegURL|vnd\.apple\.mpegURL)$/i,hlsExtRE=/.m3u8(?![^?])/i,HlsSourceHandler={name:"hlsSourceHandler",canHandleSource:function(t){return t.skipHlsJs||t.keySystems&&t.keySystems["com.apple.fps.1_0"]?"":hlsTypeRE.test(t.type)&&hlsExtRE.test(t.src)?"probably":hlsExtRE.test(t.src)?"maybe":""},handleSource:function(t,e,i){return e.hlsProvider?(e.hlsProvider.dispose(),e.hlsProvider=null):i.hlsConfig&&!1===i.hlsConfig.autoStartLoad&&e.on("play",(function(){this.player().hasStarted()||this.hlsProvider.hls.startLoad()})),e.hlsProvider=new Html5HlsJS(t,e,i),e.hlsProvider},canPlayType:function(t){return hlsTypeRE.test(t)?"probably":""}};TCPlayer.mountHlsProvider=mountHlsProvider,mountHlsProvider();var Html5DashJS=function(){function t(e,i,n){var r=this;classCallCheck(this,t);var o=function(){var o=window_1.dashjs;if(r.dashjs=o,n=n||i.options_,r.player=videojs(n.playerId),r.player.dash=r.player.dash||{},r.tech_=i,r.el_=i.el(),r.elParent_=r.el_.parentNode,r.hasFiniteDuration_=!1,e.src){i.isReady_=!1,t.updateSourceData&&(videojs.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),e=t.updateSourceData(e)),t.hooks("updatesource").forEach((function(t){e=t(e)}));var s=e.src;r.keySystemOptions_=t.buildDashJSProtData(e.keySystemOptions||e.keySystems),r.player.dash.mediaPlayer=o.MediaPlayer().create(),r.mediaPlayer_=r.player.dash.mediaPlayer,t.useVideoJSDebug&&(videojs.log.warn('useVideoJSDebug has been deprecated. Please switch to using hook("beforeinitialize", callback).'),t.useVideoJSDebug(r.mediaPlayer_)),t.beforeInitialize&&(videojs.log.warn('beforeInitialize has been deprecated. Please switch to using hook("beforeinitialize", callback).'),t.beforeInitialize(r.player,r.mediaPlayer_)),t.hooks("beforeinitialize").forEach((function(t){t(r.player,r.mediaPlayer_)})),r.mediaPlayer_.initialize(),r.retriggerError_=function(t){if("capability"===t.error&&"mediasource"===t.event)r.player.error({code:4,message:"The media cannot be played because it requires a feature that your browser does not support."});else if("manifestError"!==t.error||"createParser"!==t.event.id&&"codec"!==t.event.id&&"nostreams"!==t.event.id&&"nostreamscomposed"!==t.event.id&&"parse"!==t.event.id&&"multiplexedrep"!==t.event.id)if("mediasource"===t.error)t.event.match("MEDIA_ERR_ABORTED")?r.player.error({code:1,message:t.event}):t.event.match("MEDIA_ERR_NETWORK")?r.player.error({code:2,message:t.event}):t.event.match("MEDIA_ERR_DECODE")?r.player.error({code:3,message:t.event}):t.event.match("MEDIA_ERR_SRC_NOT_SUPPORTED")?r.player.error({code:4,message:t.event}):t.event.match("MEDIA_ERR_ENCRYPTED")?r.player.error({code:5,message:t.event}):(t.event.match("UNKNOWN"),r.player.error({code:4,message:t.event}));else if("capability"===t.error&&"encryptedmedia"===t.event)r.player.error({code:5,message:"The media cannot be played because it requires encryption features that your browser does not support."});else if("key_session"===t.error)r.player.error({code:5,message:t.event});else if("download"===t.error)r.player.error({code:2,message:"The media playback was aborted because too many consecutive download errors occurred."});else{if("mssError"!==t.error)return;r.player.error({code:3,message:t.event})}else r.player.error({code:4,message:t.event.message});setTimeout((function(){r.mediaPlayer_.reset()}),10)},r.mediaPlayer_.on(o.MediaPlayer.events.ERROR,r.retriggerError_),r.getDuration_=function(t){var e=t.data.Period_asArray,i=r.hasFiniteDuration_;t.data.mediaPresentationDuration||e[e.length-1].duration?r.hasFiniteDuration_=!0:r.hasFiniteDuration_=!1,r.hasFiniteDuration_!==i&&r.player.trigger("durationchange")},r.mediaPlayer_.on(o.MediaPlayer.events.MANIFEST_LOADED,r.getDuration_),r.mediaPlayer_.on(o.MediaPlayer.events.STREAM_INITIALIZED,videojs.bind(r,r.onMetaData)),r.currentQuality={video:"",audio:""},Object.keys(o.MediaPlayer.events).forEach((function(t){r.mediaPlayer_.on(o.MediaPlayer.events[t],videojs.bind(r,r.onEvent))})),n.dashConfig&&Object.keys(n.dashConfig).forEach((function(t){var e,i="set"+t.charAt(0).toUpperCase()+t.slice(1),o=n.dashConfig[t];r.mediaPlayer_.hasOwnProperty(i)&&(videojs.log.warn("Using dash options in videojs-contrib-dash without the set prefix has been deprecated. Change '"+t+"' to '"+i+"'"),t=i),r.mediaPlayer_.hasOwnProperty(t)?(Array.isArray(o)||(o=[o]),(e=r.mediaPlayer_)[t].apply(e,o)):videojs.log.warn("Warning: dash configuration option unrecognized: "+t)})),r.mediaPlayer_.attachView(r.el_),r.mediaPlayer_.setAutoPlay(!1),setupAudioTracks.call(null,r.player,i),setupTextTracks.call(null,r.player,i,n),r.mediaPlayer_.setProtectionData(r.keySystemOptions_),r.mediaPlayer_.attachSource(s),r.tech_.triggerReady()}};window_1.dashjs?o():loadScript(DASH_PATH,(function(){o()}))}return t.buildDashJSProtData=function(t){var e={};if(!t)return null;if(Array.isArray(t))for(var i=0;i0){s.push({id:-1,label:"auto",selected:o}),n.forEach((function(t,i){s.push({id:i,label:e.getLevelLabel(t),selected:!o&&e.currentQuality.video===i})}));var a={qualityData:{video:s},callbacks:{video:videojs.bind(this,this.switchQuality)}};this.tech_.setTimeout((function(){this.trigger({type:"masterplaylistchange",data:a})}),1)}},t.prototype.switchQuality=function(t){var e=this.mediaPlayer_;-1===t.id?e.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}}):t.id!=this.currentQuality[t.trackType]&&(e.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),e.setQualityFor(t.trackType,t.id))},t.prototype.getLevelLabel=function(t){return t.height?t.height+"p":t.width?Math.round(9*t.width/16)+"p":t.bitrate?t.bitrate/1e3+"kbps":0},t.prototype.onEvent=function(t){switch(this.tech_.trigger({type:"dash_"+t.type,data:t}),t.type){case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_REQUESTED:this.tech_.trigger({type:"dashqualityswitching",data:t});break;case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED:this.tech_.trigger({type:"dashqualityswitched",data:t}),this.currentQuality[t.mediaType]=t.newQuality}},t}();Html5DashJS.hooks_={};var canHandleKeySystems=function(t){t=JSON.parse(JSON.stringify(t)),Html5DashJS.updateSourceData&&(videojs.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=Html5DashJS.updateSourceData(t)),Html5DashJS.hooks("updatesource").forEach((function(e){t=e(t)}));var e=document_1.createElement("video");return!(t.keySystemOptions&&!window_1.navigator.requestMediaKeySystemAccess&&!e.msSetMediaKeys)};videojs.DashSourceHandler=function(){return{name:"dashSourceHandler",canHandleSource:function(t){var e=/\.mpd/i;return canHandleKeySystems(t)?videojs.DashSourceHandler.canPlayType(t.type)?"probably":e.test(t.src)?"maybe":"":""},handleSource:function(t,e,i){return new Html5DashJS(t,e,i)},canPlayType:function(t){return videojs.DashSourceHandler.canPlayType(t)}}},videojs.DashSourceHandler.canPlayType=function(t){return/^application\/dash\+xml/i.test(t)?"probably":""},TCPlayer.mountDashProvider=mountDashProvider,mountDashProvider(),videojs.Html5DashJS=Html5DashJS;var Component$6=videojs.getComponent("Component"),hlsOption=["fileID","requestID","mediaType","mimeType","provider","resolution","rate","frames","buffer","connectionSpeed"],mp4Option=["fileID","requestID","mediaType","mimeType","resolution","rate","buffer"],dashOption=["fileID","requestID","mediaType","mimeType","resolution","rate","buffer","provider","connectionSpeed"],infoOption=["info"],VideoStatisticWrapper=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.nodelist={},r.status={fileID:"",requestID:"",mediaType:"",mimeType:"",provider:"",resolution:"",rate:"",frames:"",buffer:"",connectionSpeed:"",info:""},i.on("playcgiend",(function(){clearTimeout(r.timeoutID),Object.keys(r.status).forEach((function(t){r.nodelist[t].reset()}))})),i.on("statistic",videojs.bind(r,(function(t){"open"===t.data.action?r.tick():r.clearTimeout(r.timeoutID)}))),r.init(),r}return inherits(e,t),e.prototype.tick=function(){var t=this;this.timeoutID=setTimeout(videojs.bind(this,(function(){t.tick()})),1e3),this.updatePanel()},e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-statistic-wrapper"})},e.prototype.init=function(){var t=this;Object.keys(this.status).forEach((function(e){var i=new VideoTextItem(t,{key:e,data:t.status[e]});t.nodelist[e]=i,t.addChild(i)}))},e.prototype.updatePanel=function(){var t=this;if("Html5"===this.player().techName_)switch(this.getStatus(),this.status.mediaType){case"m3u8":hlsOption.forEach((function(e){t.nodelist[e].updateContent(t.status[e])}));break;case"mp4":mp4Option.forEach((function(e){t.nodelist[e].updateContent(t.status[e])}));break;case"mpd":dashOption.forEach((function(e){t.nodelist[e].updateContent(t.status[e])}))}else"Flash"===this.player().techName_&&(this.getFlashStatus(),infoOption.forEach((function(e){"info"===e&&t.nodelist[e].updateContent(t.status[e])})))},e.prototype.getStatus=function(){this.getFileID(),this.getRequestID(),this.getMediaType(),this.getMIMEType(),this.getResolution(),this.getRate(),this.getProvider(),this.getBuffer(),"m3u8"===this.status.mediaType&&(this.getFrames(),this.getConnectionSpeed()),"mpd"===this.status.mediaType&&this.getConnectionSpeed()},e.prototype.getFlashStatus=function(){this.status.mediaType="flash",this.getSupport()},e.prototype.getFileID=function(){var t=this.player().options_.fileID||"";return this.status.fileID=t,t},e.prototype.getRequestID=function(){var t=this.player().PlayerMetrics().playStatus;if(t){var e=t.requestID;return this.status.requestID=e,e}},e.prototype.getMediaType=function(){this.player_.src()&&/\/(.+)\.(.+)\?|\/(.+)\.(.+)/.test(this.player_.src());var t=RegExp.$2||RegExp.$4||"";return this.status.mediaType=t,t},e.prototype.getMIMEType=function(){var t=this.player().src(),e=EXT_MIME[getFileExtension(t)]||"";return this.status.mimeType=e,e},e.prototype.getResolution=function(){var t=this.player_.tech_.el_.videoHeight||0,e=this.player_.tech_.el_.videoWidth||0,i=e+" x "+t;return this.status.resolution=i,i},e.prototype.getRate=function(){var t=this.player().playbackRate()||1;return this.status.rate=t+"x",t},e.prototype.getBuffer=function(){var t=this.player_.bufferedEnd().toFixed(1)||0,e=this.player_.duration().toFixed(1)||0,i=(t/e*100).toFixed(1)+"%",n=t+" / "+e+" ("+i+")";return this.status.buffer=n,n},e.prototype.getSupport=function(){var t=void 0;return t="m3u8"!==this.status.mediaType&&"mp4"!==this.status.mediaType&&"dash"!==this.status.mediaType?"视频统计功能不支持当前视频格式":"",this.status.info=t,t},e.prototype.getProvider=function(){var t=this.player_.tech_.sourceHandler_;return t instanceof Html5HlsJS?(this.status.provider="HlsJS","HlsJS"):t instanceof Html5DashJS?(this.status.provider="DashJS","DashJS"):""},e.prototype.getFrames=function(){var t=this.player_.getVideoPlaybackQuality(),e=(t.droppedVideoFrames||0)+" dropped of "+(t.totalVideoFrames||0);return this.status.frames=e,e},e.prototype.getConnectionSpeed=function(){var t=void 0;if("m3u8"===this.status.mediaType){var e=this.player_.tech_.hlsProvider.hls.abrController._bwEstimator;t=e&&e.getEstimate()?(125e-6*e.getEstimate()).toFixed(0)+"KB/s":"0KB/s",this.status.connectionSpeed=t}if("mpd"===this.status.mediaType){var i=this.player_.dash.mediaPlayer,n=i.getDashMetrics(),r=i.getDashAdapter(),o=i.getActiveStream().getStreamInfo(),s=o.index,a=n.getCurrentRepresentationSwitch("video").to,l=r.getBandwidthForRepresentation(a,s);t=l?(125e-6*l).toFixed(0)+"KB/s":"0KB/s",this.status.connectionSpeed=t}return t},e}(Component$6);videojs.registerComponent("VideoStatisticWrapper",VideoStatisticWrapper);var Component$5=videojs.getComponent("Component"),VideoStatisticPanel=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return i.on("statistic",videojs.bind(r,(function(t){"open"===t.data.action?r.show():r.hide()}))),i.on("playcgistart",(function(){i.trigger({type:"statistic",data:{action:"close"}})})),r.init(),r}return inherits(e,t),e.prototype.createEl=function(){var t=this,e=videojs.dom.createEl("div",{className:"tcp-statistic vjs-hidden"}),i=videojs.dom.createEl("div",{className:"tcp-statistic-close",innerText:"[X]"});return i.addEventListener("click",(function(){t.hide(),t.player().trigger({type:"statistic",data:{action:"close"}})})),e.appendChild(i),e},e.prototype.init=function(){this.addChild("VideoStatisticWrapper")},e.prototype.show=function(){t.prototype.show.call(this),this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.popped=!1},e}(Component$5);videojs.registerComponent("VideoStatisticPanel",VideoStatisticPanel);var MenuItem$3=videojs.getComponent("MenuItem"),MirrorMenuItem=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.addClass("tc-menu-list"),r.open=!1,r.hasOpen=!1,r.player=i,r.setup(),r}return inherits(e,t),e.prototype.setup=function(){var t=this;this.on(["tap","click"],(function(){var e=t.player.tech().el();t.hasOpen||(window.MtaH5&&MtaH5.clickStat("mirror",{appid:t.player.options_.appID,fileid:t.player.options_.fileID}),t.player.trigger({type:"feature",data:"mirror"})),t.open?(videojs.dom.removeClass(e,"tcp-mirror"),videojs.dom.removeClass(t.el_,"tcp-menu-item-select")):(videojs.dom.addClass(e,"tcp-mirror"),videojs.dom.addClass(t.el_,"tcp-menu-item-select"),t.hasOpen=!0),t.open=!t.open}))},e}(MenuItem$3);videojs.registerComponent("MirrorMenuItem",MirrorMenuItem);var MenuItem$4=videojs.getComponent("MenuItem"),PoweredByMenuItem=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.addClass("tc-menu-list"),r}return inherits(e,t),e}(MenuItem$4);videojs.registerComponent("PoweredByMenuItem",PoweredByMenuItem);var MenuItem$5=videojs.getComponent("MenuItem"),StatusMenuItem=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.addClass("tc-menu-list"),r.hasOpen=!1,r.player=i,i.on("statistic",videojs.bind(r,(function(t){"close"===t.data.action&&(videojs.dom.removeClass(r.el_,"tcp-menu-item-select"),r.hasOpen=!1)}))),r.setup(),r}return inherits(e,t),e.prototype.setup=function(){var t=this;this.on(["tap","click"],(function(){t.hasOpen?(videojs.dom.removeClass(t.el_,"tcp-menu-item-select"),t.player.trigger({type:"statistic",data:{action:"close"}}),t.hasOpen=!1):(videojs.dom.addClass(t.el_,"tcp-menu-item-select"),t.player.trigger({type:"statistic",data:{action:"open"}}),t.hasOpen=!0,window.MtaH5&&MtaH5.clickStat("mirror",{appid:t.player.options_.appID,fileid:t.player.options_.fileID}),t.player.trigger({type:"feature",data:"statistic"}))}))},e}(MenuItem$5);videojs.registerComponent("StatusMenuItem",StatusMenuItem);var Component$8=videojs.getComponent("Component"),Menu$2=videojs.getComponent("Menu"),MenuItem$2=videojs.getComponent("MenuItem"),RightClickPopupMenu=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));r.hide(),r.addChild("PoweredByMenuItem",{label:"Powered by Tencent Cloud."}),!n.statistic||IS_IOS||IS_ANDROID||r.addChild("StatusMenuItem",{label:"Video statistic"}),n.mirror&&r.addChild("MirrorMenuItem",{label:"Mirror"}),i.on("contextmenu",videojs.bind(r,r.onContextmenu)),i.on(["tap","click"],videojs.bind(r,(function(t){if(this.popped)return this.hide(),t.stopPropagation(),t.preventDefault(),!1}))),videojs.on(document,["tap","click"],videojs.bind(r,(function(t){this.popped&&this.hide()})));var o=r;return r.children().forEach((function(t){t.on(["tap","click"],(function(){o.hide()}))})),r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return videojs.dom.addClass(e,"tcp-right-click-popup-menu"),e},e.prototype.show=function(){t.prototype.show.call(this),this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.popped=!1},e.prototype.onContextmenu=function(t){t.preventDefault(),this.show();var e=this.el(),i=t.clientX,n=t.clientY,r=getViewportSize(),o=r.width,s=r.height,a=i+e.offsetWidth-o+5;a=Math.max(0,a);var l=n+e.offsetHeight-s+5;l=Math.max(0,l);var c=this.player().el().getBoundingClientRect();e.style.left=Math.max(0,i-c.left-a)+"px",e.style.top=Math.max(0,n-c.top-l)+"px"},e}(Menu$2);videojs.registerComponent("RightClickPopupMenu",RightClickPopupMenu);var clickableComponent=videojs.getComponent("ClickableComponent"),TimeTooltip$2=videojs.getComponent("TimeTooltip"),Component$9=videojs.getComponent("Component"),dom=videojs.dom,formatTime$2=videojs.formatTime,COMMENT_WIDTH=140,COMMENT_HEIGHT_SINGLE_LINE=23,COMMENT_SHOW_ON_THE_LEFT={POPUP_CONTAINER_OFFSET:-130,POPUP_CONTAINER_OFFSET_WITHOUTGIT:-100,TRIANGLE_OFFEST:96,TRIANGLE_OFFEST_WITHOUTGIF:95},COMMENT_SHOW_ON_THE_RIGHT={TRIANGLE_OFFEST:6,POPUP_CONTAINER_OFFSET:0},ProgressMarkerGenerator=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.duration=0,r.registerListener(),r}return inherits(e,t),e.prototype.registerListener=function(){this.player_.one("canplay",videojs.bind(this,this.resetDotsElement))},e.prototype.resetDotsElement=function(){var t=this.player_;this.duration=t.duration(),dom.emptyEl(this.el_),this.resetEl()},e.prototype.resetEl=function(){this.setUpEl()},e.prototype.dotMouseLeave=function(){var t=event.currentTarget,e=t.getAttribute("container-id");this.getChildById(e).hide()},e.prototype.dotHover=function(){var t=event.currentTarget.parentElement.offsetWidth,e=event.currentTarget.offsetLeft+COMMENT_WIDTH,i=this.getChildById(event.currentTarget.getAttribute("container-id")),n=i.getAttribute("class").search("tcp-without-gif")>=0,r=i.el_.querySelector(".tcp-triangle-both")||i.el_.querySelector(".tcp-triangle");e>t?n?(i.el_.style.left=COMMENT_SHOW_ON_THE_LEFT.POPUP_CONTAINER_OFFSET_WITHOUTGIT+"px",r.style.left=COMMENT_SHOW_ON_THE_LEFT.TRIANGLE_OFFEST_WITHOUTGIF+"%"):(i.el_.style.left=COMMENT_SHOW_ON_THE_LEFT.POPUP_CONTAINER_OFFSET+"px",r.style.left=COMMENT_SHOW_ON_THE_LEFT.TRIANGLE_OFFEST+"%"):event.currentTarget.offsetLeft<=COMMENT_WIDTH&&!n&&(i.el_.style.left=COMMENT_SHOW_ON_THE_RIGHT.POPUP_CONTAINER_OFFSET+"px",r.style.left=COMMENT_SHOW_ON_THE_RIGHT.TRIANGLE_OFFEST+"px");var o=i.getChild("DotImage");if(o){var s=o.el_.getElementsByClassName("tcp-dot-timestamp")[0],a=event.currentTarget.getAttribute("dotinsecond"),l=formatTime$2(a);s.innerHTML=l}i.show()},e.prototype.setChildInTheContainer=function(t,e){var i=t.content&&""!==t.content?decodeURIComponent(t.content.replace(/\+/g," ")):"";if(""!==i){var n=e.addChild("DotComment");n.el_.innerHTML=encodeHTML(i)}if(t.img){e.el_.querySelector(".tcp-triangle").setAttribute("class","tcp-triangle-both");var r=e.addChild("DotImage");r.el_.firstChild.setAttribute("src",t.img),""==i?(e.addClass("tcp-only-gif"),r.el_.firstChild.className="tcp-image-in-container-only-image"):this.countContentSize(i)<=20&&(e.addClass("tcp-single-line"),n.el_.style.height=COMMENT_HEIGHT_SINGLE_LINE+"px")}else if(""!==i){var o=this.countContentSize(i);o<=14?e.addClass("tcp-single-line"):o<=28&&e.addClass("tcp-two-lines"),e.addClass("tcp-without-gif"),n.addClass("tcp-large-comment")}},e.prototype.markSetUp=function(t){var e=t.timeOffset>0?t.timeOffset/1e3:0,i=this.duration?this.duration:0;if(!("number"!=typeof e||e>i)){var n=document.createElement("div");n.className="tcp-dot-basic-style",n.setAttribute("dotinsecond",e.toString()),t["class"]&&(n.className+=" "+t["class"]);var r=this.addChild("PopUpContainer");return n.setAttribute("container-id",r.id_),this.setChildInTheContainer(t,r),n.appendChild(r.el_),n.style.left=e/i*100+"%",n.addEventListener("mouseover",videojs.bind(this,this.dotHover)),n.addEventListener("mouseleave",videojs.bind(this,this.dotMouseLeave)),n}},e.prototype.setUpEl=function(){var e=this,i=this.player_.options_.dots||0,n=this.el_||t.prototype.createEl.call(this);return videojs.dom.addClass(n,"tcp-dot-component"),i&&i instanceof Array&&i.length>0&&i.forEach((function(t){var i=t.content||"";if(i&&""!=i||t.img){var r=e.markSetUp(t);r&&n.appendChild(r)}})),n},e.prototype.countContentSize=function(t){for(var e=0,i=t.length,n=-1,r=0;r=0&&n<=128?1:2;return e},e.prototype.createEl=function(){return this.setUpEl()},e}(clickableComponent);videojs.registerComponent("ProgressMarkerGenerator",ProgressMarkerGenerator);var DotComment=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.addClass("tcp-dot-comment"),r}return inherits(e,t),e}(Component$9);videojs.registerComponent("DotComment",DotComment);var DotImage=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));r.addClass("tcp-dot-image");var o=r.el_||t.prototype.createEl.call(r),s=dom.createEl("img");s.className="tcp-image-in-container",o.appendChild(s);var a=dom.createEl("span");return a.className="tcp-dot-timestamp",a.innerHTML="",o.appendChild(a),r}return inherits(e,t),e}(Component$9);videojs.registerComponent("DotImage",DotImage);var PopUpContainer=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));r.addClass("tcp-popup-container");var o=dom.createEl("div");return o.setAttribute("class","tcp-triangle"),r.el_.appendChild(o),r.hide(),r}return inherits(e,t),e}(TimeTooltip$2);videojs.registerComponent("PopUpContainer",PopUpContainer);var Plugin$2=videojs.getPlugin("plugin"),SpeedUp=function(t){function e(i){classCallCheck(this,e);var n=possibleConstructorReturn(this,t.call(this,i));return n.TARGET_LANTENCY=1,n.MAX_LATENCY=3,n.RATEVALUE=1.1,i.ready(videojs.bind(n,n.init)),n}return inherits(e,t),e.prototype.checkLatency=function(){var t=this.player.bufferedEnd()-this.player.currentTime();t>this.MAX_LATENCY&&this.player.playbackRate(this.RATEVALUE),t-1)return e.innerText="",!1;e.innerText=i.getConnectionSpeed()}var e=this,i=Component$10.prototype.createEl.call(this,"div",{className:"tcp-loading-spinner",dir:"ltr"});if(!this.player_.options_.loadingSpeed)return i;var n=null;return this.player_.on("waiting",(function(){n=setInterval((function(){t(e.player_,i)}),100)})),this.player_.on("timeupdate",(function(){n&&clearInterval(n)})),i};var Plugin$3=videojs.getPlugin("plugin"),log$3=videojs.log,Skin=function(t){function e(i,n){classCallCheck(this,e),log$3("Skin initializing");var r=possibleConstructorReturn(this,t.call(this,i));return r.player.addClass("tcp-skin"),log$3("Skin initialized"),r}return inherits(e,t),e}(Plugin$3);videojs.registerPlugin("Skin",Skin);var Plugin$4=videojs.getPlugin("plugin"),log$4=videojs.log,VID=function(t){function e(i,n){classCallCheck(this,e),log$4("VID initializing");var r=possibleConstructorReturn(this,t.call(this,i));return r.init(r.player.options_),log$4("VID initialized"),r}return inherits(e,t),e.prototype.init=function(t){var e=(this.player,t.sources);t&&t.appID&&t.fileID||t.plugins.DRM&&0==e.length?t.children.splice(0,"mediaLoader"==t.children[0]?1:0,"mediaAsyncLoader"):"mediaLoader"!=t.children[0]&&t.children.unshift("mediaLoader")},e}(Plugin$4);videojs.registerPlugin("VID",VID);var isObject_1=isObject$2,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=_freeGlobal||freeSelf||Function("return this")(),_root=root,now=function(){return _root.Date.now()},now_1=now,reWhitespace=/\s/,_trimmedEndIndex=trimmedEndIndex,reTrimStart=/^\s+/,_baseTrim=baseTrim,Symbol$1=_root.Symbol,_Symbol=Symbol$1,objectProto=Object.prototype,hasOwnProperty$2=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0,_getRawTag=getRawTag,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString,_objectToString=objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0,_baseGetTag=baseGetTag,isObjectLike_1=isObjectLike,symbolTag="[object Symbol]",isSymbol_1=isSymbol,NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,toNumber_1=toNumber,FUNC_ERROR_TEXT$1="Expected a function",nativeMax=Math.max,nativeMin=Math.min,debounce_1=debounce,FUNC_ERROR_TEXT="Expected a function",throttle_1=throttle$1,Component$11=videojs.getComponent("Component"),DvrProgressControl=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.on("mousemove",r.handleMouseMove),r.on("mouseup",r.handleMouseUp),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control tcp-dvr-progress-control"})},e.prototype.update=function(t){this.getChild("DvrSeekBar").update(t)},e.prototype.handleMouseMove=function(t){var e=this.getChild("DvrSeekBar"),i=e.calculateDistance(t),n=e.getChild("DvrMouseTimeDisplay");n&&n.update(videojs.dom.getBoundingClientRect(e.el()),i)},e.prototype.handleMouseUp=function(t){this.getChild("DvrSeekBar").handleMouseUp(t)},e}(Component$11);DvrProgressControl.prototype.options_={children:["DvrSeekBar"]},videojs.registerComponent("DvrProgressControl",DvrProgressControl);var Slider$2=videojs.getComponent("Slider"),DvrSeekBar=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.percent_=1,r.update=throttle_1(videojs.bind(r,r.update),50),r.on(i,"seekToLive",videojs.bind(r,(function(t){this.update(t.data)}))),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update=function(t){void 0!=t&&(this.percent_=t,this.bar.update(videojs.dom.getBoundingClientRect(this.el_),t),this.updateAriaAttributes(t))},e.prototype.handleMouseDown=function(e){t.prototype.handleMouseDown.call(this,e),this.isMouseDown=!0},e.prototype.handleMouseMove=function(t){var e=this.calculateDistance(t);this.update(e)},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this);var i=this.calculateDistance(e);this.update(i),this.player().Dvr().timeShift(i)},e.prototype.stepBack=function(){},e.prototype.stepForward=function(){},e.prototype.updateAriaAttributes=function(t){this.el().setAttribute("aria-valuenow",(100*t).toFixed(2))},e.prototype.getPercent=function(){return this.percent_},e}(Slider$2);DvrSeekBar.prototype.options_={children:["DvrMouseTimeDisplay","DvrTimeShiftBar"],barName:"DvrTimeShiftBar"},videojs.registerComponent("DvrSeekBar",DvrSeekBar);var DvrTimeShiftBar=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.el_.style.width="100%",r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar tcp-dvr-time-shift",innerHTML:''+this.localize("Progress")+": 100%"})},e.prototype.update=function(t,e){var i=(100*e).toFixed(2)+"%";this.el_.style.width=i},e}(Component$11);videojs.registerComponent("DvrTimeShiftBar",DvrTimeShiftBar);var MouseTimeDisplay$2=videojs.getComponent("MouseTimeDisplay"),DvrMouseTimeDisplay=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.update=function(t,e){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player().Dvr().dvrData.maxTimeShift,r=videojs.formatTime((1-e)*n,n);i.el_.style.left=t.width*e+"px",i.getChild("timeTooltip").update(t,e,r)}))},e}(MouseTimeDisplay$2);videojs.registerComponent("DvrMouseTimeDisplay",DvrMouseTimeDisplay);var Button$4=videojs.getComponent("Button"),LiveButton=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var t=Button$4.prototype.createEl.call(this,"button",{className:"vjs-live-control vjs-control"});return this.contentEl_=videojs.dom.createEl("div",{className:"vjs-live-display",innerHTML:this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},e.prototype.update=function(){},e.prototype.updateControlText=function(t){this.controlText(t?"直播中":"返回直播")},e.prototype.handleClick=function(t){this.player().Dvr().seekToLive()},e}(Button$4);LiveButton.prototype.controlText_="返回直播",videojs.registerComponent("LiveButton",LiveButton);var Plugin$5=videojs.getPlugin("plugin"),Dvr=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));r.isInit=!1,r.options=n;var o=r;return i.ready((function(){var t=i.tech(!0),e=t&&t.hlsProvider;if(e&&e.Hls){var n=e.Hls;t.one(n.Events.MANIFEST_LOADED,(function(t){})),t.one(n.Events.LEVEL_LOADED,(function(t){})),i.one("loadedmetadata",(function(e){t.el_.setAttribute("poster",""),o.init(),o.options.liveURL&&o.seekToLive()}))}})),r}return inherits(e,t),e.prototype.init=function(){var t=this.player,e=t.tech(!0).hlsProvider;this.parseM3u8(e.manifests[0]),this.dvrData.startTime||this.isInit?(this.initControl(),this.delay=getParams("delay",t.tech_.currentSource_.src)||0,this.updateControl(!this.isLive()),t.on("loadedmetadata",videojs.bind(this,(function(){this.parseM3u8(e.manifests[0]),this.delay=getParams("delay",t.tech_.currentSource_.src)||0,this.updateControl()}))),this.isInit=!0):t.one("loadedmetadata",videojs.bind(this,(function(t){this.init()})))},e.prototype.initControl=function(){var t=this.player;t.addClass("vjs-dvr"),t.controlBar.getChild("ProgressControl").hide(),t.controlBar.getChild("LiveDisplay").hide(),t.controlBar.addChild("DvrProgressControl",{},5),t.controlBar.addChild("liveButton",{},6)},e.prototype.updateControl=function(t){var e=this.player,i=e.controlBar.getChild("ProgressControl"),n=e.controlBar.getChild("LiveDisplay"),r=e.controlBar.getChild("DvrProgressControl"),o=e.controlBar.getChild("LiveButton");e.toggleClass("vjs-dvr-live",this.isLive()),o.updateControlText(this.isLive()),t&&r.update(1-this.delay/this.dvrData.maxTimeShift),this.dvrData.startTime?(r.show(),o.show(),i.hide(),n.hide()):(r.hide(),o.hide(),i.show(),n.show())},e.prototype.seekToLive=function(){this.isLive()||(this.timeShift(1),this.player.trigger({type:"seekToLive",data:1}))},e.prototype.isLive=function(){return!(this.delay>0)},e.prototype.timeShift=function(t){var e=this.player,i=(e.getChild("ControlBar").getChild("LiveButton"),e.tech_.currentSource_),n=Math.floor(this.dvrData.maxTimeShift*(1-t));this.delay=n,0==n&&this.options.liveURL?e.src(this.options.liveURL):(i.src=(this.options.shiftURL||i.src).replace(/delay=*(\d+)/,"delay="+n),e.src(e.tech_.currentSource_.src)),e.bigPlayButton.hide(),e.posterImage.hide(),e.tech_.one("hlsManifestParsed",videojs.bind(this,(function(){e.play()})))},e.prototype.parseM3u8=function(t){this.dvrData={};for(var e=new RegExp([/#EXT-TX-TS-START-TIME:*(.+)/.source,/|#EXT-TX-TS-DURATION:*(.+)/.source].join(""),"g"),i=void 0;null!==(i=e.exec(t));)i[1]?this.dvrData.startTime=i[1]:i[2]&&(this.dvrData.duration=i[2]);this.dvrData.startTime&&(this.dvrData.maxTimeShift=Math.min(Math.floor((new Date).getTime()/1e3-this.dvrData.startTime),this.dvrData.duration))},e}(Plugin$5);videojs.registerPlugin("Dvr",Dvr);var Menu$4=videojs.getComponent("Menu"),QualitySwitcherMenu=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.addItem=function(e){t.prototype.addItem.call(this,e)},e}(Menu$4),MenuItem$6=videojs.getComponent("MenuItem"),QualitySwitcherMenuItem=function(t){function e(i,n){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,i,n))}return inherits(e,t),e.prototype.handleClick=function(e){if(t.prototype.handleClick.call(this,e),this.updateItems(),this.options_.callback(this.options_),"video"==this.options_.trackType){var i=this.player().controlBar.getChild(this.options_.trackType+"QualitySwitcherMenuButton");i.updateLabel(this.options_),i.unpressButton()}},e.prototype.updateItems=function(){for(var t=this.player().controlBar.getChild(this.options_.trackType+"QualitySwitcherMenuButton"),e=t.getChild(this.options_.trackType+"QualitySwitcherMenu"),i=e.children(),n=0;n-1;n--){var r=t[n];i=videojs.mergeOptions(r,{trackType:this.options_.trackType,callback:this.options_.callback,selectable:!0}),e.addItem(new QualitySwitcherMenuItem(this.player(),i)),r.selected&&this.updateLabel(r)}return e},e.prototype.updateLabel=function(t){this.labelEl_.innerHTML=""+this.localize(t.label)+"
"},e}(MenuButton$2),Plugin$6=videojs.getPlugin("plugin"),TRACK_TYPES=["video","audio","subtitle"],TRACK_CLASS={video:"tcp-video-quality-switcher",audio:"tcp-audio-quality-switcher",subtitle:"tcp-subtitle-quality-switcher"},log$5=videojs.log,QualitySwitcher=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,i.on("qualitydataloaded",videojs.bind(r,r.init)),r}return inherits(e,t),e.prototype.init=function(t){log$5("QualitySwitcher initializing",t);var e=this.player,i=t.data.qualityData,n=t.data.callbacks;if(this.setOptions({qualityData:i,callbacks:n}),e.controlBar){for(var r=0;r0&&e.controlBar.options_.QualitySwitcherMenuButton&&(a&&a.el()&&(a.dispose(),e.controlBar.removeChild(a)),this.repleaceLabel(o,i),a=new QualitySwitcherMenuButton(e,{name:s,qualityList:i[o],callback:n[o],trackType:o}),a.addClass(TRACK_CLASS[o]),e.controlBar.addChild(a,{},10))}log$5("QualitySwitcher initialized",t,this)}else log$5("QualitySwitcher can not initialize without control bar")},e.prototype.setOptions=function(t){this.options=videojs.mergeOptions(this.options,t)},e.prototype.setVideoQuality=function(t){if(this.options.qualityData&&this.options.callbacks.video){for(var e=this.options.qualityData.video,i=0;i0&&i&&i.length>0)for(var r=0;r0&&n.forEach((function(n,r){var o={};o.id=n,o.selected=t.defaultRes===n,o.label=i[n]||n,e.push(o)})),{qualityData:{video:e},callbacks:{video:videojs.bind(this,this.switchResolution)}}},e.prototype.sortSourceOrder=function(t){return[]},e}(Plugin$7);videojs.registerPlugin("MultiResolution",MultiResolution);var FlashObj=videojs.getComponent("Flash"),defaultDismiss=!videojs.browser.IS_IPHONE,registerPlugin=videojs.registerPlugin||videojs.plugin,defaults$1={header:"",code:"",message:"",timeout:45e3,dismiss:defaultDismiss,progressDisabled:!1,errors:{1:{type:"MEDIA_ERR_ABORTED"},2:{type:"MEDIA_ERR_NETWORK"},3:{type:"MEDIA_ERR_DECODE"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED"},5:{type:"MEDIA_ERR_ENCRYPTED"},unknown:{type:"MEDIA_ERR_UNKNOWN"},"-1":{type:"PLAYER_ERR_NO_SRC",message:"No video has been loaded."},"-2":{type:"PLAYER_ERR_TIMEOUT",message:"Could not download the video."},10:{type:"SERVER_ERR",message:"Request timed out."},11:{type:"SERVER_ERR",message:"Server is not respond."},12:{type:"DATA_ERR",message:"Server respond error data."},13:{type:"DATA_ERR",message:"No video transcoding information found."},14:{type:"HLS_NETWORK_ERR",message:"A network error caused the media download to fail part-way."},15:{type:"HLS_MEDIA_ERR",message:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."},16:{type:"HLS_MUX_ERR",message:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."},17:{type:"HLS_OTHER_ERR",message:"Rise an internal exception when playing HLS."},18:{type:"DRM_ERR",message:"Current browser not support DRM."},403:{type:"SERVER_ERR",message:"Authentication failed."},500:{type:"SERVER_ERR",message:"Server failed."},1001:{type:"SERVER_ERR",message:"The media file does not exist. Please check if the fileID is correct."},1002:{type:"SERVER_ERR",message:"The trial duration is illegal. The trial duration must be within the video duration."},1003:{type:"SERVER_ERR",message:"Param pcfg is not unique."},1004:{type:"SERVER_ERR",message:"The license has expired. Please check whether the expiration time setting is reasonable."},1005:{type:"SERVER_ERR",message:"Did not find an adaptive stream that can be played."},1006:{type:"SERVER_ERR",message:"Invalid request format, please check the request format."},1007:{type:"SERVER_ERR",message:"AppID is not exist, Please check if the AppID is correct."},1008:{type:"SERVER_ERR",message:"Without anti-leech information."},1009:{type:"SERVER_ERR",message:"psign check failed."},1010:{type:"SERVER_ERR",message:"Other errors."},1021:{type:"SERVER_ERR",message:"qsign invalid."},1012:{type:"DATA_ERR",message:"Response data verification failed."},2001:{type:"SERVER_ERR",message:"Internal error."},10008:{type:"SERVER_ERR",message:"The media file does not exist. Please check if the fileID is correct."},"-2001":{type:"SERVER_ERR",message:"Current browser not support play this stream, please select another one."},"-2002":{type:"SERVER_ERR",message:"Server respond error data.(eg. stream not exist)"},"-2003":{type:"SERVER_ERR",message:"Video play failed, please refresh to start play again."},"-2004":{type:"SERVER_ERR",message:"Connection to the server has failed and the number of connection retries has exceeded the set value."},"-2005":{type:"SERVER_ERR",message:"Video decoding failure."},PLAYER_ERR_DOMAIN_RESTRICTED:{message:"This video is restricted from playing on your current domain."},PLAYER_ERR_IP_RESTRICTED:{message:"This video is restricted at your current IP address."},PLAYER_ERR_GEO_RESTRICTED:{message:"This video is restricted from playing in your current geographic region."}}},initPlugin=function t(e,i){var n=void 0,r=void 0,o=void 0,s=[];videojs.getComponent("ErrorDisplay").prototype.options_.fillAlways=!1;var a=function(t){i.errors=videojs.mergeOptions(i.errors,t),Object.keys(i.errors).forEach((function(t){var e=i.errors[t];e.type||(e.type=t)}))};a();var l=function(){e.clearTimeout(r),o&&(o=!1,e.removeClass("vjs-waiting")),r=e.setTimeout((function(){e.error()||e.paused()||e.ended()||(o=!0,e.addClass("vjs-waiting"))}),1e3),e.clearTimeout(n),n=e.setTimeout((function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})}),i.timeout),e.error()&&-2===e.error().code&&e.error(null)},c=function(){for(var t=void 0;s.length;)t=s.shift(),e.off(t[0],t[1]);e.clearTimeout(n),e.clearTimeout(r)},u=function(t,i){var n=function(){if(!e.error()){var t=e.$(".vjs-tech");if(t&&"application/x-shockwave-flash"===t.type&&!t.vjs_getProperty)return void e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(e.paused())return l();if(e.ended())return l()}i.call(this)};e.on(t,n),s.push([t,n])},h=function(){var t=0;c(),l(),u(["timeupdate","adtimeupdate"],(function(){var i=e.currentTime();i!==t&&(t=i,l())})),i.progressDisabled||u("progress",l)},p=function(t){var n="",r=e.error(),o=document_1.createElement("div"),s="";if(r){r=videojs.mergeOptions(r,i.errors[r.code||0]),r.message&&(n=''+e.localize(r.message)+"
"),r.code&&(n+=''+this.localize("Error Code")+" : "+r.code+"
"),r.type&&(n+=''+this.localize("Error Type")+" : "+r.type+"
"),"10"!=r.code&&"11"!=r.code||(n+='诊断网络'),o.className="vjs-errors-dialog",s='\n '+n+"\n
";var a=e.getChild("errorDisplay");a.closeable(!("dismiss"in r)||r.dismiss)?(o.innerHTML=s,a.fillWith(o),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el())):(o.innerHTML=s,a.fillWith(o)),a.one("modalclose",(function(){return e.error(null)}))}},d=function t(){c(),e.removeClass("vjs-errors"),e.off("dispose",t),e.off(["aderror","error"],p)},f=function(i){d(),t(e,videojs.mergeOptions(defaults$1,i))};f.extend=function(t){return a(t)},f.getAll=function(){return videojs.mergeOptions(i.errors)},f.disableProgress=function(t){i.progressDisabled=t,h()},e.on("dispose",d),e.on(["aderror","error"],p),e.ready((function(){e.addClass("vjs-errors")})),e.errors=f},errors=function(t){initPlugin(this,videojs.mergeOptions(defaults$1,t))};["extend","getAll","disableProgress"].forEach((function(t){errors[t]=function(){videojs.log.warn("The errors."+t+"() method is not available until the plugin has been initialized!")}})),registerPlugin("Errors",errors);var Plugin$8=videojs.getPlugin("plugin"),cgiSeq={},STATUS_CODE_REPORT_URL="//report.huatuo.qq.com/code.cgi",log$7=videojs.log,Reporter=function(t){function e(i,n){classCallCheck(this,e),log$7("Reporter initilaizing");var r,o=possibleConstructorReturn(this,t.call(this,i));return i.options_.plugins.Reporter?(o.reportContent={status:"idle"},o.mtaReportCache=[],log$7("Reporter initilaized"),o):(r=!1,possibleConstructorReturn(o,r))}return inherits(e,t),e.prototype.setStorage=function(t,e){localStorage.setItem(t,e)},e.prototype.getStorage=function(t){localStorage.getItem(t)},e.prototype.sender=function(t){var e=new Image;e.onload=e.onerror=e.onabort=function(){e.onload=e.onerror=e.onabort=null,e=null},e.src=t},e.prototype.initPlayCgiCodeReport=function(){var t=this.player;t.on("playcgistart",videojs.bind(this,this.onPlayCgiStart)),t.on("playcgiend",videojs.bind(this,this.onPlayCgiEnd))},e.prototype.onPlayCgiStart=function(t){cgiSeq[t.data.time]=cgiSeq[t.data.time]||{},cgiSeq[t.data.time].startTime=t.data.time,cgiSeq[t.data.time].url=t.data.url},e.reportPlayMetrics=function(t,e){xhr.post("https://datacenter.live.qcloud.com",{body:JSON.stringify(t)},(function(){e&&e()}))},e.prototype.onPlayCgiEnd=function(t){if(cgiSeq[t.data.startTime]){var e=t.data,i=void 0,n=void 0,r=void 0;if(e.error)switch(n=2,e.error.message){case"Timeout":i=10;break;case"ServerError":i=11}else 0==e.result.code?(n=1,i=0):(n=3,i=e.result.code),r=e.result.requestId;this.reportPlayCgiToISD("","",n,i,t.data.time-cgiSeq[t.data.startTime].startTime,r,void 0,void 0)}},e.prototype.reportPlayCgiToISD=function(t,e,i,n,r,o,s,a){var l={domain:t||"playvideo.qcloud.com",cgi:e||"/getplayinfo/v2",type:i,code:n,time:r,appid:20370,platform:videojs.browser.IS_IOS?"ios":videojs.browser.IS_ANDROID?"android":"pc",expansion1:o,expansion2:s,expansion3:a};this.sender(unifyProtocol(STATUS_CODE_REPORT_URL)+"?"+serializeParams(l))},e.prototype.reportMTA=function(t,e){window.MtaH5?(this.mtaReportCache.length>0&&(this.mtaReportCache.forEach((function(t){t.call()})),this.mtaReportCache=0),MtaH5.clickStat(t,e)):this.mtaReportCache.push((function(){MtaH5.clickStat(t,e)}))},e}(Plugin$8);videojs.registerPlugin("Reporter",Reporter);var store2=createCommonjsModule((function(t){!function(e,i){var n={version:"2.12.0",areas:{},apis:{},inherit:function(t,e){for(var i in t)e.hasOwnProperty(i)||Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i));return e},stringify:function(t){return void 0===t||"function"==typeof t?t+"":JSON.stringify(t)},parse:function(t,e){try{return JSON.parse(t,e||n.revive)}catch(i){return t}},fn:function(t,e){for(var i in n.storeAPI[t]=e,n.apis)n.apis[i][t]=e},get:function(t,e){return t.getItem(e)},set:function(t,e,i){t.setItem(e,i)},remove:function(t,e){t.removeItem(e)},key:function(t,e){return t.key(e)},length:function(t){return t.length},clear:function(t){t.clear()},Store:function(t,e,i){var r=n.inherit(n.storeAPI,(function(t,e,i){return 0===arguments.length?r.getAll():"function"==typeof e?r.transact(t,e,i):void 0!==e?r.set(t,e,i):"string"==typeof t||"number"==typeof t?r.get(t):"function"==typeof t?r.each(t):t?r.setAll(t,e):r.clear()}));r._id=t;try{e.setItem("__store2_test","ok"),r._area=e,e.removeItem("__store2_test")}catch(o){r._area=n.storage("fake")}return r._ns=i||"",n.areas[t]||(n.areas[t]=r._area),n.apis[r._ns+r._id]||(n.apis[r._ns+r._id]=r),r},storeAPI:{area:function(t,e){var i=this[t];return i&&i.area||(i=n.Store(t,e,this._ns),this[t]||(this[t]=i)),i},namespace:function(t,e){if(!t)return this._ns?this._ns.substring(0,this._ns.length-1):"";var i=t,r=this[i];if(!(r&&r.namespace||(r=n.Store(this._id,this._area,this._ns+i+"."),this[i]||(this[i]=r),e)))for(var o in n.areas)r.area(o,n.areas[o]);return r},isFake:function(){return"fake"===this._area.name},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(t){return this._area.has?this._area.has(this._in(t)):!!(this._in(t)in this._area)},size:function(){return this.keys().length},each:function(t,e){for(var i=0,r=n.length(this._area);in.length(this._area)&&(r--,i--)}return e||this},keys:function(t){return this.each((function(t,e,i){i.push(t)}),t||[])},get:function(t,e){var i,r=n.get(this._area,this._in(t));return"function"==typeof e&&(i=e,e=null),null!==r?n.parse(r,i):null!=e?e:r},getAll:function(t){return this.each((function(t,e,i){i[t]=e}),t||{})},transact:function(t,e,i){var n=this.get(t,i),r=e(n);return this.set(t,void 0===r?n:r),this},set:function(t,e,i){var r=this.get(t);return null!=r&&!1===i?e:n.set(this._area,this._in(t),n.stringify(e),i)||r},setAll:function(t,e){var i,n;for(var r in t)n=t[r],this.set(r,n,e)!==n&&(i=!0);return i},add:function(t,e){var i=this.get(t);if(i instanceof Array)e=i.concat(e);else if(null!==i){var r=typeof i;if(r===typeof e&&"object"===r){for(var o in e)i[o]=e[o];e=i}else e=i+e}return n.set(this._area,this._in(t),n.stringify(e)),e},remove:function(t,e){var i=this.get(t,e);return n.remove(this._area,this._in(t)),i},clear:function(){return this._ns?this.each((function(t){n.remove(this._area,this._in(t))}),1):n.clear(this._area),this},clearAll:function(){var t=this._area;for(var e in n.areas)n.areas.hasOwnProperty(e)&&(this._area=n.areas[e],this.clear());return this._area=t,this},_in:function(t){return"string"!=typeof t&&(t=n.stringify(t)),this._ns?this._ns+t:t},_out:function(t){return this._ns?t&&0===t.indexOf(this._ns)?t.substring(this._ns.length):void 0:t}},storage:function(t){return n.inherit(n.storageAPI,{items:{},name:t})},storageAPI:{length:0,has:function(t){return this.items.hasOwnProperty(t)},key:function(t){var e=0;for(var i in this.items)if(this.has(i)&&t===e++)return i},setItem:function(t,e){this.has(t)||this.length++,this.items[t]=e},removeItem:function(t){this.has(t)&&(delete this.items[t],this.length--)},getItem:function(t){return this.has(t)?this.items[t]:null},clear:function(){for(var t in this.items)this.removeItem(t)}}},r=n.Store("local",function(){try{return localStorage}catch(t){}}());r.local=r,r._=n,r.area("session",function(){try{return sessionStorage}catch(t){}}()),r.area("page",n.storage("page")),"function"==typeof i&&void 0!==i.amd?i("store2",[],(function(){return r})):t.exports?t.exports=r:(e.store&&(n.conflict=e.store),e.store=r)}(commonjsGlobal,commonjsGlobal&&commonjsGlobal.define)})),Plugin$9=videojs.getPlugin("plugin"),log$8=videojs.log,ContinuePlay=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,r.init(),r}return inherits(e,t),e.prototype.init=function(){var t=this.player,e=t.options_,i=void 0;t.ready(videojs.bind(this,(function(){i=e&&e.appID&&e.fileID?e.fileID:this.options.playID,this.playID=i,t.cache_&&t.cache_.source&&t.cache_.source.src&&(this.source=t.cache_.source.src.split("?")[0]),(i||this.source)&&(log$8("ContinuePlay initializing"),this.lastTime=store2.get(this.getStoreKey()),t.off("timeupdate",videojs.bind(this,this.onTimeUpdate)),t.on("timeupdate",videojs.bind(this,this.onTimeUpdate)),t.one(this.getTriggerEvent(),videojs.bind(this,this.onPlay)),!this.options.auto&&t.getChild("ContinuePlayTips")&&t.getChild("ContinuePlayTips").close(),log$8("ContinuePlay initialized"),t.trigger({type:"feature",data:"continue"}))})))},e.prototype.onTimeUpdate=function(t){store2.set(this.getStoreKey(),this.player.currentTime())},e.prototype.onPlay=function(t){var e=this.player;Math.round(this.lastTime)>1&&this.player.duration()>1&&this.player.duration()!==1/0&&Math.round(this.lastTime)!=Math.round(this.player.duration())?this.options.auto?this.start():e.addChild("ContinuePlayTips",videojs.mergeOptions(this.options,{time:this.lastTime,resumeCallback:videojs.bind(this,this.start)})):"Flash"==e.techName_&&Math.round(this.lastTime)>1&&Math.round(this.lastTime)!=Math.round(this.player.duration())&&this.player.duration()!==1/0&&!this.player.duration()&&e.one("loadedmetadata",videojs.bind(this,this.onPlay))},e.prototype.start=function(){var t=this.player;t.currentTime(this.lastTime),"Flash"==t.techName_&&t.tech(!0).trigger("seeked"),t.trigger({type:"continueplay",data:{lastTime:this.lastTime}})},e.prototype.generatePlayID=function(){},e.prototype.getStoreKey=function(){return"tcplayer-lpt-"+(this.playID||this.source)},e.prototype.getTriggerEvent=function(){var t=this.player,e=t.options_;return e.autoplay&&"Flash"==t.techName_?"loadedmetadata":"playing"},e}(Plugin$9);videojs.registerPlugin("ContinuePlay",ContinuePlay);var defaults$2={align:"top-left",className:"",content:"",debug:!1,showBackground:!0,attachToControlBar:!1,overlays:[]},Component$12=videojs.getComponent("Component"),dom$1=videojs.dom||videojs,registerPlugin$1=videojs.registerPlugin||videojs.plugin,isNumber=function(t){return"number"==typeof t&&t===t},hasNoWhitespace=function(t){return"string"==typeof t&&/^\S+$/.test(t)},Overlay=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return["start","end"].forEach((function(t){var e=r.options_[t];if(isNumber(e))r[t+"Event_"]="timeupdate";else if(hasNoWhitespace(e))r[t+"Event_"]=e;else if("start"===t)throw new Error('invalid "start" option; expected number or string')})),["endListener_","rewindListener_","startListener_"].forEach((function(t){r[t]=function(i){return e.prototype[t].call(r,i)}})),"timeupdate"===r.startEvent_&&r.on(i,"timeupdate",r.rewindListener_),r.debug('created, listening to "'+r.startEvent_+'" for "start" and "'+(r.endEvent_||"nothing")+'" for "end"'),r.hide(),r}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_,e=t.content,i=t.showBackground?"tcp-overlay-background":"tcp-overlay-no-background",n=dom$1.createEl("div",{className:"\n tcp-overlay\n tcp-overlay-"+t.align+"\n "+t.className+"\n "+i+"\n vjs-hidden\n "});return"string"==typeof e?n.innerHTML=e:videojs.browser.IS_IE8||e instanceof window_1.DocumentFragment?n.appendChild(e):dom$1.appendContent(n,e),n},e.prototype.debug=function(){if(this.options_.debug){for(var t=videojs.log,e=t,i=arguments.length,n=Array(i),r=0;r=i:i===e},e.prototype.show=function(){return t.prototype.show.call(this),"pause"===this.startEvent_&&this.off(this.player(),this.startEvent_,this.startOnPause_),this.off(this.player(),this.startEvent_,this.startListener_),this.debug("shown"),this.debug('unbound `startListener_` from "'+this.startEvent_+'"'),this.endEvent_&&(this.debug('bound `endListener_` to "'+this.endEvent_+'"'),this.on(this.player(),this.endEvent_,this.endListener_)),this},e.prototype.shouldShow_=function(t,e){var i=this.options_.start,n=this.options_.end;return isNumber(i)?isNumber(n)?t>=i&&t=i):i===e},e.prototype.startListener_=function(t){var e=this.player().currentTime();this.shouldShow_(e,t.type)&&this.show()},e.prototype.endListener_=function(t){var e=this.player().currentTime();this.shouldHide_(e,t.type)&&this.hide()},e.prototype.rewindListener_=function(t){var e=this.player().currentTime(),i=this.previousTime_,n=this.options_.start,r=this.options_.end;e0&&(log$9("ImagePatch initializing"),t.forEach((function(t){var i=void 0,r=void 0,o=void 0,s=void 0,a=document.createDocumentFragment();o=document.createElement("a"),o.className="tcp-overlay-link",o.target="_blank",t.link&&(o.href=t.link),t.url&&(s=e.loadImg(unifyProtocol(t.url),videojs.bind(e,e.onImgLoaded)),s.className="tcp-overlay-img",o.appendChild(s),videojs.browser.IS_IE8?(i=document.createElement("div"),i.className="tcp-overlay-table",r=document.createElement("div"),r.className="tcp-overlay-cell",r.appendChild(o),i.appendChild(r),a.appendChild(i)):a.appendChild(o),n.overlays.push({content:a,className:"tcp-image-patch tcp-image-patch-"+locations[t.location],start:startEvent[t.location],end:endEvent[t.location],once:0==t.location,align:"center"}))})),n.overlays.length>0?(i.Patch(n),i.trigger({type:"feature",data:"patch"}),this.hasInit=!0):this.reset(),log$9("ImagePatch initialized"))},e.prototype.loadImg=function(t,e){var i,n,r,o,s,a=new Image;return a.src=t,a.complete?(e&&e.call(e,a),a):(n=a.width,r=a.height,a.onerror=function(){i.end=!0,a=a.onload=a.onerror=null},i=function(){o=a.width,s=a.height,(o!==n||s!==r||o*s>1024)&&(e&&e.call(e,a),i.end=!0)},i(),a.onload=function(){!i.end&&i(),a=a.onload=a.onerror=null},a)},e.prototype.onImgLoaded=function(t){if(videojs.browser.IE_VERSION){var e=parseInt(this.player.el().currentStyle.width),i=parseInt(this.player.el().currentStyle.height);if(t.width>e||t.height>i){var n=e/(t.width/t.height);t.width/t.height>e/i||(t.style.marginTop=(i-n)/2+"px"),t.style.width="100%",t.style.height="auto"}}},e.prototype.reset=function(){this.hasInit&&(log$9("ImagePatch reset"),this.player.Patch(),this.hasInit=!1)},e}(Plugin$10);videojs.registerPlugin("ImagePatch",ImagePatch);var Plugin$11=videojs.getPlugin("plugin"),log$10=videojs.log,ContextMenu=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,log$10("ContextMenu initializing"),r.init(),log$10("ContextMenu initialized"),r}return inherits(e,t),e.prototype.init=function(){this.player.addChild("RightClickPopupMenu",this.options)},e}(Plugin$11);videojs.registerPlugin("ContextMenu",ContextMenu);var Plugin$12=videojs.getPlugin("plugin"),LevelSwitch=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,r.init(),r}return inherits(e,t),e.prototype.init=function(){var t=this.player,e=t.options_.plugins.ContextMenu;e&&e.levelSwitch&&e.levelSwitch.open&&t.addChild("LevelSwitchTips",this.options)},e}(Plugin$12);videojs.registerPlugin("LevelSwitch",LevelSwitch);var Plugin$13=videojs.getPlugin("plugin"),log$12=videojs.log,defaults$3={width:0,height:0,basePath:""},VttThumbnail=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.hasInit=!1,n.vttUrl&&i.ready(videojs.bind(r,(function(){this.init(n)}))),r}return inherits(e,t),e.prototype.loadTrackFile=function(t){var e=this,i=this.player,n=i.addRemoteTextTrack({src:t.vttUrl,kind:"metadata"},!0);n&&n.addEventListener("load",(function(){e.trackInfo=n}))},e.prototype.init=function(t){if(!videojs.browser.IS_IOS&&!videojs.browser.IS_ANDROID&&this.player.controlBar&&this.player.controlBar.progressControl){if(log$12("VttThumbnail initializing",t),!this.player.controlBar)return void log$12("VttThumbnail can not initialize without control bar");this.options=t;var e=this.player,i=e.controlBar.progressControl;this.loadTrackFile(t),defaults$3.basePath=parseBasePath(t.vttUrl),this.initUI(),i.on("mouseenter",videojs.bind(this,this.onMouseEnter)),i.on("mousemove",videojs.bind(this,this.onMouseMove)),i.on("mouseleave",videojs.bind(this,this.onMouseOut)),this.hasInit=!0,log$12("VttThumbnail initialized"),e.trigger({type:"feature",data:"thumbnail"})}},e.prototype.initTrackFile=function(t){t.track,this.trackInfo=t},e.prototype.initUI=function(){var t=videojs.dom.createEl("div",{className:"tcp-vtt-thumbnail-container"}),e=videojs.dom.createEl("img",{className:"tcp-vtt-thumbnail-img"});t.appendChild(e),this.containerEl=t,this.imgEl=e,this.player.controlBar.progressControl.el().appendChild(t)},e.prototype.onMouseEnter=function(){this.containerEl.style.display="block"},e.prototype.onMouseMove=function(t){if(!this.trackInfo)return!1;var e=void 0,i=void 0,n=void 0,r=void 0,o=void 0,s=void 0,a=void 0,l=void 0,c=0,u=void 0,h=void 0,p=void 0,d=void 0;for(n=this.player.controlBar.progressControl,r=this.player.controlBar.progressControl.seekBar,o=offsetParent(n.el()).getBoundingClientRect(),s=offsetParent(r.el()).getBoundingClientRect(),e=t.clientX,l=this.player.duration(),a=((e-s.left)/r.width()*l).toFixed(3),u=this.trackInfo.track||this.trackInfo;c=a){p=parseImageLink(h.text);break}c++}if(!p)return this.onMouseOut(),!1;d=e-s.left+p.w/2-r.width(),d=Math.max(0,d),i=e-o.left-p.w/2-d,i=Math.max(r.el().offsetLeft,i),p.left=i,this.setView(p)},e.prototype.onMouseOut=function(){this.containerEl.style.display="none"},e.prototype.setView=function(t){var e=this.containerEl,i=this.imgEl,n=this.options;e.style.width==t.w&&e.style.height==t.h||(e.style.width=t.w+"px",e.style.height=t.h+"px"),e.style.left=t.left+"px",n.imgUrl&&i.src!=n.imgUrl?i.src=n.imgUrl:i.src=t.src,i.style.left=-t.x+"px",i.style.top=-t.y+"px",i.style.clip="rect("+t.y+"px,"+(t.w+t.x)+"px,"+(t.y+t.h)+"px,"+t.x+"px)"},e.prototype.reset=function(){if(this.hasInit){log$12("VttThumbnail reset");var t=this.player,e=t.controlBar.progressControl;e.off("mousemove",videojs.bind(this,this.onMouseMove)),e.off("mouseleave",videojs.bind(this,this.onMouseOut)),this.hasInit=!1}},e}(Plugin$13),getComputedStyle=function(t,e){return function(i){return window.getComputedStyle?window.getComputedStyle(t,e)[i]:t.currentStyle[i]}},offsetParent=function t(e){return"HTML"!==e.nodeName&&"static"===getComputedStyle(e)("position")?t(e.offsetParent):e},parseImageLink=function(t){var e=void 0,i=void 0,n=void 0;if(-1===(i=t.indexOf("#")))return{src:t,w:0,h:0,x:0,y:0};if(e=t.substring(0,i),/^(http:|https:|\/\/)/.test(e)||(e=defaults$3.basePath+e),n=t.substring(i+1),"xywh="!==n.substring(0,5))return{src:e,w:0,h:0,x:0,y:0};var r=n.substring(5).split(",");return{src:e,w:parseInt(r[2]),h:parseInt(r[3]),x:parseInt(r[0]),y:parseInt(r[1])}},parseBasePath=function(t){/^(\/\/)/.test(t)&&(t="https:"+t);var e=/(\w+):\/\/([^\:|\/]+)(\:\d*)?(.*\/)([^#|\?|\n]+)?(#.*)?(\?.*)?/i,i=t.match(e);if(i&&i[2]&&i[4])return"//"+i[2]+i[4]};videojs.registerPlugin("VttThumbnail",VttThumbnail);var Plugin$14=videojs.getPlugin("plugin"),log$13=videojs.log,PlayerMetrics=function(t){function e(i,n){classCallCheck(this,e),log$13("PlayerMetrics initializing");var r,o=possibleConstructorReturn(this,t.call(this,i));return!1===i.options_.reportable?(r=!1,possibleConstructorReturn(o,r)):(o.player=i,o.checkPrevData(),o.initData(),o.registerListener(),log$13("PlayerMetrics initialized"),o)}return inherits(e,t),e.prototype.checkPrevData=function(){var t=localStorage.getItem("tcplayer_data");if(t){var e=JSON.parse(t);Reporter.reportPlayMetrics(e,(function(){localStorage.removeItem("tcplayer_data")}))}},e.prototype.initData=function(){this.bytes_token=guid(),this.vodBaseData={uint32_service:2,uint32_platform:3,bytes_version:String(version),uint64_appid:0,bytes_bizid:this.guid("dev_uuid"),bytes_stream_id:"",uint32_module_id:1011,uint32_data_type:1,uint32_command:40303,uint64_data_time:0,bytes_token:this.bytes_token,token:this.bytes_token,dev_uuid:this.guid("dev_uuid"),str_app_name:"",str_app_version:"",str_stream_url:"",str_brand_type:this.getDevice(),str_device_resolution:screen.width+"_"+screen.height,str_device_type:"",str_package_name:"",str_sdk_name:"TCPlayer",str_user_id:this.guid("dev_uuid"),sys_type:this.getSystem(),sys_version:String(this.getSystemVer()),str_user_agent:USER_AGENT,str_browser_version:String(this.getBrowserVer()),str_browser_model:String(this.getBrowser()),u32_app_id:String(this.player.options_.appID),str_fileid:String(this.player.options_.fileID),u32_network_type:this.getNetworkType()},this.liveBaseData={str_user_id:this.guid("dev_uuid"),dev_uuid:this.guid("dev_uuid"),str_session_id:this.bytes_token,bytes_token:this.bytes_token,str_device_type:"",str_os_info:this.getSystem(),str_package_name:"",u32_network_type:"0xFF"!==this.getNetworkType()?this.getNetworkType():"",u32_server_ip:"",str_stream_url:this.player.cache_.src,u64_timestamp:this.player.startTime,u32_link_type:1,u32_channel_type:1,str_app_version:"",platform:3,uint32_platform:3,str_browser_version:this.getBrowserVer(),str_browser_model:this.getBrowser(),str_user_agent:USER_AGENT,u32_video_drop:"",u32_drop_usage:"",float64_rtt:""},this.features=[],this.afterCanplay=!1,this.videoDuration=0,this.consumeDuration=0,this.playScene=2,this.timing={},this.playStatus={isFirstPlay:!1,pauseDuration:0},this.contentComputTimePoint=[],this.firstFrameDuration=0,this.firstIFrameDuration=0,this.blockInterval=5e3,this.bufferBlock=[],this.u32_drm_type="plain",this.resetLagStatus(),this.resetBlockData()},e.prototype.getComsumeDuration=function(t){var e=getTimeStamp()-this.timing.firstPlaying;this.consumeDuration=e-this.lagStatus.lagDuration-this.playStatus.pauseDuration,t&&this.consumeDuration<0&&(this.consumeDuration=e>0?e:0)},e.prototype.registerListener=function(){var t=this.player;t.on("loadedmetadata",videojs.bind(this,this.onLoadedmetadata)),t.one("canplay",videojs.bind(this,this.oneCanplay)),t.one("play",videojs.bind(this,this.onePlay)),t.on("play",videojs.bind(this,this.onPlay)),t.on("playing",videojs.bind(this,this.onPlaying)),t.on("seeking",videojs.bind(this,this.onSeeking)),t.on("seeked",videojs.bind(this,this.onSeeked)),t.on("error",videojs.bind(this,this.onError)),t.on("resolutionswitching",videojs.bind(this,this.onResolutionSwitching)),t.on("pause",videojs.bind(this,this.onPause)),t.on("playcgiend",videojs.bind(this,this.onPlaycgiend)),t.on("ended",videojs.bind(this,this.onEnded)),t.on("feature",videojs.bind(this,this.onFeature)),t.on("dispose",videojs.bind(this,this.onDispose)),document.addEventListener("visibilitychange",videojs.bind(this,this.onVisibilityChange)),window.addEventListener("pagehide",videojs.bind(this,this.onPageHide))},e.prototype.onPageHide=function(){this.saveData()},e.prototype.onVisibilityChange=function(){"hidden"===document.visibilityState&&this.saveData()},e.prototype.saveData=function(){this.bytes_token&&3!==this.playScene&&this.player&&(this.getComsumeDuration(),this.report(2===this.playScene?40304:40102,{},(function(t){localStorage.setItem("tcplayer_data",JSON.stringify(t))})))},e.prototype.onLoadedmetadata=function(){this.player.tech_.webrtcProvider?this.playScene=3:this.playScene=this.player.duration()===1/0?1:2,this.videoDuration=parseInt(this.player.duration())||0,videojs.bind(this,this.calculateFirstFrameDuration)(),2===this.playScene&&this.report(40303)},e.prototype.oneCanplay=function(){videojs.bind(this,this.calculateFirstFrameDuration)(),1===this.playScene&&this.report(40101)},e.prototype.calculateFirstFrameDuration=function(){var t=getperformance();t.mark&&t.measure&&t.getEntriesByName&&(t.mark("firstIFrameEnd"),t.measure("firstIFrame","firstFrameStart","firstIFrameEnd"),this.firstIFrameDuration=t.getEntriesByName("firstIFrame")[0].duration)},e.prototype.onePlay=function(){var t=this;this.setTimingData({firstPlay:getTimeStamp()});var e=this.player.el_.firstChild;this.bufferStart=e&&e.buffered&&e.buffered.length>0?e.buffered.start(e.buffered.length-1):0,this.bufferBlock=[this.bufferStart];var i=this.player.getVideoPlaybackQuality();this.recvFrames=i.totalVideoFrames,this.renderedFrames=i.totalVideoFrames-i.droppedVideoFrames,this.blockStartTime=getTimeStamp(),this.blockTimer=setInterval((function(){if(2===t.playScene)return!1;if(t.lagStatus.lagging&&t.lagStatus.lagStart){var i=getTimeStamp()-t.lagStatus.lagStart;i>t.blockInterval?t.blockData.lagBlockDuration=t.blockInterval:t.blockData.lagBlockDuration+=i}t.blockStartTime=getTimeStamp();var n=e&&e.buffered&&e.buffered.length>0?e.buffered.end(e.buffered.length-1):0,r=t.player.getVideoPlaybackQuality(),o=r.totalVideoFrames,s=r.totalVideoFrames-r.droppedVideoFrames;Object.assign(t.blockData,{buffer_avg:parseInt(1e3*(n-t.bufferStart)),recv_frames:o-t.recvFrames,render_frames:s-t.renderedFrames}),t.bufferBlock.push(t.blockData.buffer_avg),t.bufferStart=n,t.recvFrames=o,t.renderedFrames=s,t.report(40100)}),this.blockInterval)},e.prototype.onDispose=function(){clearInterval(this.blockTimer)},e.prototype.onPlay=function(){this.playStatus.pauseTime&&(this.playStatus.pauseDuration=this.playStatus.pauseDuration+getTimeStamp()-this.playStatus.pauseTime,this.playStatus.pauseTime=0)},e.prototype.onPlaying=function(){var t=this;if(!this.playStatus.isFirstPlay&&(this.playStatus.isFirstPlay=!0,this.setTimingData({firstPlaying:getTimeStamp()}),this.player.on("waiting",(function(){t.lagStatus.lagging||t.player.seeking()||t.lagStatus.skip||(t.lagStatus.lagging=!0,t.lagStatus.lagStart=getTimeStamp())})),this.player.currentSource().keySystems)){var e=this.player.currentSource().keySystems;e.plain&&(this.u32_drm_type="plain"),e.SimpleAES&&(this.u32_drm_type="SimpleAES")}this.lagStatus.lagging&&(this.lagStatus.lagEnd=getTimeStamp())-this.lagStatus.lagStart>this.lagStatus.lagInterval&&(this.lagStatus.lagging=!1,this.lagStatus.lagCount++,this.lagStatus.lagAvg.push(this.lagStatus.lagEnd-this.lagStatus.lagStart),this.lagStatus.lagDuration+=this.lagStatus.lagEnd-this.lagStatus.lagStart,this.lagStatus.lagStart=this.blockStartTime&&(this.blockData.lagBlockDuration+=this.lagStatus.lagEnd-this.lagStatus.lagStart),this.lagStatus.lagEnd=this.lagStatus.lagStart=0,this.lagStatus.isFirstLag||(this.lagStatus.isFirstLag=!0,this.setTimingData({firstLag:getTimeStamp()}))),[60,200,500,1e3].forEach((function(e){t.lagStatus.lagging&&(t.lagStatus.lagEnd=getTimeStamp())-t.lagStatus.lagStart>e&&t.blockData["lagCount_"+e]++})),this.lagStatus.skip=!1},e.prototype.onSeeking=function(){this.contentComputTimePoint.push({type:"end",time:this.player.currentTime()})},e.prototype.onSeeked=function(){this.contentComputTimePoint.push({type:"start",time:this.player.currentTime()})},e.prototype.onError=function(t){this.getComsumeDuration(!0);var e={u64_err_code:t.data.code,str_err_info:t.data.message||(defaults$1.errors[t.data.code]||{}).message},i=(this.player.cache_.src||"").indexOf("vod")>-1||this.player.options_.fileID;t&&t.data&&t.data.code&&(2===this.playScene&&i?this.report(40304,e):this.afterCanplay?this.report(40102,e):this.report(40101,e))},e.prototype.onResolutionSwitching=function(){this.lagStatus.skip=!0},e.prototype.onPause=function(){this.playStatus.pauseTime=getTimeStamp(),this.lagStatus.lagging&&(this.lagStatus.skip=!0)},e.prototype.onPlaycgiend=function(t){var e=this,i=t.data;i.result&&0==i.result.code&&(this.playStatus.requestID=i.result.requestId,setTimeout((function(){if(e.player.currentSources().length>0&&e.player.currentSources()[0].keySystems){var t=e.player.currentSources()[0].keySystems;t["com.widevine.alpha"]&&e.reportMTA("drm",{initialized:"Widevine"}),t["com.apple.fps.1_0"]&&e.reportMTA("drm",{initialized:"FairPlay"})}else e.player.options_.plugins.DRM&&e.player.options_.plugins.DRM.token&&e.reportMTA("drm",{initialized:"SimpleAES"})}),0)),this.setTimingData({cgiStart:t.data.startTime,cgiEnd:t.data.time})},e.prototype.onEnded=function(){this.getComsumeDuration(),1===this.playScene?this.report(40102):this.report(40304)},e.prototype.onFeature=function(t){-1==this.features.indexOf(t.data)&&this.features.push(t.data)},e.prototype.guid=function(t){var e=localStorage.getItem(t);return e||(e=guid(),localStorage.setItem(t,e)),e},e.prototype.report=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments[2];if(3===this.playScene)return!1;t&&this["report_"+t](e,i)},e.prototype.report_40101=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.player)return!1;var e={uint64_data_time:getTimeStampBySecond(),str_stream_url:this.player.cache_.src,u64_timestamp:this.player.startTime,u32_dns_time:"",u32_connect_server_time:parseInt(this.firstFrameDuration),u32_video_decode_type:0,u32_first_frame_down:parseInt(this.firstFrameDuration),u32_first_video_decode_time:parseInt(this.firstIFrameDuration),u32_first_i_frame:parseInt(this.firstIFrameDuration),u32_first_audio_frame_down:parseInt(this.firstFrameDuration),u32_first_audio_render_time:parseInt(this.firstIFrameDuration),u64_err_code:t.u64_err_code||"",str_err_info:t.str_err_info||""},i={app_id:0,data:[Object.assign({},this.liveBaseData,e,t)],module_id:1005,command:40101};Reporter.reportPlayMetrics(i)},e.prototype.report_40100=function(t){var e=this,i=this.player||{};this.blockData=this.blockData||{};var n={u32_cpu_usage:"",u32_app_cpu_usage:"",u32_avg_memory:"",u32_avg_cpu_usage:"",str_stream_url:i.cache_&&i.cache_.src,uint64_data_time:getTimeStampBySecond(),u32_recv_av_diff_time:0,u32_play_av_diff_time:0,u64_playtime:getTimeStamp()-this.timing.firstPlaying,u32_audio_decode_type:2,u32_audio_block_count:this.blockData.lagCount_500,u32_audio_cache_time:this.blockData.buffer_avg,u32_audio_drop:"",u32_video_decode_type:0,u32_video_recv_fps:this.blockData.recv_frames,u32_fps:this.blockData.render_frames,u32_video_cache_time:this.blockData.buffer_avg,u32_avg_cache_count:0,u32_video_block_count:this.blockData.lagCount_1000,u32_avg_net_speed:"",u32_video_light_block_count:this.blockData.lagCount_200,u32_video_large_block_count:this.blockData.lagCount_500,u32_audio_jitter_60ms_count:this.blockData.lagCount_60,u32_video_decode_fail:"",u32_audio_decode_fail:"",u32_avg_video_bitrate:0,u32_avg_audio_bitrate:0,u32_block_usage:1e3*parseInt(this.blockData.lagBlockDuration/this.blockInterval)},r={app_id:0,data:[Object.assign({},this.liveBaseData,n,t)],module_id:1005,command:40100};Reporter.reportPlayMetrics(r,(function(){e.resetBlockData()}))},e.prototype.report_40102=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.player||{},r=0,o=0,s=0;"{}"!==JSON.stringify(n)?(r=this.lagStatus.lagAvg.length>0?this.lagStatus.lagAvg.reduce((function(t,e){return t+e}),0)/this.lagStatus.lagAvg.length:0,o=this.bufferBlock.length>0?this.bufferBlock.reduce((function(t,e){return t+e}),0)/this.bufferBlock.length:0,s=(n.getVideoPlaybackQuality&&n.getVideoPlaybackQuality()||{}).totalVideoFrames/e.duration):this.resetLagStatus();var a={uint64_data_time:getTimeStampBySecond(),str_stream_url:n.cache_&&n.cache_.src,u64_timestamp:getTimeStamp(),u32_avg_cpu_usage:"",u32_avg_memory:"",u64_begin_timestamp:n.startTime,u32_result:this.consumeDuration,u64_err_code:e.u64_err_code,u32_speed_cnt:0,u32_avg_cache_time:o,u32_max_load:Math.max.apply(Math,this.lagStatus.lagAvg),u32_audio_block_time:this.lagStatus.lagDuration,u32_avg_load:r,u32_load_cnt:this.lagStatus.lagAvg.length||0,u32_nodata_cnt:this.lagStatus.lagAvg.length||0,u32_first_i_frame:this.firstIFrameDuration,u32_video_width:n.width_,u32_video_height:n.height_,u32_video_avg_fps:s,u32_avg_block_time:r,u64_block_count:this.lagStatus.lagAvg.length||0,u32_video_block_time:this.lagStatus.lagDuration,u64_jitter_cache_max:0,u64_block_duration_max:Math.max.apply(Math,this.lagStatus.lagAvg),u64_jitter_cache_avg:0,u32_ip_count_quic:"",u32_connect_count_quic:"",u32_connect_count_tcp:"",u32_is_real_time:"",u32_first_frame_black:"",u32_delay_report:0},l={app_id:0,data:[Object.assign({},this.liveBaseData,a,e)],module_id:1005,command:40102};return e.u32_delay_report?(localStorage.setItem("tcplayer_data",JSON.stringify(l)),!1):i?(l.data.u32_delay_report=1,i(l)):void Reporter.reportPlayMetrics(l,(function(){t.bytes_token=null,localStorage.removeItem("tcplayer_data")}))},e.prototype.report_40303=function(){this.setTimingData({initEnd:getTimeStamp()});var t={msg_client_ip:{uint32_ip:""},uint32_service:this.playScene,uint64_data_time:getTimeStampBySecond(),str_stream_url:this.player.cache_.src,uint32_command:40303},e={app_id:0,data:[Object.assign({},this.vodBaseData,t)],module_id:1011,command:40303};Reporter.reportPlayMetrics(e)},e.prototype.report_40304=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.lagStatus.lagAvg.length>0?this.lagStatus.lagAvg.reduce((function(t,e){return t+e}),0)/this.lagStatus.lagAvg.length:0,r={uint64_data_time:getTimeStampBySecond(),uint32_command:40304,str_stream_url:this.player.cache_.src,u32_timeuse:String(parseInt(this.consumeDuration/1e3)||0),u32_videotime:String(this.videoDuration),u32_avg_load:String(n),u32_load_cnt:String(this.lagStatus.lagCount),u32_max_load:this.lagStatus.lagAvg.length>0?String(Math.max.apply(Math,this.lagStatus.lagAvg)):String(0),u32_avg_block_time:String(this.lagStatus.lagDuration),u32_player_type:String(4),u32_dns_time:"",u32_tcp_did_connect:"",u32_first_video_packet:String(parseInt(this.firstFrameDuration)),u32_first_i_frame:String(parseInt(this.firstIFrameDuration)),u32_server_ip:"",u32_drm_type:this.u32_drm_type,u32_playmode:String(1),u64_err_code:String(e.u64_err_code||""),str_err_info:String(e.str_err_info||""),u32_video_decode_type:String(0),u32_speed:this.player&&String(100*this.player.playbackRate())||"1000"},o={app_id:0,data:[Object.assign({},this.vodBaseData,r)],module_id:1011,command:40304};if(i)return i(o);Reporter.reportPlayMetrics(o,(function(){t.bytes_token=null,localStorage.removeItem("tcplayer_data")}))},e.prototype.setTimingData=function(t){this.timing=videojs.mergeOptions(this.timing,t)},e.prototype.reset=function(){this.playStatus={isFirstPlay:!1}},e.prototype.resetLagStatus=function(){this.lagStatus={lagCount:0,lagging:!1,lagStart:0,lagEnd:0,lagInterval:500,lagDuration:0,lagAvg:[],isFirstLag:!1,skip:!1}},e.prototype.resetBlockData=function(){this.blockData={lagCount_60:0,lagCount_200:0,lagCount_500:0,lagCount_1000:0,lagBlockDuration:0,buffer_avg:0,recv_frames:0,render_frames:0}},e.prototype.reportMTA=function(t,e){},e.prototype.getSystem=function(){return IS_IOS?"ios":IS_ANDROID?"android":IS_WIN?"win":IS_MAC?"mac":"other"},e.prototype.getSystemVer=function(){var t=this.getSystem();return"ios"==t?IOS_VERSION:"android"==t?ANDROID_VERSION:"win"==t?WIN_VER:"mac"==t?MAC_VER:void 0},e.prototype.getBrowser=function(){return IS_FIREFOX?"firefox":IS_EDGE?"edge":IS_MQQB?"mqq":IS_QQB?"qq":IS_TBS?"tbs":IS_CHROME?"chrome":IE_VERSION?"ie":IS_SAFARI?"safari":"other"},e.prototype.getBrowserVer=function(){var t=this.getBrowser();return"firefox"==t?FIREFOX_VER:"edge"==t?EDGE_VER:"chrome"==t?CHROME_VER:"ie"==t?IE_VERSION:"safari"==t?SAFARI_VER:"qq"==t||"mqq"==t?QQ_VER:"tbs"==t?TBS_VERSION:"other"},e.prototype.getDevice=function(){return IS_IOS?"IPHONE":IS_HUAWEI?"HUAWEI":IS_XIAOMI?"XIAOMI":IS_OPPO?"OPPO":IS_VIVO?"VIVO":IS_SX?"SUMSUNG":IS_CP?"COOLPAD":IS_ONE?"ONEPLUS":IS_ZX?"ZTE":"OTHER"},e.prototype.getMediaType=function(){return this.player.src()&&/\/(.+)\.(.+)\?|\/(.+)\.(.+)/.test(this.player.src()),RegExp.$2||RegExp.$4},e.prototype.getNetworkType=function(){var t,e=navigator.userAgent,i=e.match(/NetType\/\w+/)?e.match(/NetType\/\w+/)[0]:"NetType/other";switch(i=i.toLowerCase().replace("nettype/",""),i){case"wifi":t="1";break;case"4g":t="2";break;case"3g":case"3gnet":t="3";break;case"2g":t="4";break;default:t="0xFF"}return t},e}(Plugin$14);videojs.registerPlugin("PlayerMetrics",PlayerMetrics);var Plugin$15=videojs.getPlugin("plugin"),log$14=videojs.log,ProgressMarker=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return i.ready(videojs.bind(r,r.init)),r}return inherits(e,t),e.prototype.init=function(){function t(){Array.isArray(e.options_.dots)&&e.options_.dots.length>0&&(e.options_.dots.forEach((function(t){!t.emitted&&t.timeOffset-1e3*(e.currentTime()||0)<500&&(t.emitted=!0,e.trigger("marker",t.content))})),e.options_.dots[e.options_.dots.length-1].emitted||window.requestAnimationFrame(t))}var e=this.player;if(e.options_.dots){if(window.requestAnimationFrame(t),IS_IOS||IS_ANDROID)return!1;if(!e.controlBar||!this.player.controlBar.progressControl)return void log$14("ProgressMarker can not initialize without control bar or progress control");log$14("ProgressMarker initializing");var i=e.controlBar.getChild("ProgressControl").getChild("SeekBar");i.getChild("ProgressMarkerGenerator")&&i.removeChild("ProgressMarkerGenerator"),e.options_.plugins.ProgressMarker&&(i.addChild("ProgressMarkerGenerator"),log$14("ProgressMarker initialized"),e.trigger({type:"feature",data:"marker"}))}},e}(Plugin$15);videojs.registerPlugin("ProgressMarker",ProgressMarker);var Component$15=videojs.getComponent("Component"),PlayListItem=function(t){function e(i,n){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,i,n))}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_,e=videojs.dom.createEl("div",{className:"tcp-playlist-item"}),i=videojs.dom.createEl("div",{className:"tcp-playlist-item-video",innerHTML:t.img?'':''}),n=videojs.dom.createEl("div",{className:"tcp-playlist-item-duration",textContent:this.timeFormat(t.duration)});i.appendChild(n);var r=videojs.dom.createEl("div",{className:"tcp-playlist-item-desc",textContent:t.text});return e.appendChild(i),e.appendChild(r),this.bindEvent(e),e},e.prototype.bindEvent=function(t){var e=this;videojs.on(t,["click"],(function(){e.player_.trigger({type:"playItem",data:e.options_})}))},e.prototype.timeFormat=function(t){var e="",i=Math.floor(t/3600);0!=i&&(t-=3600*i,i<10&&(i="0"+i),e+=i+":");var n=Math.floor(t/60);return n<10&&(n="0"+n),t-=60*n,t<10&&(t="0"+t),e+(n+":")+t},e}(Component$15);videojs.registerComponent("PlayListItem",PlayListItem);var Component$16=videojs.getComponent("Component"),PlayListTitle=function(t){function e(i,n){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,i,n))}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_;return videojs.dom.createEl("div",{className:"tcp-playlist-title",textContent:t.title})},e}(Component$16);videojs.registerComponent("PlayListTitle",PlayListTitle);var Component$14=videojs.getComponent("Component"),PlayListBox=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.init(),r.activeIndex=-1,r}return inherits(e,t),e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-playlist-box"})},e.prototype.init=function(){var t=this,e=this.options_.data;this.addChild("PlayListTitle",{title:this.options_.title}),e.forEach((function(e,i){e.index=i,t.addChild("PlayListItem",e)})),this.player_.on("ready",(function(){t.options_.loop&&(t.activeIndex=0,t.player_.on("ended",videojs.bind(t,(function(){t.player_.trigger({type:"playItem"})}))))})),this.player_.on("playItem",(function(i){var n=i.data,r=void 0;t.activeIndex=n?n.index:(t.activeIndex+1)%e.length,r=e[t.activeIndex],t.player_.loadVideoByID({fileID:r.fileID,appID:r.appID,psign:r.psign}),t.player_.one("loadedmetadata",videojs.bind(t,(function(){t.player_.play()}))),document.querySelectorAll(".tcp-playlist-item").forEach((function(t){videojs.dom.removeClass(t,"tcp-playlist-item-active")}));var o=document.querySelectorAll(".tcp-playlist-item")[t.activeIndex];videojs.dom.addClass(o,"tcp-playlist-item-active")}))},e}(Component$14);videojs.registerComponent("PlayListBox",PlayListBox);var Component$17=videojs.getComponent("Component"),PlayListToggle=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.status=0,r}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-playlist-toggle",textContent:"<"});return this.bindEvent(t),t},e.prototype.bindEvent=function(t){var e=this;videojs.on(t,["click"],(function(i){e.status=!e.status;var n=document.querySelector(".tcp-playlist");e.status?(t.textContent=">",videojs.dom.addClass(n,"tcp-playlist-open"),videojs.dom.removeClass(n,"tcp-playlist-close")):(videojs.dom.addClass(n,"tcp-playlist-close"),videojs.dom.removeClass(n,"tcp-playlist-open"),t.textContent="<")}))},e}(Component$17);videojs.registerComponent("PlayListToggle",PlayListToggle);var Component$13=videojs.getComponent("Component"),PlayList$1=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.init(),r}return inherits(e,t),e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-playlist tcp-playlist-close"})},e.prototype.init=function(){this.addChild("PlayListToggle"),this.addChild("PlayListBox",this.options_)},e}(Component$13);videojs.registerComponent("PlayList",PlayList$1);var Button$5=videojs.getComponent("Button"),PlayNextButton=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i,n));return r.addClass(),r}return inherits(e,t),e.prototype.addClass=function(){videojs.dom.addClass(this.el_,"vjs-play-next")},e.prototype.update=function(){},e.prototype.handleClick=function(t){this.player_.trigger({type:"playItem"})},e}(Button$5);PlayNextButton.prototype.controlText_="Play Next",videojs.registerComponent("PlayNextButton",PlayNextButton);var Plugin$16=videojs.getPlugin("plugin"),log$15=videojs.log,PlayList=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return IS_IOS||IS_ANDROID?possibleConstructorReturn(r):(r.options=n,n&&n.data instanceof Array&&n.data.length>0&&i.ready(videojs.bind(r,r.init)),r)}return inherits(e,t),e.prototype.init=function(){log$15("PlayList initializing"),this.player.addChild("PlayList",this.options),this.player.controlBar.addChild("PlayNextButton",{},1),log$15("PlayList initialized"),this.player.trigger({type:"feature",data:"playlist"})},e}(Plugin$16);videojs.registerPlugin("PlayList",PlayList);var Plugin$17=videojs.getPlugin("plugin"),log$16=videojs.log,HLSToken=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return log$16("HLSToken",i,n),r.init(n),r}return inherits(e,t),e.prototype.init=function(t){log$16("HLSToken init",t,this.player);var e=this.player;t.token&&(this.options=t,e.on("playcgiend",videojs.bind(this,(function(t){this.modifyData(t.data)}))))},e.prototype.modifyData=function(t){var e=this;if(log$16("HLSToken modifyData",t),0===t.result.code){var i=t.result.videoInfo;if(i.masterPlayList){var n=i.masterPlayList.url.split("/");n[n.length-1]="voddrm.token."+this.options.token+"."+n[n.length-1],i.masterPlayList.url=n.join("/")}i.transcodeList&&i.transcodeList.length>0&&(i.transcodeList=i.transcodeList.map((function(t){var i=t.url.split("/");return i[i.length-1]="voddrm.token."+e.options.token+"."+i[i.length-1],t.url=i.join("/"),t})))}},e}(Plugin$17);videojs.registerPlugin("HLSToken",HLSToken);var getMessageContents=function(t){var e=(new window_1.DOMParser).parseFromString(String.fromCharCode.apply(null,new Uint16Array(t)),"application/xml"),i=e.getElementsByTagName("HttpHeaders")[0],n={};if(i)for(var r=i.getElementsByTagName("name"),o=i.getElementsByTagName("value"),s=0;s-1)return Promise.resolve();var r=t.initData;return getSupportedKeySystem(e.keySystems).then((function(o){var s=o.keySystem;if(e.keySystems[s]&&e.keySystems[s].pssh&&(r=e.keySystems[s].pssh),!hasSession(i,r)&&r)return i.push({initData:r}),standard5July2016({video:t.target,initDataType:t.initDataType,initData:r,options:e,removeSession:removeSession.bind(null,i),eventBus:n})}))},handleWebKitNeedKeyEvent=function(t,e,i){if(e.keySystems&&e.keySystems[FAIRPLAY_KEY_SYSTEM]&&t.initData)return fairplay({video:t.target,initData:t.initData,options:e,eventBus:i})},handleMsNeedKeyEvent=function(t,e,i,n){if(e.keySystems&&e.keySystems[PLAYREADY_KEY_SYSTEM]&&!i.reduce((function(t,e){return t||e.playready}),!1)){var r=t.initData;e.keySystems[PLAYREADY_KEY_SYSTEM]&&e.keySystems[PLAYREADY_KEY_SYSTEM].pssh&&(r=e.keySystems[PLAYREADY_KEY_SYSTEM].pssh),r&&(i.push({playready:!0,initData:r}),msPrefixed({video:t.target,initData:r,options:e,eventBus:n}))}},getOptions=function(t){return videojs.mergeOptions(t.currentSource(),t.eme.options)},setupSessions=function(t){var e=t.src();e!==t.eme.activeSrc&&(t.eme.activeSrc=e,t.eme.sessions=[])},onPlayerReady=function(t){"video"===t.$(".vjs-tech").tagName.toLowerCase()&&t.tech_&&(setupSessions(t),t.tech_.el_.addEventListener("encrypted",(function(e){if(t.currentSource().keySystems&&t.currentSource().keySystems["com.widevine.alpha"]&&"application/dash+xml"===t.currentSource().type)return!1;setupSessions(t),handleEncryptedEvent(e,getOptions(t),t.eme.sessions,t.tech_)})),t.tech_.el_.addEventListener("webkitneedkey",(function(e){setupSessions(t),handleWebKitNeedKeyEvent(e,getOptions(t),t.tech_)})),videojs.browser.IS_EDGE||t.tech_.el_.addEventListener("msneedkey",(function(e){setupSessions(t),handleMsNeedKeyEvent(e,getOptions(t),t.eme.sessions,t.tech_)})))},DRM=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,i.ready((function(){return onPlayerReady(i)})),i.eme={initializeMediaKeys:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=videojs.mergeOptions(i.currentSource(),n,t),o={initDataType:"cenc",initData:null,target:i.tech_.el_};setupSessions(i),i.tech_.el_.setMediaKeys?handleEncryptedEvent(o,r,i.eme.sessions,i.tech_).then((function(){return e()}))["catch"]((function(t){return e(t)})):i.tech_.el_.msSetMediaKeys&&(handleMsNeedKeyEvent(o,r,i.eme.sessions,i.tech_),e())},options:n},r}return inherits(e,t),e.prototype.setOptions=function(t){this.options=t,this.player.options_.plugins.DRM=t},e}(Plugin$18),registerPlugin$2=videojs.registerPlugin||videojs.plugin;registerPlugin$2("DRM",DRM);var Plugin$19=videojs.getPlugin("plugin"),dom$2=videojs.dom;if(!window.requestAnimationFrame){var lastTime=0;window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16.7-(e-lastTime)),n=window.setTimeout((function(){t(e+i)}),i);return lastTime=e+i,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)});var DynamicWatermark=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n||{},r.options.content&&r.init(),r}return inherits(e,t),e.prototype.dispose=function(){this.stopAnimation(),this.player.$(".tcp-dynamic-watermark-container")&&this.player.el().removeChild(this.containerElement),t.prototype.dispose.call(this)},e.prototype.init=function(){var t=this,e=this.player;this.isFirstShow=!0,this.initUI(),this.initStyle(),this.initSpeed(),e.on("loadedmetadata",(function(){t.calculateStyle(),t.setStyle(),dom$2.removeClass(t.containerElement,"vjs-hidden")})),e.one("play",(function(){t.encModule=new Enc,t.ghostCycle=t.encModule.calculateGhost(t.player.duration()),t.startAnimation()})),e.on(["fullscreenchange","playerresize"],(function(){setTimeout((function(){t.calculateStyle()}),200)}))},e.prototype.initUI=function(){var t=this.player,e=dom$2.createEl("div",{className:"tcp-dynamic-watermark-container vjs-hidden"}),i=dom$2.createEl("div",{innerHTML:encodeHTML(this.options.content),className:"tcp-dynamic-watermark-content"});if(e.appendChild(i),this.options.keep||t.el().appendChild(e),this.containerElement=e,this.markContentElement=i,"image"===this.options.type){var n=document.createElement("img");this.options.width&&(n.style.width=this.options.width),this.options.height&&(n.style.height=this.options.height),n.setAttribute("src",this.options.content),this.markContentElement.innerHTML="",this.markContentElement.appendChild(n)}},e.prototype.initStyle=function(){this.style={containerWidth:"",containerHeight:"",containerLeft:"",containerTop:"",contentLeft:80*Math.random(),contentTop:80*Math.random(),margin:0,padding:0,display:"block",visibility:"visible",opacity:.5,position:"absolute",color:"rgba(255, 255, 255)"}},e.prototype.initSpeed=function(){this.speed=this.options.keep&&0===this.options.speed?.2:this.options.speed},e.prototype.calculateStyle=function(){var t=this.player,e=this.style,i=t.videoWidth(),n=t.videoHeight(),r=dom$2.getBoundingClientRect(t.el()),o=r.width,s=r.height,a=(o/s).toFixed(2),l=(i/n).toFixed(2),c=void 0,u=void 0;la?(c=o,u=c/l):l==a&&(c=o,u=s),e.containerLeft=(o-c)/2/o*100,e.containerTop=(s-u)/2/s*100,e.containerWidth=c/o*100,e.containerHeight=u/s*100},e.prototype.setStyle=function(){var t=this.containerElement,e=this.markContentElement,i=this.style;t.style.left=i.containerLeft+"%",t.style.top=i.containerTop+"%",t.style.width=i.containerWidth+"%",t.style.height=i.containerHeight+"%",t.style.display=e.style.display=i.display,t.style.visibility=e.style.visibility=i.visibility,t.style.opacity=e.style.opacity=i.opacity,t.style.position=e.style.position=i.position,t.style.margin=e.style.margin=i.margin,t.style.padding=e.style.padding=i.padding,e.style.left=this.options.left||i.contentLeft+"%",e.style.top=this.options.top||i.contentTop+"%",this.options.right&&(e.style.right=this.options.right),this.options.bottom&&(e.style.bottom=this.options.bottom),e.style.color=this.options.color||i.color,this.options.keep||(t.style.opacity=e.style.opacity=this.options.opacity||i.opacity),"text"===this.options.type&&(e.style.fontSize=this.options.fontSize||"12px",e.innerHTML=encodeHTML(this.options.content))},e.prototype.setContent=function(t){this.options.content=t},e.prototype.startAnimation=function(){var t=this;if(!this.rafID){var e=this.player,i=this.style,n=this.containerElement,r=this.markContentElement,o=1,s=1,a=Math.random(),l=function l(){try{if(!t.isPauseAnimation){var c=Math.min(1,0===t.speed?0:t.speed?t.speed:.2),u=dom$2.getBoundingClientRect(n),h=dom$2.getBoundingClientRect(r),p=h.left-u.left,d=h.top-u.top;p+=c*o*a,d+=c*s*(1-a),p+h.width>u.width?(o=-1,a=Math.random()):p<0&&(o=1,a=Math.random()),d+h.height>u.height?(s=-1,a=Math.random()):d<0&&(s=1,a=Math.random()),p=Math.min(u.width-h.width,p),d=Math.min(u.height-h.height,d),i.contentLeft=p/u.width*100,i.contentTop=d/u.height*100,t.setStyle(),t.options.keep&&(t.waterMarkWillRemove||(t.waterMarkWillRemove=!0,setTimeout((function(){e.el()&&e.el().removeChild(n),t.waterMarkWillRemove=!1}),1e3*t.ghostCycle.ghostOn)))}}catch(f){t.player&&t.encModule.handleWatermarkElementAdd(t)}if(t.isStopAnimation)return t.isStopAnimation=!1,cancelAnimationFrame(t.rafID),void(t.rafID=null);0!==t.speed&&requestAnimationFrame(l)};this.rafID=requestAnimationFrame(l)}},e.prototype.resumeAnimation=function(){this.isPauseAnimation=!1},e.prototype.pauseAnimation=function(){this.isPauseAnimation=!0},e.prototype.stopAnimation=function(){this.isStopAnimation=!0},e}(Plugin$19);videojs.registerPlugin("DynamicWatermark",DynamicWatermark);var Plugin$20=videojs.getPlugin("plugin"),XP2PHlsjsPlugin=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,r.hlsp2p=null,r}return inherits(e,t),e.prototype.startHLSP2P=function(t,e,i){var n=this,r=this.player.tech_,o=r.options_,s=o.xp2pConfig;if(e.isSupported()&&!window.hlsp2p){var a=["videoType","xp2pPackage","xp2pAppId","tencentCloudAppId"],l=a,c=Array.isArray(l),u=0;for(l=c?l:l[Symbol.iterator]();;){var h;if(c){if(u>=l.length)break;h=l[u++]}else{if(u=l.next(),u.done)break;h=u.value}var p=h;if(void 0===s[p])return}var d={videoId:o.playerId+"_html5_api",url:o.source.src,videoType:s.videoType,cloudAppId:s.tencentCloudAppId,domain:s.xp2pPackage,xp2pAppId:s.xp2pAppId,p2pStartDelay:1e3},f=HLSP2P.create(t,Object.assign(d,s));f.on(HLSP2P.Events.Rollback,(function(t){n.destroy(),i&&i(t)})),this.hlsp2p=f}},e.prototype.destroy=function(){this.hlsp2p&&(this.hlsp2p.destroy(),this.hlsp2p=null,window.hlsp2p=void 0)},e.prototype.dispose=function(){this.destroy()},e}(Plugin$20);videojs.registerPlugin("XP2PHlsjsPlugin",XP2PHlsjsPlugin);var Plugin$21=videojs.getPlugin("plugin"),XP2PFlvjsPlugin=function(t){function e(i,n){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,i));return r.options=n,r}return inherits(e,t),e.prototype.createLoader=function(t,e,i){var n=this.player.tech();return function(t){function r(e,i){classCallCheck(this,r);var n=possibleConstructorReturn(this,t.call(this));return n._qvbp2p=null,n._receivedLength=0,n._config=i,n}return inherits(r,t),r.isSupported=function(){return e&&e.isSupported()},r.prototype.destroy=function(){this._destroyQVBP2P(),t.prototype.destroy.call(this)},r.prototype.open=function(t){this._createQVBP2P(),this._qvbp2p.on(e.ComEvents.STATE_CHANGE,this._onQVBP2PStateChange.bind(this)),this._qvbp2p.setMediaElement(n.el());var i={src:t.url};this._qvbp2p.loadSource(i)},r.prototype.abort=function(){this._destroyQVBP2P()},r.prototype._onQVBP2PStateChange=function(t,i){var n=e.ComCodes;switch(i.code){case n.RECEIVE_BUFFER:this._receiveBuffer(i.payload);break;case n.ROLLBACK:this._rollback(i)}},r.prototype._receiveBuffer=function(t){var e=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,e,this._receivedLength)},r.prototype._rollback=function(t){i&&i(t)},r.prototype._createQVBP2P=function(){this._qvbp2p&&this._destroyQVBP2P(),this._qvbp2p=e.create(this._config.xp2pConfig),window.qvbp2p=this._qvbp2p},r.prototype._destroyQVBP2P=function(){this._qvbp2p&&(this._qvbp2p.destroy(),this._qvbp2p=null,window.qvbp2p=null)},r}(t.BaseLoader)},e}(Plugin$21);videojs.registerPlugin("XP2PFlvjsPlugin",XP2PFlvjsPlugin);var defaultConfig$1={enableStashBuffer:!1},Html5FlvJS=function(){function t(e,i,n){var r=this;classCallCheck(this,t);var o=function(){var t=window.flvjs;r.flvjs=t;var o=videojs.mergeOptions(defaultConfig$1,n.flvConfig,{xp2pConfig:n.xp2pConfig}),s=i.player();if(window.QVBP2P&&n.xp2pConfig&&n.xp2pConfig.useXP2P&&s.XP2PFlvjsPlugin){var a=s.XP2PFlvjsPlugin().createLoader(t,window.QVBP2P,(function(t){r.dispose(),n.xp2pConfig.useXP2P=!1;var e=r.tech.player(),i=r.tech.currentSource_.src;e.src(i)}));r.xp2pFlvLoader=a,o.customLoader=a}var l=new t.createPlayer({isLive:!1,url:e.src,type:"flv"},o);for(var c in r.tech=i,l.on(t.Events.ERROR,videojs.bind(r,r.onError)),t.Events)!function(e){l.on(t.Events[e],videojs.bind(r,(function(t){this.onEvent(e,t)})))}(c);r.flv=l,r._id=(new Date).getTime(),i.el().srcObject&&(i.el().srcObject=null),l.attachMediaElement(i.el()),l.load()};Promise.all([function(){return n.xp2pConfig&&n.xp2pConfig.useXP2P&&"flv"===n.xp2pConfig.format&&!window.QVBP2P?new Promise((function(t){loadScript(XP2P_FLV_PATH,(function(){t()}))})):Promise.resolve()}(),function(){return window.flvjs?Promise.resolve():new Promise((function(t){loadScript(FLV_PATH,(function(){t()}))}))}()]).then((function(){o()}))}return t.prototype.onError=function(t,e,i){var n=this.tech.player();t===this.flvjs.ErrorTypes.NETWORK_ERROR&&n.error({code:2,source:i}),t===this.flvjs.ErrorTypes.MEDIA_ERROR&&n.error({code:3,source:i})},t.prototype.onEvent=function(t,e){this.tech.player().trigger({type:"FLVJS_EVENT",data:{type:t,data:e}})},t.prototype.dispose=function(){if(this.tech.player().pause(),this.tech.flvProvider)try{this.flv.destroy()}catch(t){}this.tech.flvProvider=null},t}(),flvTypeRE=/^video\/flv$/i,flvExtRE=/.flv(?![^?])/i,flvProtoRE=/^(ws:\/\/)/i,FlvSourceHandler={name:"flvSourceHandler",canHandleSource:function(t){return flvTypeRE.test(t.type)?"probably":flvExtRE.test(t.src)||flvProtoRE.test(t.src)?"maybe":""},handleSource:function(t,e,i){return e.flvProvider&&e.flvProvider.dispose(),e.flvProvider=new Html5FlvJS(t,e,i),e.flvProvider},canPlayType:function(t){if(flvTypeRE.test(t))return"probably"}};TCPlayer.mountFlvProvider=mountFlvProvider,mountFlvProvider();var defaultConfig$2={receiveVideo:!0,receiveAudio:!0,showLog:!1},WebRTCProvider=function(){function t(e,i,n){var r=this;classCallCheck(this,t);var o=function(){r.tech=i,r.player=r.tech.player(),r.playerMetrics=r.player.PlayerMetrics(),r.report=r.player.options_.reportable;var t=window.TXLivePlayer;r.TXLivePlayer=t;var o=videojs.mergeOptions(defaultConfig$2,n.webrtcConfig);n.xp2pConfig&&"webrtc"===n.xp2pConfig.format&&n.xp2pConfig.useXP2P&&Object.assign(o,{p2pEnable:n.xp2pConfig.useXP2P,p2pConfig:{cloudAppid:n.xp2pConfig.tencentCloudAppId,xp2pAppid:n.xp2pConfig.xp2pAppId,appKey:n.xp2pConfig.xp2pAppKey,xp2pDomain:n.xp2pConfig.xp2pPackage}});var s=new t;s.setPlayerView(i.el()),s.setConfig(o),s.setPlayListener({onPlayEvent:videojs.bind(r,r.onPlayEvent),onPlayStats:videojs.bind(r,r.onPlayStats),onPlayReport:videojs.bind(r,r.onPlayReport)}),s.startPlay(e.src),r.webrtcPlayer=s};window.TXLivePlayer?o():loadScript(WEBRTC_PATH,(function(){o()}))}return t.prototype.onPlayStats=function(t){this.tech.player().trigger({type:"webrtcstats",data:t})},t.prototype.onPlayEvent=function(t,e){var i=this.tech.player();if(t<-2e3){if(-2003===t&&e&&e.videoActive&&(i.trigger("blocked"),i.trigger({type:"webrtcevent",data:{code:2005}})),-2003===t)return!1;if(-2005===t||-2001===t||-2004===t){var n=i.options_.webrtcConfig;if(!n||!1!==n.fallback)return this.switchPlaySource(),!1}return i.error({code:t,source:e}),!1}i.trigger({type:"webrtcevent",data:{code:t,data:e}})},t.prototype.onPlayReport=function(t){if(!1===this.report)return!1;40101===t.uint32_command&&this.playerMetrics.report_40101(t),40100===t.uint32_command&&this.playerMetrics.report_40100(t),40102===t.uint32_command&&this.playerMetrics.report_40102(t)},t.prototype.dispose=function(){this.webrtcPlayer&&(this.webrtcPlayer.setPlayListener({onPlayEvent:function(){},onPlayStats:function(){}}),this.webrtcPlayer.stopPlay(),this.webrtcPlayer.setPlayerView(videojs.dom.createEl("video"))),this.webrtcPlayer=null},t.prototype.setSource=function(t){var e=this;this.webrtcPlayer.startPlay(t.src),this.tech.player().one("webrtcevent",(function(t){-1002===t.data.code&&e.tech.player().play()}))},t.prototype.recovery=function(){var t=this,e=this.tech.player(),i=void 0;e.one("waiting",(function(){i=setTimeout((function(){e.one("webrtcevent",(function(i){if(1004===i.data.code){t.webrtcPlayer&&t.webrtcPlayer.startPlay(e.src()),e.play();var n=function t(i){1002===i.data.code&&(e.play(),e.off("webrtcevent",t))};e.on("webrtcevent",n)}})),t.webrtcPlayer&&t.webrtcPlayer.stopPlay()}),2e3)})),e.one("playing",(function(){i&&clearTimeout(i)}))},t.prototype.switchPlaySource=function(){var t=this.tech.player(),e=this.tech.currentSource_.src,i=this.convertProtocol(e);t.bigPlayButton&&t.bigPlayButton.hide(),t.posterImage&&t.posterImage.hide(),t.src(i);var n=videojs.browser.IS_IOS||videojs.browser.IS_ANDROID?"loadeddata":"loadedmetadata",r=function e(){t.play(),t.one("progress",(function(){t.play(),t.off(n,e)}))};t.on(n,r)},t.prototype.convertProtocol=function(t){var e=[];if(t.indexOf(".sdp")>-1)t=t.replace(".sdp",".flv"),e.push(t.replace(".sdp",".m3u8"));else{var i=t.replace("webrtc://","https://").replace("?",".flv?");-1===i.indexOf("?")&&-1===i.indexOf(".flv")&&(i+=".flv"),hlsSrc=t.replace("webrtc://","https://").replace("?",".m3u8?"),-1===hlsSrc.indexOf("?")&&-1===hlsSrc.indexOf(".m3u8")&&(hlsSrc+=".m3u8"),e.push(hlsSrc)}return e},t}(),webrtcTypeRE=/^webrtc/i,webrtcExtRE=/\.sdp/i,webrtcProtoRE=/^(webrtc:\/\/)/i,sourceHandler={name:"webrtcSourceHandler",canHandleSource:function(t){return webrtcTypeRE.test(t.type)?"probably":webrtcExtRE.test(t.src)||webrtcProtoRE.test(t.src)?"maybe":""},handleSource:function(t,e,i){return e.webrtcProvider&&e.webrtcProvider.dispose(),e.webrtcProvider=new WebRTCProvider(t,e,i),e.webrtcProvider},canPlayType:function(t){if(webrtcTypeRE.test(t))return"probably"}};mountWebRTCProvider();for(var Tech$2=videojs.getComponent("Tech"),Dom$1=videojs.dom,Url$1=videojs.url,createTimeRange=videojs.createTimeRange,mergeOptions$1=videojs.mergeOptions,navigator$2=window_1&&window_1.navigator||{},Flash=function(t){function e(i,n,r){classCallCheck(this,e);var o=possibleConstructorReturn(this,t.call(this,i,n,r));return n.source&&o.ready((function(){this.setSource(n.source)}),!0),n.startTime&&o.ready((function(){this.load(),this.play(),this.currentTime(n.startTime)}),!0),window_1.videojs=window_1.videojs||{},window_1.videojs.Flash=window_1.videojs.Flash||{},window_1.videojs.Flash.onReady=e.onReady,window_1.videojs.Flash.onEvent=e.onEvent,window_1.videojs.Flash.onError=e.onError,o.on("seeked",(function(){this.lastSeekTarget_=void 0})),o}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_;t.swf||(t.swf=unifyProtocol("//imgcache.qq.com/open/qcloud/video/tcplayer/player.swf"));var i=t.techId,n=mergeOptions$1({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:t.autoplay,preload:t.preload,loop:t.loop,muted:t.muted},t.flashVars),r=mergeOptions$1({wmode:"opaque",bgcolor:"#000000"},t.params),o=mergeOptions$1({id:i,name:i,class:"vjs-tech"},t.attributes);return this.el_=e.embed(t.swf,n,r,o),this.el_.tech=this,this.el_},e.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},e.prototype.pause=function(){this.el_.vjs_pause()},e.prototype.src=function(t){return void 0===t?this.currentSrc():this.setSrc(t)},e.prototype.setSrc=function(t){var e=this;t=Url$1.getAbsoluteURL(t),this.el_.vjs_src(t),this.autoplay()&&this.setTimeout((function(){return e.play()}),0)},e.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},e.prototype.setCurrentTime=function(e){var i=this.seekable();i.length&&(e=e>i.start(0)?e:i.start(0),e=e=0?t:1/0},e.prototype.load=function(){this.el_.vjs_load()},e.prototype.poster=function(){this.el_.vjs_getProperty("poster")},e.prototype.setPoster=function(){},e.prototype.seekable=function(){var t=this.duration();return 0===t?createTimeRange():createTimeRange(0,t)},e.prototype.buffered=function(){var t=this.el_.vjs_getProperty("buffered");return 0===t.length?createTimeRange():createTimeRange(t[0][0],t[0][1])},e.prototype.supportsFullScreen=function(){return!1},e.prototype.enterFullScreen=function(){return!1},e.prototype.getVideoPlaybackQuality=function(){var t=this.el_.vjs_getProperty("getVideoPlaybackQuality");return window_1.performance&&"function"==typeof window_1.performance.now?t.creationTime=window_1.performance.now():window_1.performance&&window_1.performance.timing&&"number"==typeof window_1.performance.timing.navigationStart&&(t.creationTime=window_1.Date.now()-window_1.performance.timing.navigationStart),t},e}(Tech$2),_readWrite=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","loop","controls","volume","muted","defaultMuted"],_readOnly=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],_api=Flash.prototype,i$2=0;i$2<_readWrite.length;i$2++)_createGetter(_readWrite[i$2]),_createSetter(_readWrite[i$2]);for(var _i$1=0;_i$1<_readOnly.length;_i$1++)_createGetter(_readOnly[_i$1]);Flash.isSupported=function(){return Flash.version()[0]>=10},Tech$2.withSourceHandlers(Flash),Flash.nativeSourceHandler={},Flash.nativeSourceHandler.canPlayType=function(t){return t in Flash.formats?"maybe":""},Flash.nativeSourceHandler.canHandleSource=function(t,e){var i=void 0;return i=t.type?t.type.replace(/;.*/,"").toLowerCase():function(t){var e=Url$1.getFileExtension(t);return e?"video/"+e:""}(t.src),Flash.nativeSourceHandler.canPlayType(i)},Flash.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)},Flash.nativeSourceHandler.dispose=function(){},Flash.registerSourceHandler(Flash.nativeSourceHandler),Flash.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},Flash.onReady=function(t){var e=Dom$1.$("#"+t),i=e&&e.tech;i&&i.el()&&Flash.checkReady(i)},Flash.checkReady=function(t){t.el()&&(t.el().vjs_getProperty?t.triggerReady():this.setTimeout((function(){Flash.checkReady(t)}),50))},Flash.onEvent=function(t,e){var i=Dom$1.$("#"+t).tech,n=Array.prototype.slice.call(arguments,2);i.setTimeout((function(){i.trigger(e,n)}),1)},Flash.onError=function(t,e){var i=Dom$1.$("#"+t).tech;if("srcnotfound"===e)return i.error(4);i.error("FLASH: "+e)},Flash.version=function(){var t="0,0,0";try{t=new window_1.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(e){try{navigator$2.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(t=(navigator$2.plugins["Shockwave Flash 2.0"]||navigator$2.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return t.split(",")},Flash.embed=function(t,e,i,n){var r=Flash.getEmbedCode(t,e,i,n);return Dom$1.createEl("div",{innerHTML:r}).childNodes[0]},Flash.getEmbedCode=function(t,e,i,n){var r="",o="",s="";return e&&Object.getOwnPropertyNames(e).forEach((function(t){r+=t+"="+e[t]+"&"})),i=mergeOptions$1({movie:t,flashvars:r,allowScriptAccess:"always",allowNetworking:"all"},i),Object.getOwnPropertyNames(i).forEach((function(t){o+=''})),n=mergeOptions$1({data:t,width:"100%",height:"100%"},n),Object.getOwnPropertyNames(n).forEach((function(t){s+=t+'="'+n[t]+'" '})),'"},FlashRtmpDecorator(Flash),Tech$2.getTech("Flash")?(videojs.log.warn("Not using videojs-flash as it appears to already be registered"),videojs.log.warn("videojs-flash should only be used with video.js@6 and above")):videojs.registerTech("Flash",Flash);var FlashlsSourceHandler={},mpegurlRE$1=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;FlashlsSourceHandler.canPlayType=function(t){return mpegurlRE$1.test(t)?"maybe":""},FlashlsSourceHandler.canHandleSource=function(t,e){return"maybe"===FlashlsSourceHandler.canPlayType(t.type)},FlashlsSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)},FlashlsSourceHandler.dispose=function(){},videojs.getTech("Flash").registerSourceHandler(FlashlsSourceHandler,0),FlashlsSourceHandler.VERSION="__VERSION__";var Play="播放",Pause="暂停",LIVE="直播",Loaded="加载完毕",Progress="进度",Fullscreen="全屏",Mute="静音",Unmute="取消静音",Subtitles="字幕",Captions="内嵌字幕",Chapters="节目段落",Descriptions="描述",Close="关闭",Replay="重播",Text="文字",White="白",Black="黑",Red="红",Green="绿",Blue="蓝",Yellow="黄",Magenta="紫红",Cyan="青",Background="背景",Window="视窗",Transparent="透明",Opaque="不透明",None="无",Raised="浮雕",Depressed="压低",Uniform="均匀",Dropshadow="下阴影",Casual="舒适",Script="手写体",Reset="重启",Done="完成",auto="自动",Mirror="镜像",CN={Play:Play,Pause:Pause,LIVE:LIVE,Loaded:Loaded,Progress:Progress,Fullscreen:Fullscreen,Mute:Mute,Unmute:Unmute,Subtitles:Subtitles,Captions:Captions,Chapters:Chapters,Descriptions:Descriptions,Close:Close,Replay:Replay,Text:Text,White:White,Black:Black,Red:Red,Green:Green,Blue:Blue,Yellow:Yellow,Magenta:Magenta,Cyan:Cyan,Background:Background,Window:Window,Transparent:Transparent,Opaque:Opaque,None:None,Raised:Raised,Depressed:Depressed,Uniform:Uniform,Dropshadow:Dropshadow,Casual:Casual,Script:Script,Reset:Reset,Done:Done,auto:auto,Mirror:Mirror,"Current Time":"当前时间","Duration Time":"时长","Remaining Time":"剩余时间","Stream Type":"媒体流类型","Non-Fullscreen":"退出全屏","Playback Rate":"播放速度","subtitles off":"关闭字幕","captions off":"关闭内嵌字幕","Close Modal Dialog":"关闭弹窗","descriptions off":"关闭描述","Audio Track":"音轨","You aborted the media playback":"视频播放被终止","A network error caused the media download to fail part-way.":"网络错误导致视频下载中途失败。","The media could not be loaded, either because the server or network failed or because the format is not supported.":"视频因格式不支持或者服务器或网络的问题无法加载。","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。","No compatible source was found for this media.":"无法找到此视频兼容的源或者当前环境无法播放该视频。","The media is encrypted and we do not have the keys to decrypt it.":"视频已加密,无法解密。","Play Video":"播放视频","Modal Window":"弹窗","This is a modal window":"这是一个弹窗","This modal can be closed by pressing the Escape key or activating the close button.":"可以按ESC按键或启用关闭按钮来关闭此弹窗。",", opens captions settings dialog":", 开启标题设置弹窗",", opens subtitles settings dialog":", 开启字幕设置弹窗",", opens descriptions settings dialog":", 开启描述设置弹窗",", selected":", 选择","captions settings":"字幕设定","Audio Player":"音频播放器","Video Player":"视频播放器","Progress Bar":"进度小节","Volume Level":"音量","subtitles settings":"字幕设定","descriptions settings":"描述设定","Semi-Transparent":"半透明","Font Size":"字体尺寸","Text Edge Style":"字体边缘样式","Font Family":"字体库","Proportional Sans-Serif":"比例无细体","Monospace Sans-Serif":"单间隔无细体","Proportional Serif":"比例细体","Monospace Serif":"单间隔细体","Small Caps":"小型大写字体","restore all settings to the default values":"恢复全部设定至预设值","Caption Settings Dialog":"字幕设定视窗","Beginning of dialog window. Escape will cancel and close the window.":"开始对话视窗。离开会取消及关闭视窗","End of dialog window.":"结束对话视窗","Request timed out.":"请求超时,请稍后再试。","Could not download the video.":"无法加载视频,请检查网络。","Server is not respond.":"服务器请求失败,请稍后再试。","Server respond error data.":"服务器返回数据有误,请稍后再试。","Last time play at ":"上次看到 ","Resume play":"恢复播放","Powered by Tencent Cloud.":"腾讯云提供技术支持","Rise an internal exception when playing HLS.":"播放 HLS 时出现内部异常。","Authentication failed.":"防盗链参数鉴权失败。","Server failed.":"媒体服务器错误。","Get file error.":"媒体服务器获取文件错误。","The media file does not exist. Please check if the fileID is correct.":"媒体文件不存在,请检查 fileID 是否正确。","No video transcoding information found.":"没有找到视频转码信息。","Current browser not support DRM.":"浏览器不支持当前 DRM 方案。","The trial duration is illegal. The trial duration must be within the video duration.":"试看时长不合法,试看时长要在视频时长范围内。","Param pcfg is not unique.":"pcfg 不唯一。","The license has expired. Please check whether the expiration time setting is reasonable.":"license 过期,请检查过期时间设置是否合理。","Did not find an adaptive stream that can be played.":"没有找到可以播放的自适应码流,查看文档。","Invalid request format, please check the request format.":"请求格式不合法,请检查请求格式。","AppID is not exist, Please check if the AppID is correct.":"AppID 不存在,请检查 AppID 是否正确。","Without anti-leech information.":"没带防盗链检测。","qsign invalid.":"播放参数 qsign 校验失败","psign check failed.":"播放参数 psign 校验失败,查看文档。","Other errors.":"其他错误。","Internal error.":"内部错误。","Response data verification failed.":"响应数据校验失败","Video statistic":"视频统计信息","Play Next":"下一个","Current browser not support play this stream, please select another one.":"无法找到此视频兼容的源或者当前环境无法播放该视频,请选择其他视频播放。","Server respond error data.(eg. stream not exist)":"媒体服务器获取数据异常,可能该视频不存在,请选择其他视频播放。","Video play failed, please refresh to start play again.":"视频播放器失败,请刷新并重新播放。","Connection to the server has failed and the number of connection retries has exceeded the set value.":"媒体服务器连接异常,并达到最大重试次数,请检查网络是否正常并刷新重试","Video decoding failure.":"视频解码失败,请选择其他视频播放。"},log=videojs.log;if(Function.prototype.bind&&"object"==("undefined"==typeof console?"undefined":_typeof(console))&&"object"==_typeof(console.log))for(var logFns=["log","info","warn","error","assert","dir","clear","profile","profileEnd"],i=0;i