428 lines
1.2 MiB
JavaScript
428 lines
1.2 MiB
JavaScript
|
!function e(t,i,n){function r(s,o){if(!i[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[s]={exports:{}};t[s][0].call(h.exports,(function(e){return r(t[s][1][e]||e)}),h,h.exports,e,t,i,n)}return i[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(e,t,i){t.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},{}],2:[function(e,t,i){var n=e("./setPrototypeOf"),r=e("./isNativeReflectConstruct");function a(e,i,s){return r()?t.exports=a=Reflect.construct:t.exports=a=function(e,t,i){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return i&&n(a,i.prototype),a},a.apply(null,arguments)}t.exports=a},{"./isNativeReflectConstruct":7,"./setPrototypeOf":8}],3:[function(e,t,i){function n(){return t.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},n.apply(this,arguments)}t.exports=n},{}],4:[function(e,t,i){var n=e("./setPrototypeOf");t.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},{"./setPrototypeOf":8}],5:[function(e,t,i){t.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},{}],6:[function(e,t,i){t.exports=function(e){return e&&e.__esModule?e:{default:e}}},{}],7:[function(e,t,i){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},{}],8:[function(e,t,i){function n(e,i){return t.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,i)}t.exports=n},{}],9:[function(e,t,i){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(i,"__esModule",{value:!0}),i.reverseBytes=i.sliceBytes=i.bytesMatch=i.concatTypedArrays=i.stringToBytes=i.bytesToString=i.numberToBytes=i.bytesToNumber=i.IS_LITTLE_ENDIAN=i.IS_BIG_ENDIAN=i.ENDIANNESS=i.toBinaryString=i.toHexString=i.toUint8=i.isTypedArray=i.padStart=i.countBytes=i.countBits=void 0;var r=n(e("global/window")),a=function(e){return e.toString(2).length};i.countBits=a;var s=function(e){return Math.ceil(a(e)/8)};i.countBytes=s;var o=function(e,t,i){return void 0===i&&(i=" "),(function(e,t){for(var i="";t--;)i+=e;return i}(i,t)+e.toString()).slice(-t)};i.padStart=o;var u=function(e){return ArrayBuffer.isView(e)};i.isTypedArray=u;var l=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||u(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))};i.toUint8=l;i.toHexString=function(e){e=l(e);for(var t="",i=0;i<e.length;i++)t+=o(e[i].toString(16),2,"0");return t};i.toBinaryString=function(e){e=l(e);for(var t="",i=0;i<e.length;i++)t+=o(e[i].toString(2),8,"0");return t};var h,d,c=r.default.BigInt||Number,f=[c("0x1"),c("0x100"),c("0x10000"),c("0x1000000"),c("0x100000000"),c("0x10000000000"),c("0x1000000000000"),c("0x100000000000000"),c("0x10000000000000000")],p=(h=new Uint16Array([65484]),255===(d=new Uint8Array(h.buffer,h.byteOffset,h.byteLength))[0]?"big":204===d[0]?"little":"unknown");i.ENDIANNESS=p;var m="big"===p;i.IS_BIG_ENDIAN=m;var _="little"===p;i.IS_LITTLE_ENDIAN=_;i.bytesToNumber=function(e,t){var i=void 0===t?{}:t,n=i.signed,r=void 0!==n&&n,a=i.le,s=void 0!==a&&a;e=l(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,i,n){var r=s?n:Math.abs(n+1-e.length);return t+c(i)*f[r]}),c(0));if(r){var h=f[e.length]/c(2)-c(1);(u=c(u))>h&&(u-=h,u-=h,u-=c(2))}return N
|
||
|
/*!
|
||
|
* The buffer module from node.js, for the browser.
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||
|
* @license MIT
|
||
|
*/
|
||
|
"use strict";var n=e("base64-js"),r=e("ieee754");i.Buffer=t,i.SlowBuffer=function(e){+e!=e&&(e=0);return t.alloc(+e)},i.INSPECT_MAX_BYTES=50;function a(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=new Uint8Array(e);return i.__proto__=t.prototype,i}function t(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,i)}function s(e,i,n){if("string"==typeof e)return function(e,i){"string"==typeof i&&""!==i||(i="utf8");if(!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);var n=0|d(e,i),r=a(n),s=r.write(e,i);s!==n&&(r=r.slice(0,s));return r}(e,i);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,i,n){if(i<0||e.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<i+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;r=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);return r.__proto__=t.prototype,r}(e,i,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return t.from(r,i,n);var s=function(e){if(t.isBuffer(e)){var i=0|h(e.length),n=a(i);return 0===n.length||e.copy(n,0,0,i),n}if(void 0!==e.length)return"number"!=typeof e.length||N(e.length)?a(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return t.from(e[Symbol.toPrimitive]("string"),i,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return o(e),a(e<0?0:0|h(e))}function l(e){for(var t=e.length<0?0:0|h(e.length),i=a(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function h(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function d(e,i){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var a=!1;;)switch(i){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(e).length;default:if(a)return r?-1:U(e).length;i=(""+i).toLowerCase(),a=!0}}function c(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,i);case"utf8":case"utf-8":return E(this,t,i);case"ascii":return w(this,t,i);case"latin1":case"binary":return A(this,t,i);case"base64":return T(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function p(e,i,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),N(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof i&&(i=t.from(i,r)),t.isBuffer(i))return 0===i.length?-1:m(e,i,n,r,a);if("number"==typeof i)return i&=255,"functio
|
||
|
/*!
|
||
|
* Programatically add the following
|
||
|
*/
|
||
|
for(s=97;s<123;s++)r[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)r[s-48]=s;for(s=1;s<13;s++)r["f"+s]=s+111;for(s=0;s<10;s++)r["numpad "+s]=s+96;var o=i.names=i.title={};for(s in r)o[r[s]]=s;for(var u in a)r[u]=a[u]},{}],38:[function(e,t,i){
|
||
|
/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */
|
||
|
"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("@babel/runtime/helpers/inheritsLoose"),r=e("@videojs/vhs-utils/cjs/stream.js"),a=e("@babel/runtime/helpers/extends"),s=e("@babel/runtime/helpers/assertThisInitialized"),o=e("@videojs/vhs-utils/cjs/decode-b64-to-uint8-array.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(n),h=u(r),d=u(a),c=u(s),f=u(o),p=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return l.default(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(h.default),m=String.fromCharCode(9),_=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},g=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},v=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}l.default(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var r=0;r<n.customParsers.length;r++)if(n.customParsers[r].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void n.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void n.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return i=d.default(_(t[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var a=g(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=_(a.BYTERANGE))}n.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=g(t[1]),i.attributes.RESOLUTION){var s=i.attributes.RESOLUTION.split("x"),o={};s[0]&&(o.width=parseInt(s[0],10)),s[1]&&(o.height=parseInt(s[1],10)),i.attributes.RESOLUTION=o}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}n.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=g(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))n.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))n.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*
|
||
|
/*! @name mpd-parser @version 0.19.0 @license Apache-2.0 */
|
||
|
"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("@videojs/vhs-utils/cjs/resolve-url"),r=e("global/window"),a=e("@videojs/vhs-utils/cjs/decode-b64-to-uint8-array"),s=e("@xmldom/xmldom");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(n),l=o(r),h=o(a),d=function(e){return!!e&&"object"==typeof e},c=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce((function(t,i){return"object"!=typeof i||Object.keys(i).forEach((function(n){Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=t[n].concat(i[n]):d(t[n])&&d(i[n])?t[n]=e(t[n],i[n]):t[n]=i[n]})),t}),{})},f=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},p=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},m="INVALID_NUMBER_OF_PERIOD",_="DASH_EMPTY_MANIFEST",g="DASH_INVALID_XML",v="NO_BASE_URL",y="SEGMENT_TIME_UNSPECIFIED",b="UNSUPPORTED_UTC_TIMING_SCHEME",S=function(e){var t=e.baseUrl,i=void 0===t?"":t,n=e.source,r=void 0===n?"":n,a=e.range,s=void 0===a?"":a,o=e.indexRange,l=void 0===o?"":o,h={uri:r,resolvedUri:u.default(i||"",r)};if(s||l){var d=(s||l).split("-"),c=parseInt(d[0],10),f=parseInt(d[1],10);h.byterange={length:f-c+1,offset:c}}return h},T=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},E={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,r=e.sourceDuration,a=e.periodDuration,s=T(e.endNumber),o=t/n;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:r/o}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,h=void 0===l?0:l,d=e.timeShiftBufferDepth,c=void 0===d?1/0:d,f=T(e.endNumber),p=(t+i)/1e3,m=n+u,_=p+h-m,g=Math.ceil(_*a/s),v=Math.floor((p-m-c)*a/s),y=Math.floor((p-m)*a/s);return{start:Math.max(0,v),end:"number"==typeof f?f:Math.min(g,y)}}},w=function(e){var t=e.type,i=e.duration,n=e.timescale,r=void 0===n?1:n,a=e.periodDuration,s=e.sourceDuration,o=E[t](e),u=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}(o.start,o.end).map(function(e){return function(t,i){var n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:n/a,timeline:s,time:i*n}}}(e));if("static"===t){var l=u.length-1,h="number"==typeof a?a:s;u[l].duration=h-i/r*l}return u},A=function(e){var t=e.baseUrl,i=e.initialization,n=void 0===i?{}:i,r=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.duration;if(!t)throw new Error(v);var u=S({baseUrl:t,source:n.sourceURL,range:n.range}),l=S({baseUrl:t,source:t,indexRange:s});if(l.map=u,o){var h=w(e);h.length&&(l.duration=h[0].duration,l.timeline=h[0].timeline)}else r&&(l.duration=r,l.timeline=0);return l.number=0,[l]},C=function(e,t,i){for(var n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,s=e.sidx.byterange,o=s.offset+s.length,u=t.timescale,l=t.references.filter((function(e){return 1!==e.referenceType})),h=[],d=e.endList?"static":"dynamic",c=o+t.firstOffset,f=0;f<l.length;f++){var p=t.references[f],m=p.referencedSize,_=p.subsegmentDuration,g=A({baseUrl:i,timescale:u,timeline:a,periodIndex:a,duration:_,sourceDuration:r,indexRange:c+"-"+(c+m-1),type:d})[0];n&&(g.map=n),h.push(g),c+=m}return e.segments=h,e},k=function(e){return e&&e.uri+"-"+(t=e.byterange,i=t.offset+t.length-1,t.offset+"-"+i);var t,i},P=function(e){var t;return(t=e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,i;return e.discontinuityStarts=(t=e.segments,i="discontinuity",t.reduce((function(e,t,n){return t[i]&&e.push(n),e}),[])),e}))},I=function(e,t){var i=k(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&C(e,n,e.sidx.resolvedUri),e},L=function(e,t){if(vo
|
||
|
/*!
|
||
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||
|
* @license Licensed under MIT license
|
||
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
||
|
* @version v4.2.8+1e68dce6
|
||
|
*/
|
||
|
var n;n=function(){"use strict";function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,a=void 0,s=void 0,o=function(e,t){p[r]=e,p[r+1]=t,2===(r+=2)&&(s?s(m):b())},u="undefined"!=typeof window?window:void 0,l=u||{},h=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),c="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var e=setTimeout;return function(){return e(m,1)}}var p=new Array(1e3);function m(){for(var e=0;e<r;e+=2)(0,p[e])(p[e+1]),p[e]=void 0,p[e+1]=void 0;r=0}var _,g,v,y,b=void 0;function S(e,t){var i=this,n=new this.constructor(w);void 0===n[E]&&O(n);var r=i._state;if(r){var a=arguments[r-1];o((function(){return R(r,n,a,i._result)}))}else L(i,n,e,t);return n}function T(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(w);return C(t,e),t}d?b=function(){return t.nextTick(m)}:h?(g=0,v=new h(m),y=document.createTextNode(""),v.observe(y,{characterData:!0}),b=function(){y.data=g=++g%2}):c?((_=new MessageChannel).port1.onmessage=m,b=function(){return _.port2.postMessage(0)}):b=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(m)}:f()}catch(e){return f()}}():f();var E=Math.random().toString(36).substring(2);function w(){}function A(t,i,n){i.constructor===t.constructor&&n===S&&i.constructor.resolve===T?function(e,t){1===t._state?P(e,t._result):2===t._state?I(e,t._result):L(t,void 0,(function(t){return C(e,t)}),(function(t){return I(e,t)}))}(t,i):void 0===n?P(t,i):e(n)?function(e,t,i){o((function(e){var n=!1,r=function(e,t,i,n){try{e.call(t,i,n)}catch(e){return e}}(i,t,(function(i){n||(n=!0,t!==i?C(e,i):P(e,i))}),(function(t){n||(n=!0,I(e,t))}),e._label);!n&&r&&(n=!0,I(e,r))}),e)}(t,i,n):P(t,i)}function C(e,t){if(e===t)I(e,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(n=t),null===n||"object"!==r&&"function"!==r)P(e,t);else{var i=void 0;try{i=t.then}catch(t){return void I(e,t)}A(e,t,i)}var n,r}function k(e){e._onerror&&e._onerror(e._result),x(e)}function P(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&o(x,e))}function I(e,t){void 0===e._state&&(e._state=2,e._result=t,o(k,e))}function L(e,t,i,n){var r=e._subscribers,a=r.length;e._onerror=null,r[a]=t,r[a+1]=i,r[a+2]=n,0===a&&e._state&&o(x,e)}function x(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var n=void 0,r=void 0,a=e._result,s=0;s<t.length;s+=3)n=t[s],r=t[s+i],n?R(i,n,r,a):r(a);e._subscribers.length=0}}function R(t,i,n,r){var a=e(n),s=void 0,o=void 0,u=!0;if(a){try{s=n(r)}catch(e){u=!1,o=e}if(i===s)return void I(i,new TypeError("A promises callback cannot return that same promise."))}else s=r;void 0!==i._state||(a&&u?C(i,s):!1===u?I(i,o):1===t?P(i,s):2===t&&I(i,s))}var D=0;function O(e){e[E]=D++,e._state=void 0,e._result=void 0,e._subscribers=[]}var U=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(w),this.promise[E]||O(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&P(this.promise,this._result))):I(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===T){var r=void 0,a=void 0,s=!1;try{r=e.then}catch(e){s=!0,a=e}if(r===S&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof r)this._remaining--,this._result[t]=e;else if(i===M){var o=new i(w);s?I(o,a):A(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new i((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,i){var n=this.
|
||
|
/**
|
||
|
* @license
|
||
|
* Video.js 7.15.4 <http://videojs.com/>
|
||
|
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
||
|
* Available under Apache License Version 2.0
|
||
|
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
||
|
*
|
||
|
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
||
|
* Available under Apache License Version 2.0
|
||
|
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
||
|
*/
|
||
|
"use strict";var n=e("global/window"),r=e("global/document"),a=e("@babel/runtime/helpers/extends"),s=e("@babel/runtime/helpers/assertThisInitialized"),o=e("@babel/runtime/helpers/inheritsLoose"),u=e("safe-json-parse/tuple"),l=e("keycode"),h=e("@videojs/xhr"),d=e("videojs-vtt.js"),c=e("@babel/runtime/helpers/construct"),f=e("@babel/runtime/helpers/inherits"),p=e("@videojs/vhs-utils/cjs/resolve-url.js"),m=e("m3u8-parser"),_=e("@videojs/vhs-utils/cjs/codecs.js"),g=e("@videojs/vhs-utils/cjs/media-types.js"),v=e("mpd-parser"),y=e("mux.js/lib/tools/parse-sidx"),b=e("@videojs/vhs-utils/cjs/id3-helpers"),S=e("@videojs/vhs-utils/cjs/containers"),T=e("@videojs/vhs-utils/cjs/byte-helpers"),E=e("mux.js/lib/utils/clock");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}for(var A,C=w(n),k=w(r),P=w(a),I=w(s),L=w(o),x=w(u),R=w(l),D=w(h),O=w(d),U=w(c),M=w(f),F=w(p),B=w(y),N={},j=function(e,t){return N[e]=N[e]||[],t&&(N[e]=N[e].concat(t)),N[e]},V=function(e,t){var i=j(e).indexOf(t);return!(i<=-1)&&(N[e]=N[e].slice(),N[e].splice(i,1),!0)},H={prefixed:!0},z=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],G=z[0],W=0;W<z.length;W++)if(z[W][1]in k.default){A=z[W];break}if(A){for(var Y=0;Y<A.length;Y++)H[G[Y]]=A[Y];H.prefixed=A[0]!==G[0]}var q=[];var K=function e(t){var i,n="info",r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",n,t)};return i=function(e,t){return function(i,n,r){var a=t.levels[n],s=new RegExp("^("+a+")$");if("log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),q){q.push([].concat(r));var o=q.length-1e3;q.splice(0,o>0?o:0)}if(C.default.console){var u=C.default.console[i];u||"debug"!==i||(u=C.default.console.info||C.default.console.log),u&&a&&s.test(i)&&u[Array.isArray(r)?"apply":"call"](C.default.console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return q?[].concat(q):[]}).filter=function(e){return(q||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){q&&(q.length=0)},r.history.disable=function(){null!==q&&(q.length=0,q=null)},r.history.enable=function(){null===q&&(q=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("error",n,t)},r.warn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("warn",n,t)},r.debug=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("debug",n,t)},r}("VIDEOJS"),X=K.createLogger,Q=Object.prototype.toString,$=function(e){return ee(e)?Object.keys(e):[]};function J(e,t){$(e).forEach((function(i){return t(e[i],i)}))}function Z(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?P.default.apply(void 0,[e].concat(i)):(i.forEach((function(t){t&&J(t,(function(t,i){e[i]=t}))})),e)}function ee(e){return!!e&&"object"==typeof e}function te(e){return ee(e)&&"[object Object]"===Q.call(e)&&e.constructor===Object}function ie(e,t){if(!e||!t)return"";if("function"==typeof C.default.getComputedStyle){var i;try{i=C.default.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}var ne,re=C.default.navigator&&C.default.navigator.userAg
|
||
|
/*! @name @videojs/http-streaming @version 2.10.2 @license Apache-2.0 */
|
||
|
var Xr=F.default,Qr=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},$r=function(e){return Yr.log.debug?Yr.log.debug.bind(Yr,"VHS:",e+" >"):function(){}},Jr=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return Yr.createTimeRanges(n)},Zr=function(e,t){return Jr(e,(function(e,i){return e-.1<=t&&i+.1>=t}))},ea=function(e,t){return Jr(e,(function(e){return e-1/30>=t}))},ta=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},ia=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},na=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},ra=Yr.createTimeRange,aa=function(e){return(e.segments||[]).reduce((function(e,t,i){return t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e}),[])},sa=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},oa=function(e){var t=e.preloadSegment;if(t){var i=t.parts,n=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return n+=i&&i.length?i.length:0}},ua=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=sa(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},la=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;var r=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=i.duration,void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:n.result+i},ha=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return C.default.Infinity}return la(e,t,i)},da=function(e){var t=e.defaultDuration,i=e.durationList,n=e.startIndex,r=e.endIndex,a=0;if(n>r){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;o<Math.min(0,r);o++)a+=t;n=0}for(var u=n;u<r;u++)a+=i[u].duration;return a},ca=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return ha(e);if(null===t)return null;t=t||0;var r=la(e,e.mediaSequence+e.segments.length,t);return i&&(r-=n="number"==typeof n?n:ua(null,e)),Math.max(0,r)},fa=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},pa=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ma=function(e){var t=fa(e);return!e.disabled&&!t},_a=function(e,t){return t.attributes&&t.attributes[e]},ga=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!ma(e)&&(e.attributes.BANDWIDTH||0)<i})).length},va=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri))))},ya=function(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},n=!1;for(var r in i){for(var a in i[r])if(n=t(i[r][a]))break;if(n)break}return!!n},ba=function(e){if(!e||!e.playlists||!e.playlists.length)return ya(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var t=function(t){var i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;return n&&
|
||
|
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
|
||
|
var a=null,s=function(){function e(e){var t,i,n;a||(a=function(){var e,t,i,n,r,a,s,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],h=u[1],d=l[4],c=h[4],f=[],p=[];for(e=0;e<256;e++)p[(f[e]=e<<1^283*(e>>7))^e]=e;for(t=i=0;!d[t];t^=n||1,i=p[i]||1)for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,d[t]=a,c[a]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,s=257*f[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,h[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),h[e]=h[e].slice(0);return u}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),h=[];for(this._key=[l,h],t=o;t<4*o+28;t++)n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;for(i=0;t;i++,t--)n=l[3&i?t:t-4],h[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,h=this._key[1],d=e^h[0],c=n^h[1],f=i^h[2],p=t^h[3],m=h.length/4-2,_=4,g=this._tables[1],v=g[0],y=g[1],b=g[2],S=g[3],T=g[4];for(l=0;l<m;l++)s=v[d>>>24]^y[c>>16&255]^b[f>>8&255]^S[255&p]^h[_],o=v[c>>>24]^y[f>>16&255]^b[p>>8&255]^S[255&d]^h[_+1],u=v[f>>>24]^y[p>>16&255]^b[d>>8&255]^S[255&c]^h[_+2],p=v[p>>>24]^y[d>>16&255]^b[c>>8&255]^S[255&f]^h[_+3],_+=4,d=s,c=o,f=u;for(l=0;l<4;l++)r[(3&-l)+a]=T[d>>>24]<<24^T[c>>16&255]<<16^T[f>>8&255]<<8^T[255&p]^h[_++],s=d,d=c,c=f,f=p,p=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),h=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(h,h+a),i,n,l)),h=a;h<s.length;h+=a)n=new Uint32Array([u(s[h-4]),u(s[h-3]),u(s[h-2]),u(s[h-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(h,h+a),i,n,l));this.asyncStream_.push((function(){
|
||
|
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||
|
var e;r(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=function(e,t,i){var n,r,a,o,l,h,d,c,f,p=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new s(Array.prototype.slice.call(t)),_=new Uint8Array(e.byteLength),g=new Int32Array(_.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f<p.length;f+=4)l=u(p[f]),h=u(p[f+1]),d=u(p[f+2]),c=u(p[f+3]),m.decrypt(l,h,d,c,g,f),g[f]=u(g[f]^n),g[f+1]=u(g[f+1]^r),g[f+2]=u(g[f+2]^a),g[f+3]=u(g[f+3]^o),n=l,r=h,a=d,o=c;return _}(e,t,i);n.set(r,e.byteOffset)}},t(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();self.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new l(i,n,r,(function(e,i){var n,r;self.postMessage((n={source:t.source,decrypted:i},r={},Object.keys(n).forEach((function(e){var t=n[e];ArrayBuffer.isView(t)?r[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:r[e]=t})),r),[i.buffer])}))}})))),Po=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Lo=function(e,t){t.activePlaylistLoader=e,e.load()},xo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Ro={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",xo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",xo[e](e,i))}},Do={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,h=o.logger_,d=t.masterPlaylistLoader,c=ba(d.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],_=void 0;if(c?(h("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,_=null):_="vhs-json"===n&&m.playlists?new Ua(m.playlists[0],i,a):m.resolvedUri?new Ua(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,d):null,m=Yr.mergeOptions({id:p,playlistLoader:_},m),Ro[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var g=new Yr.AudioTrack({id:p,kind:Po(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=g}}r.on("error",xo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,h=u.tracks,d=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=
|
||
|
/*!******************************************************!*\
|
||
|
!*** ./node_modules/es6-promise/dist/es6-promise.js ***!
|
||
|
\******************************************************/
|
||
|
function(t,i,r){
|
||
|
/*!
|
||
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||
|
* @license Licensed under MIT license
|
||
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
||
|
* @version v4.2.8+1e68dce6
|
||
|
*/
|
||
|
t.exports=function(){function t(e){return"function"==typeof e}var i=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=0,s=void 0,o=void 0,u=function(e,t){m[a]=e,m[a+1]=t,2===(a+=2)&&(o?o(_):S())},l="undefined"!=typeof window?window:void 0,h=l||{},d=h.MutationObserver||h.WebKitMutationObserver,c="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(_,1)}}var m=new Array(1e3);function _(){for(var e=0;e<a;e+=2)(0,m[e])(m[e+1]),m[e]=void 0,m[e+1]=void 0;a=0}var g,v,y,b,S=void 0;function T(e,t){var i=this,n=new this.constructor(A);void 0===n[w]&&U(n);var r=i._state;if(r){var a=arguments[r-1];u((function(){return D(r,n,a,i._result)}))}else x(i,n,e,t);return n}function E(e){if(e&&"object"===n(e)&&e.constructor===this)return e;var t=new this(A);return k(t,e),t}c?S=function(){return e.nextTick(_)}:d?(v=0,y=new d(_),b=document.createTextNode(""),y.observe(b,{characterData:!0}),S=function(){b.data=v=++v%2}):f?((g=new MessageChannel).port1.onmessage=_,S=function(){return g.port2.postMessage(0)}):S=void 0===l?function(){try{var e=Function("return this")().require("vertx");return void 0!==(s=e.runOnLoop||e.runOnContext)?function(){s(_)}:p()}catch(e){return p()}}():p();var w=Math.random().toString(36).substring(2);function A(){}function C(e,i,n){i.constructor===e.constructor&&n===T&&i.constructor.resolve===E?function(e,t){1===t._state?I(e,t._result):2===t._state?L(e,t._result):x(t,void 0,(function(t){return k(e,t)}),(function(t){return L(e,t)}))}(e,i):void 0===n?I(e,i):t(n)?function(e,t,i){u((function(e){var n=!1,r=function(e,t,i,n){try{e.call(t,i,n)}catch(e){return e}}(i,t,(function(i){n||(n=!0,t!==i?k(e,i):I(e,i))}),(function(t){n||(n=!0,L(e,t))}),e._label);!n&&r&&(n=!0,L(e,r))}),e)}(e,i,n):I(e,i)}function k(e,t){if(e===t)L(e,new TypeError("You cannot resolve a promise with itself"));else if(a=n(r=t),null===r||"object"!==a&&"function"!==a)I(e,t);else{var i=void 0;try{i=t.then}catch(t){return void L(e,t)}C(e,t,i)}var r,a}function P(e){e._onerror&&e._onerror(e._result),R(e)}function I(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&u(R,e))}function L(e,t){void 0===e._state&&(e._state=2,e._result=t,u(P,e))}function x(e,t,i,n){var r=e._subscribers,a=r.length;e._onerror=null,r[a]=t,r[a+1]=i,r[a+2]=n,0===a&&e._state&&u(R,e)}function R(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var n=void 0,r=void 0,a=e._result,s=0;s<t.length;s+=3)n=t[s],r=t[s+i],n?D(i,n,r,a):r(a);e._subscribers.length=0}}function D(e,i,n,r){var a=t(n),s=void 0,o=void 0,u=!0;if(a){try{s=n(r)}catch(e){u=!1,o=e}if(i===s)return void L(i,new TypeError("A promises callback cannot return that same promise."))}else s=r;void 0!==i._state||(a&&u?k(i,s):!1===u?L(i,o):1===e?I(i,s):2===e&&L(i,s))}var O=0;function U(e){e[w]=O++,e._state=void 0,e._result=void 0,e._subscribers=[]}var M=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(A),this.promise[w]||U(this.promise),i(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&I(this.promise,this._result))):L(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===E){var r=void 0,a=void 0,s=!1;try{r=e.then}catch(e){s=!0,a=e}if(r===T&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof r)this._remaining--,this._result[t]=e;else if(i===F){var o=new i(A);s?L(o,a):C(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new i((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,i){var n=this.promise;void 0===n.
|
||
|
/*!***************************************!*\
|
||
|
!*** ./node_modules/events/events.js ***!
|
||
|
\***************************************/
|
||
|
function(e){var t,i="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,r=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(i,n){function r(i){e.removeListener(t,a),n(i)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}_(e,t,a,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&_(e,"error",t,i)}(e,r,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(e))}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,i,n){var r,a,s;if(u(i),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),a=e._events),s=a[t]),void 0===s)s=a[t]=i,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(r=l(e))>0&&s.length>r&&!s.warned){s.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=s.length,console&&console.warn}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function f(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):m(r,r.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function m(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function _(e,t,i,r){if("function"==typeof e.on)r.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+n(e));e.addEventListener(t,(function n(a){r.once&&e.removeEventListener(t,n),i(a)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var l=u.length,h=m(u,l);for(i=0;i<l;++i)r(h[i],this,t)}return!0},s.prototype.addListener=function(e,t){return h(this,e,t,!1)},s
|
||
|
/*!**************************************************!*\
|
||
|
!*** ./node_modules/webworkify-webpack/index.js ***!
|
||
|
\**************************************************/
|
||
|
function(e,t,i){function n(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var n=i(i.s=ENTRY_MODULE);return n.default||n}function r(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(e,t,n){var a={};a[n]=[];var s=t.toString(),o=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return a;for(var u,l=o[1],h=new RegExp("(\\\\n|\\W)"+r(l)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");u=h.exec(s);)"dll-reference"!==u[3]&&a[n].push(u[3]);for(h=new RegExp("\\("+r(l)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");u=h.exec(s);)e[u[2]]||(a[n].push(u[1]),e[u[2]]=i(u[1]).m),a[u[2]]=a[u[2]]||[],a[u[2]].push(u[4]);for(var d,c=Object.keys(a),f=0;f<c.length;f++)for(var p=0;p<a[c[f]].length;p++)d=a[c[f]][p],isNaN(1*d)||(a[c[f]][p]=1*a[c[f]][p]);return a}function s(e){return Object.keys(e).reduce((function(t,i){return t||e[i].length>0}),!1)}e.exports=function(e,t){t=t||{};var r={main:i.m},o=t.all?{main:Object.keys(r.main)}:function(e,t){for(var i={main:[t]},n={main:[]},r={main:{}};s(i);)for(var o=Object.keys(i),u=0;u<o.length;u++){var l=o[u],h=i[l].pop();if(r[l]=r[l]||{},!r[l][h]&&e[l][h]){r[l][h]=!0,n[l]=n[l]||[],n[l].push(h);for(var d=a(e,e[l][h],l),c=Object.keys(d),f=0;f<c.length;f++)i[c[f]]=i[c[f]]||[],i[c[f]]=i[c[f]].concat(d[c[f]])}}return n}(r,e),u="";Object.keys(o).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;o[e][t];)t++;o[e].push(t),r[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+"var "+e+" = ("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+o[e].map((function(t){return JSON.stringify(t)+": "+r[e][t].toString()})).join(",")+"});\n"})),u=u+"new (("+n.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+o.main.map((function(e){return JSON.stringify(e)+": "+r.main[e].toString()})).join(",")+"}))(self);";var l=new window.Blob([u],{type:"text/javascript"});if(t.bare)return l;var h=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(l),d=new window.Worker(h);return d.objectURL=h,d}},"./src/config.js":
|
||
|
/*!***********************!*\
|
||
|
!*** ./src/config.js ***!
|
||
|
\***********************/
|
||
|
function(e,t,i){i.r(t),i.d(t,{defaultConfig:function(){return n},createDefaultConfig:function(){return r}});var n={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function r(){return Object.assign({},n)}},"./src/core/features.js":
|
||
|
/*!******************************!*\
|
||
|
!*** ./src/core/features.js ***!
|
||
|
\******************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ../io/io-controller.js */
|
||
|
"./src/io/io-controller.js"),r=i(
|
||
|
/*! ../config.js */
|
||
|
"./src/config.js"),a=function(){function e(){}return e.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportNetworkStreamIO=function(){var e=new n.default({},(0,r.createDefaultConfig)()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t},e.getNetworkLoaderTypeName=function(){var e=new n.default({},(0,r.createDefaultConfig)()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"==i},e.getFeatureList=function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();t.default=a},"./src/core/media-info.js":
|
||
|
/*!********************************!*\
|
||
|
!*** ./src/core/media-info.js ***!
|
||
|
\********************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t},e.prototype.isSeekable=function(){return!0===this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}},e.prototype._search=function(e,t){var i=0,n=e.length-1,r=0,a=0,s=n;for(t<e[0]&&(i=0,a=s+1);a<=s;){if((r=a+Math.floor((s-a)/2))===n||t>=e[r]&&t<e[r+1]){i=r;break}e[r]<t?a=r+1:s=r-1}return i},e}();t.default=n},"./src/core/media-segment-info.js":
|
||
|
/*!****************************************!*\
|
||
|
!*** ./src/core/media-segment-info.js ***!
|
||
|
\****************************************/
|
||
|
function(e,t,i){i.r(t),i.d(t,{SampleInfo:function(){return n},MediaSegmentInfo:function(){return r},IDRSampleList:function(){return a},MediaSegmentInfoList:function(){return s}});var n=function(e,t,i,n,r){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null},r=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),a=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0==this._list.length)return null;var t=this._list,i=0,n=t.length-1,r=0,a=0,s=n;for(e<t[0].dts&&(i=0,a=s+1);a<=s;){if((r=a+Math.floor((s-a)/2))===n||e>=t[r].dts&&e<t[r+1].dts){i=r;break}t[r].dts<e?a=r+1:s=r-1}return this._list[i]},e}(),s=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t=this._list;if(0===t.length)return-2;var i=t.length-1,n=0,r=0,a=i,s=0;if(e<t[0].originalBeginDts)return s=-1;for(;r<=a;){if((n=r+Math.floor((a-r)/2))===i||e>t[n].lastSample.originalDts&&e<t[n+1].originalBeginDts){s=n;break}t[n].originalBeginDts<e?r=n+1:a=n-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t=this._list,i=e,n=this._lastAppendLocation,r=0;-1!==n&&n<t.length&&i.originalBeginDts>=t[n].lastSample.originalDts&&(n===t.length-1||n<t.length-1&&i.originalBeginDts<t[n+1].originalBeginDts)?r=n+1:t.length>0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},"./src/core/mse-controller.js":
|
||
|
/*!************************************!*\
|
||
|
!*** ./src/core/mse-controller.js ***!
|
||
|
\************************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),r=i.n(n),a=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),s=i(
|
||
|
/*! ../utils/browser.js */
|
||
|
"./src/utils/browser.js"),o=i(
|
||
|
/*! ./mse-events.js */
|
||
|
"./src/core/mse-events.js"),u=i(
|
||
|
/*! ./media-segment-info.js */
|
||
|
"./src/core/media-segment-info.js"),l=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),h=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(r()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new u.IDRSampleList}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new l.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){a.default.e(this.TAG,e.message)}n.removeEventListener("error",this.e.onSourceBufferError),n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){a.default.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var i=e,n=""+i.container;i.codec&&i.codec.length>0&&(n+=";codecs="+i.codec);var r=!1;if(a.default.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])a.default.v(this.TAG,"Notice: "+i.type+" mimeType changed, origin: "+this._mimeTypes[i.type]+", target: "+n);else{r=!0;try{var u=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);u.addEventListener("error",this.e.onSourceBufferError),u.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return a.default.e(this.TAG,e.message),void this._emitter.emit(o.default.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),r||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),s.default.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/
|
||
|
/*!********************************!*\
|
||
|
!*** ./src/core/mse-events.js ***!
|
||
|
\********************************/
|
||
|
function(e,t,i){i.r(t),t.default={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"}},"./src/core/transmuxer.js":
|
||
|
/*!********************************!*\
|
||
|
!*** ./src/core/transmuxer.js ***!
|
||
|
\********************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),r=i.n(n),a=i(
|
||
|
/*! webworkify-webpack */
|
||
|
"./node_modules/webworkify-webpack/index.js"),s=i.n(a),o=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),u=i(
|
||
|
/*! ../utils/logging-control.js */
|
||
|
"./src/utils/logging-control.js"),l=i(
|
||
|
/*! ./transmuxing-controller.js */
|
||
|
"./src/core/transmuxing-controller.js"),h=i(
|
||
|
/*! ./transmuxing-events.js */
|
||
|
"./src/core/transmuxing-events.js"),d=i(
|
||
|
/*! ./media-info.js */
|
||
|
"./src/core/media-info.js"),c=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(r()),t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=s()(
|
||
|
/*! ./transmuxing-worker */
|
||
|
"./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},u.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:u.default.getConfig()})}catch(i){o.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new l.default(e,t)}else this._controller=new l.default(e,t);if(this._controller){var i=this._controller;i.on(h.default.IO_ERROR,this._onIOError.bind(this)),i.on(h.default.DEMUX_ERROR,this._onDemuxError.bind(this)),i.on(h.default.INIT_SEGMENT,this._onInitSegment.bind(this)),i.on(h.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),i.on(h.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),i.on(h.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),i.on(h.default.MEDIA_INFO,this._onMediaInfo.bind(this)),i.on(h.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),i.on(h.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),i.on(h.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),i.on(h.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),u.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},e.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},e.prototype.seek=function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)},e.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},e.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(h.default.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(h.default.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(h.default.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(h.default.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(h.default.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(h.default.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=t.data;if("destro
|
||
|
/*!********************************************!*\
|
||
|
!*** ./src/core/transmuxing-controller.js ***!
|
||
|
\********************************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),r=i.n(n),a=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),s=i(
|
||
|
/*! ../utils/browser.js */
|
||
|
"./src/utils/browser.js"),o=i(
|
||
|
/*! ./media-info.js */
|
||
|
"./src/core/media-info.js"),u=i(
|
||
|
/*! ../demux/flv-demuxer.js */
|
||
|
"./src/demux/flv-demuxer.js"),l=i(
|
||
|
/*! ../remux/mp4-remuxer.js */
|
||
|
"./src/remux/mp4-remuxer.js"),h=i(
|
||
|
/*! ../demux/demux-errors.js */
|
||
|
"./src/demux/demux-errors.js"),d=i(
|
||
|
/*! ../io/io-controller.js */
|
||
|
"./src/io/io-controller.js"),c=i(
|
||
|
/*! ./transmuxing-events.js */
|
||
|
"./src/core/transmuxing-events.js"),f=function(){function e(e,t){this.TAG="TransmuxingController",this._emitter=new(r()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach((function(n){n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)})),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){this._currentSegmentIndex=e;var i=this._mediaDataSource.segments[e],n=this._ioctl=new d.default(i,this._config,e);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var i=this._mediaInfo.segments[t];if(null==i)this._pendingSeekTime=e;else{var n=i.getNearestKeyframe(e);this._remuxer.seek(n.milliseconds),this._ioctl.seek(n.fileposition),this._pendingResolveSeekPoint=n.milliseconds}}else{var r=this._mediaInfo.segments[t];null==r?(this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t)):(n=r.getNearestKeyframe(e),this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,i=t.length-1,n=0;n<t.length;n++)if(e<t[n].timestampBase){i=n-1;break}return i},e.prototype._onInitChunkArrival=function(e,t){var i=this,n=null,r=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((n=u.default.probe(e)).match){this._demuxer=new u.default(n,this._config),this._remuxer||(this._remuxer=new l.default(this._config));var s=this._mediaDataSource;null==s.duration||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),"boolean"==typeof s.hasAudio&&(this._demuxer.overridedHasAudio=s.hasAudio),"boolean"==typeof s.hasVideo&&(this._demuxer.overridedHasVideo=s.hasVideo),this._demuxer.timestampBase=s.segments[this._c
|
||
|
/*!****************************************!*\
|
||
|
!*** ./src/core/transmuxing-events.js ***!
|
||
|
\****************************************/
|
||
|
function(e,t,i){i.r(t),t.default={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},"./src/core/transmuxing-worker.js":
|
||
|
/*!****************************************!*\
|
||
|
!*** ./src/core/transmuxing-worker.js ***!
|
||
|
\****************************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ../utils/logging-control.js */
|
||
|
"./src/utils/logging-control.js"),r=i(
|
||
|
/*! ../utils/polyfill.js */
|
||
|
"./src/utils/polyfill.js"),a=i(
|
||
|
/*! ./transmuxing-controller.js */
|
||
|
"./src/core/transmuxing-controller.js"),s=i(
|
||
|
/*! ./transmuxing-events.js */
|
||
|
"./src/core/transmuxing-events.js");t.default=function(e){var t=null,i=function(t,i){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:i}})}.bind(this);function o(t,i){var n={msg:s.default.INIT_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function u(t,i){var n={msg:s.default.MEDIA_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function l(){var t={msg:s.default.LOADING_COMPLETE};e.postMessage(t)}function h(){var t={msg:s.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function d(t){var i={msg:s.default.MEDIA_INFO,data:t};e.postMessage(i)}function c(t){var i={msg:s.default.METADATA_ARRIVED,data:t};e.postMessage(i)}function f(t){var i={msg:s.default.SCRIPTDATA_ARRIVED,data:t};e.postMessage(i)}function p(t){var i={msg:s.default.STATISTICS_INFO,data:t};e.postMessage(i)}function m(t,i){e.postMessage({msg:s.default.IO_ERROR,data:{type:t,info:i}})}function _(t,i){e.postMessage({msg:s.default.DEMUX_ERROR,data:{type:t,info:i}})}function g(t){e.postMessage({msg:s.default.RECOMMEND_SEEKPOINT,data:t})}r.default.install(),e.addEventListener("message",(function(r){switch(r.data.cmd){case"init":(t=new a.default(r.data.param[0],r.data.param[1])).on(s.default.IO_ERROR,m.bind(this)),t.on(s.default.DEMUX_ERROR,_.bind(this)),t.on(s.default.INIT_SEGMENT,o.bind(this)),t.on(s.default.MEDIA_SEGMENT,u.bind(this)),t.on(s.default.LOADING_COMPLETE,l.bind(this)),t.on(s.default.RECOVERED_EARLY_EOF,h.bind(this)),t.on(s.default.MEDIA_INFO,d.bind(this)),t.on(s.default.METADATA_ARRIVED,c.bind(this)),t.on(s.default.SCRIPTDATA_ARRIVED,f.bind(this)),t.on(s.default.STATISTICS_INFO,p.bind(this)),t.on(s.default.RECOMMEND_SEEKPOINT,g.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(r.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var v=r.data.param;n.default.applyConfig(v),!0===v.enableCallback?n.default.addLogListener(i):n.default.removeLogListener(i)}}))}},"./src/demux/amf-parser.js":
|
||
|
/*!*********************************!*\
|
||
|
!*** ./src/demux/amf-parser.js ***!
|
||
|
\*********************************/
|
||
|
function(e,t,i){i.r(t);var n,r=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),a=i(
|
||
|
/*! ../utils/utf8-conv.js */
|
||
|
"./src/utils/utf8-conv.js"),s=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),o=(n=new ArrayBuffer(2),new DataView(n).setInt16(0,256,!0),256===new Int16Array(n)[0]),u=function(){function e(){}return e.parseScriptData=function(t,i,n){var a={};try{var s=e.parseValue(t,i,n),o=e.parseValue(t,i+s.size,n-s.size);a[s.data]=o.data}catch(e){r.default.e("AMF",e.toString())}return a},e.parseObject=function(t,i,n){if(n<3)throw new s.IllegalStateException("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),a=e.parseValue(t,i+r.size,n-r.size),o=a.objectEnd;return{data:{name:r.data,value:a.data},size:r.size+a.size,objectEnd:o}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new s.IllegalStateException("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!o);return{data:n>0?(0,a.default)(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new s.IllegalStateException("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!o);return{data:n>0?(0,a.default)(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new s.IllegalStateException("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!o),a=n.getInt16(8,!o);return{data:new Date(r+=60*a*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new s.IllegalStateException("Data not enough when parse Value");var a,u=new DataView(t,i,n),l=1,h=u.getUint8(0),d=!1;try{switch(h){case 0:a=u.getFloat64(1,!o),l+=8;break;case 1:a=!!u.getUint8(1),l+=1;break;case 2:var c=e.parseString(t,i+1,n-1);a=c.data,l+=c.size;break;case 3:a={};var f=0;for(9==(16777215&u.getUint32(n-4,!o))&&(f=3);l<n-4;){var p=e.parseObject(t,i+l,n-l-f);if(p.objectEnd)break;a[p.data.name]=p.data.value,l+=p.size}l<=n-3&&9==(16777215&u.getUint32(l-1,!o))&&(l+=3);break;case 8:for(a={},l+=4,f=0,9==(16777215&u.getUint32(n-4,!o))&&(f=3);l<n-8;){var m=e.parseVariable(t,i+l,n-l-f);if(m.objectEnd)break;a[m.data.name]=m.data.value,l+=m.size}l<=n-3&&9==(16777215&u.getUint32(l-1,!o))&&(l+=3);break;case 9:a=void 0,l=1,d=!0;break;case 10:a=[];var _=u.getUint32(1,!o);l+=4;for(var g=0;g<_;g++){var v=e.parseValue(t,i+l,n-l);a.push(v.data),l+=v.size}break;case 11:var y=e.parseDate(t,i+1,n-1);a=y.data,l+=y.size;break;case 12:var b=e.parseString(t,i+1,n-1);a=b.data,l+=b.size;break;default:l=n,r.default.w("AMF","Unsupported AMF value type "+h)}}catch(e){r.default.e("AMF",e.toString())}return{data:a,size:l,objectEnd:d}},e}();t.default=u},"./src/demux/demux-errors.js":
|
||
|
/*!***********************************!*\
|
||
|
!*** ./src/demux/demux-errors.js ***!
|
||
|
\***********************************/
|
||
|
function(e,t,i){i.r(t),t.default={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},"./src/demux/exp-golomb.js":
|
||
|
/*!*********************************!*\
|
||
|
!*** ./src/demux/exp-golomb.js ***!
|
||
|
\*********************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),r=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new n.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t},e.prototype.readBits=function(e){if(e>32)throw new n.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var a=Math.min(r,this._current_word_bits_left),s=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,i=i<<a|s},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(0!=(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}();t.default=r},"./src/demux/flv-demuxer.js":
|
||
|
/*!**********************************!*\
|
||
|
!*** ./src/demux/flv-demuxer.js ***!
|
||
|
\**********************************/
|
||
|
function(e,t,i){i.r(t);var r=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),a=i(
|
||
|
/*! ./amf-parser.js */
|
||
|
"./src/demux/amf-parser.js"),s=i(
|
||
|
/*! ./sps-parser.js */
|
||
|
"./src/demux/sps-parser.js"),o=i(
|
||
|
/*! ./hevc-sps-parser.js */
|
||
|
"./src/demux/hevc-sps-parser.js"),u=i(
|
||
|
/*! ./demux-errors.js */
|
||
|
"./src/demux/demux-errors.js"),l=i(
|
||
|
/*! ../core/media-info.js */
|
||
|
"./src/core/media-info.js"),h=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),d=function(){function e(e,t){var i;this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new l.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=(i=new ArrayBuffer(2),new DataView(i).setInt16(0,256,!0),256===new Int16Array(i)[0])}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e),i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var n,r,a=(4&t[4])>>>2!=0,s=0!=(1&t[4]),o=(n=t)[r=5]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3];return o<9?i:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:a,hasVideoTrack:s}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVi
|
||
|
/*!**************************************!*\
|
||
|
!*** ./src/demux/hevc-sps-parser.js ***!
|
||
|
\**************************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ./exp-golomb.js */
|
||
|
"./src/demux/exp-golomb.js"),r=i(
|
||
|
/*! ./sps-parser.js */
|
||
|
"./src/demux/sps-parser.js"),a=function(){function e(){}return e.parseSPS=function(t){var i=r.default._ebsp2rbsp(t),a=new n.default(i),s={};a.readBits(16),a.readBits(4);var o=a.readBits(3);a.readBits(1),e._hvcc_parse_ptl(a,s,o),a.readUEG();var u=0,l=a.readUEG();3==l&&(u=a.readBits(1)),s.sar_width=s.sar_height=1,s.conf_win_left_offset=s.conf_win_right_offset=s.conf_win_top_offset=s.conf_win_bottom_offset=0,s.def_disp_win_left_offset=s.def_disp_win_right_offset=s.def_disp_win_top_offset=s.def_disp_win_bottom_offset=0;var h=a.readUEG(),d=a.readUEG();a.readBits(1)&&(s.conf_win_left_offset=a.readUEG(),s.conf_win_right_offset=a.readUEG(),s.conf_win_top_offset=a.readUEG(),s.conf_win_bottom_offset=a.readUEG(),1===s.default_display_window_flag&&(s.conf_win_left_offset,s.def_disp_win_left_offset,s.conf_win_right_offset,s.def_disp_win_right_offset,s.conf_win_top_offset,s.def_disp_win_top_offset,s.conf_win_bottom_offset,s.def_disp_win_bottom_offset));var c=a.readUEG()+8;a.readUEG();for(var f=a.readUEG(),p=a.readBits(1)?0:o;p<=o;p++)e._skip_sub_layer_ordering_info(a);a.readUEG(),a.readUEG(),a.readUEG(),a.readUEG(),a.readUEG(),a.readUEG(),a.readBits(1)&&a.readBits(1)&&e._skip_scaling_list_data(a),a.readBits(1),a.readBits(1),a.readBits(1)&&(a.readBits(4),a.readBits(4),a.readUEG(),a.readUEG(),a.readBits(1));var m=[],_=a.readUEG();for(p=0;p<_;p++){var g=e._parse_rps(a,p,_,m);if(g<0)return g}if(a.readBits(1)){var v=a.readUEG();for(p=0;p<v;p++){var y=Math.min(f+4,16);if(y>32){for(var b=y/32,S=y%32,T=0;T<b;T++)a.readBits(32);a.readBits(S)}else a.readBits(y);a.readBits(1)}}a.readBits(1),a.readBits(1),a.readBits(1)&&e._hvcc_parse_vui(a,s,o);var E=e.getProfileString(s.profile_idc),w=e.getLevelString(s.level_idc),A=1;1===s.sar_width&&1===s.sar_height||(A=s.sar_width/s.sar_height);var C=h,k=d,P=1===l&&0===u?2:1;C-=(1!==l&&2!=l||0!==u?1:2)*(s.conf_win_left_offset+s.conf_win_right_offset),k-=P*(s.conf_win_top_offset+s.conf_win_bottom_offset);var I=Math.ceil(C*A);return a.destroy(),a=null,{profile_string:E,level_string:w,profile_idc:s.profile_idc,level_idc:s.level_idc,bit_depth:c,ref_frames:1,chroma_format:l,chroma_format_string:e.getChromaFormatString(l),frame_rate:{fixed:s.fps_fixed,fps:s.fps,fps_den:s.fps_den,fps_num:s.fps_num},sar_ratio:{width:s.sar_width,height:s.sar_height},codec_size:{width:C,height:k},present_size:{width:I,height:k}}},e._hvcc_parse_ptl=function(e,t,i){e.readBits(2);var n=e.readBits(1),r=e.readBits(5);e.readBits(32),e.readBits(32),e.readBits(16);var a=e.readByte();void 0===t.tier_flag||void 0===t.level_idc||t.tier_flag<n?t.level_idc=a:t.level_idc=Math.max(t.level_idc,a),t.profile_idc=Math.max(void 0===t.profile_idc?0:t.profile_idc,r);for(var s=[],o=[],u=0;u<i;u++)s.push(e.readBits(1)),o.push(e.readBits(1));if(i>0)for(u=i;u<8;u++)e.readBits(2);for(u=0;u<i;u++)s[u]&&(e.readBits(32),e.readBits(32),e.readBits(24)),o[u]&&e.readByte()},e._parse_rps=function(e,t,i,n){if(t&&e.readBits(1)){if(t>=i)return-1;e.readBits(1),e.readUEG(),n[t]=0;for(var r=0;r<=n[t-1];r++){var a=0,s=e.readBits(1);s||(a=e.readBits(1)),(s||a)&&n[t]++}}else{var o=e.readUEG(),u=e.readUEG();for(n[t]=o+u,r=0;r<o;r++)e.readUEG(),e.readBits(1);for(r=0;r<u;r++)e.readUEG(),e.readBits(1)}return 0},e._hvcc_parse_vui=function(t,i,n){t.readBits(1)&&255==t.readByte()&&(i.sar_width=t.readBits(16),i.sar_height=t.readBits(16)),t.readBits(1)&&t.readBits(1),t.readBits(1)&&(t.readBits(4),t.readBits(1)&&t.readBits(24)),t.readBits(1)&&(t.readUEG(),t.readUEG()),t.readBits(3),i.default_display_window_flag=t.readBits(1),i.default_display_window_flag&&(i.def_disp_win_left_offset=t.readUEG(),i.def_disp_win_right_offset=t.readUEG(),i.def_disp_win_top_offset=t.readUEG(),i.def_disp_win_bottom_offset=t.readUEG()),t.readBits(1)&&(e._skip_timing_info(t,i),t.readBits(1)&&e._skip_hrd_parameters(t,i,1,n)),t.readBits(1)&&(t.readBits(3),t.readUEG(),t.readUEG(),t.readUEG(),t.readUEG(),t.readUEG())},e._skip_sub_layer_ordering_info=function(e,t){e.readUEG(),e.readUEG(),e.readUEG()},e._skip_scaling_list_data=function(e){for(var t=0;t<4;t++)for(var i=0;i<(3==t?2:6);i++)if(e.readBits(1)){var n=Math.mi
|
||
|
/*!*********************************!*\
|
||
|
!*** ./src/demux/sps-parser.js ***!
|
||
|
\*********************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ./exp-golomb.js */
|
||
|
"./src/demux/exp-golomb.js"),r=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,a=0;a<i;a++)a>=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(n[r]=t[a],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),r=new n.default(i);r.readByte();var a=r.readByte();r.readByte();var s=r.readByte();r.readUEG();var o=e.getProfileString(a),u=e.getLevelString(s),l=1,h=420,d=8;if((100===a||110===a||122===a||244===a||44===a||83===a||86===a||118===a||128===a||138===a||144===a)&&(3===(l=r.readUEG())&&r.readBits(1),l<=3&&(h=[0,420,422,444][l]),d=r.readUEG()+8,r.readUEG(),r.readBits(1),r.readBool()))for(var c=3!==l?8:12,f=0;f<c;f++)r.readBool()&&(f<6?e._skipScalingList(r,16):e._skipScalingList(r,64));r.readUEG();var p=r.readUEG();if(0===p)r.readUEG();else if(1===p){r.readBits(1),r.readSEG(),r.readSEG();var m=r.readUEG();for(f=0;f<m;f++)r.readSEG()}var _=r.readUEG();r.readBits(1);var g=r.readUEG(),v=r.readUEG(),y=r.readBits(1);0===y&&r.readBits(1),r.readBits(1);var b=0,S=0,T=0,E=0;r.readBool()&&(b=r.readUEG(),S=r.readUEG(),T=r.readUEG(),E=r.readUEG());var w=1,A=1,C=0,k=!0,P=0,I=0;if(r.readBool()){if(r.readBool()){var L=r.readByte();L>0&&L<16?(w=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][L-1],A=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][L-1]):255===L&&(w=r.readByte()<<8|r.readByte(),A=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var x=r.readBits(32),R=r.readBits(32);k=r.readBool(),C=(P=R)/(I=2*x)}}var D=1;1===w&&1===A||(D=w/A);var O=0,U=0;0===l?(O=1,U=2-y):(O=3===l?1:2,U=(1===l?2:1)*(2-y));var M=16*(g+1),F=16*(v+1)*(2-y);M-=(b+S)*O,F-=(T+E)*U;var B=Math.ceil(M*D);return r.destroy(),r=null,{profile_string:o,level_string:u,bit_depth:d,ref_frames:_,chroma_format:h,chroma_format_string:e.getChromaFormatString(h),frame_rate:{fixed:k,fps:C,fps_den:I,fps_num:P},sar_ratio:{width:w,height:A},codec_size:{width:M,height:F},present_size:{width:B,height:F}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0;r<t;r++)0!==n&&(n=(i+e.readSEG()+256)%256),i=0===n?i:n},e.getProfileString=function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},e}();t.default=r},"./src/flv.js":
|
||
|
/*!********************!*\
|
||
|
!*** ./src/flv.js ***!
|
||
|
\********************/
|
||
|
function(e,t,i){i.r(t);var r=i(
|
||
|
/*! ./utils/polyfill.js */
|
||
|
"./src/utils/polyfill.js"),a=i(
|
||
|
/*! ./core/features.js */
|
||
|
"./src/core/features.js"),s=i(
|
||
|
/*! ./io/loader.js */
|
||
|
"./src/io/loader.js"),o=i(
|
||
|
/*! ./player/flv-player.js */
|
||
|
"./src/player/flv-player.js"),u=i(
|
||
|
/*! ./player/native-player.js */
|
||
|
"./src/player/native-player.js"),l=i(
|
||
|
/*! ./player/player-events.js */
|
||
|
"./src/player/player-events.js"),h=i(
|
||
|
/*! ./player/player-errors.js */
|
||
|
"./src/player/player-errors.js"),d=i(
|
||
|
/*! ./utils/logging-control.js */
|
||
|
"./src/utils/logging-control.js"),c=i(
|
||
|
/*! ./utils/exception.js */
|
||
|
"./src/utils/exception.js");r.default.install();var f={createPlayer:function(e,t){var i=e;if(null==i||"object"!==n(i))throw new c.InvalidArgumentException("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new c.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"flv":return new o.default(i,t);default:return new u.default(i,t)}},isSupported:function(){return a.default.supportMSEH264Playback()},getFeatureList:function(){return a.default.getFeatureList()}};f.BaseLoader=s.BaseLoader,f.LoaderStatus=s.LoaderStatus,f.LoaderErrors=s.LoaderErrors,f.Events=l.default,f.ErrorTypes=h.ErrorTypes,f.ErrorDetails=h.ErrorDetails,f.FlvPlayer=o.default,f.NativePlayer=u.default,f.LoggingControl=d.default,Object.defineProperty(f,"version",{enumerable:!0,get:function(){return"1.7.0"}}),t.default=f},"./src/index.js":
|
||
|
/*!**********************!*\
|
||
|
!*** ./src/index.js ***!
|
||
|
\**********************/
|
||
|
function(e,t,i){e.exports=i(
|
||
|
/*! ./flv.js */
|
||
|
"./src/flv.js").default},"./src/io/fetch-stream-loader.js":
|
||
|
/*!***************************************!*\
|
||
|
!*** ./src/io/fetch-stream-loader.js ***!
|
||
|
\***************************************/
|
||
|
function(e,t,i){i.r(t);var r,a=i(
|
||
|
/*! ../utils/browser.js */
|
||
|
"./src/utils/browser.js"),s=i(
|
||
|
/*! ./loader.js */
|
||
|
"./src/io/loader.js"),o=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),u=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),l=function(e){function t(t,i){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return u(t,e),t.isSupported=function(){try{var e=a.default.msedge&&a.default.version.minor>=15048,t=!a.default.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(r=e.redirectedURL);var a=this._seekHandler.getConfig(r,t),u=new self.Headers;if("object"===n(a.headers)){var l=a.headers;for(var h in l)l.hasOwnProperty(h)&&u.append(h,l[h])}var d={method:"GET",headers:u,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===n(this._config.headers))for(var h in this._config.headers)u.append(h,this._config.headers[h]);!1===e.cors&&(d.mode="same-origin"),e.withCredentials&&(d.credentials="include"),e.referrerPolicy&&(d.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,d.signal=this._abortController.signal),this._status=s.LoaderStatus.kConnecting,self.fetch(a.url,d).then((function(e){if(i._requestAbort)return i._status=s.LoaderStatus.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.url&&i._onURLRedirect){var t=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(t)}var n=e.headers.get("Content-Length");return null!=n&&(i._contentLength=parseInt(n),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,e.body.getReader())}if(i._status=s.LoaderStatus.kError,!i._onError)throw new o.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!i._abortController||!i._abortController.signal.aborted){if(i._status=s.LoaderStatus.kError,!i._onError)throw e;i._onError(s.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==s.LoaderStatus.kBuffering||!a.default.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=s.LoaderStatus.kError;var n=s.LoaderErrors.EARLY_EOF,r={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new o.RuntimeException(r.msg);t._onError(n,r)}else t._status=s.LoaderStatus.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(t._abortController&&t._abortController.signal.aborted)return void(t._status=s.LoaderStatus.kComplete);if(!0===t._requestAbort)return t._status=s.LoaderStatus.kComplete,e.cancel();t._status=s.LoaderStatus.kBuffering;var a=i.value.buffer,u=t._range.from+t._receivedLength;t._receivedLength+=a.byteLength,t._onDataArrival&&t._onDataArrival(a,u,t._receivedLength),t._pump(e)}})).catch((function(e){if(t._abortController&&t._abortController.signal.aborted)t._status=s.LoaderStatus.kComplete;else if(11!==e.code||!a.default.msedge){t._status=s.LoaderStatus.kError;var i=0,n=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(i=s.LoaderErrors.EXCEPTION,n={code:e.code,msg:e.message}):(i=s.Loa
|
||
|
/*!*********************************!*\
|
||
|
!*** ./src/io/io-controller.js ***!
|
||
|
\*********************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),r=i(
|
||
|
/*! ./speed-sampler.js */
|
||
|
"./src/io/speed-sampler.js"),a=i(
|
||
|
/*! ./loader.js */
|
||
|
"./src/io/loader.js"),s=i(
|
||
|
/*! ./fetch-stream-loader.js */
|
||
|
"./src/io/fetch-stream-loader.js"),o=i(
|
||
|
/*! ./xhr-moz-chunked-loader.js */
|
||
|
"./src/io/xhr-moz-chunked-loader.js"),u=i(
|
||
|
/*! ./xhr-range-loader.js */
|
||
|
"./src/io/xhr-range-loader.js"),l=i(
|
||
|
/*! ./websocket-loader.js */
|
||
|
"./src/io/websocket-loader.js"),h=i(
|
||
|
/*! ./range-seek-handler.js */
|
||
|
"./src/io/range-seek-handler.js"),d=i(
|
||
|
/*! ./param-seek-handler.js */
|
||
|
"./src/io/param-seek-handler.js"),c=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),f=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=393216,null!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new r.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===u.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new h.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new d.default(t,i
|
||
|
/*!**************************!*\
|
||
|
!*** ./src/io/loader.js ***!
|
||
|
\**************************/
|
||
|
function(e,t,i){i.r(t),i.d(t,{LoaderStatus:function(){return r},LoaderErrors:function(){return a},BaseLoader:function(){return s}});var n=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},s=function(){function e(e){this._type=e||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===r.kConnecting||this._status===r.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new n.NotImplementedException("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.NotImplementedException("Unimplemented abstract function!")},e}()},"./src/io/param-seek-handler.js":
|
||
|
/*!**************************************!*\
|
||
|
!*** ./src/io/param-seek-handler.js ***!
|
||
|
\**************************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var n=!0;-1===i.indexOf("?")&&(i+="?",n=!1),n&&(i+="&"),i+=this._startName+"="+t.from.toString(),-1!==t.to&&(i+="&"+this._endName+"="+t.to.toString())}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t=e.split("?")[0],i=void 0,n=e.indexOf("?");-1!==n&&(i=e.substring(n+1));var r="";if(null!=i&&i.length>0)for(var a=i.split("&"),s=0;s<a.length;s++){var o=a[s].split("="),u=s>0;o[0]!==this._startName&&o[0]!==this._endName&&(u&&(r+="&"),r+=a[s])}return 0===r.length?t:t+"?"+r},e}();t.default=n},"./src/io/range-seek-handler.js":
|
||
|
/*!**************************************!*\
|
||
|
!*** ./src/io/range-seek-handler.js ***!
|
||
|
\**************************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i={};if(0!==t.from||-1!==t.to){var n=void 0;n=-1!==t.to?"bytes="+t.from.toString()+"-"+t.to.toString():"bytes="+t.from.toString()+"-",i.Range=n}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}},e.prototype.removeURLParameters=function(e){return e},e}();t.default=n},"./src/io/speed-sampler.js":
|
||
|
/*!*********************************!*\
|
||
|
!*** ./src/io/speed-sampler.js ***!
|
||
|
\*********************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();t.default=n},"./src/io/websocket-loader.js":
|
||
|
/*!************************************!*\
|
||
|
!*** ./src/io/websocket-loader.js ***!
|
||
|
\************************************/
|
||
|
function(e,t,i){i.r(t);var n,r=i(
|
||
|
/*! ./loader.js */
|
||
|
"./src/io/loader.js"),a=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),s=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(e){function t(){var t=e.call(this,"websocket-loader")||this;return t.TAG="WebSocketLoader",t._needStash=!0,t._ws=null,t._requestAbort=!1,t._receivedLength=0,t}return s(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=r.LoaderStatus.kConnecting}catch(e){this._status=r.LoaderStatus.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new a.RuntimeException(i.msg);this._onError(r.LoaderErrors.EXCEPTION,i)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=r.LoaderStatus.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=r.LoaderStatus.kBuffering},t.prototype._onWebSocketClose=function(e){!0!==this._requestAbort?(this._status=r.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(i.result)},i.readAsArrayBuffer(e.data)}else{this._status=r.LoaderStatus.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new a.RuntimeException(n.msg);this._onError(r.LoaderErrors.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=r.LoaderStatus.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new a.RuntimeException(t.msg);this._onError(r.LoaderErrors.EXCEPTION,t)},t}(r.BaseLoader);t.default=o},"./src/io/xhr-moz-chunked-loader.js":
|
||
|
/*!******************************************!*\
|
||
|
!*** ./src/io/xhr-moz-chunked-loader.js ***!
|
||
|
\******************************************/
|
||
|
function(e,t,i){i.r(t);var r,a=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),s=i(
|
||
|
/*! ./loader.js */
|
||
|
"./src/io/loader.js"),o=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),u=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),l=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return u(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return a.default.w("MozChunkedLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(i=e.redirectedURL);var r=this._seekHandler.getConfig(i,t);this._requestURL=r.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",r.url,!0),a.responseType="moz-chunked-arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onloadend=this._onLoadEnd.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"===n(r.headers)){var o=r.headers;for(var u in o)o.hasOwnProperty(u)&&a.setRequestHeader(u,o[u])}if("object"===n(this._config.headers))for(var u in o=this._config.headers)o.hasOwnProperty(u)&&a.setRequestHeader(u,o[u]);this._status=s.LoaderStatus.kConnecting,a.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=s.LoaderStatus.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=s.LoaderStatus.kError,!this._onError)throw new o.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=s.LoaderStatus.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==s.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},t.prototype._onLoadEnd=function(e){!0!==this._requestAbort?this._status!==s.LoaderStatus.kError&&(this._status=s.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=s.LoaderStatus.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=s.LoaderErrors.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=s.LoaderErrors.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new o.RuntimeException(i.msg);this._onError(t,i)},t}(s.BaseLoader);t.default=l},"./src/io/xhr-range-loader.js":
|
||
|
/*!************************************!*\
|
||
|
!*** ./src/io/xhr-range-loader.js ***!
|
||
|
\************************************/
|
||
|
function(e,t,i){i.r(t);var r,a=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),s=i(
|
||
|
/*! ./speed-sampler.js */
|
||
|
"./src/io/speed-sampler.js"),o=i(
|
||
|
/*! ./loader.js */
|
||
|
"./src/io/loader.js"),u=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),l=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),h=function(e){function t(t,i){var n=e.call(this,"xhr-range-loader")||this;return n.TAG="RangeLoader",n._seekHandler=t,n._config=i,n._needStash=!1,n._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],n._currentChunkSizeKB=384,n._currentSpeedNormalized=0,n._zeroSpeedChunkCount=0,n._xhr=null,n._speedSampler=new s.default,n._requestAbort=!1,n._waitForTotalLength=!1,n._totalLengthReceived=!1,n._currentRequestURL=null,n._currentRedirectedURL=null,n._currentRequestRange=null,n._totalLength=null,n._contentLength=null,n._receivedLength=0,n._lastTimeLoaded=0,n}return l(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return a.default.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=o.LoaderStatus.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,i=t+e;null!=this._contentLength&&i-this._range.from>=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var r=this._seekHandler.getConfig(i,t);this._currentRequestURL=r.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",r.url,!0),a.responseType="arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onload=this._onLoad.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"===n(r.headers)){var s=r.headers;for(var o in s)s.hasOwnProperty(o)&&a.setRequestHeader(o,s[o])}if("object"===n(this._config.headers))for(var o in s=this._config.headers)s.hasOwnProperty(o)&&a.setRequestHeader(o,s[o]);a.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=o.LoaderStatus.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=o.LoaderStatus.kBuffering}else{if(this._status=o.LoaderStatus.kError,!this._onError)throw new u.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.LoaderErrors.HTTP_STATUS_COD
|
||
|
/*!**********************************!*\
|
||
|
!*** ./src/player/flv-player.js ***!
|
||
|
\**********************************/
|
||
|
function(e,t,i){i.r(t);var r=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),a=i.n(r),s=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),o=i(
|
||
|
/*! ../utils/browser.js */
|
||
|
"./src/utils/browser.js"),u=i(
|
||
|
/*! ./player-events.js */
|
||
|
"./src/player/player-events.js"),l=i(
|
||
|
/*! ../core/transmuxer.js */
|
||
|
"./src/core/transmuxer.js"),h=i(
|
||
|
/*! ../core/transmuxing-events.js */
|
||
|
"./src/core/transmuxing-events.js"),d=i(
|
||
|
/*! ../core/mse-controller.js */
|
||
|
"./src/core/mse-controller.js"),c=i(
|
||
|
/*! ../core/mse-events.js */
|
||
|
"./src/core/mse-events.js"),f=i(
|
||
|
/*! ./player-errors.js */
|
||
|
"./src/player/player-errors.js"),p=i(
|
||
|
/*! ../config.js */
|
||
|
"./src/config.js"),m=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),_=function(){function e(e,t){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(a()),this._config=(0,p.createDefaultConfig)(),"object"===n(t)&&Object.assign(this._config,t),"flv"!==e.type.toLowerCase())throw new m.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");!0===e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var i=o.default.chrome&&(o.default.version.major<50||50===o.default.version.major&&o.default.version.build<2661);this._alwaysSeekKeyframe=!!(i||o.default.msedge||o.default.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===u.default.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){i._emitter.emit(u.default.MEDIA_INFO,i.mediaInfo)})):e===u.default.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){i._emitter.emit(u.default.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new d.default(this._config),this._msectl.on(c.default.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(c.default.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(c.default.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(c.default.ERROR,(function(e){t._emitter.emit(u.default.ERROR,f.ErrorTypes.MEDIA_ERROR,f.ErrorDetails.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new m.IllegalStateException("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new m.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new l.default(this._mediaDataSource,this._config),this._transmuxer.on(h.default.INIT_SEGMENT,(function(t,i){e._msectl.appendInitSegment(i)})),this._t
|
||
|
/*!*************************************!*\
|
||
|
!*** ./src/player/native-player.js ***!
|
||
|
\*************************************/
|
||
|
function(e,t,i){i.r(t);var r=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),a=i.n(r),s=i(
|
||
|
/*! ./player-events.js */
|
||
|
"./src/player/player-events.js"),o=i(
|
||
|
/*! ../config.js */
|
||
|
"./src/config.js"),u=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),l=function(){function e(e,t){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(a()),this._config=(0,o.createDefaultConfig)(),"object"===n(t)&&Object.assign(this._config,t),"flv"===e.type.toLowerCase())throw new u.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new u.InvalidArgumentException("NativePlayer("+e.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===s.default.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(s.default.MEDIA_INFO,i.mediaInfo)})):e===s.default.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(s.default.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){if(!this._mediaElement)throw new u.IllegalStateException("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object
|
||
|
/*!*************************************!*\
|
||
|
!*** ./src/player/player-errors.js ***!
|
||
|
\*************************************/
|
||
|
function(e,t,i){i.r(t),i.d(t,{ErrorTypes:function(){return a},ErrorDetails:function(){return s}});var n=i(
|
||
|
/*! ../io/loader.js */
|
||
|
"./src/io/loader.js"),r=i(
|
||
|
/*! ../demux/demux-errors.js */
|
||
|
"./src/demux/demux-errors.js"),a={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},s={NETWORK_EXCEPTION:n.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:r.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:r.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:r.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js":
|
||
|
/*!*************************************!*\
|
||
|
!*** ./src/player/player-events.js ***!
|
||
|
\*************************************/
|
||
|
function(e,t,i){i.r(t),t.default={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"}},"./src/remux/aac-silent.js":
|
||
|
/*!*********************************!*\
|
||
|
!*** ./src/remux/aac-silent.js ***!
|
||
|
\*********************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();t.default=n},"./src/remux/mp4-generator.js":
|
||
|
/*!************************************!*\
|
||
|
!*** ./src/remux/mp4-generator.js ***!
|
||
|
\************************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(){}return e.init=function(){for(var t in e.types={hvc1:[],hvcC:[],avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],pasp:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,i=null,n=Array.prototype.slice.call(arguments,1),r=n.length,a=0;a<r;a++)t+=n[a].byteLength;(i=new Uint8Array(t))[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);var s=8;for(a=0;a<r;a++)i.set(n[a],s),s+=n[a].byteLength;return i},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),n=e.moov(t),r=new Uint8Array(i.byteLength+n.byteLength);return r.set(i,0),r.set(n,i.byteLength),r},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),n=e.trak(t),r=e.mvex(t);return e.box(e.types.moov,i,n,r)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,n=t.duration,r=t.presentWidth,a=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,a>>>8&255,255&a,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,n=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var i=null;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i=null;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.esds=function(t){var i=t.config||[],n=i.length,r=new Uint8Array([0,0,0,0,3,
|
||
|
/*!**********************************!*\
|
||
|
!*** ./src/remux/mp4-remuxer.js ***!
|
||
|
\**********************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! ../utils/logger.js */
|
||
|
"./src/utils/logger.js"),r=i(
|
||
|
/*! ./mp4-generator.js */
|
||
|
"./src/remux/mp4-generator.js"),a=i(
|
||
|
/*! ./aac-silent.js */
|
||
|
"./src/remux/aac-silent.js"),s=i(
|
||
|
/*! ../utils/browser.js */
|
||
|
"./src/utils/browser.js"),o=i(
|
||
|
/*! ../core/media-segment-info.js */
|
||
|
"./src/core/media-segment-info.js"),u=i(
|
||
|
/*! ../utils/exception.js */
|
||
|
"./src/utils/exception.js"),l=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new o.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new o.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!s.default.chrome||!(s.default.version.major<50||50===s.default.version.major&&s.default.version.build<2661)),this._fillSilentAfterSeek=s.default.msedge||s.default.msie,this._mp3UseMpegAudio=!s.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new u.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",a=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",a="",i=new Uint8Array):i=r.default.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=r.default.generateInitSegment(t)}if(!this._onInitSegment)throw new u.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:a,container:e+"/"+n,mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var i,u=e,l=u.samples,h=void 0,d=-1,c=this._audioMeta.refSampleDuration,f="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,p=this._dtsBaseInited&&void 0===this._audioNextDts,m=!1;if(l&&0!==l.length&&(1!==l.length||t)){var _=0,g=null,v=0;f?(_=0,v=u.length):(_=8,v=8+u.length);var y=null;if(l.length>1&&(v-=(y=l.pop()).length),null!=this._audioStashedLastSample){var b=this._audioStashedLastSample;this._audioStashedLastSample=null,l.unshift(b),v+=b.length}null!=y&&(this._audioStashedLastSample=y);var S=l[0].dts-this._dtsBase;if(this._audioNextDts)h=S-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())h=0,this._fillSilentAfterSeek&&!this._videoSeg
|
||
|
/*!******************************!*\
|
||
|
!*** ./src/utils/browser.js ***!
|
||
|
\******************************/
|
||
|
function(e,t,i){i.r(t);var n={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},a={};if(r.browser){a[r.browser]=!0;var s=r.majorVersion.split(".");a.version={major:parseInt(r.majorVersion,10),string:r.version},s.length>1&&(a.version.minor=parseInt(s[1],10)),s.length>2&&(a.version.build=parseInt(s[2],10))}for(var o in r.platform&&(a[r.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),(a.rv||a.iemobile)&&(a.rv&&delete a.rv,r.browser="msie",a.msie=!0),a.edge&&(delete a.edge,r.browser="msedge",a.msedge=!0),a.opr&&(r.browser="opera",a.opera=!0),a.safari&&a.android&&(r.browser="android",a.android=!0),a.name=r.browser,a.platform=r.platform,n)n.hasOwnProperty(o)&&delete n[o];Object.assign(n,a)}(),t.default=n},"./src/utils/exception.js":
|
||
|
/*!********************************!*\
|
||
|
!*** ./src/utils/exception.js ***!
|
||
|
\********************************/
|
||
|
function(e,t,i){i.r(t),i.d(t,{RuntimeException:function(){return a},IllegalStateException:function(){return s},InvalidArgumentException:function(){return o},NotImplementedException:function(){return u}});var n,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),a=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),s=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(a),o=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(a),u=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(a)},"./src/utils/logger.js":
|
||
|
/*!*****************************!*\
|
||
|
!*** ./src/utils/logger.js ***!
|
||
|
\*****************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),r=i.n(n),a=function(){function e(){}return e.e=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",n),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn)},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&console.info&&console.info(n)},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&console.warn},e.d=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",n),e.ENABLE_DEBUG&&console.debug&&console.debug(n)},e.v=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE},e}();a.GLOBAL_TAG="flv.js",a.FORCE_GLOBAL_TAG=!1,a.ENABLE_ERROR=!0,a.ENABLE_INFO=!0,a.ENABLE_WARN=!0,a.ENABLE_DEBUG=!0,a.ENABLE_VERBOSE=!0,a.ENABLE_CALLBACK=!1,a.emitter=new(r()),t.default=a},"./src/utils/logging-control.js":
|
||
|
/*!**************************************!*\
|
||
|
!*** ./src/utils/logging-control.js ***!
|
||
|
\**************************************/
|
||
|
function(e,t,i){i.r(t);var n=i(
|
||
|
/*! events */
|
||
|
"./node_modules/events/events.js"),r=i.n(n),a=i(
|
||
|
/*! ./logger.js */
|
||
|
"./src/utils/logger.js"),s=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return a.default.FORCE_GLOBAL_TAG},set:function(t){a.default.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return a.default.GLOBAL_TAG},set:function(t){a.default.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return a.default.ENABLE_VERBOSE&&a.default.ENABLE_DEBUG&&a.default.ENABLE_INFO&&a.default.ENABLE_WARN&&a.default.ENABLE_ERROR},set:function(t){a.default.ENABLE_VERBOSE=t,a.default.ENABLE_DEBUG=t,a.default.ENABLE_INFO=t,a.default.ENABLE_WARN=t,a.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return a.default.ENABLE_DEBUG},set:function(t){a.default.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return a.default.ENABLE_VERBOSE},set:function(t){a.default.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return a.default.ENABLE_INFO},set:function(t){a.default.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return a.default.ENABLE_WARN},set:function(t){a.default.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return a.default.ENABLE_ERROR},set:function(t){a.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:a.default.GLOBAL_TAG,forceGlobalTag:a.default.FORCE_GLOBAL_TAG,enableVerbose:a.default.ENABLE_VERBOSE,enableDebug:a.default.ENABLE_DEBUG,enableInfo:a.default.ENABLE_INFO,enableWarn:a.default.ENABLE_WARN,enableError:a.default.ENABLE_ERROR,enableCallback:a.default.ENABLE_CALLBACK}},e.applyConfig=function(e){a.default.GLOBAL_TAG=e.globalTag,a.default.FORCE_GLOBAL_TAG=e.forceGlobalTag,a.default.ENABLE_VERBOSE=e.enableVerbose,a.default.ENABLE_DEBUG=e.enableDebug,a.default.ENABLE_INFO=e.enableInfo,a.default.ENABLE_WARN=e.enableWarn,a.default.ENABLE_ERROR=e.enableError,a.default.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){a.default.emitter.addListener("log",t),a.default.emitter.listenerCount("log")>0&&(a.default.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){a.default.emitter.removeListener("log",t),0===a.default.emitter.listenerCount("log")&&(a.default.ENABLE_CALLBACK=!1,e._notifyChange())},e}();s.emitter=new(r()),t.default=s},"./src/utils/polyfill.js":
|
||
|
/*!*******************************!*\
|
||
|
!*** ./src/utils/polyfill.js ***!
|
||
|
\*******************************/
|
||
|
function(e,t,i){i.r(t);var n=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},"function"!=typeof self.Promise&&i(
|
||
|
/*! es6-promise */
|
||
|
"./node_modules/es6-promise/dist/es6-promise.js").polyfill()},e}();n.install(),t.default=n},"./src/utils/utf8-conv.js":
|
||
|
/*!********************************!*\
|
||
|
!*** ./src/utils/utf8-conv.js ***!
|
||
|
\********************************/
|
||
|
function(e,t,i){function n(e,t,i){var n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}i.r(t),t.default=function(e){for(var t=[],i=e,r=0,a=e.length;r<a;)if(i[r]<128)t.push(String.fromCharCode(i[r])),++r;else{if(i[r]<192);else if(i[r]<224){if(n(i,r,1)&&(s=(31&i[r])<<6|63&i[r+1])>=128){t.push(String.fromCharCode(65535&s)),r+=2;continue}}else if(i[r]<240){if(n(i,r,2)&&(s=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2])>=2048&&55296!=(63488&s)){t.push(String.fromCharCode(65535&s)),r+=3;continue}}else if(i[r]<248){var s;if(n(i,r,3)&&(s=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3])>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var a=i[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}return r.m=t,r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"===("undefined"==typeof globalThis?"undefined":n(globalThis)))return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===("undefined"==typeof window?"undefined":n(window)))return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r("./src/index.js")}()},"object"===(void 0===i?"undefined":n(i))&&"object"===(void 0===t?"undefined":n(t))?t.exports=a():"function"==typeof define&&define.amd?define([],a):"object"===(void 0===i?"undefined":n(i))?i.flvjshevc=a():r.flvjshevc=a()}).call(this,e("_process"))},{_process:44}],69:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=e("./m3u8base"),a=e("./mpegts/mpeg.js"),s=e("./bufferFrame"),o=e("./buffer"),u=e("../decoder/hevc-imp"),l=e("../consts"),h=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hls=new r.M3u8Base,this.mpegTsObj=new a.MPEG_JS({}),this.mpegTsWasmState=!1,this.mpegTsWasmRetryLoadTimes=0,this.tsList=[],this.vStartTime=0,this.aStartTime=0,this.lockWait={state:!1,lockMember:{dur:0}},this.timerFeed=null,this.timerTsWasm=null,this.seekPos=-1,this.vPreFramePTS=0,this.aPreFramePTS=0,this.audioNone=!1,this.isHevcParam=!1,this.vCodec=!1,this.aCodec=!1,this.aChannel=0,this.durationMs=-1,this.bufObject=o(),this.fps=-1,this.sampleRate=-1,this.size={width:-1,height:-1},this.mediaInfo=null,this.extensionInfo=null,this.onReadyOBJ=null,this.onFinished=null,this.onDemuxed=null,this.onSamples=null,this.onCacheProcess=null}var t,i,h;return t=e,(i=[{key:"getCachePTS",value:function(){return Math.max(this.vPreFramePTS,this.aPreFramePTS)}},{key:"demux",value:function(e){var t=this,i=this;this.vPreFramePTS=0,this.aPreFramePTS=0,this.hls.onTransportStream=function(e,t){i.lockWait.state,i.tsList.length,i.tsList.push({streamURI:e,streamDur:t})},this.hls.onFinished=function(e){e.type==l.PLAYER_IN_TYPE_M3U8_VOD?i.durationMs=1e3*e.duration:i.durationMs=-1,null!=i.onFinished&&i.onFinished(i.onReadyOBJ,e)},this.mpegTsObj.onDemuxedFailed=function(e,t){console.error("onDemuxedFailed: ",e,t),i.lockWait.state=!1},this.mpegTsObj.onDemuxed=function(){null==i.mediaInfo&&(i.mediaInfo=i.mpegTsObj.readMediaInfo(),i.mediaInfo,i.isHevcParam=i.mpegTsObj.isHEVC(),i.vCodec=i.mpegTsObj.vCodec,i.aCodec=i.mediaInfo.aCodec,i.aChannel=i.mediaInfo.sampleChannel,i.fps=i.mediaInfo.vFps,i.sampleRate=i.mediaInfo.sampleRate,(null===i.aCodec||""===i.aCodec||i.aChannel<=0)&&(i.audioNone=!0)),null==i.extensionInfo&&(i.extensionInfo=i.mpegTsObj.readExtensionInfo(),i.extensionInfo.vWidth>0&&i.extension
|