2 lines
149 KiB
Plaintext
2 lines
149 KiB
Plaintext
/*! For license information please see player-3.86c70346.js.LICENSE.txt */
|
||
"use strict";!function(e,t){"object"==typeof module&&"object"==typeof module.exports?t():"function"==typeof define&&define.amd?define([],t):(e="undefined"!=typeof globalThis?globalThis:e||self)&&t()}(this,function(){"use strict";"object"==typeof window&&(window.openRedirect={version:"1.2.20",webpackPluginVersion:"3.4.22",reportOnly:!1})}),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).xss={})}(this,function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function i(e,t,i){if(i||2==arguments.length)for(var r,n=0,a=t.length;n<a;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}var r=/[^a-zA-Z0-9\\_:.-]/gim,n=/</g,a=/>/g,s=/&#([a-zA-Z0-9]*);?/gim,o=/"/g,d=/:?/gim,c=/&newline;?/gim,u=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,l=/u\s*r\s*l\s*\(.*/gi,h=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,f=/"/g,p=function(e){return e.replace(n,"<").replace(a,">")},_={indexOf:function(e,t){var i,r;for(i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return -1},forEach:function(e,t,i){var r,n;for(r=0,n=e.length;r<n;r++)t.call(i,e[r],r,e)},some:function(e,t,i){var r,n;for(r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r,e))return!0;return!1},trim:function(e){return e.replace(/(^\s*)|(\s*$)/g,"")},includes:function(e,t){if("string"==typeof e)return -1!==e.indexOf(t);for(var i=0;i<e.length;i++)if(e[i]===t)return!0;return!1},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},uniq:function(e){for(var t={},i=[],r=0;r<e.length;r++)t[e[r]]||(i.push(e[r]),t[e[r]]=!0);return i},from:function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},keys:function(e){var t=[];for(var i in e)t.push(i);return t}};function v(e){return null==e}function g(e){var t;return'"'===(t=e)[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]?e.substr(1,e.length-2):e}function y(e){var t,i,r,n,a,s,o,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",u=0;for(e=function(e){e=e.replace(/rn/g,"n");for(var t="",i=0;i<e.length;i++){var r=e.charCodeAt(i);r<128?t+=String.fromCharCode(r):r>127&&r<2048?t+=String.fromCharCode(r>>6|192)+String.fromCharCode(63&r|128):t+=String.fromCharCode(r>>12|224)+String.fromCharCode(r>>6&63|128)+String.fromCharCode(63&r|128)}return t}(e);u<e.length;)n=(t=e.charCodeAt(u++))>>2,a=(3&t)<<4|(i=e.charCodeAt(u++))>>4,s=(15&i)<<2|(r=e.charCodeAt(u++))>>6,o=63&r,isNaN(i)?s=o=64:isNaN(r)&&(o=64),c=c+d.charAt(n)+d.charAt(a)+d.charAt(s)+d.charAt(o);return c}function m(e){var t,i,r,n,a,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="",c=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(n=o.indexOf(e.charAt(c++)))>>4,i=(15&n)<<4|(a=o.indexOf(e.charAt(c++)))>>2,r=(3&a)<<6|(s=o.indexOf(e.charAt(c++))),d+=String.fromCharCode(t),64!==a&&(d+=String.fromCharCode(i)),64!==s&&(d+=String.fromCharCode(r));return function(e){for(var t="",i=0,r=0,n=0,a=0;i<e.length;)(r=e.charCodeAt(i))<128?(t+=String.fromCharCode(r),i++):r>191&&r<224?(t+=String.fromCharCode((31&r)<<6|63&(a=e.charCodeAt(i+1))),i+=2):(a=e.charCodeAt(i+1),t+=String.fromCharCode((15&r)<<12|(63&a)<<6|63&(n=e.charCodeAt(i+2))),i+=3);return t}(d)}function k(e,t,i){var r="",n=0,a=!1,s=!1,o=0,d=e.length,c="",u="";e:for(o=0;o<d;o++){var l=e.charAt(o);if(!1===a){if("<"===l){a=o;continue}}else if(!1===s){if("<"===l){r+=i(e.slice(n,o)),a=o,n=o;continue}if(">"===l||o===d-1){r+=i(e.slice(n,a)),c=function(e){var t,i=_.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=_.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}(u=e.slice(a,o+1)),r+=t(a,r.length,c,u,"</"===u.slice(0,2)),n=o+1,a=!1;continue}if('"'===l||"'"===l)for(var h=1,f=e.charAt(o-h);""===f.trim()||"="===f;){if("="===f){s=l;continue e}f=e.charAt(o-++h)}}else if(l===s){s=!1;continue}}return n<d&&(r+=i(e.substr(n))),r}function S(e,t){var i=0,n=0,a=[],s=!1,o=e.length;function d(e,i){if(!((e=(e=_.trim(e)).replace(r,"").toLowerCase()).length<1)){var n=t(e,i||"");n&&a.push(n)}}for(var c=0;c<o;c++){var u=e.charAt(c),l=void 0;if(!1!==s||"="!==u){if(!1===s||c!==n){if(/\s|\n|\t/.test(u)){if(e=e.replace(/\s|\n|\t/g," "),!1===s){if(-1===(l=function(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,c))){d(_.trim(e.slice(i,c))),s=!1,i=c+1;continue}c=l-1;continue}if(-1===(l=function(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,c-1))){d(s,g(_.trim(e.slice(i,c)))),s=!1,i=c+1;continue}}}else{if(-1===(l=e.indexOf(u,c+1)))break;d(s,_.trim(e.slice(n+1,l))),s=!1,i=(c=l)+1}}else s=e.slice(i,c),i=c+1,n='"'===e.charAt(i)||"'"===e.charAt(i)?i:function(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}return -1}(e,c+1)}return i<e.length&&(!1===s?d(e.slice(i)):d(s,g(_.trim(e.slice(i))))),_.trim(a.join(" "))}function b(e,t,i){if(i=function(e){return e=function(e){for(var t="",i=0,r=e.length;i<r;i++)t+=32>e.charCodeAt(i)?" ":e.charAt(i);return _.trim(t)}(e=(e=(e=e.replace(o,'"')).replace(s,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})).replace(d,":").replace(c," "))}(i),"href"===t||"src"===t){if("#"===(i=_.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(u.lastIndex=0,u.test(i))return""}else if("style"===t&&(h.lastIndex=0,h.test(i)||(l.lastIndex=0,l.test(i)&&(u.lastIndex=0,u.test(i)))))return"";return i=function(e){return e=p(e=e.replace(f,"""))}(i)}var T=function(e){return"string"==typeof e?e.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},E=function(){function e(e){var t=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{});t.stripIgnoreTag&&(t.onIgnoreTag,t.onIgnoreTag=function(){return""}),t.whiteList={},t.onTag=function(){},t.onTagAttr=function(){},t.onIgnoreTag=function(){},t.onIgnoreTagAttr=function(){},t.safeAttrValue=b,t.escapeHtml=p,this.options=Object.assign(t,e)}return e.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t,i,r,n,a,s,o=this.options,d=o.whiteList,c=o.onTag,u=o.onIgnoreTag,l=o.onTagAttr,h=o.onIgnoreTagAttr,f=o.safeAttrValue,p=o.escapeHtml;o.stripBlankChar&&(e=(t=(t=e.split("")).filter(function(e){var t=e.charCodeAt(0);return!(127===t||t<=31&&10!==t&&13!==t)})).join("")),o.allowCommentTag||(e=function(e){for(var t="",i=0;i<e.length;){var r=e.indexOf("\x3c!--",i);if(-1===r){t+=e.slice(i);break}t+=e.slice(i,r);var n=e.indexOf("--\x3e",r);if(-1===n)break;i=n+3}return t}(e));var v=!1;o.stripIgnoreTagBody&&(i=o.stripIgnoreTagBody,"function"!=typeof(r=u)&&(r=function(){}),n=!Array.isArray(i),a=[],s=!1,u=(v={onIgnoreTag:function(e,t,o){var d;if(d=e,n||-1!==_.indexOf(i,d)){if(o.isClosing){var c="[/removed]",u=o.position+c.length;return a.push([!1!==s?s:o.position,u]),s=!1,c}return s||(s=o.position),"[removed]"}return r(e,t,o)},remove:function(e){var t="",i=0;return _.forEach(a,function(r){t+=e.slice(i,r[0]),i=r[1]}),t+=e.slice(i)}}).onIgnoreTag);var g=k(e,function(e,t,i,r,n){var a={sourcePosition:e,position:t,isClosing:n,isWhite:Object.prototype.hasOwnProperty.call(d,i)},s=c(i,r,a);if(null!=s)return s;if(a.isWhite){if(a.isClosing)return"</".concat(i,">");var o=function(e){var t=_.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=_.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=_.trim(e.slice(0,-1))),{html:e,closing:i}}(r),v=d[i],g=S(o.html,function(e,t){var r=-1!==_.indexOf(v,e),n=l(i,e,t,r);return null==n?r?(t=f(i,e,t,null))?"".concat(e,'="').concat(t,'"'):e:null==(n=h(i,e,t,r))?void 0:n:n});return r="<".concat(i),g&&(r+=" ".concat(g)),o.closing&&(r+=" /"),r+=">"}return null==(s=u(i,r,a))?p(r):s},p);return v&&(g=v.remove(g)),g},e}(),L=Function("\nvar _checkXSS = function (it) {\n return it && it.Math == Math && it;\n};\nreturn _checkXSS(typeof globalThis === 'object' && globalThis) ||\n_checkXSS(typeof window === 'object' && window) ||\n_checkXSS(typeof self === 'object' && self) ||\n_checkXSS(typeof global === 'object' && global) ||\nFunction('return this')();\n")(),I=new(function(){function e(){var e=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var t,i,r="douyin_web";if(!_.includes(r,"bid"))return r;if(e.config&&e.config.bid)return e.config.bid;if(L&&L._xssBid)return L._xssBid;if(L&&L.slardar&&"function"==typeof L.slardar.config){var n=(L.slardar.config()||{}).bid;if(n)return n}if(L&&L.Slardar&&"function"==typeof L.Slardar.config){var a=(L.Slardar.config()||{}).bid;if(a)return a}return(null===(i=null===(t=null==L?void 0:L.Slardar)||void 0===t?void 0:t._baseParams)||void 0===i?void 0:i.bid)||"argus"},this.getConfigRegion=function(){var t;return _.includes("cn","region")?e.config&&e.config.region?e.config.region:((null===(t=null==L?void 0:L.gfdatav1)||void 0===t?void 0:t.region)||"cn").toLowerCase():"cn"},this.gerReportUrl=function(){var t={cn:m("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boe:m("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),ttp:m("aHR0cHM6Ly9tb24udXMudGlrdG9rdi5jb20vbW9uaXRvcl9icm93c2VyL2NvbGxlY3QvYmF0Y2gvc2VjdXJpdHkvP2JpZD0="),va:m("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),maliva:m("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),sg:m("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boei18n:m("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9")}[e.getConfigRegion()];if(t)return t+e.getSlardarBid()}}return e.prototype.setConfig=function(e){this.config=e},e.prototype.upload=function(){var e=this,t=this.gerReportUrl();!this.lock&&t&&0!==this.batchData.length&&(this.lock=!0,setTimeout(function(){var i=e.batchData.slice(0,100);e.batchData=e.batchData.slice(100),L.fetch(t,{method:"post",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).catch(function(e){}),e.lock=!1,e.upload()},this.timeout))},e.prototype.generateKey=function(e){return e.collectKey?[e.collectMode,e.collectKey].join("___"):""},e.prototype.push=function(e){this.batchData.push(e),this.upload()},e.prototype.report=function(e){var t=this.generateKey(e);if(L.fetch&&e.collectKey){var i="object"==typeof window?window.location.href:"SSR";e.documentUrl=i;var r={age:Math.floor(Date.now()),type:"xss",url:i,body:e,"user-agent":""};"enforce"===e.disposition&&"SSR"!==i||(r.url=t),"SSR"===i&&(r.url="SSR___".concat(r.url),r.body.ssr=!0),this.push(r)}},e}()),C=function(e){for(var t=0,i=function(i){Array.isArray(e[i])?0===e[i].length?delete e[i]:(e[i]=_.from(_.uniq(e[i])),t+=e[i].length):0===_.keys(e[i]).length?delete e[i]:_.keys(e[i]).forEach(function(r){e[i][r]=_.from(_.uniq(e[i][r])),t+=e[i][r].length})},r=0,n=_.keys(e);r<n.length;r++)i(n[r]);return{count:t,ret:e}};function R(e,t){return I.setConfig(t),new E(t).process(e)}function D(e){var t,i=(t=/\s|\n|\t/.exec(e))?t.index:-1;if(-1===i)return{html:"",closing:"/"===e[e.length-2]};var r="/"===(e=e.slice(i+1,-1).trim())[e.length-1];return r&&(e=e.slice(0,-1).trim()),{html:e,closing:r}}var A=function(e){return -1===(e=(e=(e=(e=e.replace(/:/gi,":")).replace(/&tab;/gi,"")).replace(/&newline;/gi,"")).replace(/(\t|\n|\r)/g,"")).indexOf("&#")?e.trim().toLowerCase():e.trim().replace(/&#(?:(x)([0-9a-f]+)|([0-9]+));?/gi,function(e,t,i,r){return String.fromCharCode(t?parseInt(i,16):parseInt(r))}).replace(/(\t|\n|\r)/g,"").toLowerCase()};function P(e,t){if(void 0===e&&(e=""),"string"!=typeof e)return!0;if(e=A(e),_.includes(e,"base64")&&!function(e){if(""===e||""===e.trim())return!0;try{return!_.includes(e,"data:text/html;base64")}catch(e){return!0}}(e))return t&&t("data:text/html;base64"),!1;var i=["expression(","behavior:","view-source:"];if(_.some(i,function(t){return -1!==e.indexOf(t)}))return _.forEach(i,function(i){-1!==e.indexOf(i)&&t&&t(i)}),!1;var r=["data:application","data:javascript","data:text/html","data:texthtml"];if(_.some(r,function(t){return -1!==e.indexOf(t)}))return _.forEach(r,function(i){-1!==e.indexOf(i)&&t&&t(i)}),!1;if(e.indexOf("javascript:")>0)return t&&t("javascript:"),!1;if(/^javascript:/i.test(e)){var n=e.slice(11).replace(/\s/g,"").trim();return!!_.some(["void","void(0)","void0","false","undefined",";"],function(e){return e===n})||(t&&t("javascript:"),!1)}return!0}var x=function(e,t){var i,r,n="<%= isSaveValidUrl =>";if("string"!=typeof e||(r=Number("<%= urlLimit =>"),void 0!==i&&(r=i),"NaN"!==e.toString()&&-1!==r&&e.length>=r)||P(e,t))return e;try{if(!0===(n=JSON.parse(n))||"true"===n){var a=new URL(e);return a.origin+a.pathname}}catch(e){}return"#"};function w(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=[]),"string"!=typeof e)return!0;if(!P(e=A(e)))return!1;var n,a={url:(n=e.match(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/)||[])[0],scheme:n[1],slash:n[2],host:n[3],port:n[4],path:n[5],query:n[6],hash:n[7]},s=a.scheme,o=a.host;return r?!!r(e):!(!s||!o)&&(!_.includes(["http","https","file"],s)||("object"==typeof window&&window&&(t=i(i([],t,!0),[location.host],!1)),_.some(t,function(e){return!!(e instanceof RegExp&&e.test(o))||e===o})))}var O={a:["target","title","spellcheck","rel"],canvas:[],abbr:["title"],address:[],area:["shape","coords","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:["dir"],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["alt","title","width","height","decoding"],ins:["datetime"],li:[],mark:[],nav:[],ol:["start"],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],delete:[],form:[],strong:[],mask:["maskunits","x","y","width","height","fill"],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],wbr:[],video:["autoplay","controls","loop","preload","height","width"],svg:["viewBox","version","xmlns","fill","width","height","stroke","stroke-width","style"],path:["d","fill","opacity","stroke","p-id","fill-rule","clip-rule","stroke-width","stroke-linecap","stroke-linejoin","fill-opacity","mask"],rect:["x","y","width","height","fill","stroke","rx"],g:[]},B={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var e=C(this.collect),t=e.count,i=e.ret;return this.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"white"}},onIgnoreTagAttr:function(e,t,r){return e&&_.indexOf(["href","src"],t)>-1?B.domainWhiteList&&Array.isArray(B.domainWhiteList)&&B.domainWhiteList.length>0&&!w(r,i([],B.domainWhiteList,!0))?"":"".concat(t,'="').concat(x(r,function(e){var t;null===(t=B.collect)||void 0===t||t.filterProtocol.push(e)}),'"'):e&&(_.indexOf(["style","class","id"],t)>-1||t.indexOf("data-")>-1)?"".concat(t,'="').concat(r,'"'):(B.collect.whiteList[e]=B.collect.whiteList[e]||[],void B.collect.whiteList[e].push(t))},onIgnoreTag:function(e,t){if("style"===e)return t;k(t,function(e,t,i,r){S(D(r).html.replace("/",""),function(e){B.collect.whiteList[i]=B.collect.whiteList[i]||[],B.collect.whiteList[i].push(e)})},p)},whiteList:O,mergeWhiteList:function(e){for(var t,i={},r=0,n=_.keys(O);r<n.length;r++)i[t=n[r]]=_.from(O[t]);for(var a=0,s=_.keys(e);a<s.length;a++)i[t=s[a]]=t in O?O[t].concat(e[t]):_.from(e[t]);return i},setWhiteList:function(e){for(var t=0,i=_.keys(e);t<i.length;t++){var r=i[t];this.whiteList[r]=r in O?O[r].concat(e[r]):_.from(e[r])}}};try{var N={},M="merge";_.includes(M,"override")&&(B.whiteList=N.whiteList),_.includes(M,"merge")&&B.setWhiteList(N.whiteList)}catch(e){}var Z=function(e,t){for(var i={},r=0,n=_.keys(e);r<n.length;r++){var a=n[r];Array.isArray(e[a])?i[a]=_.from(e[a]):i[a]=Z({},e[a])}for(var s=0,o=_.keys(t);s<o.length;s++)(a=o[s])in e?Array.isArray(e[a])?i[a]=e[a].concat(t[a]):i[a]=Z(e[a],t[a]):Array.isArray(t[a])?i[a]=_.from(t[a]):i[a]=Z({},t[a]);return i},V={blackList:{a:["folder"],meta:["content"],iframe:["srcdoc"],input:["pattern"],vmlframe:["xmlns"]},blackTags:["script","xml","embed","isindex","object","base","set","handler","animate","payload","import"],blackAttrs:["charset","ns","namespace","formaction","xlink:href","xmlns:xlink","handler","repeat","repeat-start","repeat-end"],blackAttrRegExps:[/^on/],filterList:{param:["value"],video:["poster"],form:["action"]},filterAttrs:["href","src","background","style","dynsrc","lowsrc","content"]};try{var U={};U.blackAttrRegExps&&(U.blackAttrRegExps=U.blackAttrRegExps.map(function(e){return new RegExp(e.toString().slice(1,e.toString().length-1))}));var F="merge";_.includes(F,"override")&&(V=U),_.includes(F,"merge")&&(V=Z(V,U))}catch(e){}var W={mode:"black",whiteList:{},blackConfig:V,collect:null,initCollect:function(){W.collect={blackList:{},blackTags:[],blackAttrs:[],blackAttrRegExps:[],filterAttrs:[],filterList:{},filterProtocol:[]}},removeCollect:function(){var e=C(W.collect),t=e.count,i=e.ret;return W.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"black"}},onIgnoreTag:function(e,t){var i;if(!_.includes(V.blackTags,e))return k(t,function(e,t,i,r,n){if(-1!==i.indexOf("/"))return p(r);if(n)return"</".concat(i,">");var a=D(r),s=S(a.html,function(e,t){var r,n=0;if(V.blackList[i]&&_.includes(V.blackList[i],e)&&(W.collect.blackList[i]=W.collect.blackList[i]||[],W.collect.blackList[i].push(e),n++),V.blackAttrRegExps.length&&V.blackAttrRegExps.some(function(t){return t.test(e)})&&_.forEach(V.blackAttrRegExps,function(t){t.test(e)&&(W.collect.blackAttrRegExps.push("".concat(t.toString(),"->").concat(e)),n++)}),V.blackAttrs.length&&_.includes(V.blackAttrs,e)&&(V.blackAttrs.push(e),n++),!n){if(V.filterList&&V.filterList[i]&&_.includes(V.filterList[i],e)){var a=x(t,function(e){var t;null===(t=W.collect)||void 0===t||t.filterProtocol.push(e)});return a!==t&&(W.collect.filterList[i]=W.collect.filterList[i]||[],W.collect.filterList[i].push(e)),t?"".concat(e,"='").concat(a,"'"):e}return V.filterAttrs&&_.includes(V.filterAttrs,e)?((a=x(t,function(e){var t;null===(t=W.collect)||void 0===t||t.filterProtocol.push(e)}))!==t&&(null===(r=W.collect)||void 0===r||r.filterAttrs.push(e)),t?"".concat(e,"='").concat(a,"'"):e):t?"".concat(e,"='").concat(t,"'"):e}});return r="<".concat(i),s&&(r+=" ".concat(s)),a.closing&&(r+=" /"),r+=">"},p);null===(i=W.collect)||void 0===i||i.blackTags.push(e)}},j=function(e){var t=e.reportOnly,i=void 0===t||t,r=e.block;return i&&"all"===i?"report":("string"==typeof i&&("true"===i&&(i=!0),"false"===i&&(i=!1)),r?"enforce":i?"report":"enforce")},G=function(e){return function(i,r,n){if(!i||"string"!=typeof i)return i;var a=r;e===R&&(a=B).initCollect();var s=e(i,a);if(T(s)===T(i))return i;if(!n)return s;var o=n.logType,d=j(n),c=a.removeCollect();return I.report(t(t({type:o,disposition:d},c),{sourceText:y(i),filterText:y(s)})),"enforce"===d?s:i}},H=G(function(e,t){return void 0===t&&(t={}),t&&t.whiteList||(t.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}),new E(t).process(e)}),Y=G(R),X=function(e,t,i){var r=[],n=x(e,function(e){r.push(e)});if(n===e)return e;r=_.from(_.uniq(r));var a=t||i||{};if(!a)return n;var s=a.logType,o=j(i);return I.report({type:s,disposition:o,collectKey:r.join("___"),collectData:JSON.stringify(r),collectMode:"black",sourceText:y(e),filterText:y(n)}),"enforce"===o?n:e},z=L._xssProject||{},q=L.xssNamespace||{},Q="3.0.26",K={FilterXSS:E,version:Q,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:H,_filterXSS:Y,filterUrl:X,Config:B,BlackConfig:W,project:z,setProjectName:function(e){z[e]=this,L._xssProjectName=e}};q.douyin_web=K,L.xssNamespace=q,L.Math&&!L.Math.xssNamespace&&(L.Math.xssNamespace=q),z[Q]=K,L.globalThis=L,L.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:K},L.xss=K,L.isSafeUrl=w,L.isSafeDomain=w,L.isSafeProtocol=P,L._xssProject=z,L._xssProjectName&&(z[L._xssProjectName]=K);var J=K.setProjectName.bind(K);e.BlackConfig=W,e.Config=B,e.FilterXSS=E,e._filterXSS=Y,e.filterUrl=X,e.filterXSS=H,e.isSafeDomain=w,e.isSafeProtocol=P,e.isSafeUrl=w,e.project=z,e.setProjectName=J,e.setXssNamespace=function(e){var t=e.appId,i=e.bid,r=e.region;q[t]=K;B.bid=i,B.region=r,B.enabled=!0},e.xssNamespace=q,Object.defineProperty(e,"__esModule",{value:!0})}),(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["15734"],{294784:function(e,t,i){i.d(t,{Z:function(){return T}});var r=i("726949");i("346984"),i("303846"),i("802824"),i("162093"),i("503000"),i("497397"),i("232070"),i("104882"),i("2885"),i("248385"),i("679308"),i("88856"),i("414931"),i("313626"),i("663030");var n=i("455890"),a=i("437928"),s=i("138204"),o=i("975346"),d=i("218398"),c=i("42960");i("124300"),i("870506"),i("591111"),i("916960"),i("109413"),i("424020"),i("338721"),i("19492"),i("411518"),i("288057"),i("619445"),i("467454"),i("898900"),i("370586"),i("110887"),i("174819"),i("732843"),i("263807"),i("713147"),i("490629");var u=new Set,l=new Set;function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"!=typeof performance&&!!e)try{var i=performance.mark(e,t);i&&u.add(i)}catch(e){}}function f(e,t,i){if("undefined"!=typeof performance&&!!e)try{var r=performance.measure(e,t,i);r&&l.add(r)}catch(e){}}var p=i("780048"),_=i("167033"),v=i("861962"),g=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];(0,_.cM)("xgVodLogger version is ".concat(v.Z));var y=(0,_.P9)("Object"),m=1300,k="__tea_cache_tokens_".concat(m),S="",b=null,T=function(){function e(t,i){var c=this;if((0,r.PA)(this,e),(0,r._x)(this,"initializeUrlLog",function(e){var t=e&&e.url?e.url:"String"===(0,_.kM)(e)?e:"";"String"!==(0,_.kM)(t)&&(t=""),c.urlLog={initial_url:t,initial_host:(0,_._P)(t),initial_ip:""}}),(0,r._x)(this,"onXgLogCache",function(){var e,t=c._getLogCache();t&&(c._templog={vtype:null===(e=c.player)||void 0===e?void 0:e.vtype,log:t},c.onOneTemp())}),(0,r._x)(this,"onPrfDataSize",function(e){c._progressInfo.upDateDownload(e)}),(0,r._x)(this,"onDegrade",function(e){e&&(e.local_time=new Date().getTime(),c.onOneEvent({end_type:"degrade"},e))}),(0,r._x)(this,"onMediaFormatError",function(e){c.onOneEvent({end_type:"".concat(e.error_type||"","Error")})}),(0,r._x)(this,"onReplayBtnClick",function(){c.resetLoggerParams()}),(0,r._x)(this,"onBeforeDefinitionChange",function(){c.resLogs.ldst=(0,_.je)(),c._endType="switch"}),(0,r._x)(this,"onDefinitionChangeDetail",function(e){var t=c._progressInfo;t.updateDefInfo(e,c.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&c.sendSwitchOpera("changedetail")}),(0,r._x)(this,"onDefinitionChange",function(e){var t=e.from,i=e.to;c.changeResolution({from:t,to:i,startTime:c.resLogs.ldst,operaType:"switch"}),(0,_.cM)("onDefinitionChange from:".concat(t,", to:").concat(i))}),(0,r._x)(this,"onDefiChangeSuccess",function(){(0,_.cM)("onDefinitionChangeSuccess"),c.updateVideoSize(),c.triggerTask("start")}),(0,r._x)(this,"onAbrChange",function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(c.player.abrInstance){var n=c.player.abrInstance.eventInfo;(0,_.cM)("abrChange",n),n.last_definition=t,n.now_definition=i,c.abrInfo.abr_event_info.video_switch.push(n),c.changeResolution({from:t,to:i,startTime:(0,_.je)(),operaType:"abr_switch",abrInfo:r})}}),(0,r._x)(this,"onTimeUpdate",function(){var e=c.playlogs,t=c.resLogs,i=c.player;if(c.errorLog.try_err_c=0,!e.vt&&1===c.startStep&&(e.vt=(0,_.L8)(),(0,_.cM)("onTimeUpdate: first frame inited","currentTime11:".concat(i.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),c.startStep=2),!t.initial_resolution){var r=i.currentDefitionFromPlayer&&i.currentDefitionFromPlayer.definition?i.currentDefitionFromPlayer.definition:i.config.defaultDefinition||"".concat(i.video.videoHeight,"p")||"";r=(0,_.fC)(r),t.initial_resolution=r}!t.final_resolution&&(t.final_resolution=t.initial_resolution);var n=e.played.length;n<1?e.played.push({begin:i.currentTime,end:-1}):e.played[n-1].end=i.currentTime,c._progressInfo.updatePlayed(i.currentTime),c._progressInfo.checkNextBitrate(i.currentTime);var a=t.played.length;a<1?t.played.push({begin:i.currentTime,end:-1}):t.played[a-1].end=i.currentTime,c.lastVideoTime=i.currentTime||0}),(0,r._x)(this,"onVideoProgress",function(){c.updateBuffers(),c._progressInfo.updateBuffered(c.player.buffered)}),(0,r._x)(this,"onCanplay",function(){(0,_.cM)("onCanplay","this.startStep:".concat(c.startStep," ").concat((0,_.L8)())),c.setVt()}),(0,r._x)(this,"onLoadeddata",function(){(0,_.cM)("onLoadeddata","this.startStep:".concat(c.startStep," ").concat((0,_.L8)())),c.setVt(),c.updateVideoSize(),h("playerLoadeddata_".concat(c.vid)),f("playerFirstFrame_".concat(c.vid),"playerLoadStart_".concat(c.vid),"playerLoadeddata_".concat(c.vid)),!function(){if("undefined"!=typeof performance)try{u.forEach(function(e){performance.clearMarks(e.name)}),u.clear()}catch(e){}}(),function(){if("undefined"!=typeof performance)try{l.forEach(function(e){performance.clearMeasures(e.name)}),l.clear()}catch(e){}}()}),(0,r._x)(this,"onLoadStart",function(){c.commonParams.web_url=location.href;var e=(0,_.LM)(c.player.currentSrc);c.triggerTask("start"),(0,_.cM)("onLoadStart","this.startStep:".concat(c.startStep," ").concat((0,_.L8)()," isSrcEmpty:").concat(e," player.src:").concat(c.player.src)),0===c.startStep&&!e&&"visible"===document.visibilityState&&c.setPt(),h("playerLoadStart_".concat(c.vid))}),(0,r._x)(this,"onMSEAttaching",function(){h("playerMSEBind_".concat(c.vid)),f("playerSourceReady_".concat(c.vid),"playerLoggerReady_".concat(c.vid),"playerMSEBind_".concat(c.vid))}),(0,r._x)(this,"onMSEAttached",function(){h("playerMSEOpen_".concat(c.vid)),f("playerMSEReady_".concat(c.vid),"playerMSEBind_".concat(c.vid),"playerMSEOpen_".concat(c.vid))}),(0,r._x)(this,"onBufferedChange",function(){var e=c.player.video&&c.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>c.player.duration&&(c.bft=(0,_.L8)())}}),(0,r._x)(this,"onPlayerInited",function(){(0,_.cM)("player init"),c._playerCreatedTime=(0,_.L8)(),c.playlogs.rt=(0,_.L8)(),h("playerComplete_".concat(c.vid))}),(0,r._x)(this,"onNotAutoPlay",function(){(0,_.cM)("onNotAutoPlay","autoplay:".concat(c.isAutoplay)),0===c.isAutoplay?c.isAutoplay=2:1===c.isAutoplay&&(c.isAutoplay=3)}),(0,r._x)(this,"onPlayerError",function(e){e=e||{};var t=c.errorLog,i=c.player;if((0,_.cM)("onPlayerError","this.player.type:".concat(c.player.type," this.player.replayRunning:").concat(c.player.replayRunning," isSupportMP4:").concat(o.ZP.isSupportMP4," isPC:").concat(o.ZP.isPC)),(0,_.cM)("onPlayerError",e),c.load_state=n.fp.ERROR,c._endType="error",c.suspendWaitingStatus("onPlayerError"),c._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(!e.url&&(e.url=c.player.currentSrc),o.ZP.isPC&&!o.ZP.isSupportMP4||o.ZP.isSpider){t.errc=n.O1["5"],t.errt=n.iR.notSupport,c.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),c._isOnePlayReport=!0;return}t.errt=e.errorTypeCode||(e.errorType&&n.iR[e.errorType]?n.iR[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&n.O1[e.errorCode]?n.O1[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&n.O1[e.code]?n.O1[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),c.sendSwitchOpera(n.av.ERROR),c.onOnePlay(n.av.ERROR),c.onOneTemp(n.av.ERROR),c.sendDegradeLog("playCatch_end",c.playlogs.degrade);var r=!1,a=e.mediaError;a&&c._options.needXhrCheck&&(4===a.code||2===a)&&(r=!0),c.onOneError({endState:n.av.PLAY_ERROR,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),c.sendEventsQueue()}}),(0,r._x)(this,"onPlayInterfaceInfo",function(e){(0,_.cM)("onPlayInterfaceInfo",e);var t=c.errorLog,i=c.apiLog,r=c.playlogs;if(e&&Object.keys(e).map(function(t){"code"===t?i.vsc=e[t]:"message"===t?i.vsc_message=e.message||"success,视频可正常播放":i[t]=e[t]}),r.at=e.timestamep||new Date().getTime(),!e.error||-9988!==e.error.errc){if(i.vsc=e.code||10,i.vsc_message=e.message||"success,视频可正常播放",e.error){var n=e.error;t.errt=1e3,t.errc=n.errc||-9998,t.last_errors.push(n.errc||-9998),0===t.fir_errc&&(t.fir_errc=n.errc||-9998),t.accu_errc++,1===t.accu_errc&&(t.fir_errt=(0,_.je)()),c.onOneError({errorType:1e3,code:n.errc||-9998,url:"",headers:{}})}}}),(0,r._x)(this,"onProgressEvent",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=c.netLog;if(e.speed){var i=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=i,t.totalSpeed+=i,t.rqCount++}"oversize"!==e.type&&t.requestCount++,e.connectTime&&(t.connectCost=e.connectTime);var n=t.rqCount<7?100:e.costTime>=5e3?20:10;if(!("success"===e.type&&parseInt(100*Math.random(),10)<=n)){var a=(0,d.I)(e.cdnUrl),s=e.xhr||{},o=e.type?"progress_".concat(e.type):"progress",u=e.headers;!u&&(u=(0,_.rg)(s)),u=(0,_.xV)(u);var l=(0,r.Zj)((0,r.Zj)({},u),{},{download_speed:t.downloadSpeed,connect_cost:t.connectCost,c_dur:a.connectDuration||0,d_dur:a.domainDuration||0,r_dur:a.duration||0,rqtt:new Date().getTime(),x_cache:u.x_response_cache||"",server_ip:u.x_response_sinfo});e.status?t.status=e.status:s&&s instanceof window.XMLHttpRequest&&(t.status=s.status||0),l.status=t.status;var h=e.cdnUrl||e.url;"error"===e.type&&c.merror.cdn.push((0,r.Zj)((0,r.Zj)({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:h,cdn_host:(0,_._P)(h)},l),u)),c.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:o,cur_play_pos:e.pos,cdn_url:h,cdn_host:(0,_._P)(h)},l,"error"===e.type?0:2)}}),(0,r._x)(this,"onNext",function(){if((0,_.cM)("onNext:startStep:",c.startStep),c.startStep>0){if(c._reportInvalidVV(n.av.NEXT))return;c.sendSwitchOpera(n.av.NEXT),c.onOnePlay(n.av.NEXT),c.onOneTemp(n.av.NEXT),c.sendEventsQueue()}c.vtype=null,c.playlogs.lc=0,c.resetLoggerParams()}),(0,r._x)(this,"onNextEnded",function(){var e=c.player,t=c.resLogs,i=(0,_.fC)(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i}),(0,r._x)(this,"onXgLogWaiting",function(e){var t=c.playlogs,i=c.resLogs,r=c.stall;if(!!c._options.checkByInnerLog&&0===e.type){(0,_.cM)("onXgLogWaiting",e);var n=e.endType,a=e.costTime,s=e.start,o={download_speed:c.realSpeed,avg_speed:c.avgSpeed,mse_op:c.mp4MseOpLength,mp4_load_range:c.mp4LoadSegmentTimeRange,bitrate:c.curBitrate};if("waitingStart"===e.eventType){c.onOneEvent({costTime:a,end_type:"waitstart"},o,2),c.appendStallInfo("start",s);return}if("waitingEnd"===e.eventType){var d=(0,_.je)();(0,_.cM)("onXgLogWaiting>>".concat(n,"|costTime:").concat(a," vt:").concat(t.vt)),c.appendStallInfo("end",d,n),t.bc++,c.checkInBuffer(c.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),i.bc++,t.bu_acu_t+=a,i.bu_acu_t+=a,r.end=c.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=c.cur_play_pos),c.onOneEvent({costTime:a,end_type:"waitend"},o,2)}}}),(0,r._x)(this,"onSeeking",function(){if(!(0,_.LM)(c.player.src)){var e=c.resLogs,t=c.playlogs,i=c.player,r=c.seekLog;(0,_.cM)("onSeeking","currentTime:".concat(i.currentTime)),0===c.startStep&&c.setPt(),c.suspendWaitingStatus("seek"),c.isSeeking&&c.suspendSeekStatus("seek",!1),c.isSeeking=!0,t.played.push({begin:i.currentTime,end:-1}),e.played.push({begin:i.currentTime,end:-1}),c._progressInfo.updatePlayed(i.currentTime,0),r.lastSeekStartTime=(0,_.je)(),r.seekBefore=c.lastVideoTime.toString(),r.buf_include=c.checkInBuffer(c.player.currentTime)?1:0,r.intervalId=setTimeout(function(){c.isSeeking&&c.suspendSeekStatus("seekTimeout",!0)},n.co)}}),(0,r._x)(this,"onSeeked",function(){if(!(0,_.LM)(c.player.src))c.isSeeking&&c.suspendSeekStatus("seeked",!0)}),(0,r._x)(this,"onPlaying",function(){c.suspendWaitingStatus("play"),c.load_state=n.fp.PLAYABLE;var e=(0,_.je)();c.pauseLog.isPausing&&(c.pauseLog.isPausing=!1,c.pauseLog.pause_acu_t+=e-c.pauseLog.pause_start)}),(0,r._x)(this,"onPlayCatch",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0};if((0,_.cM)("onPlayCatch",e,t),!!e){switch(e){case"mp42dash":c.vtype="DASH_2";break;case"dash2mp4":c.vtype="MP4_2";break;case"dash1mp4":c.vtype="MP4_1";break;default:c.vtype=e}var i=c.errorLog,a=c.playlogs;c.merror.playCatch.push((0,r.Zj)({errc:t.errorCode,errt:t.errorType},t.headers)),c.setBr("playcatch"),i.accu_errc++,i.try_err_c++,i.fir_errc=t.errorCode,t.errorCode&&i.last_errors.push(t.errorCode),c.suspendWaitingStatus("playcatch"),c.suspendSeekStatus("playcatch"),c.sendDegradeLog("playCatch",a.degrade,{cdn_url:t.url}),a.degrade=e,c.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||c.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:n.av.PLAY_CATCH,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}}),(0,r._x)(this,"onMediaExpied",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=c.errorLog,i=c.playlogs;(0,_.cM)("onMediaExpied",e),c.suspendWaitingStatus("expied"),c.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),i.at=new Date().getTime(),c.merror.expied.push((0,r.Zj)({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},(0,_.xV)(e.headers||{}))),c.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)}),(0,r._x)(this,"onLog",function(e){(0,_.cM)("onLog",e);var t=e.type;if(delete e.type,!!t)switch(t){case n.LH.RETRY:break;case n.LH.ONETEMP:!c._templog&&(c._templog={}),c._templog=(0,_.yc)(c._templog,e.data,e.action),c._templog.preload_hit&&(c._cacheFile=n.c3.CACHED);break;case n.LH.ONEERROR:var i=c.errorLog;i.accu_errc++,i.try_err_c++,c.setBr("mp4error"),i.last_errors.push(e.code),c.onOneError(e,0);break;case n.LH.ONEEVENT:var r=(0,_.lv)(e,{costTime:"costTime",vid:"vid",end_type:"end_type",pos:"cur_play_pos",cdnUrl:"cdn_url"});r.ext&&["start","end"].map(function(e){r.ext[e]&&(r.ext["ext_".concat(e)]=r.ext[e],delete r.ext[e])}),c.onOneEvent(r.data,r.ext,2)}}),(0,r._x)(this,"onReady",function(){(0,_.cM)("onReady");var e,t=null===(e=c.player)||void 0===e?void 0:e.getPlugin("progress");null==t||t.addCallBack("mouseleaveFinished",function(){var e;if(null==t||null===(e=t.statistic)||void 0===e?void 0:e.hasActive){var i="";try{i=JSON.stringify((null==t?void 0:t.statistic)||{})}catch(e){}if(!i)return;c._templog={progress:i},c.onOneTemp(n.av.PROGRESS_LEAVE)}})}),(0,r._x)(this,"onPlay",function(){(0,_.cM)("onPlay","this.startStep :".concat(c.startStep," this.isEnded:").concat(c.isEnded)),c.isEnded&&(c.resetLoggerParams(),c.setPt())}),(0,r._x)(this,"onPause",function(){(0,_.cM)("onPause");var e=c.pauseLog;e.isPausing=!0,e.pause_start=(0,_.je)()}),(0,r._x)(this,"onWaiting",function(){var e=c._options;if(c.updateCurBuffer("onWaiting"),e.checkByInnerLog)return;if((0,_.cM)("onWaiting>","isSeeking:".concat(c.isSeeking," startStep:").concat(c.startStep," intervalId:").concat(c.stallIntervalId)),c.wait_buf_include=c.checkInBuffer(c.player.currentTime,-1e3)?1:0,!c.isSeeking&&0!==c.playlogs.vt&&!(c.inWaitingStart>0))c.stallIntervalId&&(window.clearTimeout(c.stallIntervalId),c.stallIntervalId=null),c.inWaitingStart=(0,_.je)(),c.waitStartTime=c.cur_play_pos,c.stallIntervalId=window.setTimeout(function(){var e=c.stall;(0,_.cM)("this.stallIntervalId>>".concat(c.stallIntervalId," cost: ").concat((0,_.je)()-c.inWaitingStart)),c._endType="wait",c.load_state=n.fp.STALLED,c.vtype.indexOf("MP4")>-1&&c.player.currentTime>10&&c.task&&(c.triggerTask("waiting",c.initial_url),c.requestCount++),e.start=c.waitStartTime,e.bc++,1===e.bc&&(e.startf=c.waitStartTime),window.clearTimeout(c.stallIntervalId),c.stallIntervalId=null,c.startWaitingStatus(c.inWaitingStart,(0,_.je)()-c.inWaitingStart),c.stallIntervalId=setTimeout(function(){c.inWaitingStart>0&&c.suspendWaitingStatus("timeout")},n.co)},n.bJ)}),(0,r._x)(this,"onEnded",function(){if(!!c.initial_url){(0,_.cM)("onEnded","watchDur:".concat(c.watchDur," vt:").concat(c.vt," pt:").concat(c.pt)),c.isEnded=!0;var e=c.resLogs.df,t=c._progressInfo;t.calculatePlaySize(),t.cachedSize<1?c.changeResolution({from:e,to:e,startTime:(0,_.je)(),operaType:"leave_switch",endType:"ended"}):c.sendSwitchOpera(n.av.ENDED),c.onOnePlay(n.av.ENDED),c.sendDegradeLog("playCatch_end",c.playlogs.degrade),c.onOneTemp(n.av.ENDED),c.sendEventsQueue(),c.playlogs.lc++}}),(0,r._x)(this,"onUnload",function(){if(0===c.startStep||!c.initial_url)return;if(c.onOneTemp(n.av.UNLOAD),c.sendDegradeLog("playCatch_end",c.playlogs.degrade),!c._reportInvalidVV(n.av.UNLOAD))c.sendSwitchOpera(n.av.UNLOAD),c.onOnePlay(n.av.UNLOAD,!0)}),(0,r._x)(this,"onVisibilitychange",function(){var e=c.playlogs.vt;"visible"===document.visibilityState&&!e&&c.setPt()}),(0,r._x)(this,"onDestroy",function(){(0,_.cM)("onDestroy:this.startStep:".concat(c.startStep," initial_url:").concat(c.initial_url," ").concat(!!c.initial_url)),c.onOnePlay(n.av.DESTROY),c.startStep>0&&c.initial_url&&(c.onOneTemp(n.av.DESTROY),c.sendDegradeLog("playCatch_end",c.playlogs.degrade));var e=c.resLogs.df;c._progressInfo.cachedSize<1?c.changeResolution({from:e,to:e,startTime:(0,_.je)(),operaType:"leave_switch",endType:"destroy"}):c.sendSwitchOpera(n.av.ENDED),c.sendEventsQueue(),o.ZP.isPC?window.removeEventListener("beforeunload",c.onUnload):(o.ZP.isMobile||o.ZP.isPad)&&window.removeEventListener("pagehide",c.onUnload),document.removeEventListener("visibilitychange",c.onVisibilitychange),c.listeners.forEach(function(e){c.player.off(e.evt,e.handler)}),c.clearTimers(),c.player.off("destroy",c.onDestroy),c.task&&c.task.clear(),c.tracker instanceof s.z&&(c.tracker=void 0)}),(0,r._x)(this,"onOnePlay",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,_.cM)("onOnePlay _isOnePlayReport:".concat(c._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!c._isOnePlayReport){var i=c.errorLog,a=c.playlogs,s=c.abrInfo,d=c.resLogs,u=c.player,l=c.apiLog,h=c.pauseLog,f=c.stall,p=c.netLog,v=c.watchDur;c._isOnePlayReport=!0;var g=(0,_.L8)();c.getBufferTime(u);var y=c.getFrameInfo(),m=c.getPerformance(),k=i.errc,S=c._progressInfo,b=S.playedSize,T=S.cachedSize,E=S.pcdnCached,L=S.cachedVideoSize,I=S.pcdnVideoCached,C=c._progressInfo.getFileSize(u.duration),R=c.seekLog,D=R.sc,A=R.sat,P={bc:(0,_.RB)(v,c.bc),bu_acu_t:(0,_.RB)(v,c.bu_acu_t),sc:(0,_.RB)(v,D),sat:(0,_.RB)(v,A)};c.setExt();var x=c._getCompatibilityInfo();c.setNovv(null,e);var w=(0,r.Zj)((0,r.Zj)((0,r.Zj)((0,r.Zj)({local_time:new Date().getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:c.vid,initial_url:c.initial_url,initial_host:c.initial_host,initial_ip:c.curHeaders.x_response_sinfo||0,initial_type:c.initial_type},c.curHeaders),{},{initial_resolution:d.initial_resolution,final_resolution:d.final_resolution,pt:c.pt,prepare_start_time:a.nt,prepare_end_time:a.rt||(0,_.L8)(),vt:c.vt,lt:c.lt,lpt:c.lpt,fvt:c.fvt,nvt:c.nvt,bft:c.bft,sc:D,sat:A,bc:c.bc,dbc:a.dbc||0,nbc:a.nbc||0,video_net_s:c.videoNetworkState,status:c.curStatus,first_buf_startt:f.startf,first_buf_endt:f.endf,lc:a.lc,bu_acu_t:c.bu_acu_t,de_bu_acu_t:a.de_bu_acu_t||0,n_bu_acu_t:a.n_bu_acu_t||0,pause_acu_t:h.pause_acu_t,cur_play_pos:c.cur_play_pos,load_state:c.load_state,play_speed:c.playbackRate,playback_state:c.playback_state,end_state:e,watch_dur:v,switch_resolution_c:c.switchResolutionCount,is_start_play_automatically:c.isAutoplay,start_time:c.start_time,finish:c.finish,errt:i.errt,errc:k,vsc:l.vsc,vsc_message:i.message||l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:c.videoWidth,height:c.videoHeight,vd:c.vd,video_length:C.video,audio_length:C.audio,df:c.resolution,lf:d.lf,play_c:0,player_created_t:c.player_created_t,fir_errt:i.fir_errt,fir_errc:i.fir_errc,lv_method:0,ldst:d.ldst,ldet:d.ldet,is_disable_short_seek:0,mute:c.mute,volume:c.volume,download_speed:c.realSpeed?c.realSpeed:c.task&&c.task.speed?c.task.speed:p.downloadSpeed,avg_speed:c.avgSpeed?c.avgSpeed:p.rqCount>0?parseInt(p.totalSpeed/p.rqCount,10):0,bitrate:c.curBitrate,preload_state:c.preloadState,preload_hit:c.preLoadData.hit||0,preload_cached:c.preLoadData.duration||c.preLoadData.byteLength||0,mdl_req_num:p.requestCount,watingcost:c.watingCost,br:a.br,fbrt:a.fbrt,try_err_c:i.try_err_c,accu_errc:i.accu_errc,merror:(0,_.LQ)(c.merror),ex:(0,_.LQ)(c.exInfo),perf:(0,_.LQ)(m),bufs:(0,_.LQ)(c.buffers.allBuffer),vds:T,pvds:E,vps:b,vvds:L,pvvds:I,pcdn:(0,_.LQ)(c.getPCDNStat())},c.buffers.curBuffer),{},{degrade:a.degrade,cache_file:c._cacheFile},y),{},{fullScreen:c._getFullScreenType(),per100_info:(0,_.LQ)(P)},x);0!==c.vt&&(w.et=g);var O=c._logstrcache||c._getLogCache();0===w.fvt&&O&&(w.log=O,c._logstrcache=null),null!=u&&u.softDecoder&&(w.soft_decoder=u.softDecoder),u&&u.dashState&&(w.dash_state=u.dashState),null!=u&&u.softDecoder&&(w.soft_decoder=u.softDecoder),s.abr_init_opts=u.config.autoBitrateOpts||{},w.abr_info=(0,_.LQ)(c.abrInfo);var B=x.is_support_mp4&&x.is_support_mse_mp4;if(x.is_spider||o.ZP.isPC&&!B&&0===c.fvt){(0,_.cM)("is_spider",x.is_spider,"is_support_mp4",x.is_support_mp4);return}if(w.isLeave=t,t){var N=!c._options.disableLocalCache;c.reportLog(n.bT.ONE_PLAY,w,N?1:0)}else c.reportLog(n.bT.ONE_PLAY,w)}}),(0,r._x)(this,"onOneEvent",function(e){var t=e.costTime,i=e.vid,a=e.end_type,s=e.cur_play_pos,o=e.cdn_url,d=e.cdn_host,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;(0,_.cM)("onOneEvent",a);var h=c.buffers,f=h.curBuffer,p=h.allBuffer,v=c.getFrameInfo(),g=(0,r.Zj)((0,r.Zj)({local_time:new Date().getTime(),v:i||c.vid,cost_time:t,end_type:a||c.end_type,cdn_url:o||c.url,cdn_host:d||"",initial_type:c.initial_type,resolution:c.resolution,play_speed:c.playbackRate,first_frame_interval:(0,_.je)()-c.pt,last_switch_interval:c.getLastInterval("lastSwitchStartTime",c.resLogs,!1),last_seek_interval:c.updateSeekPt(!1),last_event_interval:c.getLastInterval("lastEventTime"),cur_play_pos:s||c.cur_play_pos,video_ready_s:c.videoReadyState,video_seeking:c.videoSeeking,video_paused:c.videoPaused,bufs:(0,_.LQ)(p),retry_count:c._retryCount,at:c.playlogs.at,bc:c.stall.bc,stay_seconds:parseInt((new Date().getTime()-c.playlogs.at)/1e3,10),preload_state:c.preloadState,preload_hit:c.preLoadData.hit,preload_cached:c.preLoadData.duration||c.preLoadData.byteLength},f),v);a.indexOf("waitend")>=0&&t>3e3&&(g.log=c._getLogCache());var y=c.player,m=y.currentTime,k=y.duration;if(a.indexOf("waitstart")>=0&&k-m<=1){var S=g.local_time,b=g.v,T=g.cost_time,E=g.cdn_url,L=g.first_frame_interval,I=g.cur_play_pos,C=g.video_ready_s,R=g.video_seeking,D=g.video_paused,A=g.bufs,P=g.bc,x=g.preload_hit;c.reportLog(n.bT.ONE_EVENT,(0,r.Zj)({end_type:"longwait",local_time:S,v:b,cost_time:T,cdn_url:E,first_frame_interval:L,cur_play_pos:I,video_ready_s:C,video_seeking:R,video_paused:D,bufs:A,bc:P,preload_hit:x},f),l)}if("waitstart"===a&&"function"==typeof c._options.getPageFPS){var w=c._options.getPageFPS();g.cur_fps=w.curFPS||0,g.avg_fps=w.avgFPS||0}a.indexOf("wait")>-1&&(g.buf_include=c.wait_buf_include),a.indexOf("timeout")>-1&&g.cost_time>n.YL&&(g.cost_time=n.YL);var O=c.player;O&&O.dashState&&(g.dash_state=c.player.dashState),Object.keys(u).forEach(function(e){g[e]=u[e]}),g.ex=(0,_.LQ)(c.getPlayerExt()),c.addIfExist("drm_type",c._options,g),c.reportLog(n.bT.ONE_EVENT,g,l)}),(0,r._x)(this,"onOneTemp",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.av.UNSPECIFIED;if((0,_.cM)("onOneTemp>>",!c._templog),!!c._templog){var t=c.player,i=c.playlogs,a=c.pauseLog,s=c.errorLog,o=c.resLogs,d=c.watchDur,u=(0,r.Zj)((0,r.Zj)((0,r.Zj)({local_time:new Date().getTime()},c._templog),{},{end_state:e,v:c.vid,initial_type:c.initial_type,pt:c.pt,vt:c.vt,lt:c.lt,fvt:c.fvt,bc:c.bc,bu_acu_t:c.bu_acu_t>n.bB?0:c.bu_acu_t,pause_acu_t:a.pause_acu_t,cur_play_pos:c.cur_play_pos,watch_dur:d>n.bB?0:d,finish:c.finish,errt:s.errt,errc:s.errc,vd:c.vd,df:c.resolution,lf:o.lf,br:i.br,fbrt:i.fbrt,try_err_c:s.try_err_c,accu_errc:s.accu_errc,dash_break:2===t.dashBufferBreak?1:0,bufs:(0,_.LQ)(c.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},c.buffers.curBuffer),{},{degrade:i.degrade});0!==c.vt&&(u.et=(0,_.L8)()),["drm_type","dynamic_type"].forEach(function(e){c.addIfExist(e,c._options,u)}),c.reportLog(n.bT.ONE_TEMP,u,0),c._templog=null}}),this.player=t,void 0===this.player||null===this.player)throw Error("player is ".concat(this.player));if(!!i&&!!i.line_app_id){i.isTask&&(this.task=new p.Z),this.eventQueue=[],this._instanceCreateTime=new Date().getTime(),i.codec_type=i.codec_type||"h264",this._envInfo=i.envInfo||{},this._options=i,this._options.maxQueueCount||(this._options.maxQueueCount=5),this.line_app_id=parseInt(i.line_app_id,10)||0,this.line_user_id=(i.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=i.playerVersion,this.closeSeekLog=i.closeSeekLog||!1,this.start_time=1e3*(i.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this._progressInfo=new a.Z,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),(0,_.cM)("logger constructor:".concat(this.player.video))}catch(e){}h("playerLoggerReady_".concat(this.vid))}}return(0,r.qH)(e,[{key:"resetLoggerParams",value:function(){(0,_.cM)("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:(0,_.L8)(),vt:0,rt:this.isEnded?(0,_.L8)():0,at:0,pt:0,bu_acu_t:0,bc:0,br:0,fbrt:"",dbc:0,de_bu_acu_t:0,nbc:0,n_bu_acu_t:0,played:[{begin:0,end:-1}],degrade:"none",lc:e},this.degradeLog={bu_acu_t:0,bc:0,watch_dur:0,hasSendEnd:!1},this.buffers={allBuffer:[],curBuffer:{buf_diff:0,buf_s_pos:0,buf_e_pos:0,buf_include:0}},this.netLog={downloadSpeed:0,requestCount:0,connectCost:0,totalSpeed:0,rqCount:0,status:0},this.merror={cdn:[],player:[],playCatch:[],expied:[]},this.exInfo={stall:[]},this._templog=null,this._isOnePlayReport=!1,this.startStep=0,this.bft=0,this._progressInfo.reset(),this._novv={log_pt:(0,_.L8)()},this.initializeLogDatas(),this.initializeUrlLog()}},{key:"setNovv",value:function(e,t){if(!!this._novv&&!(this.fvt>0))e&&(this._novv.errc=e.code,this._novv.errt=e.errorType,this._novv.errorMessage=e.message),this._novv.end_state=t,!this._novv.novv_pt&&(this._novv.novv_pt=(0,_.L8)(),this._novv.novv_lpt=(0,_.L8)()-this._novv.log_pt),this.player&&(this._novv.vtype=this.player.vtype,this.player.novv=this._novv)}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=-1,this.lastEventTime=-1,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:(0,_.je)(),seekBefore:0,sat:0,sc:0,buf_include:0},this.resLogs={lastSwitchStartTime:-1,switch_count:0,abr_switch_count:0,initial_resolution:"",final_resolution:"",ldst:0,ldet:0,df:"",lf:"",played:[],bc:0,bu_acu_t:0,sc:0,sat:0,buf:0,lbuf:0,lplayed:0,vs:0,vds:0,vps:0,vis:0,bitrate:0},this.apiLog={code:0,message:"",logid:"",api:"",auth:"",error:{}},this.errorLog={accu_errc:0,try_err_c:0,errt:0,errc:0,fir_errt:0,fir_errc:o.ZP.isSupportMP4?0:1005,last_errors:[],message:""},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={sc:0,startf:0,endf:0,start:0,end:0,cost:0,acc:0},this._playerCreatedTime=0,this.load_state=n.fp.UNKNOWN,this.lv_method=6,this.isSeeking=!1,this.isEnded=!1,this.startStep=0,this.isAutoplay=this.player.config&&this.player.config.autoplay?1:0,this.abrInfo={abr_general_info:{},abr_event_info:{video_switch:[],video_stall:[],video_exit:{}},abr_play_info:{start_play_time_ms:0,is_hint:0,playback_info:{internet_speed_record:[],play_bitrate_record:[],buffer_length_record:[],play_speed_record:[]}},abr_user_info:{cancel_abr:0},abr_init_opts:this.player.config.autoBitrateOpts||{}},this._cacheFile=n.c3.NO_CACHE}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(k).web_id||"0"}catch(t){e="0"}this._sessionId=(0,_.xv)(e),(0,_.cM)("sessionId ".concat(this._sessionId))}},{key:"initializeTracker",value:function(){var e,t,i,n,a=this,d=this._options;if(window.__xgplayer_vod_log__)this.tracker=window.__xgplayer_vod_log__;else{var c=d.trackerWorker;d.trackerWorker?(b=s.z,this.tracker=new s.z(s.z.CollectorName,{externalWorker:c instanceof Worker||c instanceof SharedWorker?c:null,waitForWorkerReady:!0===d.waitForWorkerReady})):this.tracker=new b(s.z.CollectorName),window.__xgplayer_vod_log__=this.tracker;var u=d.channel||"cn",l={app_id:"cn"===(u="va"===u||"sg"===u?u:"cn")?m:1300===m?323254:m,channel:u,log:!1,disable_sdk_monitor:!0,disable_heartbeat:!0};d.channelDomain&&(l.channel_domain=d.channelDomain),l.enable_ab_test=!!d.enableAbTest,this.tracker.init(l)}this.initSessionId();var h=!this.tracker.syncMode,f=navigator?navigator.hardwareConcurrency:0,p=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:v.Z,pc:this.playerCoreVersion,pv:this.playerVersion,line_app_id:this.line_app_id,line_user_id:this.line_user_id,app_version:d.appVersion||"",platform:o.ZP.isPad?"pad":o.ZP.isMobile?"mobile":"pc",cpu_core:Number(f)||0,memory_size:Number(p)||0,support:(0,o.Cy)(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent,browser_plugins:(0,_.xp)(),encrypted_info:(0,_.LQ)(this.encryptedInfo)};var g=d.trackerConfig||{};(0,_.cM)("commonParams ",this.commonParams,g);var y=(0,r.Zj)({evtParams:this.commonParams,disable_auto_pv:!0},g);null!==(n=o.ZP.browser)&&void 0!==n&&n.name&&(!["Chrome","Safari"].includes(o.ZP.browser.name)||h)&&(y.browser=o.ZP.browser.name,o.ZP.browser.version&&(y.browser_version=o.ZP.browser.version)),this.line_user_id&&(y.user_unique_id=this.line_user_id,d.enableTeaWebId||(y.web_id=this.line_user_id)),d.referrer&&(y.referrer=d.referrer,y.referrer_host=(0,_._P)(d.referrer)),h&&(y.device_model=(null===(e=o.ZP.device)||void 0===e?void 0:e.model)||"",y.os_name=(null===(t=o.ZP.os)||void 0===t?void 0:t.name)||"",y.os_version=(null===(i=o.ZP.os)||void 0===i?void 0:i.version)||""),d.ext&&Object.keys(d.ext).map(function(e){a.exInfo[e]=d.ext[e]}),(0,_.cM)("trackConfig",y),this.tracker.config(y),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=c.Z.get();c.Z.remove(),t.map(function(t){Object.keys(t).map(function(i){if((0,_.cM)("sendLocalLog",i,t[i]),e.player){e.player.emit("abLog",i,t[i]);var r=e._options.sendLocalCallback;r&&"function"==typeof r&&r(i,t[i])}e._track(i,t[i])})})}},{key:"_track",value:function(e,t){var i=t.isLeave;delete t.isLeave,"function"==typeof this.tracker?this.tracker(e,t):this._options.enableBeacon&&e===n.bT.ONE_PLAY&&i?this.tracker.beaconEvent(e,t):this.tracker.event(e,t)}},{key:"bindEvt",value:function(){var e=this;this.listeners=[{evt:"ready",handler:this.onReady},{evt:"play",handler:this.onPlay},{evt:"playing",handler:this.onPlaying},{evt:"pause",handler:this.onPause},{evt:"waiting",handler:this.onWaiting},{evt:"playInterfaceInfo",handler:this.onPlayInterfaceInfo},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"progress",handler:this.onVideoProgress},{evt:"autoplay_was_prevented",handler:this.onNotAutoPlay},{evt:"seeking",handler:this.onSeeking},{evt:"seeked",handler:this.onSeeked},{evt:"complete",handler:this.onPlayerInited},{evt:"timeupdate",handler:this.onTimeUpdate},{evt:"mseAttaching",handler:this.onMSEAttaching},{evt:"mseAttached",handler:this.onMSEAttached},{evt:"bufferedChange",handler:this.onBufferedChange},{evt:"beforeDefinitionChange",handler:this.onBeforeDefinitionChange},{evt:"definitionChange",handler:this.onDefinitionChange},{evt:"definitionChangeSuccess",handler:this.onDefiChangeSuccess},{evt:"replayBtnClick",handler:this.onReplayBtnClick},{evt:"initialUrl",handler:this.initializeUrlLog},{evt:"ABR_CHANGE",handler:this.onAbrChange},{evt:"playCatch",handler:this.onPlayCatch},{evt:"log",handler:this.onLog},{evt:"progress_event",handler:this.onProgressEvent},{evt:"logger_next",handler:this.onNext},{evt:"playnext",handler:this.onNext},{evt:"nextEnded",handler:this.onNextEnded},{evt:"media_format_error",handler:this.onMediaFormatError},{evt:"xglog",handler:this.onXgLogWaiting},{evt:"xglog_cache",handler:this.onXgLogCache},{evt:"degrade",handler:this.onDegrade},{evt:"definitionChangeDetail",handler:this.onDefinitionChangeDetail},{evt:"prf_data_size",handler:this.onPrfDataSize}];var t=this.player.config.errorKey;(0,_.cM)(">>>errorKey",t);var i={evt:"error",handler:this.onPlayerError};t&&(i.evt=t),this.listeners.push(i),this.listeners.forEach(function(t){e.player.on(t.evt,t.handler)}),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t;return(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache)}},{key:"addIfExist",value:function(e,t,i){if(!!y(t)){var r=t[e];null!=r&&(i[e]=r)}}},{key:"sendSwitchOpera",value:function(e){var t=this._progressInfo,i=t.lastBitrate,r=t.curBitrate,n=t.nextBitrate,a={costTime:0,operaType:"detail_switch",stateBefore:"",stateAfter:"",endType:e},s=null;if("changedetail"===e){if(!i)return;s=i,a.stateBefore=i.definition,a.stateAfter=n.definition}else s=r,a.stateBefore=r.definition,a.stateAfter="";var o={vds:s.cdnSize,pvds:s.pcdnSize,fileid:s.fileid};this.onOneOperator(a,o)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,r=e.startTime,n=e.operaType,a=e.abrInfo,s=e.endType,o=this.resLogs;t=(0,_.fC)(t),i=(0,_.fC)(i),o.ldet=(0,_.je)(),o.df=i,o.lf=t,o.final_resolution=i,o.switch_count++;var d=o.ldet-r,c={bc:o.bc,bu_acu_t:o.bu_acu_t,sc:o.sc,sat:o.sat,watch_dur:(0,_.uV)(o.played)};a&&(c.abrInfo=a),this.updateVds(),this.resetDefiInfo(),!this._options.closeResolutionLog&&this.onOneOperator({costTime:d,operaType:n,endType:void 0===s?"":s,stateBefore:t,stateAfter:i},c,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=t[e],n=(0,_.je)();return i&&(t[e]=n),-1===r?-1:n-r}},{key:"updateSeekPt",value:function(e){return this.getLastInterval("lastSeekStartTime",this.seekLog,e)}},{key:"_reportInvalidVV",value:function(e){return!!this._isInvaidVV()&&(this.onOneError({endState:e,errorType:9998,code:-1,url:this.player.currentSrc,headers:{}},0),this._isOnePlayReport=!0,!0)}},{key:"_isInvaidVV",value:function(){return 0===this.vt&&-1===this.curStatus}},{key:"bindUnload",value:function(){o.ZP.isPC?window.addEventListener("beforeunload",this.onUnload):(o.ZP.isMobile||o.ZP.isPad)&&window.addEventListener("pagehide",this.onUnload),document.addEventListener("visibilitychange",this.onVisibilitychange),this.player.once("destroy",this.onDestroy)}},{key:"clearTimers",value:function(){var e=this.seekLog;e.intervalId&&window.clearTimeout(e.intervalId),this.stallIntervalId&&window.clearTimeout(this.stallIntervalId)}},{key:"sendDegradeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"playCatch",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,_.cM)("sendDegradeLog",e,t,i);var a=this.degradeLog;if(!a.hasSendEnd&&("playCatch_end"!==e||"none"!==t)){"playCatch_end"===e&&(a.hasSendEnd=!0);var s=this.bu_acu_t-a.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:i.url},(0,r.Zj)({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-a.bc,bu_acu_t:s>n.bB?0:s,watch_dur:this.watchDur-a.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?n.UK.FULLSCREEN_TYPE:this.player.isCssfullScreen?n.UK.CSS:n.UK.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,i=0,r=e.video&&e.video.buffered;if(r){for(var n=r.length,a=0,s=0;s<n;s++)a+=r.end(s)-r.start(s);t=i=1e3*a}return{video:t,audio:i}}},{key:"updateAbrInfo",value:function(e,t,i){e.abr_general_info=t.generalInfo,e.abr_event_info.video_exit={local_time_ms:new Date().getTime(),buffer_length:t.bufferLength,internet_speed:t.downloadSpeed,now_bitrate:t.nowBitrate,play_speed:i},t.getAbrPlayInfo&&(e.abr_play_info=t.getAbrPlayInfo())}},{key:"getPerformance",value:function(){return this.player.performance||{}}},{key:"setExt",value:function(){var e=this,t=this.player.ext||{};t.performance&&delete t.performance,Object.keys(t).map(function(i){"performance"!==i&&(e.exInfo[i]=t[i])})}},{key:"onOneOperator",value:function(e){var t=e.costTime,i=e.operaType,r=e.stateBefore,a=e.stateAfter,s=e.endType,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,c=this.getLastInterval("lastOperaTime"),u={local_time:new Date().getTime(),v:this.vid,opera_type:i,state_before:r,state_after:a,cost_time:t,end_type:s||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:c,bufs:(0,_.LQ)(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount};"seek"===i&&(u.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var l=this.player;l&&l.dashState&&(u.dash_state=this.player.dashState),Object.keys(o).forEach(function(e){u[e]=o[e]}),this.addIfExist("drm_type",this._options,u),this.reportLog(n.bT.ONE_OPERA,u,d)}},{key:"onOneError",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:0,code:0,url:"",headers:{},costTime:0,vid:"",message:"",preload_hit:0,preload_cached:0,interval_time:0},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,_.cM)("onOneError",t);var s=this.errorLog,o=this.apiLog,d=this.resLogs,c=this.player,u=this.playlogs,l=(0,_.xV)(t.headers||{}),h=this.getPerformance(),f=t.code>0?0-t.code:t.code;this.setExt();var p=this._getCompatibilityInfo();this.setNovv(t,t.endState||n.av.ERROR);var v=(0,r.Zj)((0,r.Zj)((0,r.Zj)({v:t.vid||this.vid,video_pos:this.cur_play_pos,local_time:new Date().getTime(),cost_time:t&&t.costTime?t.costTime:0,errt:t.errorType,errc:f,es:this.es,cdn_url:t.url||this.url,bufs:(0,_.LQ)(this.buffers.allBuffer),resolution:d.final_resolution,last_errors:s.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:l.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},l),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:u.degrade,end_state:t.endState||n.av.ERROR,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:(0,_.LQ)(this.exInfo),pref:(0,_.LQ)(h),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0},p);c&&c.dashState&&(v.dash_state=c.dashState);var g=this.player.currentSrc,y=(0,_.ky)(g)?(0,_.ky)(t.url)?this.initial_url:t.url:g,m={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:(0,_.ky)(g)?1:0};if(a&&"String"===(0,_.kM)(y)){var k={};(0,_.vR)(y,{range:"0-8",timeout:2e3}).then(function(e){(0,_.cM)("getXhr>>check result ",e);var t=(0,_.xV)(e.headers||{});v.server_ip=t.x_response_sinfo,k=(0,r.Zj)((0,r.Zj)({},m),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})}).catch(function(e){k=(0,r.Zj)((0,r.Zj)({},m),{},{statusText:-2===e.status?"timeout":"error",status:e.status})}).finally(function(){var t=(0,_.qP)(y);k.isexpired=t,v.net=(0,_.LQ)(k),e.reportLog(n.bT.ONE_ERROR,v,i)})}else v.net=(0,_.LQ)(m),this.reportLog(n.bT.ONE_ERROR,v,i)}},{key:"_getCompatibilityInfo",value:function(){var e=(0,o._M)();return{is_spider:o.ZP.isSpider?1:0,is_support_mp4:o.ZP.isSupportMP4?1:0,is_support_hevc:(0,o.G9)()?1:0,is_support_mse_mp4:e.support?1:0,support_mse_mp4:e.message}}},{key:"reportLog",value:function(t,i,r){var a=this,s=this._options,d=this.player.ABTestTag,u=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===(0,_.kM)(s.absdkVersion)?s.absdkVersion.join(","):s.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=d&&(i.abtest_tag=d);var h=this._options;i.codec_type=this.codecType,y(h)&&(n.qC.forEach(function(e){a.addIfExist(e,h,i)}),Object.keys(u).forEach(function(e){a.addIfExist(e,u,i)}),i.vtype=this.vtype),i.env_info=(0,_.LQ)(this._envInfo||{}),i.support=(0,o.Cy)(),i.visible=(0,_.ab)();var f=function(){if(1===r){var e={};e[t]=i,c.Z.set(e);return}if(2===r){a.addEventsQueue(t,i);return}a.player&&a.player.emit("abLog",t,i),a._track(t,i)};if("function"==typeof s.onReportLog){var p=s.onReportLog(t,i);null!=p&&p.then?p.finally(function(){return f()}):f()}else f()}},{key:"addEventsQueue",value:function(e,t){this.eventQueue.push({event:e,params:t}),this.eventQueue.length>=this._options.maxQueueCount&&this.sendEventsQueue()}},{key:"sendEventsQueue",value:function(){for(;this.eventQueue.length>0;){var e=this.eventQueue.pop();this._track(e.event,e.params)}}},{key:"startWaitingStatus",value:function(e,t){this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus"),this.onOneEvent({costTime:t,end_type:"waitstart"},{},2)}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;(0,_.cM)("triggerTask>>",e),t=t||this.player.src,!(0,_.LM)(t)&&this.vtype.indexOf("MP4")>-1&&this.task&&this.task.trigger(t,e)}},{key:"appendStallInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;!this.exInfo.stall&&(this.exInfo.stall=[]);var r=this.exInfo.stall;if("start"===e){r.length>6&&r.splice(0,r.length-6);var n=this.buffers.curBuffer;r.push({start:t,end:-1,endType:"waitstart",cost:0,cur:this.cur_play_pos,buf_s:n.buf_s_pos,buf_e:n.buf_e_pos,buf_i:n.buf_include})}else if("end"===e){var a=r.length-1;if(a<0)return;r[a].end<0&&(r[a].end=t,r[a].endType=i,r[a].cost=t-r[a].start)}(0,_.cM)("appendStallInfo",r)}},{key:"suspendWaitingStatus",value:function(e){var t=(0,_.je)(),i=this.playlogs,r=this.resLogs,a=this.stall,s=this.inWaitingStart;if(!(s<=0)&&!this.isSeeking&&!(i.vt<=0)){if((0,_.cM)("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-s," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-s>n.bJ){var o=t-this.inWaitingStart;if(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=o,i.dbc++):(i.nbc++,i.n_bu_acu_t+=o),r.bc++,i.bu_acu_t+=o,r.bu_acu_t+=o,a.end=this.cur_play_pos,a.cost=o,a.acc+=a.cost,1===a.sc&&(a.endf=this.cur_play_pos),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var d=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:new Date().getTime(),stall_duration:parseFloat((o/1e3).toFixed(2)),buffer_length:d.bufferLength,internet_speed:d.downloadSpeed,now_bitrate:d.nowBitrate,play_speed:this.player.playbackRate,is_abr:d.isCurrentInAbr?1:0})}this.onOneEvent({costTime:o,end_type:"waitend_".concat(e)||"waitend"},{},2)}this._endType="",this.load_state=n.fp.PLAYABLE,this.inWaitingStart=0,this.waitStartTime=0,window.clearTimeout(this.stallIntervalId),this.stallIntervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!!this.isSeeking){var i=this.seekLog,r=this.resLogs,a=this.player,s=(0,_.je)()-i.lastSeekStartTime;(0,_.cM)("suspendSeekStatus>>","".concat(e," currentTime:").concat(a.currentTime," costTime:").concat(s," sat:").concat(i.sat," resLogs.sat:").concat(r.sat)),i.intervalId&&window.clearTimeout(i.intervalId),i.intervalId=null,this.isSeeking=!1;var o=this._endType="seek",d=i.seekBefore,c=(a.currentTime||0).toString();i.sc++,i.sat+=s>n.YL?0:s,r.sc++,r.sat+=s>n.YL?0:s,s>n.YL&&(s=n.YL),this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:s,operaType:o,stateBefore:d,stateAfter:c,endType:e})}}},{key:"setPt",value:function(){var e=this.playlogs;this.startStep=1,!e.pt&&this.player.currentTime&&(this.isSeeking=!0),!e.pt&&(e.pt=(0,_.L8)(),(0,_.cM)("setPt","init pt :".concat(e.pt,", document.visibilityState:").concat(document.visibilityState)))}},{key:"setVt",value:function(){var e=this.playlogs;1===this.startStep&&(!e.vt&&(e.vt=(0,_.L8)(),(0,_.cM)("setVt: first frame inited","vt-pt:".concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt))),this.startStep=2)}},{key:"setBr",value:function(e){var t=this.playlogs;t.vt>0&&(0===t.br&&(t.fbrt=e||""),t.br++)}},{key:"codecType",get:function(){var e=this.player;return e&&e.config&&e.config.codecType?e.config.codecType:this._options.codec_type||"h264"}},{key:"url",get:function(){var e=this.player;return e&&e.config?e.config.url:""}},{key:"vid",get:function(){var e=this.player;return e&&e.config?e.config.vid:""}},{key:"bc",get:function(){return this.playlogs.bc}},{key:"bu_acu_t",get:function(){var e=this.playlogs.bu_acu_t;return e>n.bB?0:e}},{key:"pt",get:function(){return this.playlogs.pt||(0,_.L8)()}},{key:"vt",get:function(){var e=this.playlogs,t=e.vt;return e.pt>0?t:0}},{key:"fvt",get:function(){var e=this.playlogs,t=e.vt,i=e.pt,r=0;return t>0&&i>0&&(r=parseInt(t-i,10)),r>n.T3?n.T3:r}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,i=e.nt;return t>0&&i>0?parseInt(t-i,10):0}},{key:"getFrameInfo",value:function(){if(!this.player||!this.player.videoFrameInfo)return{f_total:0,drop_count:0,drop_rate:0,corrupted:0};var e=this.player.videoFrameInfo,t=e.dropped,i=e.corrupted,r=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:r,corrupted:i}}},{key:"vd",get:function(){var e=this.player;return e.duration&&"number"==typeof e.duration&&e.duration>0?parseInt(1e3*e.duration,10):e.config.duration&&"number"==typeof e.config.duration?parseInt(1e3*e.config.duration,10):0}},{key:"cur_play_pos",get:function(){return parseInt(1e3*this.player.currentTime,10)}},{key:"volume",get:function(){return this.player.volume}},{key:"buffer_time",get:function(){var e=0;try{var t=this.player.getBufferedRange();e=t[1]-t[0]}catch(t){e=0}return e}},{key:"player_created_t",get:function(){return this._playerCreatedTime}},{key:"playbackRate",get:function(){return this.player.playbackRate}},{key:"mute",get:function(){return this.player.muted?0:1}},{key:"videoWidth",get:function(){var e=this.player;return e&&e.video?e.video.videoWidth:0}},{key:"videoHeight",get:function(){var e=this.player;return e&&e.video?e.video.videoHeight:0}},{key:"preload",get:function(){var e=this.player;return!!e&&!!e.video&&e.video.preload}},{key:"initial_url",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_url?this.urlLog.initial_url:(0,_.LM)(e)?"":e}},{key:"initial_host",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_host?this.urlLog.initial_host:(0,_._P)((0,_.LM)(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;if(e&&e.__dash__&&e.__dash__.curReqVideoSegInfo){var i=e.__dash__.curReqVideoSegInfo.headers||{};return(0,_.xV)(i)}return t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,i=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:i.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?"".concat(e.definition):this.resLogs.df}},{key:"sessionId",get:function(){return this._sessionId}},{key:"finish",get:function(){return this.isEnded?1:0}},{key:"end_type",get:function(){return this._endType}},{key:"avgSpeed",get:function(){return this.player&&this.player.avgSpeed?this.player.avgSpeed:0}},{key:"realSpeed",get:function(){return this.player&&this.player.realTimeSpeed?this.player.realTimeSpeed:0}},{key:"mp4MseOpLength",get:function(){if(!this.player||!this.player.plugins)return -1;var e=this.player.plugins.mp4encryptplayer;return e?e.opQueueLen||0:-1}},{key:"mp4LoadSegmentTimeRange",get:function(){if(!this.player||!this.player.plugins)return"";var e=this.player.plugins.mp4encryptplayer;return e?e.loadSegmentTimeRange.join(","):""}},{key:"preLoadData",get:function(){if(!this.player||!this.player.plugins)return[];var e=this.player.plugins.mp4encryptplayer;if(e&&e.preLoadData)return{hit:1,duration:e.preLoadData.duration,length:e.preLoadData.byteLength};var t=this.player.stat||{};if(t.preLoadData){var i=t.preLoadData.length;return{hit:i>0?1:0,length:i}}return{hit:0,duration:0,length:0}}},{key:"preloadState",get:function(){if(!this.player||!this.player.plugins)return 0;if(void 0!==this.player.preloadState)return this.player.preloadState||0;var e=this.player.plugins.mp4encryptplayer;return e&&e.preloadState?e.preloadState:0}},{key:"curBitrate",get:function(){var e=this.player,t=e.config,i=e.curDefinition;return i&&i.bitrate?i.bitrate:t.defaultBitrate?t.defaultBitrate:0}},{key:"videoReadyState",get:function(){var e=this.player;return e&&e.video?e.video.readyState:-1}},{key:"videoSeeking",get:function(){var e=this.player;return e&&e.video&&e.video.seeking?1:0}},{key:"videoPaused",get:function(){var e=this.player;return e&&e.video&&e.video.paused?1:0}},{key:"switchResolutionCount",get:function(){return this.resLogs.switch_count}},{key:"isError",get:function(){return this.player._isError||this.player.video.error}},{key:"isPlaying",get:function(){return(0,_.pv)(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return(0,_.pv)(this.player.root,"xgplayer-ended")||(0,_.pv)(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return(0,_.pv)(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return(0,_.pv)(this.player.root,"xgplayer-isloading")}},{key:"es",get:function(){return this.isPlaying?"playing":"beforePlay"}},{key:"lt",get:function(){var e=0;return 0===this.vt&&((0,_.cM)("lt init",this.playlogs.lt),e=(0,_.L8)()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?n.kU.ERROR:this.isStop?n.kU.STOP:this.isPause?n.kU.PAUSE:this.isLoading?n.kU.LOADING:n.kU.PLAYING}},{key:"is_start_play_automatically",get:function(){return"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,i=e.cumulateTime?e.cumulateTime:(0,_.uV)(t.played);return i>=0?i>n.bB?n.bB:i:0}},{key:"vtype",get:function(){if(this.__vtype)return this.__vtype;var e=this.player?this.player.vtype||this.player.config.vtype:"";return e||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"envInfo",get:function(){return this._envInfo},set:function(e){if(!!e)this._envInfo=e}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(!(this.inWaitingStart>0))return 0;var e=(0,_.je)()-this.inWaitingStart;return e>n.YL?0:e}},{key:"videoNetworkState",get:function(){var e=this.player;return e&&e.video?e.video.networkState:-1}},{key:"eagleid",get:function(){var e=this.player;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?(e.__dash__.curReqVideoSegInfo.headers||{}).eagleid:""}},{key:"initial_type",get:function(){var e=this.player.config||{};return e&&e.vodLogOpts&&void 0!==e.vodLogOpts.currentDashType?parseInt(e.vodLogOpts.currentDashType,10):-1}},{key:"dynamicType",get:function(){var e=this.player;return this.__dt?this.__dt:e&&e.__dash__&&e.__dash__.dash&&e.__dash__.dash.mpd?(this.__dt=e.__dash__.dash.mpd.dashType,this.__dt):""}},{key:"updateBuffers",value:function(){var e=this.player.buffered,t=[];if(!e||e.length<1){this.buffers.allBuffer=[];return}for(var i=0;i<e.length;i++){var r=parseInt(1e3*e.start(i),10),n=parseInt(1e3*e.end(i),10);t.push({s:r,e:n})}this.buffers.allBuffer=t}},{key:"updateCurBuffer",value:function(e){var t=this.player,i=t.buffered,r=t.currentTime,n={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!i||i.length<1)return n;for(var a=-1,s=-1,o=parseInt(1e3*r,10),d=i.length-1;d>-1;d--){var c=parseInt(1e3*i.start(d),10),u=parseInt(1e3*i.end(d),10);if(o>=c&&o<=u){n.buf_include=1,n.buf_s_pos=c,n.buf_e_pos=u,n.buf_diff=u-o;break}o<c&&(a<0||c-o<a)?(a=c-o,s=d):o>u&&(a<0||o-u<a)&&(a=o-u,s=d)}1!==n.buf_include&&(s<0&&(s=i.length-1),n.buf_s_pos=parseInt(1e3*i.start(s),10),n.buf_e_pos=parseInt(1e3*i.end(s),10)),this.buffers.curBuffer=n}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.player.buffered;if(!i)return!1;e=parseInt(1e3*e,10);for(var r=0;r<i.length;r++){var n=parseInt(1e3*i.start(r),10),a=parseInt(1e3*i.end(r),10)+t;if(e>n&&e<a)return!0}return!1}},{key:"getPCDNStat",value:function(){if(!this.player||!this.player.pcdnVVStat)return{};var e=this.player.pcdnVVStat,t=e.try_req_num,i=e.req_node_succ,n=e.conn_req_num,a=e.has_ret_node,s=e.conn_fail_num,o=e.conn_jump_num,d=(0,r.Kd)(e,g);return(0,r.Zj)({try_req:t,req_succ:i,has_ret:a,conn_req:n,conn_fail:s,conn_jump:o},d)}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,i=this.resLogs,r=0,n=0;if(t.__dash__&&t.__dash__.dash&&t.__dash__.dash.mpd.mediaList){var a=t.__dash__.dash.mpd.mediaList.video,s=a[a.selectedIdx];(0,_.cM)("updateVideoSize》》videoItem",s),n=s?s.bitrate||s.bandwidth:0,r=s?s.size:0}else{var o=this.player.curDefinition;o?(n=o.bitrate||t.config.bitrate||0,r=parseInt(o.bitrate*t.duration/8,10)):(r=e.videoSize||t.config.videoSize||0,n=e.bitrate||t.config.bitrate||0)}(0,_.cM)("updateVideoSize","bitrate:".concat(n,", vs:").concat(r)),r&&(i.vs=r,i.vis=parseInt(r/t.duration,10),i.bitrate=n||i.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,i=this.player;if(0===e.vis){(0,_.cM)("updateVds","vis:".concat(e.vis));return}for(var r=parseInt((0,_.uV)(t.played)/1e3,10),n=i.buffered,a=0,s=0;s<n.length;s++)a+=parseInt(n.end(s)-n.start(s),10);(0,_.cM)("updateVds","pdur:".concat(r," bdur:").concat(a," \n lbuf:").concat(e.lbuf," lplayed:").concat(e.lplayed," bitrate: ").concat(e.bitrate," vis:").concat(e.vis," vs:").concat(e.vs)),e.lplayed=r,e.lbuf=a}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return m},set:function(e){m=e,k="__tea_cache_tokens_".concat(m)}},{key:"AB_SDK_VERSION",get:function(){return S},set:function(e){S="Array"===(0,_.kM)(e)?e.join(","):e}},{key:"Collector",set:function(e){b=e}},{key:"defaultConfig",value:function(){return{line_app_id:"",line_user_id:"",isTask:!1,codec_type:"",playerCoreVersion:"",playerVersion:"",start_time:0,maxQueueCount:5,channel:"cn",channelDomain:"",absdkVersion:"",checkByInnerLog:!0,drm_type:0,vtype:"MP4",tag:"普通视频",subtag:"",dynamic_type:"",sendLocalCallback:function(){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1,trackerConfig:{},envInfo:{},enableTeaWebId:!1,enableBeacon:!1,trackerWorker:null}}}])}()},38546:function(e,t,i){i.d(t,{C:function(){return a}});var r=i(726949);i(124300),i(497397),i(248385),i(591111),i(490629),i(656562),i(520995),i(992871);var n=(0,r.qH)(function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.PA)(this,e),n.collectorName=t.name,t.worker&&(n.instance=t.worker,n.bindEvents()),n.callbacks=i},[{key:"callMethod",value:function(e,t){if(!!n.instance)(n.instance instanceof SharedWorker?n.instance.port:n.instance).postMessage({trackerName:n.collectorName,type:"__CUSTOM_CALL__",data:{method:e,args:t||[]}})}},{key:"destroy",value:function(){n.instance&&(n.unbindEvents(n.instance),n.instance=void 0)}}],[{key:"bindEvents",value:function(e){if(!!e||!!(e=n.instance))n.unbindEvents(e),(e instanceof SharedWorker?e.port:e).addEventListener("message",n.handleMessage),e.addEventListener("error",n.handleError)}},{key:"unbindEvents",value:function(e){e&&((e instanceof SharedWorker?e.port:e).removeEventListener("message",n.handleMessage),e.removeEventListener("error",n.handleError))}},{key:"handleMessage",value:function(e){var t=e.data,i=t.trackerName,r=t.type;if(t.data,"ready"!==r&&i!==n.collectorName)return}},{key:"handleError",value:function(e){n.notifyCallbacks("onError",Error(e.message))}},{key:"notifyCallbacks",value:function(e){var t=n.callbacks[e];if(t&&"function"==typeof t){for(var i=arguments.length,r=Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];t.apply(void 0,r)}}},{key:"isSupported",value:function(){return"undefined"!=typeof SharedWorker&&"undefined"!=typeof Worker&&"undefined"!=typeof Blob&&"undefined"!=typeof URL}},{key:"isWorkerReady",value:function(){var e;return!!(null!==(e=n.instance)&&void 0!==e&&e.isReady)}}]),a=n;a.instance=void 0,a.callbacks={}},343476:function(e,t,i){i(346984),i(932651),i(248385),i(679308),i(88856),i(759943)},21979:function(e,t,i){(0,i(671194).q9)()},965410:function(e,t,i){i.d(t,{Z:function(){return k}});var r,n,a=i(648955);i(346984),i(705574),i(941533),i(124300),i(9498),i(117232),i(173757),i(248385),i(679308),i(414931),i(591111),i(604575),i(663030),i(490629);var s=i(734123),o=i(298757),d=i(333777),c=i(405762),u=i(521323),l=i(731751),h=i(874768),f=i(364285),p=i(309324),_=i(525231),v=i(204961),g=i(106140),y=i(373974),m=l.iS;let k=(0,a.qH)(function e(t){var i=this;(0,a.PA)(this,e),(0,a._x)(this,"_onChangeConfig",function(e){if(e){var t,r=e.nextBufferLength===(null===(t=i.config)||void 0===t?void 0:t.minBufferLength);if(i._nextBufferLength=e.nextBufferLength,e.nextBufferLength&&!r)try{i.loadData()}catch(e){}}}),(0,a._x)(this,"startProgressTimer",function(){i._pluginInst.info({msg:"startProgressTimer"});i._loadDataTime=0;var e=i.player,t=i.config;if(!!e&&!!i&&!!i.isDashCanUse&&!!i.dash.mse)i.dash.mse.progressTimer=new o.zh,i.dash.mse.progressTimer.repeat(function(){i._checkAndLoadData&&i._checkAndLoadData("timer")},1e3*t.tickInSeconds||t.progressTimer||l.vG),i._startCheckBufferBreakTimer(),i.player.on(s.Events.TIME_UPDATE,i._onTimeUpdate)}),(0,a._x)(this,"_onTimeUpdate",function(){var e,t;if(!!i.isDashCanUse&&!!i.config.dashOpts&&!!(null!==(e=i.dash)&&void 0!==e&&e.mse))i._checkAndLoadData("timeupdate"),i.isEnded(),null===(t=i.dash)||void 0===t||t.onTimeUpdate(),i._seekingCheckBuffer()}),(0,a._x)(this,"_checkAndLoadData",function(){var e=i.config;if(!!i.isDashCanUse&&!!i.dash.mse&&!!i.dash.mse.progressTimer){var t=1e3*e.tickInSeconds||e.progressTimer||l.vG,r=c.Z.nowTime();r-i._loadDataTime>=t&&(i._loadDataTime=r,i.checkRemoveBuffer(),i.handleUrlExpire(),i.loadData(void 0),i.isEnded())}}),(0,a._x)(this,"_onAutoDescChange",function(e){var t,r=e.definition,n=e.reset,s=e.fps,o=e.item;!n&&(i.player.curDefinition=(0,a.Zj)({},o)),i.setAudioDefinition(),u.ZP.log(i.config.vid,"abritem autoDescChange",null===(t=i.player.curDefinition)||void 0===t?void 0:t.definition),i.updateAutoDefiDesc(r,n,s,o)}),this._pluginInst=t.pluginInst;var r=this._pluginInst,n=r.player,d=r.config;this._minDuration=1/0,this.player=n,this.config=d,this.startTimestamp=new Date().getTime(),this.lastDefiIdx=void 0,this.__isDashCanUse=!1,this.preloadBufferThreshold=this.config.preloadBufferThreshold||.5,this.abrInstance=null,this.definitions=[];var h=this.config.autoBitrateOpts||{};this.isPlayAutoDefi=!!h.isPlayAutoDefi,this.isOpenAutoDefi=!!h.isOpenAutoDefi,this.isCurrentAutoDefi=this.isOpenAutoDefi&&this.isPlayAutoDefi,this.bitrateMap={},this.curBitrate=0,this.defiIdMap={},this.definition2item={},this.bandwidth2item={},(this.preloadBufferThreshold<=0||this.preloadBufferThreshold>1)&&(this.preloadBufferThreshold=.5),this.curVideoInitSegmentIdx=-1,this.curVideoFileId=void 0,this.getPlayInfoTimestamp=this.startTimestamp/1e3;var p=d.dashOpts.dynamic_video.dynamic_video_list,_=d.dashOpts.dynamic_video.dynamic_audio_list;p&&p.length>0?this.urlExpireTimestamp=d.dashOpts.dynamic_video.dynamic_video_list[0].url_expire||0:_&&_.length>0&&(this.urlExpireTimestamp=d.dashOpts.dynamic_video.dynamic_audio_list[0].url_expire||0),this.gapJumpInst=new f.Z(n,d),c.Z.on(n,"addVideoBufferEnd",function(){i.gapJumpInst.onSegmentAppend()},"dashDestroy"),this._nextBufferLength=this.config.nextBufferLength,c.Z.on(n,g.J.CHANGE_FLYING_PLUGIN_CONFIG,this._onChangeConfig,"dashDestroy"),this._lastRemoveTimestamp=0},[{key:"initDash",value:function(e){var t=this;this.dash=e;var i=this.config;i.dashOpts.dynamic_video.dynamic_video_list.length>0&&(this.initAbr(),i.dashOpts.dynamic_video.dynamic_video_list.sort(function(e,t){return t.vheight-e.vheight}),i.dashOpts.dynamic_video.dynamic_video_list.forEach(function(e,r){e.definition===i.defaultDefinition&&(t.dash.selectedIdx=r)}),this.dashVideoEncrypted=i.dashOpts.dynamic_video.dynamic_video_list.some(function(e){return!!e.kid})),i.dashOpts.dynamic_video.dynamic_audio_list.length>0&&(this.dashAudioEncrypted=i.dashOpts.dynamic_video.dynamic_audio_list.some(function(e){return!!e.kid}))}},{key:"isDashCanUse",get:function(){return this.__isDashCanUse},set:function(e){this.__isDashCanUse=e}},{key:"encryptedType",get:function(){if(this.dashVideoEncrypted||this.dashAudioEncrypted){var e,t=!!this.config.intertrustServerURL||(null===(e=this.player.plugins)||void 0===e||null===(e=e.drm)||void 0===e?void 0:e.serverCertificatePath);return this.config.useEME?t?1:3:2}return 0}},{key:"isSuspendLoading",get:function(){return this._suspendLoading}},{key:"isEnded",value:function(){var e=this.dash,t=this.player,i=this.mse,r=this.config;if("vod"===e.type){if(t.ended)u.ZP.log("player.ended === true"),"safari"===s.Sniffer.browser&&(t.pause(),t.emit("ended"));else{var n=r.duration||t.duration||e.mpd.duration;if(t.duration&&(n=Math.min(n,t.duration)),e.mpd.duration&&(n=Math.min(n,e.mpd.duration)),n-this._minDuration<10&&(n=Math.min(n,this._minDuration)),n>0&&n-t.currentTime<l.Z6){var a=this._findRangeForPlaybackTime(t.currentTime)||{start:0,end:0};u.ZP.log("range",a,"current",t.currentTime,"duration",n);var o=Math.min(a.end,t.duration),d=t.currentTime-o>=0&&a.end>0,c=o-t.currentTime<l.Z6&&a.end>0;(d||c)&&(u.ZP.log("isEnded execute, isOver",d,"isClosed",c),i.endOfStream(),this.clearProgressTimer())}}}}},{key:"dashDestroy",value:function(){var e=this.player,t=this.dash;for(var i in t&&t.mse&&t.mse.unbindMedia&&t.mse.unbindMedia(),t&&t.eme&&(t.eme.emit("destroy"),t.eme.destroy()),t&&e.errorHandler&&(t.abortLoadingTasks(),t.emit("destroy")),t&&t.mpd&&t.mpd.timer&&(clearTimeout(t.mpd.timer),t.mpd.timer=null),this.crypto&&this.crypto.destroy(),t&&t.destroy(),this.clearCheckCanplayTimer(),this.clearProgressTimer(),this.clearBufferBreakTimer(),this.destroyAbr(),this.gapJumpInst&&this.gapJumpInst.destroy(),e&&(this.player.off(s.Events.TIME_UPDATE,this._onTimeUpdate),e.__dash__=null,this._pluginInst.unloadVideo(),"function"==typeof e.video.setMediaKeys&&e.video.setMediaKeys(null).catch(function(){})),t)delete t[i];for(var r in this)delete this[r]}},{key:"bindComEvent",value:function(){var e,t=this;this._lastSeekTime=null;var i=this.player,r=this.config;c.Z.on(i,"error",t.clearProgressTimer.bind(t),"dashDestroy"),c.Z.on(i,"ended",t.clearProgressTimer.bind(t),"dashDestroy"),c.Z.on(i,"ended",function(){t.ended=!0},"dashDestroy");var n=(e=(0,a.x)((0,a.l5)().mark(function e(){var n,s,o,d,c,l,h,f,_,v;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u.ZP.log(null==r?void 0:r.vid,"dash onSeeking",i.currentTime,"duration",i.duration),!i._invalidSeekTag){e.next=5;break}return i._invalidSeekTag=!1,u.ZP.log("auto seek 0.001, return"),e.abrupt("return");case 5:if(!(!t.isDashCanUse||!r.dashOpts||!t.mse)){e.next=7;break}return e.abrupt("return");case 7:if(s=t.ended,t.ended=i.ended,!s){e.next=12;break}return this.isOpenAutoDefi?this._pluginInst.next(i.currentTime,"NEXT",i.config.DASHPlugin,!0):t.startProgressTimer(),e.abrupt("return");case 12:if(d=0===(o=i.getBufferedRange(i.buffered)[1]),u.ZP.log(null==r?void 0:r.vid,"dash onseeking, bufferEnd:".concat(o,", outBuffer:").concat(d,", \n switching:").concat(t.switching,", isFull:").concat(null===(n=t.mse)||void 0===n?void 0:n.isFull(p.d1.VIDEO))),!(d&&!t.switching)){e.next=20;break}return t.abortLoading=!0,e.next=19,t.dash.abortLoadingTasks();case 19:u.ZP.log("dash cancel loading task execute");case 20:if(t.dash){e.next=22;break}return e.abrupt("return");case 22:if(t.dash.mpd.setSegmentIndexByTime(i.currentTime),t.mse){e.next=25;break}return e.abrupt("return");case 25:if((c=t.mse).isFull&&(c.isFull(p.d1.VIDEO)||c.isFull(p.d1.AUDIO)))t.checkRemoveBuffer(!0,!0);else if(!d&&r.removeBufferWhenSeekInBuffer)try{l=i.getBufferedRange(t.mse.buffered("video"))[1],h=i.getBufferedRange(t.mse.buffered("audio"))[1],t._clearBufferByTime(Math.max(l,h),i.duration)}catch(e){}t.abortLoading=!1,d&&t._checkAndLoadData(),f=r.useDurationBackoff||!1,_=Date.now()/1e3,v=i.duration-i.currentTime<1,f&&v&&(!this._lastSeekTime||this._lastSeekTime<_-1)&&(this._lastSeekTime=_,i.currentTime=i.duration-1),t.gapJumpInst&&t.gapJumpInst.onSeeking();case 34:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)});c.Z.on(i,"seeking",n,"dashDestroy");c.Z.on(i,"seeked",function(){u.ZP.log("dash onSeeked",i.currentTime),t.seeking=!1,t.isEnded(),t.dash.isAllAppend()&&(t.mse.endOfStream(),u.ZP.log("dash seeked endofstream"))},"dashDestroy"),c.Z.on(i,"dashDestroy",t.dashDestroy.bind(this))}},{key:"_seekingCheckBuffer",value:function(){var e=this;if(!!this.dash)for(var t=[p.d1.VIDEO,p.d1.AUDIO],i=0;i<t.length;i++){for(var r=t[i],n=this.dash.getCurrentTask(r),a=this.dash.mpd.getBuffered(r),s=0;s<a.length;s++)!function(){var t,i=a[s],o=e.player.currentTime,d=i.start<=o&&o<=i.end,c=!1;if(n&&null!==(t=n._config)&&void 0!==t&&null!==(t=t.priOptions)&&void 0!==t&&t.extData){var l=n._config.priOptions.extData;c=l.startRaw-.1<=i.start&&i.end<=l.endRaw+.1}if(!d&&i.end-i.start<.5&&!c){u.ZP.log("remove buffer _seekingCheckBuffer",i.start,i.end,"curTime",o,"inBuffer",d,"mediaType",r,"mediaBuffered",a);var h=e.removeBuffer(r,i.start,i.end);h&&h.catch(function(e){u.ZP.log("_seekingCheckBuffer start",i.start,"end",i.end,e.message)})}}()}}},{key:"destroy",value:function(){var e=this.player;null==e||e.emit("dashDestroy")}},{key:"_findRangeForPlaybackTime",value:function(e){var t=this.player.buffered;if(!!t){for(var i=0;i<t.length;i++)if(c.Z.round(t.start(i))<=c.Z.round(e)&&c.Z.round(t.end(i))>=c.Z.round(e))return{start:c.Z.round(t.start(i)),end:c.Z.round(t.end(i)),rawStart:t.start(i),rawEnd:t.end(i)}}}},{key:"loadData",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.player,n=this.config;if(this.switching||this.abortLoading){u.ZP.log(n.vid,"loadData switching",this.switching);return}if(!this.dash||this._suspendLoading)return;var a=n.maxBufferLength||n.preloadTime||l.VC,s=this.dash.mpd.mediaList.video;if(s&&s.length>0&&s[s.selectedIdx]){var o=s[s.selectedIdx].bandwidth;t=s[s.selectedIdx].definition||this.bandwidth2item[o].definition}if(n.dynamicPreloadTimeOpts&&t){var c=n.dynamicPreloadTimeOpts[t];c&&(a=c)}var h=!1;r.paused&&(h=!0),a=h?r.isInstNext&&this._nextBufferLength>=0?this._nextBufferLength:n.minBufferLength:this.dash.getAdaptCacheBuffer(a),this.preloadTime!==a&&(this.preloadTime=a,u.ZP.log("maxCacheTimeAudio change",a),r.emit(d._c.MAX_BUFFER_CHANGE,{videoCacheTime:a,audioCacheTime:a}));var f=e||r.currentTime;!e&&(e=r.currentTime);var p=this._findRangeForPlaybackTime(e),_=p&&Math.ceil(Math.max(p.end,p.rawEnd))||Math.floor(e);if(this.dash.isOpenPCDN((null==p?void 0:p.end)||0),!(_>e+a)){var v=this.dash.getPCDNInOutBuffer(),g={force_set_min:h,buffer_dur:a,load_size:-1,load_tar_dur:-1,load_dur:-1,in_buf:v.PCDNInBuffer||-1,out_buf:v.PCDNOutBuffer||-1};this.dash.pushDynamicBufferServiceRes(g),this.dash.seek(e>0,f,i,a)}}},{key:"startCheckCanplayTimer",value:function(){var e=this,t=this.player,i=this.config;if(!!t&&!i.disableCanplayCheck)u.ZP.log("未起播计时开始!持续".concat(i.canplayTimeout,"毫秒未启播降级")),this.checkCanplayTimer=setTimeout(function(){u.ZP.log("确认没有起播!!!"),e.clearCheckCanplayTimer(),null==t||t.errorHandler(new h.Z(_.wb.RUNTIME,_.wb.SUB_TYPES.NO_CANPLAY_ERROR,{message:"NO_CANPLAY_ERROR"}))},i.canplayTimeout)}},{key:"clearCheckCanplayTimer",value:function(){this.checkCanplayTimer&&(clearTimeout(this.checkCanplayTimer),this.checkCanplayTimer=null)}},{key:"clearBufferBreakTimer",value:function(){this.bufferCheckTimer&&(clearTimeout(this.bufferCheckTimer),this.bufferCheckTimer=null)}},{key:"handleUrlExpire",value:function(){var e;null===(e=this._pluginInst)||void 0===e||e.handleUrlExpire(this)}},{key:"_startCheckBufferBreakTimer",value:function(){var e=this,t=this.config;if(!!t&&!t.disableBufferBreakCheck)this.clearBufferBreakTimer(),this.bufferCheckTimer=setTimeout(function(){e._onBufferBreakCheck(),e._startCheckBufferBreakTimer()},l.vG)}},{key:"_onBufferBreakCheck",value:function(){var e=this,t=this.player,i=this.config;if(!i){this.clearBufferBreakTimer();return}!i.disableBufferBreakCheck&&(Math.abs(t.currentTime-(e.lastCurrentTime||0))>.1||t.paused?(1===e.dashBufferBreak||2===e.dashBufferBreak)&&(u.ZP.log(null==i?void 0:i.vid,"视频没有卡死,重置卡死标记"),e.dashBufferBreak=0,clearTimeout(e.dashBufferBreakTimer),e.dashBufferBreakTimer=null):!e.dashBufferBreak&&(e.dashBufferBreak=1,u.ZP.log(null==i?void 0:i.vid,"卡死计时开始!持续".concat(i.waitingTimeOut,"毫秒则确认卡死")),e.dashBufferBreakTimer=setTimeout(function(){if(1===e.dashBufferBreak){e.dashBufferBreak=2,u.ZP.log("确认卡死!!!");var t=document.hidden||"hidden"===document.visibilityState?_.wb.SUB_TYPES.WAITING_TIMEOUT_ERROR:_.wb.SUB_TYPES.BUFFERBREAK_ERROR;e.dash.emit("error",new h.Z(_.wb.RUNTIME,t))}e.dashBufferBreakTimer=null},i.waitingTimeOut)),e.lastCurrentTime=t.currentTime)}},{key:"_isMseFull",value:function(){return!!this.mse&&!!this.mse.isFull&&(this.mse.isFull(p.d1.VIDEO)||this.mse.isFull(p.d1.AUDIO))}},{key:"checkRemoveBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player,r=this.config,n=new Date().getTime(),a=this._isMseFull(),s=e||a;if(!(n-this._lastRemoveTimestamp<1e3*r.removeBufferLen)||!!s){this._lastRemoveTimestamp=n;var o=i.currentTime,d=i.getBufferedRange(),c=d&&d[0]>=0&&o-d[0]>r.removeBufferLen;u.ZP.log("checkRemoveBuffer","mseFull",a,"force",e,"needRemove",c),(s||c)&&this._clearBuffer(s,t)}}},{key:"_checkBufferFull",value:function(e){var t=this;clearTimeout(this._fullTimer),this._isMseFull()&&(this._fullTimer=setTimeout(function(){clearTimeout(t._fullTimer),t._clearBuffer(!0)},1e3*e))}},{key:"_clearBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.player;if(!!this.isDashCanUse&&!!this.mse){var n=r.getBufferedRange()[1]>0,a=r.currentTime,s=c.Z.getBufferData(null==r?void 0:r.buffered,a),o=s.beforeBufLen,d=s.afterBufLen,l=s.beforeLastBuffEnd,h=s.afterFirstBuffEnd,f=s.afterFirstBuffStart;!n&&(a=a-l<15?l:a);var p=this._findClosetGop(a,!1),_=t&&i&&!n,v=_?.1:5;if(p&&this._clearBufferByTime(0,p,function(t){_&&(null==t?void 0:t.removeDur)<5&&e._clearBuffer(!0,!0)}),t){u.ZP.log("clearBuffer isFull","isSeeking",i,"isInBuffer",n,"beforeBufLen",o,"afterBufLen",d,"afterFirstBuffEnd",h,"afterFirstBuffStart",f,"beforeLastBuffEnd",l);var g=0,y=0;if(i&&!n){if(y=this._findClosetGop(f,!0,2),g=this._findClosetGop(h,!1,1),u.ZP.log("clearBuffer isFull removeStart",y,"removeEnd",g),0===o){for(var m=this.player.video.buffered,k=0,S=m.length-1;S>=0;S--){var b=m.start(S),T=m.end(S);if((k+=T-b)>10){y=c.Z.round(b),g=c.Z.round(T);break}}u.ZP.log("clearBuffer isFull beforeBufLen 0 removeStart",y,"removeEnd",g)}y<g?this._clearBufferByTime(y,g,function(t){_&&(null==t?void 0:t.removeDur)<5&&e._clearBuffer(!0,!0)}):this._checkBufferFull(v)}else this._checkBufferFull(v)}}}},{key:"_findClosetGop",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=this.dash.mpd.mediaList.video;!r[r.selectedIdx]&&(r=this.dash.mpd.mediaList.audio);var n=r[r.selectedIdx].mediaSegments;if(t){for(var a=0,s=0;s<n.length;s++)if(n[s].startRaw>e&&++a>i)return n[s].start}else{for(var o=0,d=n.length-1;d>-1;d--)if(n[d].endRaw<e&&++o>i)return n[d].end}}},{key:"_getFirstGopEnd",value:function(){var e,t=this.dash.mpd.mediaList,i=t.video.length>0,r=this.dash.mpd.mediaList.audio.length>0,n=0;if(i&&(n=Math.max(n,t.video[t.video.selectedIdx].mediaSegments[0].end)),r){;n=Math.max(n,(null===(e=t.audio[t.audio.selectedIdx].mediaSegments[0])||void 0===e?void 0:e.end)||0)}return{clearMinStart:n,hasVideo:i,hasAudio:r}}},{key:"clearBufferDirect",value:function(e,t){var i=t.startRaw,r=t.endRaw;if(!(i>=r)){var n=this.removeBuffer(e,i+1e-5,r);n&&n.catch(function(){u.ZP.log("mediaType",e,"catch clearBufferDirect start: ".concat(i," end: ").concat(r))})}}},{key:"_clearBufferByTime",value:function(e,t,i){var r=this,n=[],a=this._getFirstGopEnd(),s=a.clearMinStart,o=a.hasVideo,d=a.hasAudio;e=Math.max(s,e),u.ZP.log("removeBuffer clearBufferByTime start: ".concat(e," end: ").concat(t," clearMinStart:").concat(s));var c=this.getBufferDur();if(e>t){u.ZP.log("clearBuffer return clearBufferByTime start: ".concat(e," end: ").concat(t," clearMinStart:").concat(s)),i({removeDur:0});return}if(o){var l=this.removeBuffer(p.d1.VIDEO,e,t);l&&n.push(l)}if(d){var h=this.removeBuffer(p.d1.AUDIO,e,t);h&&n.push(h)}Promise.all(n).then(function(){var e=r.getBufferDur(),t=c-e;t>0&&(r.player.emit("removeBuffer",{removeDur:t}),u.ZP.log("removeBuffer dur,",t,"oldTotalBuffer",c,"newTotalBuffer",e),r.player.emit("removeBufferEnd"),i&&i({removeDur:t}))}).catch(function(e){u.ZP.log("removeBuffer error",e),i&&i({removeDur:0})})}},{key:"removeBuffer",value:function(e,t,i){var r=this;if(u.ZP.log("removeBuffer start",e,t,i),void 0===i){var n,a,s,o=this.dash.mpd.mediaList[e];if(null!==(n=o[o.selectedIdx])&&void 0!==n&&null!==(n=n.mediaSegments)&&void 0!==n&&n[0])i=null===(a=o[o.selectedIdx])||void 0===a||null===(a=a.mediaSegments)||void 0===a?void 0:a[0].endRaw;else{;i=this.config.duration||this.player.duration||(null===(s=this.dash)||void 0===s||null===(s=s.mpd)||void 0===s?void 0:s.duration)}u.ZP.log("removeBuffer end undefined, fix",e,t,i)}if(this.mse&&this.mse.remove&&!this._pluginInst.softVideo){var d=this.mse.remove(e,t,i);return d&&d.then(function(){var e,n=r.player.currentTime;t<n&&n<i&&r._pluginInst&&(r._pluginInst.removedCurrBuf=!0,u.ZP.log("removeBuffer currentTime",null===(e=r.player)||void 0===e?void 0:e.currentTime))}).catch(function(){}),d}return null}},{key:"getBufferDur",value:function(){if(!(null!==(e=this.player)&&void 0!==e&&e.buffered))return 0;for(var e,t=this.player.buffered,i=0,r=0,n=t.length;r<n;r++)i+=t.end(r)-t.start(r);return i}},{key:"abort",value:function(e){if(this.mse&&this.mse.abort&&this.dash.mpd.mediaList[e].length>0){var t=this.mse.abort(e,{mediaType:e});t&&t.catch(function(){})}}},{key:"clearProgressTimer",value:function(){this.isDashCanUse&&this.dash.mse&&this.dash.mse.progressTimer&&(this.dash.mse.progressTimer.clear(),this.dash.mse.progressTimer=null),this.dashBufferBreakTimer&&(clearTimeout(this.dashBufferBreakTimer),this.dashBufferBreakTimer=null,this.dashBufferBreak=void 0)}},{key:"emitMenuResolutionChange",value:function(){var e=this.player;try{var t=this.dash.mpd.mediaList.video;if(t){var i=t[t.selectedIdx],r={width:i.width,height:i.height};e.emit("RESOLUTION_UPDATE",r)}else e.emit("RESOLUTION_UPDATE")}catch(t){e.emit("RESOLUTION_UPDATE")}}},{key:"updateDashType",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=o.Xb.getItem(l.WV),r=l.sp;e=t?r.MAIN:i===r.BACK?r.MAIN:r.BACK,o.Xb.setItem(l.WV,e)}},{key:"changeMainBackUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m.INIT,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t&&!!this._pluginInst){var i=this._pluginInst.config,r=o.Xb.getItem(l.WV),n=!1,a=l.sp;if((e===m.INIT&&r===a.BACK||e===m.ERR)&&(n=!0),u.ZP.log(i.vid,"curDashType",r,"changeState",e,"needChange",n),n){var s=i.dashOpts.dynamic_video.main_url,d=i.dashOpts.dynamic_video.backup_url_1;i.dashOpts.dynamic_video.main_url=d,i.dashOpts.dynamic_video.backup_url_1=s,c.Z.exchangeListUrl(i.dashOpts.dynamic_video.dynamic_video_list),c.Z.exchangeListUrl(i.dashOpts.dynamic_video.dynamic_audio_list)}var h=i.dashOpts.dynamic_video.main_url;return this._checkUrlRange(h),i}}},{key:"_checkUrlRange",value:function(e){var t=this._pluginInst.config,i=t.url_range_domains||[],r=c.Z.validateUrlRange(i,e);t.useUrlRange=r}},{key:"updateAutoDefiDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=this.player,a=(this.config.autoBitrateOpts||{}).autoDefiText||"auto";n.emit("ABR_AUTO_DESC_CHANGE",a,t?void 0:e,i,r),!t&&this._pluginInst.setCurrentDefitionInfos("自动 ".concat(e),r)}},{key:"_abrLoadMetaSuccess",value:function(e,t,i,r){if(r===p.d1.VIDEO){var n,a=this.dash,s=this.config,o=a.mpd.mediaList.video,d=this.defiIdMap[e].bitrate;null===(n=this.abrInstance)||void 0===n||n.updateBitrate(d);var c=this.definitions.filter(function(e){return e.bitrate===d&&"__auto__"!==e.url})[0];this.abrInstance&&c&&(this.abrInstance.isCurrentHDR=!!c.isHDR),i&&(this.lastDefiIdx=e),this.selectedIdx=t,s.defaultDefinition=o[this.selectedIdx].definition}}},{key:"_startLoadInitSegment",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"video",n=new o.XK,a=this,s=this.dash,d=this.config;if(!s.mpd){u.ZP.log("_startLoadInitSegment dash.mpd is null"),n.reject();return}var c=s.mpd.mediaList[r],l=c.selectedIdx;return c.every(function(o,h){if(o.id!==e)return!0;l=h,a.setSwitching(r,!0);var f=c[l].wrapperData,p=s.isProgressiveLoading(r).isCancellable;return u.ZP.log("mediaType",r,"isCancellable",p),f&&p?((a.dashVideoEncrypted||a.dashAudioEncrypted)&&!1===d.useEME&&a.crypto&&a.crypto.updateHeaderId(),t._abrLoadMetaSuccess(e,l,i,r),n.resolve(f)):a._makeInitSegemntRequestWithRetry(r,l,!1,function(){a.setSwitching(r,!1)}).then(function(a){t._abrLoadMetaSuccess(e,l,i,r),n.resolve(a)}).catch(function(e){a.setSwitching(r,!1),u.ZP.log("_makeInitSegemntRequestWithRetry",JSON.stringify({msg:e.message}))}),!1}),n}},{key:"setCurrentDefinition",value:function(){try{var e=this.dash,t=e.mpd.mediaList.video,i=t[t.selectedIdx],r=i.definition,n=i.bandwidth;this._pluginInst.setCurrentDefitionInfos(r,this.definition2item[r]),e.updateDynamicBufferServiceBitrate(n),e.checkPCDN()}catch(e){}}},{key:"_emitDefinitionChangeDetailEvent",value:function(e){this.player.emit("definitionChangeDetail",e)}},{key:"setPlayerCurDefinition",value:function(e){var t=this._pluginInst.player;e&&"__auto__"===e.url||(t.curDefinition=e),this.setAudioDefinition()}},{key:"setAudioDefinition",value:function(){var e=this._pluginInst.player;if(e.curDefinition&&"object"===(0,a.Ac)(e.curDefinition)){var t=e.curDefinition.audio_file_id,i=this.config.dashOpts.dynamic_video.dynamic_audio_list;if(i.length>0)try{e.curDefinition.audioDefinition=i.filter(function(e){return e.file_id===t})[0]}catch(e){u.ZP.log("setAudioFaild",e)}}}},{key:"switchURL",value:function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=this;if(!e)return;if(!Array.isArray(e)){var r=e.toString();e=r.split("/")[r.split("/").length-1]}var n=i.definitions.filter(function(t){return t.url===e})[0];if(!!n){this.setPlayerCurDefinition(n);var a=e===d.UV;if(u.ZP.log("switchURL",e,t),a){i.abrInstance.start(),i.isCurrentAutoDefi=!0,i.abrInstance.isCurrentInAbr=!0,setTimeout(function(){i.abrInstance._onTimeUpdate(null,!0)});return}i.isCurrentAutoDefi&&(i.updateAutoDefiDesc("",!0),i.isCurrentAutoDefi=!1,i.abrInstance.isCurrentInAbr=this.isCurrentAutoDefi),t&&i.abrInstance.stop(!0),this._doChangeDefinition(p.d1.VIDEO,e),this._audioChangeDefinition(e)}}},{key:"_audioChangeDefinition",value:function(e){var t=this.dash.selectAudio(e,!1);if(t>-1)try{u.ZP.log("switch url audio change",t);var i=this.dash.mpd.mediaList.audio[t].id;if(i!==this.dash.mpd.mediaList.audio.selectedIdx){u.ZP.log("switch url audio same no need change");return}this._doChangeDefinition(p.d1.AUDIO,i)}catch(e){}}},{key:"_doChangeDefinition",value:function(e,t){var i,r=this,n=this._pluginInst.player,o=this;o._startLoadInitSegment(t,!0,e).then((i=(0,a.x)((0,a.l5)().mark(function t(i){var d,l,h,f,_,v,g,y,m,k,S;return(0,a.l5)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!((d=o.dash.mpd.mediaList[e])[o.selectedIdx].definition!==i.definition&&e===p.d1.VIDEO)){t.next=7;break}return o._videoSwiting=!1,u.ZP.log("definitionSwitchTime cancel, current:",o.selectedIdx,"self",i.newIdx),t.abrupt("return");case 7:return i.newIdx!==o.selectedIdx&&(u.ZP.log("definitionSwitch fix:",o.selectedIdx,"newIdx",i.newIdx),i.newIdx=o.selectedIdx),t.next=10,o._switch(i.newIdx,e);case 10:if(l=t.sent,h=n.currentTime,f=null,f=d[l||0].mediaSegments.find(function(e){return e.start-h>2.5}),_=!1,!f&&(f=(v=d[l||0].mediaSegments)[v.length-1],_=!0),f){t.next=19;break}return o._doAppendInitSegment(e,i,f),t.abrupt("return");case 19:g=c.Z.round(f.start),y=c.Z.round(n.getBufferedRange(n.buffered)[1]),u.ZP.log("切换清晰度 curTime: ".concat(h," start: ").concat(g," end: ").concat(y),h),e===p.d1.VIDEO&&(o.setCurrentDefinition(),!o.isCurrentInAbr()&&(u.ZP.log("definitionSwitchTime emit, current",o.selectedIdx),n.emit("definitionSwitchTime",g)),r._emitDefinitionChangeDetailEvent({start:g,bitrate:null===(m=d[i.newIdx])||void 0===m?void 0:m.bandwidth,mediaType:e,definition:i.definition,url:i.url,fileid:i.fileId})),y-g>0&&"safari"!==s.Sniffer.browser&&!_&&e===p.d1.VIDEO&&(u.ZP.log("switch seek removeBuffer: ".concat(g," ").concat(n.duration),"currentTime",n.currentTime),o.removeBuffer(e,f.startRaw,n.duration),k=Math.max(1,f.idx-1),(S=d[l||0].mediaSegments[k-1]).start>0&&S.start<h&&o.removeBuffer(e,0,S.startRaw-.001)),o._doAppendInitSegment(e,i,f);case 25:case"end":return t.stop()}},t)})),function(e){return i.apply(this,arguments)}))}},{key:"_doAppendInitSegment",value:function(e,t,i){var r=this;u.ZP.log("switchURL appendInitSegment start",t.newIdx),this._appendInitSegment(e,t,t.newIdx).then(function(){if(u.ZP.log("switchURL appendInitSegment",t.newIdx),r.setSwitching(e,!1),i&&r.loadData((i.start+i.end)/2,!1),r.emitMenuResolutionChange(),r.config.loadFirstGopData){var n;null===(n=r.dash)||void 0===n||n.loadFirstVideoGop()}})}},{key:"switching",get:function(){return this._switching}},{key:"setSwitching",value:function(e,t){e===p.d1.VIDEO?this._videoSwiting=t:this._audioSwiting=t,this._switching=this._videoSwiting||this._audioSwiting,u.ZP.log("setSwitching",e,"video",this._videoSwiting,"audio",this._audioSwiting)}},{key:"abrSwitchURL",value:function(e){var t,i=this,r=this.dash,n=this.player,s=this.config;e=e.split("/")[e.split("/").length-1],u.ZP.log("abrSwitchURL",e),this._startLoadInitSegment(e).then((t=(0,a.x)((0,a.l5)().mark(function e(t){var o,d,c,l;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.mpd.mediaList.video,e.next=3,i._switch(t.newIdx,p.d1.VIDEO);case 3:if(d=e.sent,c=n.getBufferedRange(n.buffered)[1],l=o[d].mediaSegments.find(function(e){return e.start-c>=0})){e.next=9;break}return i._doAppendInitSegment(p.d1.VIDEO,t,l),e.abrupt("return");case 9:i._pluginInst.info({msg:"abr switch",data:{bd:o[d].definition,d:o[t.newIdx].definition,start:0===c?n.currentTime:l.start},add:!0}),i.setCurrentDefinition(),i._appendInitSegment("video",t,t.newIdx).then(function(){u.ZP.log(null==s?void 0:s.vid,"abrSwitchURL appendInitSegment",t.newIdx),i.setSwitching(p.d1.VIDEO,!1),i.loadData(void 0,!1)}).catch(function(e){u.ZP.log(null==s?void 0:s.vid,"appendInitSegment",e)});case 12:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})).catch(function(e){u.ZP.log("startLoadInitSegemnt",e)}),u.ZP.log("abrSwitchURLAudioStart",e),this._audioChangeDefinition(e)}},{key:"_switch",value:(r=(0,a.x)((0,a.l5)().mark(function e(t,i){var r,n,s,o;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.dash,s=(n=i===p.d1.VIDEO?r.mpd.mediaList.video:r.mpd.mediaList.audio).selectedIdx,n.selectedIdx=t,e.next=6,r.abortLoadingTasks(i);case 6:return n[s].mediaSegments.every(function(e){return e.downloaded=l.Kc.NO_START,!0}),(o=r.mpd.mediaList.audio)[o.selectedIdx]&&o[o.selectedIdx].mediaSegments&&o[o.selectedIdx].mediaSegments.forEach(function(e){e.downloaded===l.Kc.GOING&&(e.downloaded=l.Kc.NO_START)}),e.abrupt("return",s);case 10:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"_handleInitData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=arguments.length>4?arguments[4]:void 0,a=this.dash,s=new o.XK;if(e instanceof ArrayBuffer){var d=0===t.length?e:e.slice(t[0],t[1]+1),c=null===i?null:e.slice(i[0],i[1]+1);a&&!1===a.useEME&&this.crypto?this.crypto.decryptHeader(d,"video"===n,!this._pluginInst.softVideo).then(function(t){var i=t.data,n=i.res,a=i.videoTrack,o=i.audioTrack;s.resolve({initSegmentRes:n,data:e,sidxSegmentRes:c,headers:r,videoTrack:a,audioTrack:o})}):s.resolve({initSegmentRes:d,data:e,sidxSegmentRes:c,vid:null,headers:r})}return s}},{key:"_appendInitSegment",value:function(e,t,i){var r=this,n=this.player,a=this.config,s=a.duration;this.dash.mpd.duration>0&&(s=this.dash.mpd.duration);var d=new o.XK,c=this.dash.mpd.mediaList[e],l=t.initSegmentRes,f=t.sidxSegmentRes;if(!t.fromCache&&(t.fromCache=!0,c[c.selectedIdx].wrapperData=t,f))try{if(this.dash.mpd.getSidx(f,e,i,s),this.abrInstance&&e===p.d1.VIDEO){var g=c[c.selectedIdx].mediaSegments[0].segmentDuration;this.abrInstance.readyPromise().then(function(){r.abrInstance.updateSegmentDuration(g)})}}catch(e){n.errorHandler(e);return}if(e===p.d1.VIDEO){var m=(0,v.Ww)(c[c.selectedIdx].codecs);this._pluginInst.setCodeInfo(m)}return u.ZP.log(null==a?void 0:a.vid,"appendInitSegment mediaType:".concat(e,", index: ").concat(i)),this.dash.changeType(e,c[c.selectedIdx].codecs),this._pluginInst._kernal.setNodeTime("init_".concat(e,"_appendStart")),this.dash.appendBuffer(e,l,{mediaType:e,index:i,initSegment:!0,allSegment:!0},t.videoTrack,t.audioTrack).then(function(t){if(r._pluginInst.info({msg:"appendBuffer",data:{mediaType:e,index:i}}),r._pluginInst._kernal.setNodeTime("init_".concat(e,"_appendDone"),t),u.ZP.log(null==a?void 0:a.vid,"appendInitSegment success mediaType:".concat(e,", index: ").concat(i,", \n curVideoInitSegment:").concat(r.curVideoInitSegmentIdx)),c[c.selectedIdx].inited=!0,c.switchTag=!0,d.resolve(),"video"===e&&r.curVideoInitSegmentIdx!==i){r.curVideoInitSegmentIdx=i,r.curVideoFileId=c[c.selectedIdx].fileId,u.ZP.log(null==a?void 0:a.vid,"appendInitSegment",i,"fileId",r.curVideoFileId);var s=r._findClosetGop(n.currentTime,!0,0);r.dash.mpd.clearBuffer(s,n.duration,"video")}}).catch(function(t){var i,s="appendInitSegment type-".concat(e,"-appendCatch,range:").concat(JSON.stringify(l),",\n message:").concat(t.message);u.ZP.log(null==a?void 0:a.vid,s),null===(i=r._pluginInst)||void 0===i||i.setStartTimelines(y.l1.MSE_ERROR,{message:s}),t&&t.errorCode&&n&&n.emit(new h.Z(_.wb.MEDIA,t.errorCode,{message:"appendInit ".concat(t.message)}))}),this.dash.appendFirstSegment(e),d}},{key:"_makeInitSegemntRequest",value:(n=(0,a.x)((0,a.l5)().mark(function e(){var t,i,r,n,s,d,c,l,h,f,p,_,v,g,y,m,k,S,b,T,E,L,I,C,R,D=arguments;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=D.length>0&&void 0!==D[0]?D[0]:"video",i=D.length>1&&void 0!==D[1]?D[1]:0,r=D.length>2&&void 0!==D[2]?D[2]:null,n=this.dash,s=this.config,d=new o.XK,c=n.mpd&&n.mpd.mediaList[t][i],l=[],h="",c){e.next=12;break}return d.reject({mediaType:t,index:i,initSegmentRange:l,url:h,rejected:!0,msg:"list is null"}),u.ZP.log("initSegmentRequest error"),e.abrupt("return",d);case 12:return l=(c.initSegmentRange||[]).concat(),(f="segment_base"===n.mpd.dashType)&&(l[1]=c.sidxRange[1]),h=c.initSegment,p="video"===t&&(c.definition||this.bandwidth2item[c.bandwidth].definition),this._checkUrlRange(h),_=s.useInitTimeout?s.initTimeout:0,v={mediaType:t,vid:s.vid,definition:"video"===t?p:void 0,useUrlRange:s.useUrlRange,timeout:_,bitrate:c.avg_bitrate||c.bandwidth||c.bitrate,initSegment:!0,codecType:c.codecType||"h264",fileId:c.fileId,checkPreload:!0,urlList:c.backupUrlList},g=!1,y=function(){r&&r(),g=!0},e.next=24,n.getData(h,l,t,v,!1,null,y,_);case 24:return k=(m=e.sent||{}).res,S=m.headers,b=m.status,T=m.readyState,E=m.fromCache,L=m.error,I=m.orgDefinition,k&&"error"!==k?(I&&p===(null===(R=this.player.curDefinition)||void 0===R?void 0:R.definition)&&(this.player.curDefinition.orgDefinition=I),this._handleInitData(k,c.initSegmentRange,f?c.sidxRange:null,S,t).then(function(e){e.newIdx=i,e.mediaType=t,e.initSegmentRange=l,e.cache=E,e.definition=v.definition,e.bitrate=v.bitrate,e.url=h,e.fileId=v.fileId,d.resolve(e)})):(C=!1,c.fallbackUrl&&!c.hasFallback&&f&&(c.hasFallback=!0,C=!0,c.initSegment=c.fallbackUrl),d.reject({mediaType:t,index:i,initSegmentRange:l,url:h,rejected:!0,reason:k||(g?"isCanceled":"initData is null"),status:b,readyState:T,ext:L instanceof Error?{msg:L.message}:L,retry:C})),e.abrupt("return",d);case 28:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"_makeInitSegemntRequestWithRetry",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;this.handleUrlExpire();var s=a||new o.XK;return r&&this._pluginInst._kernal.setNodeTime("init".concat(t,"_metastart")),this._makeInitSegemntRequest(t,i,n).then(function(n){if(!e._pluginInst){s.reject(new h.Z(_.wb.RUNTIME,h.Z.INIT_SEGMENT_ERROR,{message:"".concat(t," initSegment has destroyed"),mediaType:t,index:i,destroy:!0}));return}e._pluginInst.info({msg:"initSegmentRequest succ"}),r&&(e._pluginInst._kernal.setNodeTime("init".concat(t,"_metadone"),{fromCache:n.cache,byteLength:n.data.byteLength,mediaType:t,index:i,definition:n.definition,isInitSegment:!0},!0),e._emitDefinitionChangeDetailEvent({start:0,bitrate:n.bitrate,mediaType:t,definition:n.definition,url:n.url,fileid:n.fileId})),s.resolve(n)}).catch(function(r){if(r.retry){e._makeInitSegemntRequestWithRetry(t,i,!1,n,s);return}var a,o=r.message?r.message:r;s.reject(new h.Z(_.wb.RUNTIME,h.Z.INIT_SEGMENT_ERROR,{line:329,mediaType:t,index:i,error:o,message:"reason ".concat((null==r||null===(a=r.ext)||void 0===a?void 0:a.msg)||(null==o?void 0:o.reason)," status ").concat(null==o?void 0:o.status),retry:r.retry}))}),s}},{key:"updateAbrCacheData",value:function(e,t,i){var r=this.dash,n=this.config,a=n.autoBitrateOpts||{},s=r.mpd.mediaList.video,o=i.definition,c=n.definitionText&&n.definitionText[o]||o,u=s[e],l=i.bitrate;this.bitrateMap[l]={url:u.id,definition:o,definitionName:c},this.defiIdMap[u.id]={bitrate:l,definition:o},e===s.length-1&&this.isOpenAutoDefi&&this.definitions.push({name:a.autoDefiText||"auto",url:d.UV,selected:t,definition:"自动",fps:void 0})}},{key:"destroyAbr",value:function(){var e=this.player;this.abrInstance&&(e&&e.off(d._c.UPDATE_AUTO_DESC,this._onAutoDescChange),this.abrInstance.destroy(),this.abrInstance=null)}},{key:"initAbr",value:function(){var e,t=this,i=this,r=this.player,n=this.config;c.Z.on(r,d._c.UPDATE_AUTO_DESC,this._onAutoDescChange,"dashDestroy"),this.bitrateMap={},this.defiIdMap={};var s=u.qu;i.abrInstance=new d.ZP(r,n,0,n.dashOpts.dynamic_video,5e3,{logger:u.ZP.abr,openLog:s}),c.Z.once(r,d._c.ABR_START_PROGRESS,this.startProgressTimer,"dashDestroy"),i.abrInstance.onAbrChange=function(e){var t=e.prevBitrate,n=e.curBitrate,a=i.bitrateMap[t],s=i.bitrateMap[n],o=null==a?void 0:a.definition,d=null==s?void 0:s.definition;if(u.ZP.abr("abr change prevD:",o,"curDef:".concat(d)),o!==d&&!!s)i.abrSwitchURL(s.url),r.emit("ABR_CHANGE",{prev:o,cur:d,prevName:a.definitionName,curName:s.definitionName})},c.Z.on(r,d._c.ABR_CHANGE,i.abrInstance.onAbrChange,"dashDestroy"),c.Z.on(r,d._c.ABR_LIMIT_BITRATE,(e=(0,a.x)((0,a.l5)().mark(function e(n){var s,o,d;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n.removed,u.ZP.log("ABR_LIMIT_BITRATE, currentTime",r.currentTime,"removed",s),!(i.isCurrentInAbr()&&s)){e.next=8;break}return e.next=5,null===(o=i.dash)||void 0===o?void 0:o._doCancel(p.d1.VIDEO);case 5:d=t._findClosetGop(r.currentTime,!0,2),u.ZP.log("ABR_LIMIT_BITRATE, currentTime",r.currentTime,"removeStart",d),t.removeBuffer(p.d1.VIDEO,d,r.duration);case 8:case"end":return e.stop()}},e)})),function(t){return e.apply(this,arguments)}),"dashDestroy"),i.abrInstance.isCurrentInAbr=this.isCurrentAutoDefi}},{key:"isCurrentInAbr",value:function(){return!!this.abrInstance&&this.abrInstance.isCurrentInAbr}},{key:"resumeLoading",value:function(){var e;if(!!this._suspendLoading)this._suspendLoading=!1,u.ZP.log(null===(e=this.config)||void 0===e?void 0:e.vid,"resumeLoading"),this.startProgressTimer()}},{key:"suspendLoading",value:function(){var e,t;if(!this._suspendLoading)this._suspendLoading=!0,u.ZP.log(null===(e=this.config)||void 0===e?void 0:e.vid,"suspendLoading"),null===(t=this.dash)||void 0===t||t.abortLoadingTasks(),this.clearProgressTimer()}}])},639803:function(e,t,i){i.d(t,{Ft:function(){return d},LY:function(){return o},NK:function(){return s},iR:function(){return c},uS:function(){return u},zB:function(){return a}});var r=i(648955);i(2885);var n=i(373974),a={TOP:"TOP",FEED:"FEED"};function s(e){e.duration=e.dashOpts.Data.Duration,e.dashOpts.dynamic_video=e.dashOpts.Data,e.dashOpts.dynamic_video.dynamic_video_list=[],e.dashOpts.dynamic_video.dynamic_audio_list=[],e.dashOpts.dynamic_video.dynamic_type=e.dashOpts.Data.AdaptiveInfo.AdaptiveType,e.dashOpts.dynamic_video.main_url=e.dashOpts.Data.AdaptiveInfo.MainPlayUrl;for(var t=0;t<e.dashOpts.Data.PlayInfoList.length;t++){var i=e.dashOpts.Data.PlayInfoList[t],r={backup_url_1:i.BackupPlayUrl,bitrate:e.dashOpts.Data.VideoID?i.Bitrate:1e3*i.Bitrate,check_info:i.CheckInfo,codec_type:i.Codec,definition:i.Definition,encrypt:!!i.PlayAuth&&!!(i.PlayAuthID||i.PlayAuthId),file_hash:i.FileHash||i.Md5,file_id:i.FileID,index_range:i.IndexRange,init_range:i.InitRange,first_segment_range:i.FirstSegmentRange,kid:i.PlayAuthID||i.PlayAuthId,logo_type:i.Logo||i.LogoType,main_url:i.MainPlayUrl,preload_interval:i.PreloadInterval,preload_max_step:i.PreloadMaxStep,preload_min_step:i.PreloadMinStep,preload_size:i.PreloadSize,quality:i.Quality,size:i.Size,spade_a:i.PlayAuth,vheight:i.Height,vtype:i.Format,vwidth:i.Width,isHDR:i.isHDR||0};"video"===i.MediaType||"video"===i.FileType?e.dashOpts.dynamic_video.dynamic_video_list.push(r):("audio"===i.MediaType||"audio"===i.FileType)&&e.dashOpts.dynamic_video.dynamic_audio_list.push(r)}}function o(e){var t=e.dashOpts.dynamic_video=e.dashOpts.Data;t.video_duration=t.duration,t.dynamic_video_list=[],t.dynamic_audio_list=[],e.dashOpts.dynamic_video.dynamic_type="segment_base";for(var i=t.playInfoList||t.payload,r=0;r<i.length;r++){var a,s,o,d=i[r];d.vtype.toUpperCase()===n.l0.DASH&&(d.main_url=(null===(a=d.url[0])||void 0===a?void 0:a.src)||d.main_url,d.backup_url_1=(null===(s=d.url[1])||void 0===s?void 0:s.src)||d.backup_url_1,d.fallback_url=(null===(o=d.url[2])||void 0===o?void 0:o.src)||d.fallback_url,d.codec_type="bytevc1"===d.codecType?"h265":d.codecType,"video"===d.mediaType&&t.dynamic_video_list.push(JSON.parse(JSON.stringify(d))),"audio"===d.mediaType&&t.dynamic_audio_list.push(d))}}function d(e,t,i){var r,n=e.selectedIdx;i>-1&&(n=i);var a=null===(r=e[n])||void 0===r?void 0:r.audioFileId;if(!a)return -1;for(var s=0;s<t.length;s++)if(t[s].fileId===a)return s;return 0}function c(e,t){try{("undefined"==typeof sessionStorage?"undefined":(0,r.Ac)(sessionStorage))==="object"&&"function"==typeof sessionStorage.setItem&&sessionStorage.setItem(e,t)}catch(e){}}function u(e){try{if(("undefined"==typeof sessionStorage?"undefined":(0,r.Ac)(sessionStorage))==="object"&&"function"==typeof sessionStorage.getItem)return sessionStorage.getItem(e)}catch(e){}return null}},190516:function(e,t,i){i.d(t,{D:function(){return v},o:function(){return g}});var r=i(236699),n=i(734123),a=i(648711),s=i(112751),o=i(778406),d=i(983711),c=i(879434),u=i(696001),l=i(829503),h=i(827147),f=[n.Events.PLAY,n.Events.SEEKING],p=[n.Events.PAUSE,n.Events.ENDED],_="definition_change_hint",v={SR_DEGRADE:"SR_DEGRADE",SR_ERROR:"SR_ERROR"},g=function(e){(0,r.XW)(i,e);var t=(0,r.WY)(i);function i(){var e;(0,r.PA)(this,i);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),(0,r._x)((0,r.Lc)(e),"_srCore",null),(0,r._x)((0,r.Lc)(e),"_paintCount",0),(0,r._x)((0,r.Lc)(e),"_degradeCount",0),(0,r._x)((0,r.Lc)(e),"_loadDataPromise",(0,d.Qo)()),(0,r._x)((0,r.Lc)(e),"_usedSr",!1),(0,r._x)((0,r.Lc)(e),"_isOnSR",!1),(0,r._x)((0,r.Lc)(e),"_code",c.te.NOT_ACTIVE),(0,r._x)((0,r.Lc)(e),"_rateTimestamp",performance.now()),(0,r._x)((0,r.Lc)(e),"_logger",new u.Z("SRPlugin")),(0,r._x)((0,r.Lc)(e),"_codeDesc",{}),(0,r._x)((0,r.Lc)(e),"_appendFrameStat",null),(0,r._x)((0,r.Lc)(e),"_hasGLErrorCall",!1),(0,r._x)((0,r.Lc)(e),"_isVideoPlaybackQualitySupported",!1),(0,r._x)((0,r.Lc)(e),"_encrypted",!1),(0,r._x)((0,r.Lc)(e),"_hasDefinitionChanged",!1),(0,r._x)((0,r.Lc)(e),"_preVideoWidth",0),(0,r._x)((0,r.Lc)(e),"_preVideoHeihgt",0),(0,r._x)((0,r.Lc)(e),"_hasRebuildWebGL",!1),(0,r._x)((0,r.Lc)(e),"_srCoreConfig",null),(0,r._x)((0,r.Lc)(e),"_isRebuildingContext",!1),(0,r._x)((0,r.Lc)(e),"_contextLostRetryCount",0),(0,r._x)((0,r.Lc)(e),"_setCore",function(t){e._srCore=t}),(0,r._x)((0,r.Lc)(e),"_refreshCoreIfSingle",function(){var t;if(null!==(t=e.config)&&void 0!==t&&t.isSingle&&e._srCoreConfig){var i=(0,s.s8)(!0,e._srCoreConfig);e._setCore(i)}}),(0,r._x)((0,r.Lc)(e),"_rebuildContext",function(t){if(!!e._srCore&&!e._isRebuildingContext&&!!e._srCoreConfig){if(!e.config.contextLostRetry||e._contextLostRetryCount>=e.config.contextLostRetryCount){e._onDegrade(c.te.WEBGL_CONTEXT_LOST,{msg:"WEBGL Context LOST",recover:!1});return}e._contextLostRetryCount++,e._isRebuildingContext=!0,e._hasRebuildWebGL=!0,e._code=c.te.WEBGL_CONTEXT_LOST,e._codeMsg="WEBGL Context LOST",e._logger.log("context lost, try rebuild, from:".concat(t));try{e._srCore.unBindMediaElement()}catch(e){}try{e.config.isSingle?(0,s.LQ)():e._srCore.destroy()}catch(e){}setTimeout(function(){var t=(0,s.s8)(e.config.isSingle,e._srCoreConfig);e._setCore(t),e._isRebuildingContext=!1,e._srCore.readyPromise.then(function(){e._srCore&&e.player&&(e._code=c.te.NOT_ACTIVE,e.active())})})}}),(0,r._x)((0,r.Lc)(e),"_onDefinitionChange",function(){e._hasDefinitionChanged=!0}),(0,r._x)((0,r.Lc)(e),"_onTimeUpdate",function(){var t=e.video,i=t.videoWidth,r=t.videoHeight;(e._preVideoWidth!==i||e._preVideoHeihgt!==r)&&(e._preVideoWidth=i,e._preVideoHeihgt=r,e._hasDefinitionChanged&&e._isLimitWidthHeight&&(e._hasDefinitionChanged=!1,e._isLimitWidthHeight=!1,e.core.video?e._startRender():e.active(),e._logger.log("onTimeUpdate render")))}),(0,r._x)((0,r.Lc)(e),"_onEncrypted",function(){e._encrypted=!0,e._isOnSR&&(e._logger.log("onEncrypted degrade"),e._onDegrade(c.te.ENCRYPTED,{msg:"encrypted video"}))}),(0,r._x)((0,r.Lc)(e),"_onSRCodeChanged",function(t){if(e._code=t,e._logger.log("SRCodeChange",t),t===c.te.WEBGL_CONTEXT_LOST){e._rebuildContext("SRCodeChange");return}c.GK.indexOf(t)>-1&&e._srCore&&e._onDegrade(e._code,{msg:e._srCore.codeMsg,recover:!1})}),(0,r._x)((0,r.Lc)(e),"getPaintCount",function(){return e._paintCount}),(0,r._x)((0,r.Lc)(e),"_onRenderLost",function(){var t;e._appendFrameStat=null===(t=e._appendFrameStragty)||void 0===t?void 0:t.getStat(),e._destroyAppendFrame(),e._isOnSR=!1,e._unBind()}),(0,r._x)((0,r.Lc)(e),"_onRenderCallback",function(t){if(!!e._srCore){if(t.code===c.te.LIMIT_WIDTH_HEIGHT&&(e._isLimitWidthHeight=!0),t.code===c.te.WEBGL_CONTEXT_LOST){e._rebuildContext("render");return}if(0!==t.code){var i=c.eO[t.code],n=!1;i&&(t.algoMsg=i.msg,n=i.recover),e._srCore.statMark(h.E.RUNINFO);var a=e._srCore.getRuntimeInfo()+(null==t?void 0:t.errMsg);e._srCore.statEndMark(h.E.RUNINFO),e._onDegrade(c.te.WASM_RENDER_FAIL,(0,r.Zj)((0,r.Zj)({},t),{},{msg:t.code+" WASM_RENDER_FAIL "+a,recover:n}))}else e._isLimitWidthHeight=!1,e._contextLostRetryCount=0,e._usedSr=!0,e._code=c.te.SUCCESS,e._codeMsg="SUCCESS",e._calFps()}}),(0,r._x)((0,r.Lc)(e),"_onRun",function(){e._srCore.readyPromise.then(function(){if(!!e._handleLimitResolution())e._loadDataPromise.then(function(){if(e._isOnSR&&e._srCore.code===c.te.SUCCESS){var t;null===(t=e._srCore)||void 0===t||t.run()}})})}),(0,r._x)((0,r.Lc)(e),"_onStop",function(){e._srCore.readyPromise.then(function(){if(e._isOnSR){var t;null===(t=e._srCore)||void 0===t||t.stop()}})}),(0,r._x)((0,r.Lc)(e),"_onLoadeddata",function(){e._loadDataPromise.resolve()}),e}return(0,r.qH)(i,[{key:"version",get:function(){return"1.0.20"}},{key:"setConfig",value:function(){this._code===c.te.WEBGL_CONTEXT_LOST&&this._rebuildContext("setConfig"),this._code=c.te.NOT_ACTIVE,this._codeMsg=this._codeDesc[this._code],this._isOnSR=!1,this._usedSr=!1,this._hasRebuildWebGL=!1}},{key:"core",get:function(){return this._srCore}},{key:"video",get:function(){var e=this.player;return e.media||e.video}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=this.player;if(t.disabled){this._usedSr=!1,this._code=c.te.SR_DISABLED,this._logger.log("disabled");return}(i.video||i.media).addEventListener("encrypted",this._onEncrypted),i.on("encrypted",this._onEncrypted),i.on(_,this._onDefinitionChange),i.on(n.Events.TIME_UPDATE,this._onTimeUpdate),Object.keys(c.te).forEach(function(t){e._codeDesc[c.te[t]]=t}),this._srCoreConfig=Object.assign({},t,{enableContextmenu:this.playerConfig.enableContextmenu,videoConfig:this.playerConfig.videoConfig||{}}),this._setCore((0,s.s8)(t.isSingle,this._srCoreConfig)),!t.isSingle&&this.active()}},{key:"_proxyVideoPlayQuality",value:function(){this._isVideoPlaybackQualitySupported=(0,a.rP)()}},{key:"active",value:function(){if(this._refreshCoreIfSingle(),this._encrypted){this._logger.log("ACTIVE ENCRYPTED return"),this._onDegrade(c.te.ENCRYPTED,{msg:"encrypted video"});return}if(this._srCore.code===c.te.WASM_INIT_FAIL||this._srCore.code===c.te.WASM_LOADED_FAILED){this._srCore.code===c.te.WASM_LOADED_FAILED&&(0,s.LQ)(),this._logger.log("ACTIVE FAIL",this._srCore.code),this._code=this._srCore.code,!this._srCore.hasReport&&(this._srCore.hasReport=!0,this._onDegrade(this._code,{msg:this._srCore.codeMsg,recover:!1}));return}if(this._srCore.isContextLost()||this._srCore.code===c.te.WEBGL_CONTEXT_LOST){this._rebuildContext("active");return}if([c.te.WASM_URL_MISS,c.te.HIJACK].includes(this._srCore.code)){this._code=this._srCore.code;return}var e=!!this.config.useDelayedSR&&this.config.isSingle,t=!this._srCore.isContextReady||this._code===c.te.WASM_NOT_READY;if(e&&t){this._code=c.te.WASM_NOT_READY,this._codeMsg="激活时超分未ready,并且设置useDelayedSR为false",this._isOnSR=!1;return}this._code=c.te.NOT_PLAY,this._logger.log("ACTIVE current stat notplay");var i=this.player;if(this._srCore.bindMediaElement(i.media||i.video,{onRenderCallback:this._onRenderCallback,onRenderLostCallback:this._onRenderLost,onSRCodeChanged:this._onSRCodeChanged}),this._isVideoPlaybackQualitySupported){var r=this.video.getVideoPlaybackQuality().totalVideoFrames;this._paintCount=r}this._unBind(),this._bindEvents(),this._startRender()}},{key:"_startRender",value:function(){var e=this;this._destroyAppendFrame();var t=this.config,i=t.threshold,r=t.minRenderCount;this._appendFrameStragty=new l.Z({isVFC:this._srCore.isUseVideoFrame,threshold:i,minRenderCount:r},this.player.media||this.player.video,function(t){e._paintCount=t}),this._isOnSR=!0,this._hasGLErrorCall=!1,this._tryRender()}},{key:"_calFps",value:function(){if(!!this._srCore){this._srCore.statMark(h.E.CALFPS);var e=this.config;if(this._srCore.isUseVideoFrame?this._paintCount+=this.video.playbackRate:this._paintCount++,!this._appendFrameStragty||!this._isVideoPlaybackQualitySupported){this._srCore.statEndMark(h.E.CALFPS);return}var t=this.video.getVideoPlaybackQuality(),i=t.droppedVideoFrames,r=t.totalVideoFrames;this._appendFrameStragty.record(performance.now(),r),this._dropRate=(r-this._appendFrameStragty.missFrames-this._paintCount)/r,this._dropRate<0&&(this._dropRate=Math.max(0,i/r)),this._srCore.recordDropRate(this._dropRate);var n=performance.now();this._dropRate>=e.degradeFrameRate&&r>100?n-this._rateTimestamp>1e3&&(this._rateTimestamp=n,this._degradeCount++,this._degradeCount>e.degradeFrameRateCount&&(this._degradeCount=0,this._onDegrade(c.te.FPS_DEGRADE,{msg:"FPS_DEGRADE",recover:!0,dropRate:this._srCore.getDropRate()}))):this._degradeCount=0,this._srCore.statEndMark(h.E.CALFPS)}}},{key:"_onDegrade",value:function(e,t){var i=t||{};this._logger.log("onDegrade, code: ".concat(e,", ext:").concat(JSON.stringify(t))),this._code=e,this._codeMsg=t.msg,this.emit(v.SR_DEGRADE,(0,r.Zj)((0,r.Zj)({code:e},i),{},{defaultRenderDelta:1e3/this.config.minRenderCount})),this._srCore.unBindMediaElement(),this._isOnSR=!1}},{key:"_bindEvents",value:function(){var e=this;f.forEach(function(t){e.on(t,e._onRun)}),p.forEach(function(t){e.on(t,e._onStop)})}},{key:"_isLimitResolution",value:function(){var e=this.config,t=e.maxWdith,i=e.maxHeight;return!!(this.video.videoWidth>t)||!!(this.video.videoHeight>i)||!1}},{key:"_handleLimitResolution",value:function(){return!this._isLimitResolution()||(this._code=c.te.LIMIT_WIDTH_HEIGHT,this._logger.log("LIMIT_WIDTH_HEIGHT"),!1)}},{key:"_unBind",value:function(){var e=this;this.player&&(f.forEach(function(t){e.off(t,e._onRun)}),p.forEach(function(t){e.off(t,e._onStop)}))}},{key:"_tryRender",value:function(){var e=this;this.video.readyState>=2?this._loadDataPromise.resolve():this.on("loadeddata",this._onLoadeddata),Promise.all([this._loadDataPromise,this._srCore.readyPromise]).then(function(){if(e._logger.log("tryRender width:".concat(e.video.videoWidth,", height:").concat(e.video.videoHeight)),e._isOnSR&&e._srCore.isContextReady&&e._handleLimitResolution()){var t;null===(t=e._srCore)||void 0===t||t.doRender()}}).catch(function(){})}},{key:"_destroyAppendFrame",value:function(){this._appendFrameStragty&&(this._appendFrameStragty.destroy(),this._appendFrameStragty=null)}},{key:"fps",get:function(){return this._fps}},{key:"isPlaybackUsedSR",value:function(){return this._usedSr}},{key:"getReason",value:function(){return this._code}},{key:"destroy",value:function(){var e,t;this.off("loadeddata",this._onLoadeddata),this._unBind(),null===(e=this.player)||void 0===e||e.off(n.Events.TIME_UPDATE,this._onTimeUpdate),null===(t=this.player)||void 0===t||t.off(_,this._onDefinitionChange),this._loadDataPromise=null,this._appendFrameStragty&&this._appendFrameStragty.destroy(),this._appendFrameStragty=null,this._srCoreConfig=null,!this.config.isSingle&&this._srCore.destroy(),this._srCore=null}},{key:"getStat",value:function(){var e,t,i,a=this._srCore?this._srCore.getStat():{},s=this._appendFrameStat?this._appendFrameStat:null===(e=this._appendFrameStragty)||void 0===e?void 0:e.getStat(),d=this.player.video||this.player.media;return(0,r.Zj)((0,r.Zj)({width:this.video.videoWidth,height:this.video.videoHeight,playbackRate:this.video.playbackRate,mediaTime:null===(t=this.video)||void 0===t?void 0:t.currentTime,presentedFrames:this._paintCount,isPlaybackUsedSR:this.isPlaybackUsedSR(),usingSR:n.Util.hasClass(d.parentElement,o.Xv),reason:this._code,reasonDesc:this._codeMsg||(null===(i=this._srCore)||void 0===i?void 0:i.codeMsg)||this._codeDesc[this._code],isLimitResolution:this._isLimitResolution(),isDestroyed:null===this._srCore,rebuildWebGL:this._hasRebuildWebGL},a),s)}},{key:"getLog",value:function(){var e=this._srCore.getLog()+"\n"+this._logger.getLogs();return this.emit("log",{type:"oneevent",end_type:"srlog",log:e}),e}},{key:"setRunning",value:function(e){if(!!this._srCore){if(this._srCore.statMark(h.E.SETRUNNING),this.config.disabled){this._srCore.statMark(h.E.SETRUNNING);return}this._isOnSR?(this._srCore.setRunning(e),!e&&(this._isOnSR=!1)):e&&(this._isOnSR=!0,this._srCore.setRunning(e)),this._srCore.statEndMark(h.E.SETRUNNING)}}}],[{key:"defaultConfig",get:function(){return(0,c.Rl)({})}},{key:"pluginName",get:function(){return"srplugin"}},{key:"isSupported",value:function(){return(0,a.Gb)()}},{key:"preload",value:function(e){(0,s.s8)(e.isSingle,e)}}]),i}(n.BasePlugin)},879434:function(e,t,i){i.d(t,{GK:function(){return l},Rl:function(){return a},eO:function(){return h},s8:function(){return d},te:function(){return u}});var r,n=i(236699);function a(e){return(0,n.Zj)({disabled:!1,algType:s.RAISEROPT,scaleType:o.SCALE_20X_LEGACY,backend:c.OPENGL,poolSize:2,maxWidth:2048,maxHeight:2048,wasmUrl:"",degradeFrameRate:.15,degradeFrameRateCount:3,canvasId:"",useVFC:!0,isSingle:!1,threshold:2,minRenderCount:20,useDelayedSR:!1,useScale:!1,useVideoTexture:!1,sizeChangeDelayRender:!1,sizeChangeDelayRenderCount:3,contextLostRetry:!1,contextLostRetryCount:1},e)}var s={RAISEROPT:2},o={SCALE_20X_LEGACY:0,SCALE_15X:1,SCALE_11X:4,SCALE_12X:8,SCALE_13X:16,SCALE_14X:32},d=(r={},(0,n._x)(r,o.SCALE_20X_LEGACY,2),(0,n._x)(r,o.SCALE_11X,1.1),(0,n._x)(r,o.SCALE_12X,1.2),(0,n._x)(r,o.SCALE_13X,1.3),(0,n._x)(r,o.SCALE_14X,1.4),(0,n._x)(r,o.SCALE_15X,1.5),r),c={OPENGL:3},u={SUCCESS:0,WASM_URL_MISS:1,WASM_INIT_FAIL:2,WASM_RENDER_FAIL:3,FPS_DEGRADE:4,SR_DISABLED:5,NOT_ACTIVE:6,NOT_PLAY:7,LIMIT_WIDTH_HEIGHT:8,WASM_NOT_READY:9,WASM_LOADED_FAILED:10,WEBGL_CONTEXT_LOST:11,HIJACK:12,ENCRYPTED:13},l=[u.WEBGL_CONTEXT_LOST,u.WASM_URL_MISS,u.WASM_RENDER_FAIL],h={"-100":{recover:!1,msg:"内存错误"},"-200":{recover:!0,msg:"参数错误"},"-201":{recover:!0,msg:"未创建超分处理上下文"},"-300":{recover:!1,msg:"GL错误"},"-600":{recover:!1,msg:"hydra错误"}}},827147:function(e,t,i){i.d(t,{E:function(){return n},Z:function(){return a}});var r=i(236699),n={LOAD_WASM:"loadWasm",WASM_INIT:"initWasm",RENDER:"render",CALFPS:"calfps",RUNINFO:"runinfo",GETERRORRENDER:"geterrorrender",SETRUNNING:"setrunning",SETWIDTHHEIGHT:"setwidthheight"},a=function(){function e(){var t=this;(0,r.PA)(this,e),(0,r._x)(this,"_marks",new Map),(0,r._x)(this,"_names",Object.values(n)),this._names.forEach(function(e){t._marks.set(e,{start:0,duration:0,avg:0,count:0})})}return(0,r.qH)(e,[{key:"mark",value:function(e){this._marks.get(e).start=performance.now()}},{key:"endMark",value:function(e){var t=this._marks.get(e);t.duration=performance.now()-t.start,t.count++,t.avg=(t.avg*(t.count-1)+t.duration)/t.count}},{key:"getStat",value:function(){var e=this,t={};return this._names.forEach(function(i){t[i]=e._marks.get(i).avg}),t}}]),e}()},310267:function(e,t,i){i.d(t,{v:function(){return a}});var r=i(261825);i(932651);var n=i(78346),a=(0,r.qH)(function e(t){(0,r.PA)(this,e),this.updateConfig(t)},[{key:"updateConfig",value:function(e){this._config=Object.assign({},e)}},{key:"_getTargetBitrate",value:function(e,t){var i=t.degFactor,r=this._config,n=r.autoBitrateParams,a=r.defaultBitrate,s=n.paramA,o=n.paramB,d=n.paramC,c=n.paramD,u=e<=0||!e?a:s*Math.pow(e,3)+o*Math.pow(e,2)+d*e+c;return i&&"factor"===i.degradeBitrateType&&"bitrate"===i.factorType&&(u*=i.value),u}},{key:"select",value:function(e,t,i){var r=i.speed,a=i.degFactor;this._config=Object.assign({},t);var s=r;if(a&&"factor"===a.degradeBitrateType&&"speed"===a.factorType&&(s*=a.value),e.length<=1)return e[0];var o=this._getTargetBitrate(s,{degFactor:a}),d=(0,n.v2)(e,o,t.selectAlgType);return!d&&(d=e[e.length-1]),d._targetBitrate=o,d}}])},410733:function(e,t,i){i.d(t,{Z:function(){return a}});var r=i(6055);i(346984),i(497397),i(2885),i(248385),i(679308);var n=i(99020);let a=(0,r.qH)(function e(){(0,r.PA)(this,e)},[{key:"_initStorage",value:function(e){var t=e.name,i=e.storeName,n="".concat(t,"_").concat(i);return this.key=n,(!window[n]||"object"!==(0,r.Ac)(window[n]))&&(window[n]={}),this.store=window[n],Promise.resolve()}},{key:"getItem",value:function(e,t){var i=this.store[e];return void 0===i&&(i=null),this._internalPromise(t,i)}},{key:"getItemSync",value:function(e,t){var i=this.store[e];return void 0===i&&(i=null),t&&t(i),i}},{key:"setItem",value:function(e,t,i){return this.store[e]=t,this._internalPromise(i)}},{key:"removeItem",value:function(e,t){return delete this.store[e],this._internalPromise(t)}},{key:"clear",value:function(e){return this.store={},window[this.key]={},this._internalPromise(e)}},{key:"length",value:function(e){var t=Object.keys(this.store).length;return this._internalPromise(e,t)}},{key:"_internalPromise",value:function(e,t){var i=t?Promise.resolve(t):Promise.resolve();return(0,n.Z)(i,e),i}},{key:"all",value:function(e){for(var t=[],i=Object.keys(this.store),r=0;r<i.length;r++){var n=i[r];t.push({key:n,value:this.store[n]})}return this._internalPromise(e,t)}},{key:"probeSupport",value:function(){return!0}}])},874281:function(e,t,i){i.d(t,{Z:function(){return r}});function r(e){return"string"!=typeof e&&(e=String(e)),e}},39455:function(e,t,i){i.d(t,{Z:function(){return y}}),i(149336);var r=i(315355),n=i(919209),a=i(732905),s=i(625813),o=i(278997),d=i(508881);i(248385),i(679308),i(346984);var c=i(942155),u=i.n(c),l=i(597931),h=i(455792),f=i(367625),p=i(651668),_=i(534611),v=i(155363),g=i(874668),y=function(e){(0,s.Z)(u,e);var t,i,c=(t=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,d.Z)(t);return e=i?Reflect.construct(r,arguments,(0,d.Z)(this).constructor):r.apply(this,arguments),(0,o.Z)(this,e)});function u(e,t){var i;return(0,r.Z)(this,u),(i=c.call(this)).TAG="TimeLine",i._parent=t,i._seeking=!1,i.audioRender=f.Z.isSupported()?new f.Z(e,(0,a.Z)(i)):new h.Z(e,(0,a.Z)(i)),i.videoRender=new p.Z(e,(0,a.Z)(i)),i._readyStatus={audio:!1,video:!1},i._paused=!0,i._switchToMultiWorker=!1,i._lowdecodeEmited=!1,i._startPlayed=!1,i._emitReady=!1,i._singleTrack=-1,i._bindEvent(),i._decodeVideo=e.video,i._seekDirection=1,i}return(0,n.Z)(u,[{key:"analyse",get:function(){return this._parent.analyse}},{key:"ready",get:function(){return this._readyStatus.video&&this._readyStatus.audio}},{key:"played",get:function(){var e=this;return{length:this.currentTime?1:0,start:function(){return 0},end:function(){return e.currentTime}}}},{key:"noAudio",get:function(){return 1===this._singleTrack||2===this._singleTrack}},{key:"isLive",get:function(){return this._parent.live}},{key:"seeking",get:function(){return this._seeking}},{key:"decodeFps",get:function(){return this.videoRender.decodeFps}},{key:"decodeCost",get:function(){return this.videoRender.decodeCost}},{key:"renderCost",get:function(){return this.videoRender.renderCost}},{key:"wasmInitCost",get:function(){return this.videoRender.wasmInitCost}},{key:"fps",get:function(){return this.videoRender.fps}},{key:"totalSize",get:function(){return this.videoRender.totalSize}},{key:"bitrate",get:function(){return this.videoRender.bitrate}},{key:"gopLength",get:function(){return this.videoRender.gopLength}},{key:"currentTime",get:function(){if(this.noAudio)return this.paused?this.videoRender.nextFrameTime:this.videoRender.currentTime;return this.audioRender.currentTime}},{key:"timelinePosition",get:function(){return this.noAudio?performance.now()/1e3:this.audioRender.currentTime}},{key:"canvas",get:function(){return this.videoRender.canvas}},{key:"readyState",get:function(){return this.audioRender.readyState}},{key:"buffered",get:function(){var e=this;return this.noAudio?this.videoRender.buffered:this.audioRender.isMse||this.isLive?this.audioRender.buffered:{length:this.audioRender.buffered.length,start:function(t){return Math.max(e.audioRender.buffered.start(t),e.videoRender.buffered.start(t))},end:function(t){return Math.min(e.audioRender.buffered.end(t),e.videoRender.buffered.end(t))}}}},{key:"duration",get:function(){return this.noAudio?this.videoRender.duration:this.isLive?this.audioRender.duration:Math.min(this.audioRender.duration,this.videoRender.duration)}},{key:"paused",get:function(){return this._paused},set:function(e){this._paused=e}},{key:"lowlatency",get:function(){return this._parent.lowlatency}},{key:"decoderMode",get:function(){return this.videoRender.decoderMode}},{key:"currentAudioCanAutoplay",get:function(){return this.audioRender.audioCanAutoplay}},{key:"_checkInBuffer",value:function(){for(var e=this.buffered,t=0,i=e.length;t<i;t++)if(e.start(t)<=this.currentTime+.1&&e.end(t)>=this.currentTime)return!0;return!1}},{key:"_resetReadyStatus",value:function(){this._readyStatus.audio=!1,this._readyStatus.video=!1}},{key:"_bindEvent",value:function(){var e=this;this.on(_.ZP.DECODE_EVENTS.REMUX,function(t){e.videoRender.setRemux(t)}),this.on(_.ZP.DECODE_EVENTS.CHASE_VIDEO_FRAME_END,function(t){e.emit(_.ZP.DECODE_EVENTS.CHASE_AUDIO_FRAME,t)}),this.audioRender.on(_.ZP.AUDIO.AUDIO_READY,function(t){l.kg.log(e.TAG,"audio ready! seeking=",e._seeking,"seeked:",!!t,"paused:",e._paused),e._seeking&&setTimeout(function(){try{var t=1===e._seekDirection?e.videoRender.getSeekStartPositionBehind(e.currentTime,1/0):e.videoRender.getSeekStartPosition(e.currentTime,1/0);if(e.audioRender.isMse&&t){if((0,g.tT)().preciseSeekLimit>e.duration&&e.currentTime>.1){e.audioRender.seekNoSideEffect({position:e.currentTime+.1}),e.videoRender.ajustSeekTime(e.currentTime,!0);return}e.audioRender.seekNoSideEffect({position:t.position+.1}),e.videoRender.ajustSeekTime(t.position);return}e.videoRender.ajustSeekTime(e.currentTime)}catch(e){}},10),e._readyStatus.video&&e._startRender(e._seeking&&t),e._readyStatus.audio=!0,!e._startPlayed&&e.analyse.addAudioReady()}),this.audioRender.on(_.ZP.AUDIO.AUDIO_NOT_ALLOWED_AUTOPLAY,function(){e._emitReady&&e.pause()}),this.audioRender.on(_.ZP.AUDIO.AUDIO_WAITING,function(){!e.noAudio&&e.currentTime&&(l.kg.warn(e.TAG,"lack data, audio waiting,currentTime:",e.currentTime),e.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.WAITING),e.emit(_.ZP.TIMELINE.DO_PAUSE),e._readyStatus.audio=!1)}),this.videoRender.on(_.ZP.VIDEO.VIDEO_WAITING,function(){l.kg.warn(e.TAG,"lack data, video waiting"),e.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.WAITING),e.emit(_.ZP.TIMELINE.DO_PAUSE),e._readyStatus.video=!1}),this.videoRender.on(_.ZP.VIDEO.VIDEO_READY,function(){l.kg.log(e.TAG,"video ready!"),!e._startPlayed&&e.analyse.addVideoReady(),e._readyStatus.audio&&e._startRender(e._seeking),e._readyStatus.video=!0}),this.videoRender.on(_.ZP.VIDEO.DECODE_LOW_FPS,function(t){!(e.currentTime<.1)&&(e.analyse.increaseLowDecodeCount(t),!e._lowdecodeEmited&&((0,v.u$)(),e._lowdecodeEmited=!0),e.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.LOW_DECODE))}),this.on(_.ZP.TIMELINE.SINGLE_TRACK,function(t){e._singleTrack=t,(1===t||2===t)&&(e._readyStatus.audio=!0),3===t&&(e._readyStatus.video=!0),e.emit(_.ZP.TIMELINE.SYNC_DTS,0)}),this.on(_.ZP.TIMELINE.DESTROY,function(){e.removeAllListeners(),e.videoRender=null,e.audioRender=null}),this.on(_.ZP.TIMELINE.DO_PLAY,function(){e.emit(_.ZP.TIMELINE.START_RENDER),e._paused=!1,e.noAudio&&e.emit(_.ZP.TIMELINE.SYNC_DTS,0)})}},{key:"_startRender",value:function(e){if(!this._parent.error&&this.videoRender){if(this.noAudio&&this.emit(_.ZP.TIMELINE.SYNC_DTS,0),this.videoRender.forceRender(),!this.isLive&&this._paused&&this.seeking&&this._checkInBuffer()){l.kg.log(this.TAG,"set seeking = false"),this._seeking=!1,this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.SEEKED),l.kg.groupEnd();return}!this._startPlayed&&(this.analyse.addFirstframe(),this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.LOADEDDATA),this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.FIRST_FRAME),this._startPlayed=!0),l.kg.log(this.TAG,"emit canplay"),this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.CANPLAY),this._parent.autoplay&&(l.kg.warn(this.TAG,"startRender: time=",this.currentTime,"paused:",this.paused,"seeking:",this.seeking),this.emit(_.ZP.TIMELINE.START_RENDER)),this.emit(_.ZP.TIMELINE.READY),this._emitReady=!0,this._seeking&&e&&(l.kg.log(this.TAG,"set seeking = false"),this._seeking=!1,this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.SEEKED),l.kg.groupEnd())}}},{key:"_checkHlsTracks",value:function(e){if(!(null==e?void 0:e.samples[0])){if(!this.buffered.length){var t=Error("lack video sample");t.code=3,this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.ERROR,t)}return!1}return!0}},{key:"appendBuffer",value:function(e,t){this.emit(_.ZP.TIMELINE.APPEND_CHUNKS,e,t),this.noAudio&&this._seeking&&this.videoRender.ajustSeekTime(this.currentTime)}},{key:"play",value:function(){var e=this;return new Promise(function(t,i){var r=e.currentAudioCanAutoplay;e.noAudio?r=!0:e.audioRender&&e.audioRender.resume().then(function(){if(l.kg.log(e.TAG,"audio render resumed, pause status: ".concat(e._paused,", audioCanAutoplay:").concat(e.currentAudioCanAutoplay)),e._paused||!e.currentAudioCanAutoplay){r=!1,e.emit(_.ZP.TIMELINE.DO_PAUSE);return}r=!0}).catch(function(){}),setTimeout(function(){if(l.kg.log(e.TAG,"play() timer done, resumed=".concat(r,", paused=").concat(e.paused)),!r){if(!e.paused){l.kg.log(e.TAG,"audioCtx can't autoplay"),e.pause(),i({name:"NotAllowedError"});return}e.pause(),t();return}e._paused=!1,t()},e.audioRender.isMse?10:60)})}},{key:"pause",value:function(){var e,t;(!this._paused||null===(e=this.audioRender)||void 0===e||null===(t=e.media)||void 0===t||!t.paused)&&(this.ready||this._seeking)&&(this.emit(_.ZP.TIMELINE.DO_PAUSE),this._paused=!0,this.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.PAUSE))}},{key:"seek",value:function(e){var t=this;if(this._seeking&&l.kg.groupEnd(),this.isLive){if(this.currentTime<.1||!this.currentAudioCanAutoplay||this.paused)return;var i=this.videoRender.getSeekStartPosition(e,this._parent.preloadTime+1);if(i){if(i.position<this.currentTime)return;var r=this.audioRender.canSeek(i.position),n=this.videoRender.canSeek(i);if(!r||!n){l.kg.log(this.TAG,"seek, !!!!!!!!!can not seek, audioCanSeek:",r,"videoCanSeek:",n);return}l.kg.warn(this.TAG,"seek, chase frame to time: ",i.position,"currentTime:",this.currentTime,"duration:",this.duration),this.videoRender.videoDecode?(this.audioRender.doPause(),i.position=i.position-1.5,this.emit(_.ZP.DECODE_EVENTS.CHASE_VIDEO_FRAME,i)):this.emit(_.ZP.TIMELINE.CHASE_FRAME,i)}return}e>=this.duration&&(e=this.duration-1),e<0&&(e=0),l.kg.group(this.TAG,"start seek to:".concat(e,", set seeking status=true")),this._seeking=!0,this.videoRender.setSeekingStatus(!0),this.noAudio?(this.emit(_.ZP.TIMELINE.SYNC_DTS,this.videoRender.getDtsOfTime(e)),this.videoRender.ajustSeekTime(e)):this._resetReadyStatus(),this._seekDirection=this.currentTime<e?1:2,this.emit(_.ZP.TIMELINE.DO_SEEK,e),new Promise(function(e){t.emit(_.ZP.TIMELINE.PLAY_EVENT,_.ZP.VIDEO_EVENTS.SEEKING),e()})}}]),u}(u())},982143:function(e,t,i){i.d(t,{K:function(){return r}});var r={ERROR:"error",TTFB:"core.ttfb",LOAD_START:"core.loadstart",LOAD_RESPONSE_HEADERS:"core.loadresponseheaders",LOAD_COMPLETE:"core.loadcomplete",LOAD_RETRY:"core.loadretry",SOURCEBUFFER_CREATED:"core.sourcebuffercreated",MEDIASOURCE_OPENED:"core.mediasourceopened",ANALYZE_DURATION_EXCEEDED:"core.analyzedurationexceeded",APPEND_BUFFER:"core.appendbuffer",REMOVE_BUFFER:"core.removebuffer",BUFFEREOS:"core.buffereos",KEYFRAME:"core.keyframe",CHASEFRAME:"core.chaseframe",METADATA_PARSED:"core.metadataparsed",SEI:"core.sei",SEI_IN_TIME:"core.seiintime",FLV_SCRIPT_DATA:"core.flvscriptdata",LOWDECODE:"core.lowdecode",SWITCH_URL_SUCCESS:"core.switchurlsuccess",SWITCH_URL_FAILED:"core.switchurlfailed",SPEED:"core.speed",HLS_MANIFEST_LOADED:"core.hlsmanifestloaded",HLS_LEVEL_LOADED:"core.hlslevelloaded",DEMUXED_TRACK:"core.demuxedtrack",STREAM_EXCEPTION:"core.streamexception",LARGE_AV_FIRST_FRAME_GAP_DETECT:"LARGE_AV_FIRST_FRAME_GAP_DETECT",LARGE_VIDEO_DTS_GAP_DETECT:"LARGE_VIDEO_DTS_GAP_DETECT",LARGE_AUDIO_DTS_GAP_DETECT:"LARGE_AUDIO_DTS_GAP_DETECT",AUDIO_GAP_DETECT:"AUDIO_GAP_DETECT",AUDIO_OVERLAP_DETECT:"AUDIO_OVERLAP_DETECT",MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT:"MAX_DTS_DELTA_WITH_NEXT_SEGMENT_DETECT",REAL_TIME_SPEED:"real_time_speed"}},107180:function(e,t,i){i.d(t,{Y:function(){return n}});var r=i(697946),n=function(){function e(t,i){(0,r.PA)(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=i}return(0,r.qH)(e,[{key:"debug",value:function(){var t;if(!e.disabled){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(t=console).debug.apply(t,[this._prefix].concat(r))}}},{key:"log",value:function(){var t;if(!e.disabled){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(t=console).log.apply(t,[this._prefix].concat(r))}}},{key:"warn",value:function(){var t;if(!e.disabled){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(t=console).warn.apply(t,[this._prefix].concat(r))}}},{key:"error",value:function(){var t;if(!e.disabled){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(t=console).error.apply(t,[this._prefix].concat(r))}}},{key:"table",value:function(){var t;!e.disabled&&(t=console).table.apply(t,arguments)}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();(0,r._x)(n,"disabled",!0)},833022:function(e,t,i){i.d(t,{i:function(){return s}});var r=i(519357),n=i(597269),a=function(){function e(t){(0,r.PA)(this,e),this._buffer=t,this._offset=0,this._heldBits=0,this._numHeldBits=0}return(0,r.qH)(e,[{key:"readUint8",value:function(){return this._buffer[this._offset++]}},{key:"readUint16",value:function(){return this._buffer[this._offset++]<<8|this._buffer[this._offset++]}},{key:"readUint32",value:function(){return this._buffer[this._offset++]<<24|this._buffer[this._offset++]<<16|this._buffer[this._offset++]<<8|this._buffer[this._offset++]}},{key:"readUint8Array",value:function(e){var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t}},{key:"streamRead1Bytes",value:function(){this._heldBits=this.readUint8(),this._numHeldBits=8}},{key:"streamRead2Bytes",value:function(){this._heldBits=this.readUint16(),this._numHeldBits=16}},{key:"extractBits",value:function(e){var t=this._heldBits>>this._numHeldBits-e&(1<<e)-1;return this._numHeldBits-=e,t}}]),e}(),s=function(){function e(){(0,r.PA)(this,e)}return(0,r.qH)(e,null,[{key:"parseVVCDecoderConfigurationRecord",value:function(t){var i,r,n,s,o,d,c,u,l=new a(t),h=l.readUint8();l.streamRead1Bytes(),l.extractBits(5);var f=l.extractBits(2)+1,p=l.extractBits(1),_={};p&&(l.streamRead2Bytes(),s=l.extractBits(2),o=l.extractBits(3),r=l.extractBits(3),n=l.extractBits(2),l.extractBits(6),_=e.parseVVCPTLRecord(l,r),i=l.readUint16(),d=l.readUint16(),c=l.readUint16(),u=l.readUint16());for(var v=l.readUint8(),g=[],y=[],m=[],k=null,S=0;S<v;S++){l.streamRead1Bytes(),l.extractBits(1),l.extractBits(2);var b=l.extractBits(5),T=1;13!==b&&12!==b&&(T=l.readUint16());for(var E=0;E<T;E++){var L=l.readUint16();switch(b){case 14:g.push(l.readUint8Array(L));break;case 15:var I=l.readUint8Array(L);!k&&(k=e.parseSPS(e.removeEPB(I))),y.push(I);break;case 16:m.push(l.readUint8Array(L))}}}return{data:t,configurationVersion:h,codec:"bvc2.1.6.L93.B0",nalUnitSize:f,ptlPresentFlag:p,olsIdx:i,numSublayers:r,constantFrameRate:n,chromaFormatIdc:s,bitDepthLumaMinus8:o,ptlRecord:_,width:d,height:c,sampleRate:u,numOfArrays:v,vps:g,sps:y,pps:m,spsParsed:k}}},{key:"parseVVCPTLRecord",value:function(e,t){e.streamRead2Bytes(),e.extractBits(2);var i=e.extractBits(6),r=e.extractBits(7),n=e.extractBits(1),a=e.readUint8();e.streamRead1Bytes();var s=e.extractBits(1),o=e.extractBits(1),d=new Uint8Array(i);if(i){for(var c=0;c<i-1;c++){var u=e.extractBits(6);e.streamRead1Bytes();var l=e.extractBits(2);d[c]=u<<2|l}d[i-1]=e.extractBits(6)}else e.extractBits(6);var h=[];if(t>1){e.streamRead1Bytes();for(var f=0,p=t-2;p>=0;--p)f|=e.extractBits(1)<<p;for(var _=t;_<=8&&t>1;++_)e.extractBits(1);for(var v=t-2;v>=0;--v)f&1<<v&&(h[v]=e.readUint8())}var g=e.readUint8(),y=[];if(g)for(var m=0;m<g;m++)y.push(e.readUint32());return{generalProfileIdc:r,generalTierFlag:n,generalLevelIdc:a,ptlFrameOnlyConstraintFlag:s,ptlMultilayerEnabledFlag:o,generalConstraintInfo:d,subLayerLevelIdc:h,generalSubProfileIdc:y,ptlNumSubProfiles:g,numBytesConstraintInfo:i}}},{key:"getAvccNals",value:function(e){for(var t=[];e.position<e.length-4;){var i=e.dataview.getInt32(e.dataview.position);if(e.length-e.position>=i){var r=e.buffer.slice(e.position,e.position+4);e.skip(4);var n=new Uint8Array(e.buffer.slice(e.position,e.position+i));e.skip(i),t.push({header:r,body:n});continue}break}return t}},{key:"analyseNal",value:function(e){var t=(248&e.body[1])>>3;switch(e.type=t,t){case 23:case 24:break;case 7:case 8:e.key=!0;break;case 14:e.vps=!0;break;case 15:e.sps=!0;break;case 16:e.pps=!0;break;case 17:e.aps=!0}}},{key:"removeEPB",value:function(e){for(var t=e.byteLength,i=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(i.push(r+2),r+=2):r++;if(!i.length)return e;var n=t-i.length,a=new Uint8Array(n),s=0;for(r=0;r<n;s++,r++)s===i[0]&&(s++,i.shift()),a[r]=e[s];return a}},{key:"parseVps",value:function(){}},{key:"parseSPS",value:function(t){var i=new n.Z(t);i.readUByte(),i.readUByte(),i.skipBits(4);var r=i.readBits(4),a=i.readBits(3),s=i.readBits(2),o=420;s<=3&&(o=[0,420,422,444][s]),i.readBits(2),i.readBits(1);var d=e._parseProfileTierLevel(i,1,a);i.readBits(1),i.readBits(1)&&i.readBits(1);var c=i.readUEG();return{width:c,height:i.readUEG(),spsMaxSubLayerMinus1:a,spsVideoParameterSetId:r,chromaFormatIdc:s,chromaFormat:o,ptlInfo:d}}},{key:"_parseProfileTierLevel",value:function(t,i,r){var n,a=t.readBits(7),s=t.readBits(1),o=t.readBits(8),d=t.readBits(1),c=t.readBits(1);i&&(n=e._parseGeneralConstraintsInfo(t));for(var u=r-1,l=[],h=[],f=[],p=u;p>=0;--p)l[p]=t.readBits(1);for(;!t.byteAligned();)t.readBits(1);for(var _=u;_>=0;--_)l[_]&&(h[_]=t.readUByte());if(i){for(var v=t.readUByte(),g=0;g<v;g++)f[g]=t.readBits(32)}return{generalProfileIdc:a,generalTierFlag:s,generalLevelIdc:o,ptlFrameOnlyConstraintFlag:d,ptlMultilayerEnabledFlag:c,ptlSublayerLevelPresentFlags:l,ptlSublayerLevelIdcs:h,ptlSubProfileIdcs:f,gciInfo:n}}},{key:"_parseGeneralConstraintsInfo",value:function(e){var t=e.readBits(1);if(t){e.skipBits(71);var i=e.readBits(8);i&&e.skipBits(i)}var r=8-e.bitsPos()%8;return e.skipBits(r),{gciPresentFlag:t}}}]),e}()}}]); |