luckyphoenix 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -4
  3. package/alist-web/README.md +34 -0
  4. package/alist-web/assets/2fa-legacy.3350d44d.js +1 -0
  5. package/alist-web/assets/2fa.0dab7189.js +1 -0
  6. package/alist-web/assets/About-legacy.e1597551.js +1 -0
  7. package/alist-web/assets/About.11e2f3bb.js +1 -0
  8. package/alist-web/assets/AddOrEdit-legacy.2a02db88.js +1 -0
  9. package/alist-web/assets/AddOrEdit-legacy.432f6c0e.js +1 -0
  10. package/alist-web/assets/AddOrEdit-legacy.6ac6f516.js +1 -0
  11. package/alist-web/assets/AddOrEdit.79c069f9.js +1 -0
  12. package/alist-web/assets/AddOrEdit.e641a9bd.js +1 -0
  13. package/alist-web/assets/AddOrEdit.f0ec5bf9.js +1 -0
  14. package/alist-web/assets/Common-legacy.5144e9c0.js +1 -0
  15. package/alist-web/assets/Common.6eff9060.js +1 -0
  16. package/alist-web/assets/Copy-legacy.3d846482.js +1 -0
  17. package/alist-web/assets/Copy.d1980101.js +1 -0
  18. package/alist-web/assets/DeletePopover-legacy.1906395c.js +1 -0
  19. package/alist-web/assets/DeletePopover.f7887d88.js +1 -0
  20. package/alist-web/assets/File-legacy.889dd355.js +1 -0
  21. package/alist-web/assets/File.23490613.js +1 -0
  22. package/alist-web/assets/Folder-legacy.a4550db5.js +29 -0
  23. package/alist-web/assets/Folder.7e9202ae.js +179 -0
  24. package/alist-web/assets/Folder.b511ba9e.css +1 -0
  25. package/alist-web/assets/FolderTree-legacy.2cffdb64.js +1 -0
  26. package/alist-web/assets/FolderTree.3d6d889d.js +1 -0
  27. package/alist-web/assets/Grid-legacy.a63ef469.js +1 -0
  28. package/alist-web/assets/Grid.7759c684.js +1 -0
  29. package/alist-web/assets/GridItem-legacy.2300a556.js +1 -0
  30. package/alist-web/assets/GridItem.5502f946.js +1 -0
  31. package/alist-web/assets/ImageWithError-legacy.184872e5.js +1 -0
  32. package/alist-web/assets/ImageWithError.fbebe083.js +1 -0
  33. package/alist-web/assets/Images-legacy.47953965.js +1 -0
  34. package/alist-web/assets/Images.cc1e423a.js +1 -0
  35. package/alist-web/assets/Layout-legacy.bbe308ea.js +1 -0
  36. package/alist-web/assets/Layout.683e33e3.js +6 -0
  37. package/alist-web/assets/List-legacy.dc5a2a38.js +1 -0
  38. package/alist-web/assets/List.249d43e3.js +1 -0
  39. package/alist-web/assets/Messenger-legacy.15747cf4.js +1 -0
  40. package/alist-web/assets/Messenger.0de50ee8.js +1 -0
  41. package/alist-web/assets/Metas-legacy.9a37ad69.js +1 -0
  42. package/alist-web/assets/Metas.94282135.js +1 -0
  43. package/alist-web/assets/Other-legacy.1defd90b.js +1 -0
  44. package/alist-web/assets/Other.c698471d.js +1 -0
  45. package/alist-web/assets/PackageDownload-legacy.13e43bb9.js +1 -0
  46. package/alist-web/assets/PackageDownload.89e4ecc4.js +1 -0
  47. package/alist-web/assets/Paginator-legacy.6f9f1dcb.js +1 -0
  48. package/alist-web/assets/Paginator.758bcfa3.js +1 -0
  49. package/alist-web/assets/Password-legacy.5e5cbd20.js +1 -0
  50. package/alist-web/assets/Password.500d1886.js +1 -0
  51. package/alist-web/assets/Profile-legacy.ccf1ddd4.js +1 -0
  52. package/alist-web/assets/Profile.33671ffe.js +1 -0
  53. package/alist-web/assets/ResponsiveGrid-legacy.d58d4dfe.js +1 -0
  54. package/alist-web/assets/ResponsiveGrid.04e247e9.js +1 -0
  55. package/alist-web/assets/S3-legacy.fb41a1b8.js +1 -0
  56. package/alist-web/assets/S3.135ba8ad.js +1 -0
  57. package/alist-web/assets/SettingItem-legacy.51bf5808.js +1 -0
  58. package/alist-web/assets/SettingItem.d9757149.js +1 -0
  59. package/alist-web/assets/SourceHanSansCN-Bold.b5627435.woff2 +0 -0
  60. package/alist-web/assets/Storages-legacy.6fe86e3a.js +1 -0
  61. package/alist-web/assets/Storages.22e89c36.js +1 -0
  62. package/alist-web/assets/Tasks-legacy.bcf4e457.js +1 -0
  63. package/alist-web/assets/Tasks.f607862a.js +1 -0
  64. package/alist-web/assets/TimesNewRoman.d9fb32eb.ttf +0 -0
  65. package/alist-web/assets/Upload-legacy.7dd2be21.js +1 -0
  66. package/alist-web/assets/Upload-legacy.cb936202.js +1 -0
  67. package/alist-web/assets/Upload.4c54bcbf.js +1 -0
  68. package/alist-web/assets/Upload.d35bb47b.js +1 -0
  69. package/alist-web/assets/Users-legacy.b992a339.js +1 -0
  70. package/alist-web/assets/Users.7eb39296.js +1 -0
  71. package/alist-web/assets/Wether-legacy.66b7b0d3.js +1 -0
  72. package/alist-web/assets/Wether.f17d6a97.js +1 -0
  73. package/alist-web/assets/_commonjs-dynamic-modules-legacy.cf19cda3.js +1 -0
  74. package/alist-web/assets/_commonjs-dynamic-modules.30ae7933.js +1 -0
  75. package/alist-web/assets/aliyun_office-legacy.7e1c4ff6.js +1 -0
  76. package/alist-web/assets/aliyun_office.627eb2ac.js +1 -0
  77. package/alist-web/assets/aliyun_video-legacy.dfd303c5.js +1 -0
  78. package/alist-web/assets/aliyun_video.681fb5ee.js +1 -0
  79. package/alist-web/assets/asciinema-legacy.554330ec.js +1 -0
  80. package/alist-web/assets/asciinema.53412307.css +1 -0
  81. package/alist-web/assets/asciinema.a6e925e9.js +7 -0
  82. package/alist-web/assets/audio-legacy.d6ef56f6.js +1 -0
  83. package/alist-web/assets/audio.0cad5cce.js +154 -0
  84. package/alist-web/assets/audio.e5b5af14.css +1 -0
  85. package/alist-web/assets/backup-restore-legacy.f4c8daf0.js +1 -0
  86. package/alist-web/assets/backup-restore.db700ca0.js +1 -0
  87. package/alist-web/assets/entry-legacy.01f22349.js +1 -0
  88. package/alist-web/assets/entry-legacy.31390e6c.js +1 -0
  89. package/alist-web/assets/entry-legacy.5119e4e8.js +1 -0
  90. package/alist-web/assets/entry-legacy.d3b909f7.js +1 -0
  91. package/alist-web/assets/entry-legacy.e017de3e.js +1 -0
  92. package/alist-web/assets/entry-legacy.eec15c4b.js +1 -0
  93. package/alist-web/assets/entry-legacy.fa23a37d.js +1 -0
  94. package/alist-web/assets/entry.2eaf5bb3.js +5 -0
  95. package/alist-web/assets/entry.371138c7.js +7 -0
  96. package/alist-web/assets/entry.5c41c532.js +5 -0
  97. package/alist-web/assets/entry.6cce3889.js +5 -0
  98. package/alist-web/assets/entry.8acdb7f9.js +9 -0
  99. package/alist-web/assets/entry.abb9e6ed.js +5 -0
  100. package/alist-web/assets/entry.e83ea613.js +6 -0
  101. package/alist-web/assets/helper-legacy.646eb2d9.js +1 -0
  102. package/alist-web/assets/helper.d54883e3.js +1 -0
  103. package/alist-web/assets/hls-legacy.9e0f7edb.js +379 -0
  104. package/alist-web/assets/hls.1623c369.js +49 -0
  105. package/alist-web/assets/html-legacy.fa26963f.js +1 -0
  106. package/alist-web/assets/html.8b79f6ca.js +1 -0
  107. package/alist-web/assets/icon-legacy.2d7c0a16.js +1 -0
  108. package/alist-web/assets/icon.94f94d81.js +37 -0
  109. package/alist-web/assets/image-legacy.236a9cca.js +1 -0
  110. package/alist-web/assets/image.82ca8574.js +1 -0
  111. package/alist-web/assets/index-legacy.0bd3a7f2.js +1 -0
  112. package/alist-web/assets/index-legacy.40b50240.js +1 -0
  113. package/alist-web/assets/index-legacy.61172c95.js +1 -0
  114. package/alist-web/assets/index-legacy.840e3d82.js +18 -0
  115. package/alist-web/assets/index-legacy.91fe7355.js +1 -0
  116. package/alist-web/assets/index-legacy.a7c40fe3.js +22 -0
  117. package/alist-web/assets/index-legacy.d72e643a.js +1 -0
  118. package/alist-web/assets/index-legacy.efef9df2.js +1 -0
  119. package/alist-web/assets/index-legacy.fb7fb711.js +1 -0
  120. package/alist-web/assets/index.0adfc44b.js +1 -0
  121. package/alist-web/assets/index.26f5b473.js +14 -0
  122. package/alist-web/assets/index.72e3f724.js +1 -0
  123. package/alist-web/assets/index.7409b67a.js +1 -0
  124. package/alist-web/assets/index.952b63b2.js +1 -0
  125. package/alist-web/assets/index.afa471fc.js +1 -0
  126. package/alist-web/assets/index.c15f7469.js +2 -0
  127. package/alist-web/assets/index.c4c82a28.css +1 -0
  128. package/alist-web/assets/index.dcae211e.js +1 -0
  129. package/alist-web/assets/index.fae3cea4.js +333 -0
  130. package/alist-web/assets/indexes-legacy.2c89d2d8.js +1 -0
  131. package/alist-web/assets/indexes.9cb6f537.js +2 -0
  132. package/alist-web/assets/ipa-legacy.7a49e0e2.js +1 -0
  133. package/alist-web/assets/ipa.97543f5f.js +1 -0
  134. package/alist-web/assets/item_type-legacy.d1f1c701.js +1 -0
  135. package/alist-web/assets/item_type.be442da4.js +1 -0
  136. package/alist-web/assets/lg.22b72ba5.ttf +0 -0
  137. package/alist-web/assets/lg.f2fe1c00.svg +54 -0
  138. package/alist-web/assets/lg.fefc5c0d.woff +0 -0
  139. package/alist-web/assets/loading.298ad3ff.gif +0 -0
  140. package/alist-web/assets/markdown-legacy.164943d8.js +1 -0
  141. package/alist-web/assets/markdown.3a932f53.js +1 -0
  142. package/alist-web/assets/markdown_with_word_wrap-legacy.5e032546.js +1 -0
  143. package/alist-web/assets/markdown_with_word_wrap.0efe2540.js +1 -0
  144. package/alist-web/assets/offline_download-legacy.11c4744c.js +1 -0
  145. package/alist-web/assets/offline_download.940ca54b.js +1 -0
  146. package/alist-web/assets/plist-legacy.c76fc720.js +1 -0
  147. package/alist-web/assets/plist.3c9cbb1a.js +1 -0
  148. package/alist-web/assets/polyfills-legacy.5f28c7ae.js +1 -0
  149. package/alist-web/assets/subtitles-octopus-worker.62892886.wasm +0 -0
  150. package/alist-web/assets/subtitles-octopus-worker.f95f2186.js +1 -0
  151. package/alist-web/assets/text-editor-legacy.6e126724.js +1 -0
  152. package/alist-web/assets/text-editor.45600bb2.js +11 -0
  153. package/alist-web/assets/url-legacy.e95c5b8b.js +1 -0
  154. package/alist-web/assets/url.f7914d75.js +1 -0
  155. package/alist-web/assets/useTitle-legacy.e942225f.js +1 -0
  156. package/alist-web/assets/useTitle.630c0b7f.js +1 -0
  157. package/alist-web/assets/video-legacy.5198eeb8.js +135 -0
  158. package/alist-web/assets/video.afae2b68.js +9 -0
  159. package/alist-web/assets/video360-legacy.227ed7df.js +16 -0
  160. package/alist-web/assets/video360.c8385eb2.js +18 -0
  161. package/alist-web/assets/video360.f0192288.css +1 -0
  162. package/alist-web/assets/video_box-legacy.d60b6928.js +7 -0
  163. package/alist-web/assets/video_box.bfb0d4a5.js +18 -0
  164. package/alist-web/assets/webauthn-json.browser-ponyfill-legacy.8ddd819a.js +1 -0
  165. package/alist-web/assets/webauthn-json.browser-ponyfill.1c672167.js +1 -0
  166. package/alist-web/images/figplayer.webp +0 -0
  167. package/alist-web/images/fileball.webp +0 -0
  168. package/alist-web/images/iina.webp +0 -0
  169. package/alist-web/images/infuse.webp +0 -0
  170. package/alist-web/images/mxplayer-pro.webp +0 -0
  171. package/alist-web/images/mxplayer.webp +0 -0
  172. package/alist-web/images/nplayer.webp +0 -0
  173. package/alist-web/images/omniplayer.webp +0 -0
  174. package/alist-web/images/potplayer.webp +0 -0
  175. package/alist-web/images/vlc.webp +0 -0
  176. package/alist-web/index.html +81 -0
  177. package/alist-web/package.json +95 -0
  178. package/alist-web/static/epub.js/viewer.html +467 -0
  179. package/alist-web/static/manifest.json +13 -0
  180. package/alist-web/streamer/mitm.html +186 -0
  181. package/alist-web/streamer/sw.js +141 -0
  182. package/css/alist_skin_v2.css +410 -410
  183. package/css/alist_skin_v3.css +216 -217
  184. package/css/alist_wallpaper.css +49 -48
  185. package/css/colorful.css +65 -65
  186. package/css/font-awesome.css +10570 -10569
  187. package/css/lxgw-style.css +12 -6
  188. package/css/lxgwwenkai-bold.css +873 -873
  189. package/css/lxgwwenkai-light.css +873 -873
  190. package/css/lxgwwenkai-regular.css +873 -873
  191. package/css/lxgwwenkaimono-bold.css +873 -873
  192. package/css/lxgwwenkaimono-light.css +873 -873
  193. package/css/lxgwwenkaimono-regular.css +873 -873
  194. package/js/Meting2.min.js +1 -0
  195. package/js/alist_skin.js +33 -33
  196. package/package.json +2 -2
  197. package/favicon.ico +0 -0
  198. package/js/yaml/js-yaml.js +0 -3874
  199. package/js/yaml/js-yaml.min.js +0 -2
  200. package/js/yaml/js-yaml.mjs +0 -3851
  201. /package/js/{jquery-3.6.0.min.js → jquery.min.js} +0 -0
@@ -0,0 +1,9 @@
1
+ import{cU as Ie,b as De,a5 as we,dB as Me,a1 as ne,aJ as Pe,cF as me,dC as ye,aL as Fe,c9 as Be,ca as ke,o as Ue,e as je,m as Ne,h as Se,a7 as Ge,ai as We,d as Le,dD as be}from"./index.fae3cea4.js";import{O as Ke,A as Ve}from"./icon.94f94d81.js";import{A as ze,a as He,V as Xe}from"./video_box.bfb0d4a5.js";import{H as Ye,a as Qe,b as Je}from"./hls.1623c369.js";import"./index.0adfc44b.js";import"./Layout.683e33e3.js";import"./useTitle.630c0b7f.js";import"./index.952b63b2.js";import"./FolderTree.3d6d889d.js";import"./index.afa471fc.js";import"./_commonjs-dynamic-modules.30ae7933.js";var Ae={exports:{}};(function(ve,Ee){(function(ue,z){ve.exports=z()})(self,function(){return function(){var se={"./node_modules/es6-promise/dist/es6-promise.js":function(I,S,p){/*!
2
+ * @overview es6-promise - a tiny implementation of Promises/A+.
3
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
4
+ * @license Licensed under MIT license
5
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
6
+ * @version v4.2.8+1e68dce6
7
+ */(function(y,h){I.exports=h()})(this,function(){function y(b){var O=typeof b;return b!==null&&(O==="object"||O==="function")}function h(b){return typeof b=="function"}var f=void 0;Array.isArray?f=Array.isArray:f=function(b){return Object.prototype.toString.call(b)==="[object Array]"};var o=f,d=0,n=void 0,l=void 0,a=function(O,C){g[d]=O,g[d+1]=C,d+=2,d===2&&(l?l(L):A())};function r(b){l=b}function t(b){a=b}var s=typeof window<"u"?window:void 0,i=s||{},e=i.MutationObserver||i.WebKitMutationObserver,u=typeof self>"u"&&typeof process<"u"&&{}.toString.call(process)==="[object process]",_=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function c(){return function(){return process.nextTick(L)}}function v(){return typeof n<"u"?function(){n(L)}:m()}function E(){var b=0,O=new e(L),C=document.createTextNode("");return O.observe(C,{characterData:!0}),function(){C.data=b=++b%2}}function x(){var b=new MessageChannel;return b.port1.onmessage=L,function(){return b.port2.postMessage(0)}}function m(){var b=setTimeout;return function(){return b(L,1)}}var g=new Array(1e3);function L(){for(var b=0;b<d;b+=2){var O=g[b],C=g[b+1];O(C),g[b]=void 0,g[b+1]=void 0}d=0}function R(){try{var b=Function("return this")().require("vertx");return n=b.runOnLoop||b.runOnContext,v()}catch{return m()}}var A=void 0;u?A=c():e?A=E():_?A=x():s===void 0?A=R():A=m();function T(b,O){var C=this,D=new this.constructor(P);D[k]===void 0&&fe(D);var F=C._state;if(F){var U=arguments[F-1];a(function(){return ae(F,D,U,C._result)})}else J(C,D,b,O);return D}function B(b){var O=this;if(b&&typeof b=="object"&&b.constructor===O)return b;var C=new O(P);return Q(C,b),C}var k=Math.random().toString(36).substring(2);function P(){}var j=void 0,W=1,M=2;function N(){return new TypeError("You cannot resolve a promise with itself")}function q(){return new TypeError("A promises callback cannot return that same promise.")}function G(b,O,C,D){try{b.call(O,C,D)}catch(F){return F}}function K(b,O,C){a(function(D){var F=!1,U=G(C,O,function(H){F||(F=!0,O!==H?Q(D,H):V(D,H))},function(H){F||(F=!0,w(D,H))},"Settle: "+(D._label||" unknown promise"));!F&&U&&(F=!0,w(D,U))},b)}function Z(b,O){O._state===W?V(b,O._result):O._state===M?w(b,O._result):J(O,void 0,function(C){return Q(b,C)},function(C){return w(b,C)})}function X(b,O,C){O.constructor===b.constructor&&C===T&&O.constructor.resolve===B?Z(b,O):C===void 0?V(b,O):h(C)?K(b,O,C):V(b,O)}function Q(b,O){if(b===O)w(b,N());else if(y(O)){var C=void 0;try{C=O.then}catch(D){w(b,D);return}X(b,O,C)}else V(b,O)}function re(b){b._onerror&&b._onerror(b._result),ee(b)}function V(b,O){b._state===j&&(b._result=O,b._state=W,b._subscribers.length!==0&&a(ee,b))}function w(b,O){b._state===j&&(b._state=M,b._result=O,a(re,b))}function J(b,O,C,D){var F=b._subscribers,U=F.length;b._onerror=null,F[U]=O,F[U+W]=C,F[U+M]=D,U===0&&b._state&&a(ee,b)}function ee(b){var O=b._subscribers,C=b._state;if(O.length!==0){for(var D=void 0,F=void 0,U=b._result,H=0;H<O.length;H+=3)D=O[H],F=O[H+C],D?ae(C,D,F,U):F(U);b._subscribers.length=0}}function ae(b,O,C,D){var F=h(C),U=void 0,H=void 0,de=!0;if(F){try{U=C(D)}catch(pe){de=!1,H=pe}if(O===U){w(O,q());return}}else U=D;O._state!==j||(F&&de?Q(O,U):de===!1?w(O,H):b===W?V(O,U):b===M&&w(O,U))}function ie(b,O){try{O(function(D){Q(b,D)},function(D){w(b,D)})}catch(C){w(b,C)}}var oe=0;function le(){return oe++}function fe(b){b[k]=oe++,b._state=void 0,b._result=void 0,b._subscribers=[]}function te(){return new Error("Array Methods must be provided an Array")}var $=function(){function b(O,C){this._instanceConstructor=O,this.promise=new O(P),this.promise[k]||fe(this.promise),o(C)?(this.length=C.length,this._remaining=C.length,this._result=new Array(this.length),this.length===0?V(this.promise,this._result):(this.length=this.length||0,this._enumerate(C),this._remaining===0&&V(this.promise,this._result))):w(this.promise,te())}return b.prototype._enumerate=function(C){for(var D=0;this._state===j&&D<C.length;D++)this._eachEntry(C[D],D)},b.prototype._eachEntry=function(C,D){var F=this._instanceConstructor,U=F.resolve;if(U===B){var H=void 0,de=void 0,pe=!1;try{H=C.then}catch(xe){pe=!0,de=xe}if(H===T&&C._state!==j)this._settledAt(C._state,D,C._result);else if(typeof H!="function")this._remaining--,this._result[D]=C;else if(F===Y){var ge=new F(P);pe?w(ge,de):X(ge,C,H),this._willSettleAt(ge,D)}else this._willSettleAt(new F(function(xe){return xe(C)}),D)}else this._willSettleAt(U(C),D)},b.prototype._settledAt=function(C,D,F){var U=this.promise;U._state===j&&(this._remaining--,C===M?w(U,F):this._result[D]=F),this._remaining===0&&V(U,this._result)},b.prototype._willSettleAt=function(C,D){var F=this;J(C,void 0,function(U){return F._settledAt(W,D,U)},function(U){return F._settledAt(M,D,U)})},b}();function he(b){return new $(this,b).promise}function ce(b){var O=this;return o(b)?new O(function(C,D){for(var F=b.length,U=0;U<F;U++)O.resolve(b[U]).then(C,D)}):new O(function(C,D){return D(new TypeError("You must pass an array to race."))})}function Re(b){var O=this,C=new O(P);return w(C,b),C}function Oe(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ce(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Y=function(){function b(O){this[k]=le(),this._result=this._state=void 0,this._subscribers=[],P!==O&&(typeof O!="function"&&Oe(),this instanceof b?ie(this,O):Ce())}return b.prototype.catch=function(C){return this.then(null,C)},b.prototype.finally=function(C){var D=this,F=D.constructor;return h(C)?D.then(function(U){return F.resolve(C()).then(function(){return U})},function(U){return F.resolve(C()).then(function(){throw U})}):D.then(C,C)},b}();Y.prototype.then=T,Y.all=he,Y.race=ce,Y.resolve=B,Y.reject=Re,Y._setScheduler=r,Y._setAsap=t,Y._asap=a;function Te(){var b=void 0;if(typeof p.g<"u")b=p.g;else if(typeof self<"u")b=self;else try{b=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var O=b.Promise;if(O){var C=null;try{C=Object.prototype.toString.call(O.resolve())}catch{}if(C==="[object Promise]"&&!O.cast)return}b.Promise=Y}return Y.polyfill=Te,Y.Promise=Y,Y})},"./node_modules/events/events.js":function(I){var S=typeof Reflect=="object"?Reflect:null,p=S&&typeof S.apply=="function"?S.apply:function(m,g,L){return Function.prototype.apply.call(m,g,L)},y;S&&typeof S.ownKeys=="function"?y=S.ownKeys:Object.getOwnPropertySymbols?y=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:y=function(m){return Object.getOwnPropertyNames(m)};function h(x){console&&console.warn&&console.warn(x)}var f=Number.isNaN||function(m){return m!==m};function o(){o.init.call(this)}I.exports=o,I.exports.once=c,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var d=10;function n(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(x){if(typeof x!="number"||x<0||f(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");d=x}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||f(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function l(x){return x._maxListeners===void 0?o.defaultMaxListeners:x._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(m){for(var g=[],L=1;L<arguments.length;L++)g.push(arguments[L]);var R=m==="error",A=this._events;if(A!==void 0)R=R&&A.error===void 0;else if(!R)return!1;if(R){var T;if(g.length>0&&(T=g[0]),T instanceof Error)throw T;var B=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw B.context=T,B}var k=A[m];if(k===void 0)return!1;if(typeof k=="function")p(k,this,g);else for(var P=k.length,j=e(k,P),L=0;L<P;++L)p(j[L],this,g);return!0};function a(x,m,g,L){var R,A,T;if(n(g),A=x._events,A===void 0?(A=x._events=Object.create(null),x._eventsCount=0):(A.newListener!==void 0&&(x.emit("newListener",m,g.listener?g.listener:g),A=x._events),T=A[m]),T===void 0)T=A[m]=g,++x._eventsCount;else if(typeof T=="function"?T=A[m]=L?[g,T]:[T,g]:L?T.unshift(g):T.push(g),R=l(x),R>0&&T.length>R&&!T.warned){T.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=x,B.type=m,B.count=T.length,h(B)}return x}o.prototype.addListener=function(m,g){return a(this,m,g,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(m,g){return a(this,m,g,!0)};function r(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function t(x,m,g){var L={fired:!1,wrapFn:void 0,target:x,type:m,listener:g},R=r.bind(L);return R.listener=g,L.wrapFn=R,R}o.prototype.once=function(m,g){return n(g),this.on(m,t(this,m,g)),this},o.prototype.prependOnceListener=function(m,g){return n(g),this.prependListener(m,t(this,m,g)),this},o.prototype.removeListener=function(m,g){var L,R,A,T,B;if(n(g),R=this._events,R===void 0)return this;if(L=R[m],L===void 0)return this;if(L===g||L.listener===g)--this._eventsCount===0?this._events=Object.create(null):(delete R[m],R.removeListener&&this.emit("removeListener",m,L.listener||g));else if(typeof L!="function"){for(A=-1,T=L.length-1;T>=0;T--)if(L[T]===g||L[T].listener===g){B=L[T].listener,A=T;break}if(A<0)return this;A===0?L.shift():u(L,A),L.length===1&&(R[m]=L[0]),R.removeListener!==void 0&&this.emit("removeListener",m,B||g)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(m){var g,L,R;if(L=this._events,L===void 0)return this;if(L.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):L[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete L[m]),this;if(arguments.length===0){var A=Object.keys(L),T;for(R=0;R<A.length;++R)T=A[R],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(g=L[m],typeof g=="function")this.removeListener(m,g);else if(g!==void 0)for(R=g.length-1;R>=0;R--)this.removeListener(m,g[R]);return this};function s(x,m,g){var L=x._events;if(L===void 0)return[];var R=L[m];return R===void 0?[]:typeof R=="function"?g?[R.listener||R]:[R]:g?_(R):e(R,R.length)}o.prototype.listeners=function(m){return s(this,m,!0)},o.prototype.rawListeners=function(m){return s(this,m,!1)},o.listenerCount=function(x,m){return typeof x.listenerCount=="function"?x.listenerCount(m):i.call(x,m)},o.prototype.listenerCount=i;function i(x){var m=this._events;if(m!==void 0){var g=m[x];if(typeof g=="function")return 1;if(g!==void 0)return g.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]};function e(x,m){for(var g=new Array(m),L=0;L<m;++L)g[L]=x[L];return g}function u(x,m){for(;m+1<x.length;m++)x[m]=x[m+1];x.pop()}function _(x){for(var m=new Array(x.length),g=0;g<m.length;++g)m[g]=x[g].listener||x[g];return m}function c(x,m){return new Promise(function(g,L){function R(T){x.removeListener(m,A),L(T)}function A(){typeof x.removeListener=="function"&&x.removeListener("error",R),g([].slice.call(arguments))}E(x,m,A,{once:!0}),m!=="error"&&v(x,R,{once:!0})})}function v(x,m,g){typeof x.on=="function"&&E(x,"error",m,g)}function E(x,m,g,L){if(typeof x.on=="function")L.once?x.once(m,g):x.on(m,g);else if(typeof x.addEventListener=="function")x.addEventListener(m,function R(A){L.once&&x.removeEventListener(m,R),g(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof x)}},"./node_modules/webworkify-webpack/index.js":function(I,S,p){function y(r){var t={};function s(e){if(t[e])return t[e].exports;var u=t[e]={i:e,l:!1,exports:{}};return r[e].call(u.exports,u,u.exports,s),u.l=!0,u.exports}s.m=r,s.c=t,s.i=function(e){return e},s.d=function(e,u,_){s.o(e,u)||Object.defineProperty(e,u,{configurable:!1,enumerable:!0,get:_})},s.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},s.n=function(e){var u=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(u,"a",u),u},s.o=function(e,u){return Object.prototype.hasOwnProperty.call(e,u)},s.p="/",s.oe=function(e){throw console.error(e),e};var i=s(s.s=ENTRY_MODULE);return i.default||i}var h="[\\.|\\-|\\+|\\w|/|@]+",f="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+h+").*?\\)";function o(r){return(r+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function d(r){return!isNaN(1*r)}function n(r,t,s){var i={};i[s]=[];var e=t.toString(),u=e.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return i;for(var _=u[1],c=new RegExp("(\\\\n|\\W)"+o(_)+f,"g"),v;v=c.exec(e);)v[3]!=="dll-reference"&&i[s].push(v[3]);for(c=new RegExp("\\("+o(_)+'\\("(dll-reference\\s('+h+'))"\\)\\)'+f,"g");v=c.exec(e);)r[v[2]]||(i[s].push(v[1]),r[v[2]]=p(v[1]).m),i[v[2]]=i[v[2]]||[],i[v[2]].push(v[4]);for(var E=Object.keys(i),x=0;x<E.length;x++)for(var m=0;m<i[E[x]].length;m++)d(i[E[x]][m])&&(i[E[x]][m]=1*i[E[x]][m]);return i}function l(r){var t=Object.keys(r);return t.reduce(function(s,i){return s||r[i].length>0},!1)}function a(r,t){for(var s={main:[t]},i={main:[]},e={main:{}};l(s);)for(var u=Object.keys(s),_=0;_<u.length;_++){var c=u[_],v=s[c],E=v.pop();if(e[c]=e[c]||{},!(e[c][E]||!r[c][E])){e[c][E]=!0,i[c]=i[c]||[],i[c].push(E);for(var x=n(r,r[c][E],c),m=Object.keys(x),g=0;g<m.length;g++)s[m[g]]=s[m[g]]||[],s[m[g]]=s[m[g]].concat(x[m[g]])}}return i}I.exports=function(r,t){t=t||{};var s={main:p.m},i=t.all?{main:Object.keys(s.main)}:a(s,r),e="";Object.keys(i).filter(function(E){return E!=="main"}).forEach(function(E){for(var x=0;i[E][x];)x++;i[E].push(x),s[E][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",e=e+"var "+E+" = ("+y.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+i[E].map(function(m){return""+JSON.stringify(m)+": "+s[E][m].toString()}).join(",")+`});
8
+ `}),e=e+"new (("+y.toString().replace("ENTRY_MODULE",JSON.stringify(r))+")({"+i.main.map(function(E){return""+JSON.stringify(E)+": "+s.main[E].toString()}).join(",")+"}))(self);";var u=new window.Blob([e],{type:"text/javascript"});if(t.bare)return u;var _=window.URL||window.webkitURL||window.mozURL||window.msURL,c=_.createObjectURL(u),v=new window.Worker(c);return v.objectURL=c,v}},"./src/config.js":function(I,S,p){p.r(S),p.d(S,{defaultConfig:function(){return y},createDefaultConfig:function(){return h}});var y={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,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 h(){return Object.assign({},y)}},"./src/core/features.js":function(I,S,p){p.r(S);var y=p("./src/io/io-controller.js"),h=p("./src/config.js"),f=function(){function o(){}return o.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},o.supportNetworkStreamIO=function(){var d=new y.default({},(0,h.createDefaultConfig)()),n=d.loaderType;return d.destroy(),n=="fetch-stream-loader"||n=="xhr-moz-chunked-loader"},o.getNetworkLoaderTypeName=function(){var d=new y.default({},(0,h.createDefaultConfig)()),n=d.loaderType;return d.destroy(),n},o.supportNativeMediaPlayback=function(d){o.videoElement==null&&(o.videoElement=window.document.createElement("video"));var n=o.videoElement.canPlayType(d);return n==="probably"||n=="maybe"},o.getFeatureList=function(){var d={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return d.mseFlvPlayback=o.supportMSEH264Playback(),d.networkStreamIO=o.supportNetworkStreamIO(),d.networkLoaderName=o.getNetworkLoaderTypeName(),d.mseLiveFlvPlayback=d.mseFlvPlayback&&d.networkStreamIO,d.nativeMP4H264Playback=o.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),d.nativeWebmVP8Playback=o.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),d.nativeWebmVP9Playback=o.supportNativeMediaPlayback('video/webm; codecs="vp9"'),d},o}();S.default=f},"./src/core/media-info.js":function(I,S,p){p.r(S);var y=function(){function h(){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 h.prototype.isComplete=function(){var f=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,o=this.hasVideo===!1||this.hasVideo===!0&&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!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&f&&o},h.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},h.prototype.getNearestKeyframe=function(f){if(this.keyframesIndex==null)return null;var o=this.keyframesIndex,d=this._search(o.times,f);return{index:d,milliseconds:o.times[d],fileposition:o.filepositions[d]}},h.prototype._search=function(f,o){var d=0,n=f.length-1,l=0,a=0,r=n;for(o<f[0]&&(d=0,a=r+1);a<=r;)if(l=a+Math.floor((r-a)/2),l===n||o>=f[l]&&o<f[l+1]){d=l;break}else f[l]<o?a=l+1:r=l-1;return d},h}();S.default=y},"./src/core/media-segment-info.js":function(I,S,p){p.r(S),p.d(S,{SampleInfo:function(){return y},MediaSegmentInfo:function(){return h},IDRSampleList:function(){return f},MediaSegmentInfoList:function(){return o}});var y=function(){function d(n,l,a,r,t){this.dts=n,this.pts=l,this.duration=a,this.originalDts=r,this.isSyncPoint=t,this.fileposition=null}return d}(),h=function(){function d(){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 d.prototype.appendSyncPoint=function(n){n.isSyncPoint=!0,this.syncPoints.push(n)},d}(),f=function(){function d(){this._list=[]}return d.prototype.clear=function(){this._list=[]},d.prototype.appendArray=function(n){var l=this._list;n.length!==0&&(l.length>0&&n[0].originalDts<l[l.length-1].originalDts&&this.clear(),Array.prototype.push.apply(l,n))},d.prototype.getLastSyncPointBeforeDts=function(n){if(this._list.length==0)return null;var l=this._list,a=0,r=l.length-1,t=0,s=0,i=r;for(n<l[0].dts&&(a=0,s=i+1);s<=i;)if(t=s+Math.floor((i-s)/2),t===r||n>=l[t].dts&&n<l[t+1].dts){a=t;break}else l[t].dts<n?s=t+1:i=t-1;return this._list[a]},d}(),o=function(){function d(n){this._type=n,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(d.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),d.prototype.isEmpty=function(){return this._list.length===0},d.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},d.prototype._searchNearestSegmentBefore=function(n){var l=this._list;if(l.length===0)return-2;var a=l.length-1,r=0,t=0,s=a,i=0;if(n<l[0].originalBeginDts)return i=-1,i;for(;t<=s;)if(r=t+Math.floor((s-t)/2),r===a||n>l[r].lastSample.originalDts&&n<l[r+1].originalBeginDts){i=r;break}else l[r].originalBeginDts<n?t=r+1:s=r-1;return i},d.prototype._searchNearestSegmentAfter=function(n){return this._searchNearestSegmentBefore(n)+1},d.prototype.append=function(n){var l=this._list,a=n,r=this._lastAppendLocation,t=0;r!==-1&&r<l.length&&a.originalBeginDts>=l[r].lastSample.originalDts&&(r===l.length-1||r<l.length-1&&a.originalBeginDts<l[r+1].originalBeginDts)?t=r+1:l.length>0&&(t=this._searchNearestSegmentBefore(a.originalBeginDts)+1),this._lastAppendLocation=t,this._list.splice(t,0,a)},d.prototype.getLastSegmentBefore=function(n){var l=this._searchNearestSegmentBefore(n);return l>=0?this._list[l]:null},d.prototype.getLastSampleBefore=function(n){var l=this.getLastSegmentBefore(n);return l!=null?l.lastSample:null},d.prototype.getLastSyncPointBefore=function(n){for(var l=this._searchNearestSegmentBefore(n),a=this._list[l].syncPoints;a.length===0&&l>0;)l--,a=this._list[l].syncPoints;return a.length>0?a[a.length-1]:null},d}()},"./src/core/mse-controller.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=p("./src/utils/logger.js"),o=p("./src/utils/browser.js"),d=p("./src/core/mse-events.js"),n=p("./src/core/media-segment-info.js"),l=p("./src/utils/exception.js"),a=function(){function r(t){this.TAG="MSEController",this._config=t,this._emitter=new(h()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(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 n.IDRSampleList}return r.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},r.prototype.on=function(t,s){this._emitter.addListener(t,s)},r.prototype.off=function(t,s){this._emitter.removeListener(t,s)},r.prototype.attachMediaElement=function(t){if(this._mediaSource)throw new l.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var s=this._mediaSource=new window.MediaSource;s.addEventListener("sourceopen",this.e.onSourceOpen),s.addEventListener("sourceended",this.e.onSourceEnded),s.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=t,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),t.src=this._mediaSourceObjectURL},r.prototype.detachMediaElement=function(){if(this._mediaSource){var t=this._mediaSource;for(var s in this._sourceBuffers){var i=this._pendingSegments[s];i.splice(0,i.length),this._pendingSegments[s]=null,this._pendingRemoveRanges[s]=null,this._lastInitSegments[s]=null;var e=this._sourceBuffers[s];if(e){if(t.readyState!=="closed"){try{t.removeSourceBuffer(e)}catch(u){f.default.e(this.TAG,u.message)}e.removeEventListener("error",this.e.onSourceBufferError),e.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[s]=null,this._sourceBuffers[s]=null}}if(t.readyState==="open")try{t.endOfStream()}catch(u){f.default.e(this.TAG,u.message)}t.removeEventListener("sourceopen",this.e.onSourceOpen),t.removeEventListener("sourceended",this.e.onSourceEnded),t.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)},r.prototype.appendInitSegment=function(t,s){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(t),this._pendingSegments[t.type].push(t);return}var i=t,e=""+i.container;i.codec&&i.codec.length>0&&(e+=";codecs="+i.codec);var u=!1;if(f.default.v(this.TAG,"Received Initialization Segment, mimeType: "+e),this._lastInitSegments[i.type]=i,e!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])f.default.v(this.TAG,"Notice: "+i.type+" mimeType changed, origin: "+this._mimeTypes[i.type]+", target: "+e);else{u=!0;try{var _=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(e);_.addEventListener("error",this.e.onSourceBufferError),_.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(c){f.default.e(this.TAG,c.message),this._emitter.emit(d.default.ERROR,{code:c.code,msg:c.message});return}}this._mimeTypes[i.type]=e}s||this._pendingSegments[i.type].push(i),u||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),o.default.safari&&i.container==="audio/mpeg"&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},r.prototype.appendMediaSegment=function(t){var s=t;this._pendingSegments[s.type].push(s),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[s.type];i&&!i.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()},r.prototype.seek=function(t){for(var s in this._sourceBuffers)if(!!this._sourceBuffers[s]){var i=this._sourceBuffers[s];if(this._mediaSource.readyState==="open")try{i.abort()}catch(E){f.default.e(this.TAG,E.message)}this._idrList.clear();var e=this._pendingSegments[s];if(e.splice(0,e.length),this._mediaSource.readyState!=="closed"){for(var u=0;u<i.buffered.length;u++){var _=i.buffered.start(u),c=i.buffered.end(u);this._pendingRemoveRanges[s].push({start:_,end:c})}if(i.updating||this._doRemoveRanges(),o.default.safari){var v=this._lastInitSegments[s];v&&(this._pendingSegments[s].push(v),i.updating||this._doAppendSegments())}}}},r.prototype.endOfStream=function(){var t=this._mediaSource,s=this._sourceBuffers;if(!t||t.readyState!=="open"){t&&t.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}s.video&&s.video.updating||s.audio&&s.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,t.endOfStream())},r.prototype.getNearestKeyframe=function(t){return this._idrList.getLastSyncPointBeforeDts(t)},r.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var t=this._mediaElement.currentTime;for(var s in this._sourceBuffers){var i=this._sourceBuffers[s];if(i){var e=i.buffered;if(e.length>=1&&t-e.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},r.prototype._doCleanupSourceBuffer=function(){var t=this._mediaElement.currentTime;for(var s in this._sourceBuffers){var i=this._sourceBuffers[s];if(i){for(var e=i.buffered,u=!1,_=0;_<e.length;_++){var c=e.start(_),v=e.end(_);if(c<=t&&t<v+3){if(t-c>=this._config.autoCleanupMaxBackwardDuration){u=!0;var E=t-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[s].push({start:c,end:E})}}else v<t&&(u=!0,this._pendingRemoveRanges[s].push({start:c,end:v}))}u&&!i.updating&&this._doRemoveRanges()}}},r.prototype._updateMediaSourceDuration=function(){var t=this._sourceBuffers;if(!(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")&&!(t.video&&t.video.updating||t.audio&&t.audio.updating)){var s=this._mediaSource.duration,i=this._pendingMediaDuration;i>0&&(isNaN(s)||i>s)&&(f.default.v(this.TAG,"Update MediaSource duration from "+s+" to "+i),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},r.prototype._doRemoveRanges=function(){for(var t in this._pendingRemoveRanges)if(!(!this._sourceBuffers[t]||this._sourceBuffers[t].updating))for(var s=this._sourceBuffers[t],i=this._pendingRemoveRanges[t];i.length&&!s.updating;){var e=i.shift();s.remove(e.start,e.end)}},r.prototype._doAppendSegments=function(){var t=this._pendingSegments;for(var s in t)if(!(!this._sourceBuffers[s]||this._sourceBuffers[s].updating)&&t[s].length>0){var i=t[s].shift();if(i.timestampOffset){var e=this._sourceBuffers[s].timestampOffset,u=i.timestampOffset/1e3,_=Math.abs(e-u);_>.1&&(f.default.v(this.TAG,"Update MPEG audio timestampOffset from "+e+" to "+u),this._sourceBuffers[s].timestampOffset=u),delete i.timestampOffset}if(!i.data||i.data.byteLength===0)continue;try{this._sourceBuffers[s].appendBuffer(i.data),this._isBufferFull=!1,s==="video"&&i.hasOwnProperty("info")&&this._idrList.appendArray(i.info.syncPoints)}catch(c){this._pendingSegments[s].unshift(i),c.code===22?(this._isBufferFull||this._emitter.emit(d.default.BUFFER_FULL),this._isBufferFull=!0):(f.default.e(this.TAG,c.message),this._emitter.emit(d.default.ERROR,{code:c.code,msg:c.message}))}}},r.prototype._onSourceOpen=function(){if(f.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var s=t.shift();this.appendInitSegment(s,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(d.default.SOURCE_OPEN)},r.prototype._onSourceEnded=function(){f.default.v(this.TAG,"MediaSource onSourceEnded")},r.prototype._onSourceClose=function(){f.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},r.prototype._hasPendingSegments=function(){var t=this._pendingSegments;return t.video.length>0||t.audio.length>0},r.prototype._hasPendingRemoveRanges=function(){var t=this._pendingRemoveRanges;return t.video.length>0||t.audio.length>0},r.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(d.default.UPDATE_END)},r.prototype._onSourceBufferError=function(t){f.default.e(this.TAG,"SourceBuffer Error: "+t)},r}();S.default=a},"./src/core/mse-events.js":function(I,S,p){p.r(S);var y={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};S.default=y},"./src/core/transmuxer.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=p("./node_modules/webworkify-webpack/index.js"),o=p.n(f),d=p("./src/utils/logger.js"),n=p("./src/utils/logging-control.js"),l=p("./src/core/transmuxing-controller.js"),a=p("./src/core/transmuxing-events.js"),r=p("./src/core/media-info.js"),t=function(){function s(i,e){if(this.TAG="Transmuxer",this._emitter=new(h()),e.enableWorker&&typeof Worker<"u")try{this._worker=o()("./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[i,e]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},n.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:n.default.getConfig()})}catch{d.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new l.default(i,e)}else this._controller=new l.default(i,e);if(this._controller){var u=this._controller;u.on(a.default.IO_ERROR,this._onIOError.bind(this)),u.on(a.default.DEMUX_ERROR,this._onDemuxError.bind(this)),u.on(a.default.INIT_SEGMENT,this._onInitSegment.bind(this)),u.on(a.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),u.on(a.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),u.on(a.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),u.on(a.default.MEDIA_INFO,this._onMediaInfo.bind(this)),u.on(a.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),u.on(a.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),u.on(a.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),u.on(a.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return s.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),n.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},s.prototype.on=function(i,e){this._emitter.addListener(i,e)},s.prototype.off=function(i,e){this._emitter.removeListener(i,e)},s.prototype.hasWorker=function(){return this._worker!=null},s.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},s.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},s.prototype.seek=function(i){this._worker?this._worker.postMessage({cmd:"seek",param:i}):this._controller.seek(i)},s.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},s.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},s.prototype._onInitSegment=function(i,e){var u=this;Promise.resolve().then(function(){u._emitter.emit(a.default.INIT_SEGMENT,i,e)})},s.prototype._onMediaSegment=function(i,e){var u=this;Promise.resolve().then(function(){u._emitter.emit(a.default.MEDIA_SEGMENT,i,e)})},s.prototype._onLoadingComplete=function(){var i=this;Promise.resolve().then(function(){i._emitter.emit(a.default.LOADING_COMPLETE)})},s.prototype._onRecoveredEarlyEof=function(){var i=this;Promise.resolve().then(function(){i._emitter.emit(a.default.RECOVERED_EARLY_EOF)})},s.prototype._onMediaInfo=function(i){var e=this;Promise.resolve().then(function(){e._emitter.emit(a.default.MEDIA_INFO,i)})},s.prototype._onMetaDataArrived=function(i){var e=this;Promise.resolve().then(function(){e._emitter.emit(a.default.METADATA_ARRIVED,i)})},s.prototype._onScriptDataArrived=function(i){var e=this;Promise.resolve().then(function(){e._emitter.emit(a.default.SCRIPTDATA_ARRIVED,i)})},s.prototype._onStatisticsInfo=function(i){var e=this;Promise.resolve().then(function(){e._emitter.emit(a.default.STATISTICS_INFO,i)})},s.prototype._onIOError=function(i,e){var u=this;Promise.resolve().then(function(){u._emitter.emit(a.default.IO_ERROR,i,e)})},s.prototype._onDemuxError=function(i,e){var u=this;Promise.resolve().then(function(){u._emitter.emit(a.default.DEMUX_ERROR,i,e)})},s.prototype._onRecommendSeekpoint=function(i){var e=this;Promise.resolve().then(function(){e._emitter.emit(a.default.RECOMMEND_SEEKPOINT,i)})},s.prototype._onLoggingConfigChanged=function(i){this._worker&&this._worker.postMessage({cmd:"logging_config",param:i})},s.prototype._onWorkerMessage=function(i){var e=i.data,u=e.data;if(e.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(e.msg){case a.default.INIT_SEGMENT:case a.default.MEDIA_SEGMENT:this._emitter.emit(e.msg,u.type,u.data);break;case a.default.LOADING_COMPLETE:case a.default.RECOVERED_EARLY_EOF:this._emitter.emit(e.msg);break;case a.default.MEDIA_INFO:Object.setPrototypeOf(u,r.default.prototype),this._emitter.emit(e.msg,u);break;case a.default.METADATA_ARRIVED:case a.default.SCRIPTDATA_ARRIVED:case a.default.STATISTICS_INFO:this._emitter.emit(e.msg,u);break;case a.default.IO_ERROR:case a.default.DEMUX_ERROR:this._emitter.emit(e.msg,u.type,u.info);break;case a.default.RECOMMEND_SEEKPOINT:this._emitter.emit(e.msg,u);break;case"logcat_callback":d.default.emitter.emit("log",u.type,u.logcat);break}},s}();S.default=t},"./src/core/transmuxing-controller.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=p("./src/utils/logger.js"),o=p("./src/utils/browser.js"),d=p("./src/core/media-info.js"),n=p("./src/demux/flv-demuxer.js"),l=p("./src/remux/mp4-remuxer.js"),a=p("./src/demux/demux-errors.js"),r=p("./src/io/io-controller.js"),t=p("./src/core/transmuxing-events.js"),s=function(){function i(e,u){this.TAG="TransmuxingController",this._emitter=new(h()),this._config=u,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),typeof e.cors!="boolean"&&(e.cors=!0),typeof e.withCredentials!="boolean"&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var _=0;this._mediaDataSource.segments.forEach(function(c){c.timestampBase=_,_+=c.duration,c.cors=e.cors,c.withCredentials=e.withCredentials,u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy)}),!isNaN(_)&&this._mediaDataSource.duration!==_&&(this._mediaDataSource.duration=_),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return i.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},i.prototype.on=function(e,u){this._emitter.addListener(e,u)},i.prototype.off=function(e,u){this._emitter.removeListener(e,u)},i.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},i.prototype._loadSegment=function(e,u){this._currentSegmentIndex=e;var _=this._mediaDataSource.segments[e],c=this._ioctl=new r.default(_,this._config,e);c.onError=this._onIOException.bind(this),c.onSeeked=this._onIOSeeked.bind(this),c.onComplete=this._onIOComplete.bind(this),c.onRedirect=this._onIORedirect.bind(this),c.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),u?this._demuxer.bindDataSource(this._ioctl):c.onDataArrival=this._onInitChunkArrival.bind(this),c.open(u)},i.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},i.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},i.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},i.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},i.prototype.seek=function(e){if(!(this._mediaInfo==null||!this._mediaInfo.isSeekable())){var u=this._searchSegmentIndexContains(e);if(u===this._currentSegmentIndex){var _=this._mediaInfo.segments[u];if(_==null)this._pendingSeekTime=e;else{var c=_.getNearestKeyframe(e);this._remuxer.seek(c.milliseconds),this._ioctl.seek(c.fileposition),this._pendingResolveSeekPoint=c.milliseconds}}else{var v=this._mediaInfo.segments[u];if(v==null)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(u);else{var c=v.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[u].timestampBase,this._loadSegment(u,c.fileposition),this._pendingResolveSeekPoint=c.milliseconds,this._reportSegmentMediaInfo(u)}}this._enableStatisticsReporter()}},i.prototype._searchSegmentIndexContains=function(e){for(var u=this._mediaDataSource.segments,_=u.length-1,c=0;c<u.length;c++)if(e<u[c].timestampBase){_=c-1;break}return _},i.prototype._onInitChunkArrival=function(e,u){var _=this,c=null,v=0;if(u>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,v=this._demuxer.parseChunks(e,u);else if((c=n.default.probe(e)).match){this._demuxer=new n.default(c,this._config),this._remuxer||(this._remuxer=new l.default(this._config));var E=this._mediaDataSource;E.duration!=null&&!isNaN(E.duration)&&(this._demuxer.overridedDuration=E.duration),typeof E.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=E.hasAudio),typeof E.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=E.hasVideo),this._demuxer.timestampBase=E.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),v=this._demuxer.parseChunks(e,u)}else c=null,f.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){_._internalAbort()}),this._emitter.emit(t.default.DEMUX_ERROR,a.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),v=0;return v},i.prototype._onMediaInfo=function(e){var u=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,d.default.prototype));var _=Object.assign({},e);Object.setPrototypeOf(_,d.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=_,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var c=u._pendingSeekTime;u._pendingSeekTime=null,u.seek(c)})},i.prototype._onMetaDataArrived=function(e){this._emitter.emit(t.default.METADATA_ARRIVED,e)},i.prototype._onScriptDataArrived=function(e){this._emitter.emit(t.default.SCRIPTDATA_ARRIVED,e)},i.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},i.prototype._onIOComplete=function(e){var u=e,_=u+1;_<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(_)):(this._remuxer.flushStashedSamples(),this._emitter.emit(t.default.LOADING_COMPLETE),this._disableStatisticsReporter())},i.prototype._onIORedirect=function(e){var u=this._ioctl.extraData;this._mediaDataSource.segments[u].redirectedURL=e},i.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(t.default.RECOVERED_EARLY_EOF)},i.prototype._onIOException=function(e,u){f.default.e(this.TAG,"IOException: type = "+e+", code = "+u.code+", msg = "+u.msg),this._emitter.emit(t.default.IO_ERROR,e,u),this._disableStatisticsReporter()},i.prototype._onDemuxException=function(e,u){f.default.e(this.TAG,"DemuxException: type = "+e+", info = "+u),this._emitter.emit(t.default.DEMUX_ERROR,e,u)},i.prototype._onRemuxerInitSegmentArrival=function(e,u){this._emitter.emit(t.default.INIT_SEGMENT,e,u)},i.prototype._onRemuxerMediaSegmentArrival=function(e,u){if(this._pendingSeekTime==null&&(this._emitter.emit(t.default.MEDIA_SEGMENT,e,u),this._pendingResolveSeekPoint!=null&&e==="video")){var _=u.info.syncPoints,c=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.default.safari&&_.length>0&&_[0].originalDts===c&&(c=_[0].pts),this._emitter.emit(t.default.RECOMMEND_SEEKPOINT,c)}},i.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},i.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},i.prototype._reportSegmentMediaInfo=function(e){var u=this._mediaInfo.segments[e],_=Object.assign({},u);_.duration=this._mediaInfo.duration,_.segmentCount=this._mediaInfo.segmentCount,delete _.segments,delete _.keyframesIndex,this._emitter.emit(t.default.MEDIA_INFO,_)},i.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(t.default.STATISTICS_INFO,e)},i}();S.default=s},"./src/core/transmuxing-events.js":function(I,S,p){p.r(S);var y={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"};S.default=y},"./src/core/transmuxing-worker.js":function(I,S,p){p.r(S);var y=p("./src/utils/logging-control.js"),h=p("./src/utils/polyfill.js"),f=p("./src/core/transmuxing-controller.js"),o=p("./src/core/transmuxing-events.js"),d=function(n){var l=null,a=m.bind(this);h.default.install(),n.addEventListener("message",function(g){switch(g.data.cmd){case"init":l=new f.default(g.data.param[0],g.data.param[1]),l.on(o.default.IO_ERROR,v.bind(this)),l.on(o.default.DEMUX_ERROR,E.bind(this)),l.on(o.default.INIT_SEGMENT,r.bind(this)),l.on(o.default.MEDIA_SEGMENT,t.bind(this)),l.on(o.default.LOADING_COMPLETE,s.bind(this)),l.on(o.default.RECOVERED_EARLY_EOF,i.bind(this)),l.on(o.default.MEDIA_INFO,e.bind(this)),l.on(o.default.METADATA_ARRIVED,u.bind(this)),l.on(o.default.SCRIPTDATA_ARRIVED,_.bind(this)),l.on(o.default.STATISTICS_INFO,c.bind(this)),l.on(o.default.RECOMMEND_SEEKPOINT,x.bind(this));break;case"destroy":l&&(l.destroy(),l=null),n.postMessage({msg:"destroyed"});break;case"start":l.start();break;case"stop":l.stop();break;case"seek":l.seek(g.data.param);break;case"pause":l.pause();break;case"resume":l.resume();break;case"logging_config":{var L=g.data.param;y.default.applyConfig(L),L.enableCallback===!0?y.default.addLogListener(a):y.default.removeLogListener(a);break}}});function r(g,L){var R={msg:o.default.INIT_SEGMENT,data:{type:g,data:L}};n.postMessage(R,[L.data])}function t(g,L){var R={msg:o.default.MEDIA_SEGMENT,data:{type:g,data:L}};n.postMessage(R,[L.data])}function s(){var g={msg:o.default.LOADING_COMPLETE};n.postMessage(g)}function i(){var g={msg:o.default.RECOVERED_EARLY_EOF};n.postMessage(g)}function e(g){var L={msg:o.default.MEDIA_INFO,data:g};n.postMessage(L)}function u(g){var L={msg:o.default.METADATA_ARRIVED,data:g};n.postMessage(L)}function _(g){var L={msg:o.default.SCRIPTDATA_ARRIVED,data:g};n.postMessage(L)}function c(g){var L={msg:o.default.STATISTICS_INFO,data:g};n.postMessage(L)}function v(g,L){n.postMessage({msg:o.default.IO_ERROR,data:{type:g,info:L}})}function E(g,L){n.postMessage({msg:o.default.DEMUX_ERROR,data:{type:g,info:L}})}function x(g){n.postMessage({msg:o.default.RECOMMEND_SEEKPOINT,data:g})}function m(g,L){n.postMessage({msg:"logcat_callback",data:{type:g,logcat:L}})}};S.default=d},"./src/demux/amf-parser.js":function(I,S,p){p.r(S);var y=p("./src/utils/logger.js"),h=p("./src/utils/utf8-conv.js"),f=p("./src/utils/exception.js"),o=function(){var n=new ArrayBuffer(2);return new DataView(n).setInt16(0,256,!0),new Int16Array(n)[0]===256}(),d=function(){function n(){}return n.parseScriptData=function(l,a,r){var t={};try{var s=n.parseValue(l,a,r),i=n.parseValue(l,a+s.size,r-s.size);t[s.data]=i.data}catch(e){y.default.e("AMF",e.toString())}return t},n.parseObject=function(l,a,r){if(r<3)throw new f.IllegalStateException("Data not enough when parse ScriptDataObject");var t=n.parseString(l,a,r),s=n.parseValue(l,a+t.size,r-t.size),i=s.objectEnd;return{data:{name:t.data,value:s.data},size:t.size+s.size,objectEnd:i}},n.parseVariable=function(l,a,r){return n.parseObject(l,a,r)},n.parseString=function(l,a,r){if(r<2)throw new f.IllegalStateException("Data not enough when parse String");var t=new DataView(l,a,r),s=t.getUint16(0,!o),i;return s>0?i=(0,h.default)(new Uint8Array(l,a+2,s)):i="",{data:i,size:2+s}},n.parseLongString=function(l,a,r){if(r<4)throw new f.IllegalStateException("Data not enough when parse LongString");var t=new DataView(l,a,r),s=t.getUint32(0,!o),i;return s>0?i=(0,h.default)(new Uint8Array(l,a+4,s)):i="",{data:i,size:4+s}},n.parseDate=function(l,a,r){if(r<10)throw new f.IllegalStateException("Data size invalid when parse Date");var t=new DataView(l,a,r),s=t.getFloat64(0,!o),i=t.getInt16(8,!o);return s+=i*60*1e3,{data:new Date(s),size:8+2}},n.parseValue=function(l,a,r){if(r<1)throw new f.IllegalStateException("Data not enough when parse Value");var t=new DataView(l,a,r),s=1,i=t.getUint8(0),e,u=!1;try{switch(i){case 0:e=t.getFloat64(1,!o),s+=8;break;case 1:{var _=t.getUint8(1);e=!!_,s+=1;break}case 2:{var c=n.parseString(l,a+1,r-1);e=c.data,s+=c.size;break}case 3:{e={};var v=0;for((t.getUint32(r-4,!o)&16777215)===9&&(v=3);s<r-4;){var E=n.parseObject(l,a+s,r-s-v);if(E.objectEnd)break;e[E.data.name]=E.data.value,s+=E.size}if(s<=r-3){var x=t.getUint32(s-1,!o)&16777215;x===9&&(s+=3)}break}case 8:{e={},s+=4;var v=0;for((t.getUint32(r-4,!o)&16777215)===9&&(v=3);s<r-8;){var m=n.parseVariable(l,a+s,r-s-v);if(m.objectEnd)break;e[m.data.name]=m.data.value,s+=m.size}if(s<=r-3){var x=t.getUint32(s-1,!o)&16777215;x===9&&(s+=3)}break}case 9:e=void 0,s=1,u=!0;break;case 10:{e=[];var g=t.getUint32(1,!o);s+=4;for(var L=0;L<g;L++){var R=n.parseValue(l,a+s,r-s);e.push(R.data),s+=R.size}break}case 11:{var A=n.parseDate(l,a+1,r-1);e=A.data,s+=A.size;break}case 12:{var T=n.parseString(l,a+1,r-1);e=T.data,s+=T.size;break}default:s=r,y.default.w("AMF","Unsupported AMF value type "+i)}}catch(B){y.default.e("AMF",B.toString())}return{data:e,size:s,objectEnd:u}},n}();S.default=d},"./src/demux/demux-errors.js":function(I,S,p){p.r(S);var y={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};S.default=y},"./src/demux/exp-golomb.js":function(I,S,p){p.r(S);var y=p("./src/utils/exception.js"),h=function(){function f(o){this.TAG="ExpGolomb",this._buffer=o,this._buffer_index=0,this._total_bytes=o.byteLength,this._total_bits=o.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return f.prototype.destroy=function(){this._buffer=null},f.prototype._fillCurrentWord=function(){var o=this._total_bytes-this._buffer_index;if(o<=0)throw new y.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");var d=Math.min(4,o),n=new Uint8Array(4);n.set(this._buffer.subarray(this._buffer_index,this._buffer_index+d)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=d,this._current_word_bits_left=d*8},f.prototype.readBits=function(o){if(o>32)throw new y.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(o<=this._current_word_bits_left){var d=this._current_word>>>32-o;return this._current_word<<=o,this._current_word_bits_left-=o,d}var n=this._current_word_bits_left?this._current_word:0;n=n>>>32-this._current_word_bits_left;var l=o-this._current_word_bits_left;this._fillCurrentWord();var a=Math.min(l,this._current_word_bits_left),r=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,n=n<<a|r,n},f.prototype.readBool=function(){return this.readBits(1)===1},f.prototype.readByte=function(){return this.readBits(8)},f.prototype._skipLeadingZero=function(){var o;for(o=0;o<this._current_word_bits_left;o++)if((this._current_word&2147483648>>>o)!==0)return this._current_word<<=o,this._current_word_bits_left-=o,o;return this._fillCurrentWord(),o+this._skipLeadingZero()},f.prototype.readUEG=function(){var o=this._skipLeadingZero();return this.readBits(o+1)-1},f.prototype.readSEG=function(){var o=this.readUEG();return o&1?o+1>>>1:-1*(o>>>1)},f}();S.default=h},"./src/demux/flv-demuxer.js":function(I,S,p){p.r(S);var y=p("./src/utils/logger.js"),h=p("./src/demux/amf-parser.js"),f=p("./src/demux/sps-parser.js"),o=p("./src/demux/demux-errors.js"),d=p("./src/core/media-info.js"),n=p("./src/utils/exception.js");function l(r,t){return r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]}var a=function(){function r(t,s){this.TAG="FLVDemuxer",this._config=s,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new d.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=function(){var i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256}()}return r.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},r.probe=function(t){var s=new Uint8Array(t),i={match:!1};if(s[0]!==70||s[1]!==76||s[2]!==86||s[3]!==1)return i;var e=(s[4]&4)>>>2!==0,u=(s[4]&1)!==0,_=l(s,5);return _<9?i:{match:!0,consumed:_,dataOffset:_,hasAudioTrack:e,hasVideoTrack:u}},r.prototype.bindDataSource=function(t){return t.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(r.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(t){this._onTrackMetadata=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(t){this._onMediaInfo=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(t){this._onMetaDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(t){this._onScriptDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onError",{get:function(){return this._onError},set:function(t){this._onError=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(t){this._onDataAvailable=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(t){this._timestampBase=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"overridedDuration",{get:function(){return this._duration},set:function(t){this._durationOverrided=!0,this._duration=t,this._mediaInfo.duration=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"overridedHasAudio",{set:function(t){this._hasAudioFlagOverrided=!0,this._hasAudio=t,this._mediaInfo.hasAudio=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"overridedHasVideo",{set:function(t){this._hasVideoFlagOverrided=!0,this._hasVideo=t,this._mediaInfo.hasVideo=t},enumerable:!1,configurable:!0}),r.prototype.resetMediaInfo=function(){this._mediaInfo=new d.default},r.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1},r.prototype.parseChunks=function(t,s){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new n.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0,e=this._littleEndian;if(s===0)if(t.byteLength>13){var u=r.probe(t);i=u.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,s+i!==this._dataOffset&&y.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var _=new DataView(t,i),c=_.getUint32(0,!e);c!==0&&y.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4}for(;i<t.byteLength;){this._dispatch=!0;var _=new DataView(t,i);if(i+11+4>t.byteLength)break;var v=_.getUint8(0),E=_.getUint32(0,!e)&16777215;if(i+11+E+4>t.byteLength)break;if(v!==8&&v!==9&&v!==18){y.default.w(this.TAG,"Unsupported tag type "+v+", skipped"),i+=11+E+4;continue}var x=_.getUint8(4),m=_.getUint8(5),g=_.getUint8(6),L=_.getUint8(7),R=g|m<<8|x<<16|L<<24,A=_.getUint32(7,!e)&16777215;A!==0&&y.default.w(this.TAG,"Meet tag which has StreamID != 0!");var T=i+11;switch(v){case 8:this._parseAudioData(t,T,E,R);break;case 9:this._parseVideoData(t,T,E,R,s+i);break;case 18:this._parseScriptData(t,T,E);break}var B=_.getUint32(11+E,!e);B!==11+E&&y.default.w(this.TAG,"Invalid PrevTagSize "+B),i+=11+E+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i},r.prototype._parseScriptData=function(t,s,i){var e=h.default.parseScriptData(t,s,i);if(e.hasOwnProperty("onMetaData")){if(e.onMetaData==null||typeof e.onMetaData!="object"){y.default.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&y.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=e;var u=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},u)),typeof u.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=u.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof u.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=u.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof u.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=u.audiodatarate),typeof u.videodatarate=="number"&&(this._mediaInfo.videoDataRate=u.videodatarate),typeof u.width=="number"&&(this._mediaInfo.width=u.width),typeof u.height=="number"&&(this._mediaInfo.height=u.height),typeof u.duration=="number"){if(!this._durationOverrided){var _=Math.floor(u.duration*this._timescale);this._duration=_,this._mediaInfo.duration=_}}else this._mediaInfo.duration=0;if(typeof u.framerate=="number"){var c=Math.floor(u.framerate*1e3);if(c>0){var v=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=v,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=v}}if(typeof u.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var E=u.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(E),u.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=u,y.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(e).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},e))},r.prototype._parseKeyframesIndex=function(t){for(var s=[],i=[],e=1;e<t.times.length;e++){var u=this._timestampBase+Math.floor(t.times[e]*1e3);s.push(u),i.push(t.filepositions[e])}return{times:s,filepositions:i}},r.prototype._parseAudioData=function(t,s,i,e){if(i<=1){y.default.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(!(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)){this._littleEndian;var u=new DataView(t,s,i),_=u.getUint8(0),c=_>>>4;if(c!==2&&c!==10){this._onError(o.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+c);return}var v=0,E=(_&12)>>>2;if(E>=0&&E<=4)v=this._flvSoundRateTable[E];else{this._onError(o.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+E);return}var x=_&1,m=this._audioMetadata,g=this._audioTrack;if(m||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),m=this._audioMetadata={},m.type="audio",m.id=g.id,m.timescale=this._timescale,m.duration=this._duration,m.audioSampleRate=v,m.channelCount=x===0?1:2),c===10){var L=this._parseAACAudioData(t,s+1,i-1);if(L==null)return;if(L.packetType===0){m.config&&y.default.w(this.TAG,"Found another AudioSpecificConfig!");var R=L.data;m.audioSampleRate=R.samplingRate,m.channelCount=R.channelCount,m.codec=R.codec,m.originalCodec=R.originalCodec,m.config=R.config,m.refSampleDuration=1024/m.audioSampleRate*m.timescale,y.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",m);var A=this._mediaInfo;A.audioCodec=m.originalCodec,A.audioSampleRate=m.audioSampleRate,A.audioChannelCount=m.channelCount,A.hasVideo?A.videoCodec!=null&&(A.mimeType='video/x-flv; codecs="'+A.videoCodec+","+A.audioCodec+'"'):A.mimeType='video/x-flv; codecs="'+A.audioCodec+'"',A.isComplete()&&this._onMediaInfo(A)}else if(L.packetType===1){var T=this._timestampBase+e,B={unit:L.data,length:L.data.byteLength,dts:T,pts:T};g.samples.push(B),g.length+=L.data.length}else y.default.e(this.TAG,"Flv: Unsupported AAC data type "+L.packetType)}else if(c===2){if(!m.codec){var R=this._parseMP3AudioData(t,s+1,i-1,!0);if(R==null)return;m.audioSampleRate=R.samplingRate,m.channelCount=R.channelCount,m.codec=R.codec,m.originalCodec=R.originalCodec,m.refSampleDuration=1152/m.audioSampleRate*m.timescale,y.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",m);var A=this._mediaInfo;A.audioCodec=m.codec,A.audioSampleRate=m.audioSampleRate,A.audioChannelCount=m.channelCount,A.audioDataRate=R.bitRate,A.hasVideo?A.videoCodec!=null&&(A.mimeType='video/x-flv; codecs="'+A.videoCodec+","+A.audioCodec+'"'):A.mimeType='video/x-flv; codecs="'+A.audioCodec+'"',A.isComplete()&&this._onMediaInfo(A)}var k=this._parseMP3AudioData(t,s+1,i-1,!1);if(k==null)return;var T=this._timestampBase+e,P={unit:k,length:k.byteLength,dts:T,pts:T};g.samples.push(P),g.length+=k.length}}},r.prototype._parseAACAudioData=function(t,s,i){if(i<=1){y.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var e={},u=new Uint8Array(t,s,i);return e.packetType=u[0],u[0]===0?e.data=this._parseAACAudioSpecificConfig(t,s+1,i-1):e.data=u.subarray(1),e},r.prototype._parseAACAudioSpecificConfig=function(t,s,i){var e=new Uint8Array(t,s,i),u=null,_=0,c=0,v=0,E=null;if(_=c=e[0]>>>3,v=(e[0]&7)<<1|e[1]>>>7,v<0||v>=this._mpegSamplingRates.length){this._onError(o.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var x=this._mpegSamplingRates[v],m=(e[1]&120)>>>3;if(m<0||m>=8){this._onError(o.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}_===5&&(E=(e[1]&7)<<1|e[2]>>>7,(e[2]&124)>>>2);var g=self.navigator.userAgent.toLowerCase();return g.indexOf("firefox")!==-1?v>=6?(_=5,u=new Array(4),E=v-3):(_=2,u=new Array(2),E=v):g.indexOf("android")!==-1?(_=2,u=new Array(2),E=v):(_=5,E=v,u=new Array(4),v>=6?E=v-3:m===1&&(_=2,u=new Array(2),E=v)),u[0]=_<<3,u[0]|=(v&15)>>>1,u[1]=(v&15)<<7,u[1]|=(m&15)<<3,_===5&&(u[1]|=(E&15)>>>1,u[2]=(E&1)<<7,u[2]|=2<<2,u[3]=0),{config:u,samplingRate:x,channelCount:m,codec:"mp4a.40."+_,originalCodec:"mp4a.40."+c}},r.prototype._parseMP3AudioData=function(t,s,i,e){if(i<4){y.default.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}this._littleEndian;var u=new Uint8Array(t,s,i),_=null;if(e){if(u[0]!==255)return;var c=u[1]>>>3&3,v=(u[1]&6)>>1,E=(u[2]&240)>>>4,x=(u[2]&12)>>>2,m=u[3]>>>6&3,g=m!==3?2:1,L=0,R=0,A="mp3";switch(c){case 0:L=this._mpegAudioV25SampleRateTable[x];break;case 2:L=this._mpegAudioV20SampleRateTable[x];break;case 3:L=this._mpegAudioV10SampleRateTable[x];break}switch(v){case 1:E<this._mpegAudioL3BitRateTable.length&&(R=this._mpegAudioL3BitRateTable[E]);break;case 2:E<this._mpegAudioL2BitRateTable.length&&(R=this._mpegAudioL2BitRateTable[E]);break;case 3:E<this._mpegAudioL1BitRateTable.length&&(R=this._mpegAudioL1BitRateTable[E]);break}_={bitRate:R,samplingRate:L,channelCount:g,codec:A,originalCodec:A}}else _=u;return _},r.prototype._parseVideoData=function(t,s,i,e,u){if(i<=1){y.default.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(!(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)){var _=new Uint8Array(t,s,i)[0],c=(_&240)>>>4,v=_&15;if(v!==7){this._onError(o.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+v);return}this._parseAVCVideoPacket(t,s+1,i-1,e,u,c)}},r.prototype._parseAVCVideoPacket=function(t,s,i,e,u,_){if(i<4){y.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var c=this._littleEndian,v=new DataView(t,s,i),E=v.getUint8(0),x=v.getUint32(0,!c)&16777215,m=x<<8>>8;if(E===0)this._parseAVCDecoderConfigurationRecord(t,s+4,i-4);else if(E===1)this._parseAVCVideoData(t,s+4,i-4,e,u,_,m);else if(E!==2){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid video packet type "+E);return}},r.prototype._parseAVCDecoderConfigurationRecord=function(t,s,i){if(i<7){y.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var e=this._videoMetadata,u=this._videoTrack,_=this._littleEndian,c=new DataView(t,s,i);e?typeof e.avcc<"u"&&y.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),e=this._videoMetadata={},e.type="video",e.id=u.id,e.timescale=this._timescale,e.duration=this._duration);var v=c.getUint8(0),E=c.getUint8(1);if(c.getUint8(2),c.getUint8(3),v!==1||E===0){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(c.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(o.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));return}var x=c.getUint8(5)&31;if(x===0){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else x>1&&y.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+x);for(var m=6,g=0;g<x;g++){var L=c.getUint16(m,!_);if(m+=2,L!==0){var R=new Uint8Array(t,s+m,L);m+=L;var A=f.default.parseSPS(R);if(g===0){e.codecWidth=A.codec_size.width,e.codecHeight=A.codec_size.height,e.presentWidth=A.present_size.width,e.presentHeight=A.present_size.height,e.profile=A.profile_string,e.level=A.level_string,e.bitDepth=A.bit_depth,e.chromaFormat=A.chroma_format,e.sarRatio=A.sar_ratio,e.frameRate=A.frame_rate,(A.frame_rate.fixed===!1||A.frame_rate.fps_num===0||A.frame_rate.fps_den===0)&&(e.frameRate=this._referenceFrameRate);var T=e.frameRate.fps_den,B=e.frameRate.fps_num;e.refSampleDuration=e.timescale*(T/B);for(var k=R.subarray(1,4),P="avc1.",j=0;j<3;j++){var W=k[j].toString(16);W.length<2&&(W="0"+W),P+=W}e.codec=P;var M=this._mediaInfo;M.width=e.codecWidth,M.height=e.codecHeight,M.fps=e.frameRate.fps,M.profile=e.profile,M.level=e.level,M.refFrames=A.ref_frames,M.chromaFormat=A.chroma_format_string,M.sarNum=e.sarRatio.width,M.sarDen=e.sarRatio.height,M.videoCodec=P,M.hasAudio?M.audioCodec!=null&&(M.mimeType='video/x-flv; codecs="'+M.videoCodec+","+M.audioCodec+'"'):M.mimeType='video/x-flv; codecs="'+M.videoCodec+'"',M.isComplete()&&this._onMediaInfo(M)}}}var N=c.getUint8(m);if(N===0){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else N>1&&y.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+N);m++;for(var g=0;g<N;g++){var L=c.getUint16(m,!_);m+=2,L!==0&&(m+=L)}e.avcc=new Uint8Array(i),e.avcc.set(new Uint8Array(t,s,i),0),y.default.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",e)},r.prototype._parseAVCVideoData=function(t,s,i,e,u,_,c){for(var v=this._littleEndian,E=new DataView(t,s,i),x=[],m=0,g=0,L=this._naluLengthSize,R=this._timestampBase+e,A=_===1;g<i;){if(g+4>=i){y.default.w(this.TAG,"Malformed Nalu near timestamp "+R+", offset = "+g+", dataSize = "+i);break}var T=E.getUint32(g,!v);if(L===3&&(T>>>=8),T>i-L){y.default.w(this.TAG,"Malformed Nalus near timestamp "+R+", NaluSize > DataSize!");return}var B=E.getUint8(g+L)&31;B===5&&(A=!0);var k=new Uint8Array(t,s+g,L+T),P={type:B,data:k};x.push(P),m+=k.byteLength,g+=L+T}if(x.length){var j=this._videoTrack,W={units:x,length:m,isKeyframe:A,dts:R,cts:c,pts:R+c};A&&(W.fileposition=u),j.samples.push(W),j.length+=m}},r}();S.default=a},"./src/demux/sps-parser.js":function(I,S,p){p.r(S);var y=p("./src/demux/exp-golomb.js"),h=function(){function f(){}return f._ebsp2rbsp=function(o){for(var d=o,n=d.byteLength,l=new Uint8Array(n),a=0,r=0;r<n;r++)r>=2&&d[r]===3&&d[r-1]===0&&d[r-2]===0||(l[a]=d[r],a++);return new Uint8Array(l.buffer,0,a)},f.parseSPS=function(o){var d=f._ebsp2rbsp(o),n=new y.default(d);n.readByte();var l=n.readByte();n.readByte();var a=n.readByte();n.readUEG();var r=f.getProfileString(l),t=f.getLevelString(a),s=1,i=420,e=[0,420,422,444],u=8;if((l===100||l===110||l===122||l===244||l===44||l===83||l===86||l===118||l===128||l===138||l===144)&&(s=n.readUEG(),s===3&&n.readBits(1),s<=3&&(i=e[s]),u=n.readUEG()+8,n.readUEG(),n.readBits(1),n.readBool()))for(var _=s!==3?8:12,c=0;c<_;c++)n.readBool()&&(c<6?f._skipScalingList(n,16):f._skipScalingList(n,64));n.readUEG();var v=n.readUEG();if(v===0)n.readUEG();else if(v===1){n.readBits(1),n.readSEG(),n.readSEG();for(var E=n.readUEG(),c=0;c<E;c++)n.readSEG()}var x=n.readUEG();n.readBits(1);var m=n.readUEG(),g=n.readUEG(),L=n.readBits(1);L===0&&n.readBits(1),n.readBits(1);var R=0,A=0,T=0,B=0,k=n.readBool();k&&(R=n.readUEG(),A=n.readUEG(),T=n.readUEG(),B=n.readUEG());var P=1,j=1,W=0,M=!0,N=0,q=0,G=n.readBool();if(G){if(n.readBool()){var K=n.readByte(),Z=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],X=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];K>0&&K<16?(P=Z[K-1],j=X[K-1]):K===255&&(P=n.readByte()<<8|n.readByte(),j=n.readByte()<<8|n.readByte())}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(4),n.readBool()&&n.readBits(24)),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool()){var Q=n.readBits(32),re=n.readBits(32);M=n.readBool(),N=re,q=Q*2,W=N/q}}var V=1;(P!==1||j!==1)&&(V=P/j);var w=0,J=0;if(s===0)w=1,J=2-L;else{var ee=s===3?1:2,ae=s===1?2:1;w=ee,J=ae*(2-L)}var ie=(m+1)*16,oe=(2-L)*((g+1)*16);ie-=(R+A)*w,oe-=(T+B)*J;var le=Math.ceil(ie*V);return n.destroy(),n=null,{profile_string:r,level_string:t,bit_depth:u,ref_frames:x,chroma_format:i,chroma_format_string:f.getChromaFormatString(i),frame_rate:{fixed:M,fps:W,fps_den:q,fps_num:N},sar_ratio:{width:P,height:j},codec_size:{width:ie,height:oe},present_size:{width:le,height:oe}}},f._skipScalingList=function(o,d){for(var n=8,l=8,a=0,r=0;r<d;r++)l!==0&&(a=o.readSEG(),l=(n+a+256)%256),n=l===0?n:l},f.getProfileString=function(o){switch(o){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"}},f.getLevelString=function(o){return(o/10).toFixed(1)},f.getChromaFormatString=function(o){switch(o){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},f}();S.default=h},"./src/flv.js":function(I,S,p){p.r(S);var y=p("./src/utils/polyfill.js"),h=p("./src/core/features.js"),f=p("./src/io/loader.js"),o=p("./src/player/flv-player.js"),d=p("./src/player/native-player.js"),n=p("./src/player/player-events.js"),l=p("./src/player/player-errors.js"),a=p("./src/utils/logging-control.js"),r=p("./src/utils/exception.js");y.default.install();function t(u,_){var c=u;if(c==null||typeof c!="object")throw new r.InvalidArgumentException("MediaDataSource must be an javascript object!");if(!c.hasOwnProperty("type"))throw new r.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");switch(c.type){case"flv":return new o.default(c,_);default:return new d.default(c,_)}}function s(){return h.default.supportMSEH264Playback()}function i(){return h.default.getFeatureList()}var e={};e.createPlayer=t,e.isSupported=s,e.getFeatureList=i,e.BaseLoader=f.BaseLoader,e.LoaderStatus=f.LoaderStatus,e.LoaderErrors=f.LoaderErrors,e.Events=n.default,e.ErrorTypes=l.ErrorTypes,e.ErrorDetails=l.ErrorDetails,e.FlvPlayer=o.default,e.NativePlayer=d.default,e.LoggingControl=a.default,Object.defineProperty(e,"version",{enumerable:!0,get:function(){return"1.6.2"}}),S.default=e},"./src/index.js":function(I,S,p){I.exports=p("./src/flv.js").default},"./src/io/fetch-stream-loader.js":function(I,S,p){p.r(S);var y=p("./src/utils/browser.js"),h=p("./src/io/loader.js"),f=p("./src/utils/exception.js"),o=function(){var n=function(l,a){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])},n(l,a)};return function(l,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");n(l,a);function r(){this.constructor=l}l.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),d=function(n){o(l,n);function l(a,r){var t=n.call(this,"fetch-stream-loader")||this;return t.TAG="FetchStreamLoader",t._seekHandler=a,t._config=r,t._needStash=!0,t._requestAbort=!1,t._contentLength=null,t._receivedLength=0,t}return l.isSupported=function(){try{var a=y.default.msedge&&y.default.version.minor>=15048,r=y.default.msedge?a:!0;return self.fetch&&self.ReadableStream&&r}catch{return!1}},l.prototype.destroy=function(){this.isWorking()&&this.abort(),n.prototype.destroy.call(this)},l.prototype.open=function(a,r){var t=this;this._dataSource=a,this._range=r;var s=a.url;this._config.reuseRedirectedURL&&a.redirectedURL!=null&&(s=a.redirectedURL);var i=this._seekHandler.getConfig(s,r),e=new self.Headers;if(typeof i.headers=="object"){var u=i.headers;for(var _ in u)u.hasOwnProperty(_)&&e.append(_,u[_])}var c={method:"GET",headers:e,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var _ in this._config.headers)e.append(_,this._config.headers[_]);a.cors===!1&&(c.mode="same-origin"),a.withCredentials&&(c.credentials="include"),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,c.signal=this._abortController.signal),this._status=h.LoaderStatus.kConnecting,self.fetch(i.url,c).then(function(v){if(t._requestAbort){t._status=h.LoaderStatus.kIdle,v.body.cancel();return}if(v.ok&&v.status>=200&&v.status<=299){if(v.url!==i.url&&t._onURLRedirect){var E=t._seekHandler.removeURLParameters(v.url);t._onURLRedirect(E)}var x=v.headers.get("Content-Length");return x!=null&&(t._contentLength=parseInt(x),t._contentLength!==0&&t._onContentLengthKnown&&t._onContentLengthKnown(t._contentLength)),t._pump.call(t,v.body.getReader())}else if(t._status=h.LoaderStatus.kError,t._onError)t._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:v.status,msg:v.statusText});else throw new f.RuntimeException("FetchStreamLoader: Http code invalid, "+v.status+" "+v.statusText)}).catch(function(v){if(!(t._abortController&&t._abortController.signal.aborted))if(t._status=h.LoaderStatus.kError,t._onError)t._onError(h.LoaderErrors.EXCEPTION,{code:-1,msg:v.message});else throw v})},l.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==h.LoaderStatus.kBuffering||!y.default.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},l.prototype._pump=function(a){var r=this;return a.read().then(function(t){if(t.done)if(r._contentLength!==null&&r._receivedLength<r._contentLength){r._status=h.LoaderStatus.kError;var s=h.LoaderErrors.EARLY_EOF,i={code:-1,msg:"Fetch stream meet Early-EOF"};if(r._onError)r._onError(s,i);else throw new f.RuntimeException(i.msg)}else r._status=h.LoaderStatus.kComplete,r._onComplete&&r._onComplete(r._range.from,r._range.from+r._receivedLength-1);else{if(r._abortController&&r._abortController.signal.aborted){r._status=h.LoaderStatus.kComplete;return}else if(r._requestAbort===!0)return r._status=h.LoaderStatus.kComplete,a.cancel();r._status=h.LoaderStatus.kBuffering;var e=t.value.buffer,u=r._range.from+r._receivedLength;r._receivedLength+=e.byteLength,r._onDataArrival&&r._onDataArrival(e,u,r._receivedLength),r._pump(a)}}).catch(function(t){if(r._abortController&&r._abortController.signal.aborted){r._status=h.LoaderStatus.kComplete;return}if(!(t.code===11&&y.default.msedge)){r._status=h.LoaderStatus.kError;var s=0,i=null;if((t.code===19||t.message==="network error")&&(r._contentLength===null||r._contentLength!==null&&r._receivedLength<r._contentLength)?(s=h.LoaderErrors.EARLY_EOF,i={code:t.code,msg:"Fetch stream meet Early-EOF"}):(s=h.LoaderErrors.EXCEPTION,i={code:t.code,msg:t.message}),r._onError)r._onError(s,i);else throw new f.RuntimeException(i.msg)}})},l}(h.BaseLoader);S.default=d},"./src/io/io-controller.js":function(I,S,p){p.r(S);var y=p("./src/utils/logger.js"),h=p("./src/io/speed-sampler.js"),f=p("./src/io/loader.js"),o=p("./src/io/fetch-stream-loader.js"),d=p("./src/io/xhr-moz-chunked-loader.js"),n=p("./src/io/xhr-range-loader.js"),l=p("./src/io/websocket-loader.js"),a=p("./src/io/range-seek-handler.js"),r=p("./src/io/param-seek-handler.js"),t=p("./src/utils/exception.js"),s=function(){function i(e,u,_){this.TAG="IOController",this._config=u,this._extraData=_,this._stashInitialSize=1024*384,u.stashInitialSize!=null&&u.stashInitialSize>0&&(this._stashInitialSize=u.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,u.enableStashBuffer===!1&&(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 h.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 i.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},i.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},i.prototype.isPaused=function(){return this._paused},Object.defineProperty(i.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currentSpeed",{get:function(){return this._loaderClass===n.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),i.prototype._selectSeekHandler=function(){var e=this._config;if(e.seekType==="range")this._seekHandler=new a.default(this._config.rangeLoadZeroStart);else if(e.seekType==="param"){var u=e.seekParamStart||"bstart",_=e.seekParamEnd||"bend";this._seekHandler=new r.default(u,_)}else if(e.seekType==="custom"){if(typeof e.customSeekHandler!="function")throw new t.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}else throw new t.InvalidArgumentException("Invalid seekType in config: "+e.seekType)},i.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=l.default;else if(o.default.isSupported())this._loaderClass=o.default;else if(d.default.isSupported())this._loaderClass=d.default;else if(n.default.isSupported())this._loaderClass=n.default;else throw new t.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!")},i.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},i.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},i.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},i.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},i.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},i.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},i.prototype._internalSeek=function(e,u){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(u),this._loader.destroy(),this._loader=null;var _={from:e,to:-1};this._currentRange={from:_.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,_),this._onSeeked&&this._onSeeked()},i.prototype.updateUrl=function(e){if(!e||typeof e!="string"||e.length===0)throw new t.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e},i.prototype._expandBuffer=function(e){for(var u=this._stashSize;u+1024*1024*1<e;)u*=2;if(u+=1024*1024*1,u!==this._bufferSize){var _=new ArrayBuffer(u);if(this._stashUsed>0){var c=new Uint8Array(this._stashBuffer,0,this._stashUsed),v=new Uint8Array(_,0,u);v.set(c,0)}this._stashBuffer=_,this._bufferSize=u}},i.prototype._normalizeSpeed=function(e){var u=this._speedNormalizeList,_=u.length-1,c=0,v=0,E=_;if(e<u[0])return u[0];for(;v<=E;){if(c=v+Math.floor((E-v)/2),c===_||e>=u[c]&&e<u[c+1])return u[c];u[c]<e?v=c+1:E=c-1}},i.prototype._adjustStashSize=function(e){var u=0;this._config.isLive||e<512?u=e:e>=512&&e<=1024?u=Math.floor(e*1.5):u=e*2,u>8192&&(u=8192);var _=u*1024+1024*1024*1;this._bufferSize<_&&this._expandBuffer(_),this._stashSize=u*1024},i.prototype._dispatchChunks=function(e,u){return this._currentRange.to=u+e.byteLength-1,this._onDataArrival(e,u)},i.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},i.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},i.prototype._onLoaderChunkArrival=function(e,u,_){if(!this._onDataArrival)throw new t.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var c=this._speedSampler.lastSecondKBps;if(c!==0){var v=this._normalizeSpeed(c);this._speedNormalized!==v&&(this._speedNormalized=v,this._adjustStashSize(v))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=u),this._stashUsed+e.byteLength<=this._stashSize){var m=new Uint8Array(this._stashBuffer,0,this._stashSize);m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var L=this._stashBuffer.slice(0,this._stashUsed),E=this._dispatchChunks(L,this._stashByteStart);if(E<L.byteLength){if(E>0){var g=new Uint8Array(L,E);m.set(g,0),this._stashUsed=g.byteLength,this._stashByteStart+=E}}else this._stashUsed=0,this._stashByteStart+=E;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),m=new Uint8Array(this._stashBuffer,0,this._bufferSize)),m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var E=this._dispatchChunks(e,u);if(E<e.byteLength){var x=e.byteLength-E;x>this._bufferSize&&(this._expandBuffer(x),m=new Uint8Array(this._stashBuffer,0,this._bufferSize)),m.set(new Uint8Array(e,E),0),this._stashUsed+=x,this._stashByteStart=u+E}}}else if(this._stashUsed===0){var E=this._dispatchChunks(e,u);if(E<e.byteLength){var x=e.byteLength-E;x>this._bufferSize&&this._expandBuffer(x);var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);m.set(new Uint8Array(e,E),0),this._stashUsed+=x,this._stashByteStart=u+E}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var E=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(E<this._stashUsed&&E>0){var g=new Uint8Array(this._stashBuffer,E);m.set(g,0)}this._stashUsed-=E,this._stashByteStart+=E}}},i.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var u=this._stashBuffer.slice(0,this._stashUsed),_=this._dispatchChunks(u,this._stashByteStart),c=u.byteLength-_;if(_<u.byteLength)if(e)y.default.w(this.TAG,c+" bytes unconsumed data remain when flush buffer, dropped");else{if(_>0){var v=new Uint8Array(this._stashBuffer,0,this._bufferSize),E=new Uint8Array(u,_);v.set(E,0),this._stashUsed=E.byteLength,this._stashByteStart+=_}return 0}return this._stashUsed=0,this._stashByteStart=0,c}return 0},i.prototype._onLoaderComplete=function(e,u){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},i.prototype._onLoaderError=function(e,u){switch(y.default.e(this.TAG,"Loader error, code = "+u.code+", msg = "+u.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=f.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case f.LoaderErrors.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var _=this._currentRange.to+1;_<this._totalLength&&(y.default.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(_,!1));return}e=f.LoaderErrors.UNRECOVERABLE_EARLY_EOF;break}case f.LoaderErrors.UNRECOVERABLE_EARLY_EOF:case f.LoaderErrors.CONNECTING_TIMEOUT:case f.LoaderErrors.HTTP_STATUS_CODE_INVALID:case f.LoaderErrors.EXCEPTION:break}if(this._onError)this._onError(e,u);else throw new t.RuntimeException("IOException: "+u.msg)},i}();S.default=s},"./src/io/loader.js":function(I,S,p){p.r(S),p.d(S,{LoaderStatus:function(){return h},LoaderErrors:function(){return f},BaseLoader:function(){return o}});var y=p("./src/utils/exception.js"),h={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},f={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},o=function(){function d(n){this._type=n||"undefined",this._status=h.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return d.prototype.destroy=function(){this._status=h.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},d.prototype.isWorking=function(){return this._status===h.kConnecting||this._status===h.kBuffering},Object.defineProperty(d.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(n){this._onContentLengthKnown=n},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(n){this._onURLRedirect=n},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(n){this._onDataArrival=n},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onError",{get:function(){return this._onError},set:function(n){this._onError=n},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onComplete",{get:function(){return this._onComplete},set:function(n){this._onComplete=n},enumerable:!1,configurable:!0}),d.prototype.open=function(n,l){throw new y.NotImplementedException("Unimplemented abstract function!")},d.prototype.abort=function(){throw new y.NotImplementedException("Unimplemented abstract function!")},d}()},"./src/io/param-seek-handler.js":function(I,S,p){p.r(S);var y=function(){function h(f,o){this._startName=f,this._endName=o}return h.prototype.getConfig=function(f,o){var d=f;if(o.from!==0||o.to!==-1){var n=!0;d.indexOf("?")===-1&&(d+="?",n=!1),n&&(d+="&"),d+=this._startName+"="+o.from.toString(),o.to!==-1&&(d+="&"+this._endName+"="+o.to.toString())}return{url:d,headers:{}}},h.prototype.removeURLParameters=function(f){var o=f.split("?")[0],d=void 0,n=f.indexOf("?");n!==-1&&(d=f.substring(n+1));var l="";if(d!=null&&d.length>0)for(var a=d.split("&"),r=0;r<a.length;r++){var t=a[r].split("="),s=r>0;t[0]!==this._startName&&t[0]!==this._endName&&(s&&(l+="&"),l+=a[r])}return l.length===0?o:o+"?"+l},h}();S.default=y},"./src/io/range-seek-handler.js":function(I,S,p){p.r(S);var y=function(){function h(f){this._zeroStart=f||!1}return h.prototype.getConfig=function(f,o){var d={};if(o.from!==0||o.to!==-1){var n=void 0;o.to!==-1?n="bytes="+o.from.toString()+"-"+o.to.toString():n="bytes="+o.from.toString()+"-",d.Range=n}else this._zeroStart&&(d.Range="bytes=0-");return{url:f,headers:d}},h.prototype.removeURLParameters=function(f){return f},h}();S.default=y},"./src/io/speed-sampler.js":function(I,S,p){p.r(S);var y=function(){function h(){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 h.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},h.prototype.addBytes=function(f){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=f,this._totalBytes+=f):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=f,this._totalBytes+=f):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=f,this._totalBytes+=f,this._lastCheckpoint=this._now())},Object.defineProperty(h.prototype,"currentKBps",{get:function(){this.addBytes(0);var f=(this._now()-this._lastCheckpoint)/1e3;return f==0&&(f=1),this._intervalBytes/f/1024},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"averageKBps",{get:function(){var f=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/f/1024},enumerable:!1,configurable:!0}),h}();S.default=y},"./src/io/websocket-loader.js":function(I,S,p){p.r(S);var y=p("./src/io/loader.js"),h=p("./src/utils/exception.js"),f=function(){var d=function(n,l){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(a[t]=r[t])},d(n,l)};return function(n,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");d(n,l);function a(){this.constructor=n}n.prototype=l===null?Object.create(l):(a.prototype=l.prototype,new a)}}(),o=function(d){f(n,d);function n(){var l=d.call(this,"websocket-loader")||this;return l.TAG="WebSocketLoader",l._needStash=!0,l._ws=null,l._requestAbort=!1,l._receivedLength=0,l}return n.isSupported=function(){try{return typeof self.WebSocket<"u"}catch{return!1}},n.prototype.destroy=function(){this._ws&&this.abort(),d.prototype.destroy.call(this)},n.prototype.open=function(l){try{var a=this._ws=new self.WebSocket(l.url);a.binaryType="arraybuffer",a.onopen=this._onWebSocketOpen.bind(this),a.onclose=this._onWebSocketClose.bind(this),a.onmessage=this._onWebSocketMessage.bind(this),a.onerror=this._onWebSocketError.bind(this),this._status=y.LoaderStatus.kConnecting}catch(t){this._status=y.LoaderStatus.kError;var r={code:t.code,msg:t.message};if(this._onError)this._onError(y.LoaderErrors.EXCEPTION,r);else throw new h.RuntimeException(r.msg)}},n.prototype.abort=function(){var l=this._ws;l&&(l.readyState===0||l.readyState===1)&&(this._requestAbort=!0,l.close()),this._ws=null,this._status=y.LoaderStatus.kComplete},n.prototype._onWebSocketOpen=function(l){this._status=y.LoaderStatus.kBuffering},n.prototype._onWebSocketClose=function(l){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=y.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)},n.prototype._onWebSocketMessage=function(l){var a=this;if(l.data instanceof ArrayBuffer)this._dispatchArrayBuffer(l.data);else if(l.data instanceof Blob){var r=new FileReader;r.onload=function(){a._dispatchArrayBuffer(r.result)},r.readAsArrayBuffer(l.data)}else{this._status=y.LoaderStatus.kError;var t={code:-1,msg:"Unsupported WebSocket message type: "+l.data.constructor.name};if(this._onError)this._onError(y.LoaderErrors.EXCEPTION,t);else throw new h.RuntimeException(t.msg)}},n.prototype._dispatchArrayBuffer=function(l){var a=l,r=this._receivedLength;this._receivedLength+=a.byteLength,this._onDataArrival&&this._onDataArrival(a,r,this._receivedLength)},n.prototype._onWebSocketError=function(l){this._status=y.LoaderStatus.kError;var a={code:l.code,msg:l.message};if(this._onError)this._onError(y.LoaderErrors.EXCEPTION,a);else throw new h.RuntimeException(a.msg)},n}(y.BaseLoader);S.default=o},"./src/io/xhr-moz-chunked-loader.js":function(I,S,p){p.r(S);var y=p("./src/utils/logger.js"),h=p("./src/io/loader.js"),f=p("./src/utils/exception.js"),o=function(){var n=function(l,a){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])},n(l,a)};return function(l,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");n(l,a);function r(){this.constructor=l}l.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),d=function(n){o(l,n);function l(a,r){var t=n.call(this,"xhr-moz-chunked-loader")||this;return t.TAG="MozChunkedLoader",t._seekHandler=a,t._config=r,t._needStash=!0,t._xhr=null,t._requestAbort=!1,t._contentLength=null,t._receivedLength=0,t}return l.isSupported=function(){try{var a=new XMLHttpRequest;return a.open("GET","https://example.com",!0),a.responseType="moz-chunked-arraybuffer",a.responseType==="moz-chunked-arraybuffer"}catch(r){return y.default.w("MozChunkedLoader",r.message),!1}},l.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),n.prototype.destroy.call(this)},l.prototype.open=function(a,r){this._dataSource=a,this._range=r;var t=a.url;this._config.reuseRedirectedURL&&a.redirectedURL!=null&&(t=a.redirectedURL);var s=this._seekHandler.getConfig(t,r);this._requestURL=s.url;var i=this._xhr=new XMLHttpRequest;if(i.open("GET",s.url,!0),i.responseType="moz-chunked-arraybuffer",i.onreadystatechange=this._onReadyStateChange.bind(this),i.onprogress=this._onProgress.bind(this),i.onloadend=this._onLoadEnd.bind(this),i.onerror=this._onXhrError.bind(this),a.withCredentials&&(i.withCredentials=!0),typeof s.headers=="object"){var e=s.headers;for(var u in e)e.hasOwnProperty(u)&&i.setRequestHeader(u,e[u])}if(typeof this._config.headers=="object"){var e=this._config.headers;for(var u in e)e.hasOwnProperty(u)&&i.setRequestHeader(u,e[u])}this._status=h.LoaderStatus.kConnecting,i.send()},l.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=h.LoaderStatus.kComplete},l.prototype._onReadyStateChange=function(a){var r=a.target;if(r.readyState===2){if(r.responseURL!=null&&r.responseURL!==this._requestURL&&this._onURLRedirect){var t=this._seekHandler.removeURLParameters(r.responseURL);this._onURLRedirect(t)}if(r.status!==0&&(r.status<200||r.status>299))if(this._status=h.LoaderStatus.kError,this._onError)this._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:r.status,msg:r.statusText});else throw new f.RuntimeException("MozChunkedLoader: Http code invalid, "+r.status+" "+r.statusText);else this._status=h.LoaderStatus.kBuffering}},l.prototype._onProgress=function(a){if(this._status!==h.LoaderStatus.kError){this._contentLength===null&&a.total!==null&&a.total!==0&&(this._contentLength=a.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var r=a.target.response,t=this._range.from+this._receivedLength;this._receivedLength+=r.byteLength,this._onDataArrival&&this._onDataArrival(r,t,this._receivedLength)}},l.prototype._onLoadEnd=function(a){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===h.LoaderStatus.kError)return;this._status=h.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)},l.prototype._onXhrError=function(a){this._status=h.LoaderStatus.kError;var r=0,t=null;if(this._contentLength&&a.loaded<this._contentLength?(r=h.LoaderErrors.EARLY_EOF,t={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(r=h.LoaderErrors.EXCEPTION,t={code:-1,msg:a.constructor.name+" "+a.type}),this._onError)this._onError(r,t);else throw new f.RuntimeException(t.msg)},l}(h.BaseLoader);S.default=d},"./src/io/xhr-range-loader.js":function(I,S,p){p.r(S);var y=p("./src/utils/logger.js"),h=p("./src/io/speed-sampler.js"),f=p("./src/io/loader.js"),o=p("./src/utils/exception.js"),d=function(){var l=function(a,r){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])},l(a,r)};return function(a,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");l(a,r);function t(){this.constructor=a}a.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}}(),n=function(l){d(a,l);function a(r,t){var s=l.call(this,"xhr-range-loader")||this;return s.TAG="RangeLoader",s._seekHandler=r,s._config=t,s._needStash=!1,s._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],s._currentChunkSizeKB=384,s._currentSpeedNormalized=0,s._zeroSpeedChunkCount=0,s._xhr=null,s._speedSampler=new h.default,s._requestAbort=!1,s._waitForTotalLength=!1,s._totalLengthReceived=!1,s._currentRequestURL=null,s._currentRedirectedURL=null,s._currentRequestRange=null,s._totalLength=null,s._contentLength=null,s._receivedLength=0,s._lastTimeLoaded=0,s}return a.isSupported=function(){try{var r=new XMLHttpRequest;return r.open("GET","https://example.com",!0),r.responseType="arraybuffer",r.responseType==="arraybuffer"}catch(t){return y.default.w("RangeLoader",t.message),!1}},a.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),l.prototype.destroy.call(this)},Object.defineProperty(a.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),a.prototype.open=function(r,t){this._dataSource=r,this._range=t,this._status=f.LoaderStatus.kConnecting;var s=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(s=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!s?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()},a.prototype._openSubRange=function(){var r=this._currentChunkSizeKB*1024,t=this._range.from+this._receivedLength,s=t+r;this._contentLength!=null&&s-this._range.from>=this._contentLength&&(s=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:s},this._internalOpen(this._dataSource,this._currentRequestRange)},a.prototype._internalOpen=function(r,t){this._lastTimeLoaded=0;var s=r.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?s=this._currentRedirectedURL:r.redirectedURL!=null&&(s=r.redirectedURL));var i=this._seekHandler.getConfig(s,t);this._currentRequestURL=i.url;var e=this._xhr=new XMLHttpRequest;if(e.open("GET",i.url,!0),e.responseType="arraybuffer",e.onreadystatechange=this._onReadyStateChange.bind(this),e.onprogress=this._onProgress.bind(this),e.onload=this._onLoad.bind(this),e.onerror=this._onXhrError.bind(this),r.withCredentials&&(e.withCredentials=!0),typeof i.headers=="object"){var u=i.headers;for(var _ in u)u.hasOwnProperty(_)&&e.setRequestHeader(_,u[_])}if(typeof this._config.headers=="object"){var u=this._config.headers;for(var _ in u)u.hasOwnProperty(_)&&e.setRequestHeader(_,u[_])}e.send()},a.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=f.LoaderStatus.kComplete},a.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)},a.prototype._onReadyStateChange=function(r){var t=r.target;if(t.readyState===2){if(t.responseURL!=null){var s=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&s!==this._currentRedirectedURL&&(this._currentRedirectedURL=s,this._onURLRedirect&&this._onURLRedirect(s))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=f.LoaderStatus.kBuffering}else if(this._status=f.LoaderStatus.kError,this._onError)this._onError(f.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText});else throw new o.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText)}},a.prototype._onProgress=function(r){if(this._status!==f.LoaderStatus.kError){if(this._contentLength===null){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var s=r.total;this._internalAbort(),s!=null&s!==0&&(this._totalLength=s)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=r.loaded-this._lastTimeLoaded;this._lastTimeLoaded=r.loaded,this._speedSampler.addBytes(i)}},a.prototype._normalizeSpeed=function(r){var t=this._chunkSizeKBList,s=t.length-1,i=0,e=0,u=s;if(r<t[0])return t[0];for(;e<=u;){if(i=e+Math.floor((u-e)/2),i===s||r>=t[i]&&r<t[i+1])return t[i];t[i]<r?e=i+1:u=i-1}},a.prototype._onLoad=function(r){if(this._status!==f.LoaderStatus.kError){if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(t===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),t!==0){var s=this._normalizeSpeed(t);this._currentSpeedNormalized!==s&&(this._currentSpeedNormalized=s,this._currentChunkSizeKB=s)}var i=r.target.response,e=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var u=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():u=!0,this._onDataArrival&&this._onDataArrival(i,e,this._receivedLength),u&&(this._status=f.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},a.prototype._onXhrError=function(r){this._status=f.LoaderStatus.kError;var t=0,s=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=f.LoaderErrors.EARLY_EOF,s={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=f.LoaderErrors.EXCEPTION,s={code:-1,msg:r.constructor.name+" "+r.type}),this._onError)this._onError(t,s);else throw new o.RuntimeException(s.msg)},a}(f.BaseLoader);S.default=n},"./src/player/flv-player.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=p("./src/utils/logger.js"),o=p("./src/utils/browser.js"),d=p("./src/player/player-events.js"),n=p("./src/core/transmuxer.js"),l=p("./src/core/transmuxing-events.js"),a=p("./src/core/mse-controller.js"),r=p("./src/core/mse-events.js"),t=p("./src/player/player-errors.js"),s=p("./src/config.js"),i=p("./src/utils/exception.js"),e=function(){function u(_,c){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(h()),this._config=(0,s.createDefaultConfig)(),typeof c=="object"&&Object.assign(this._config,c),_.type.toLowerCase()!=="flv")throw new i.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");_.isLive===!0&&(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=_,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 v=o.default.chrome&&(o.default.version.major<50||o.default.version.major===50&&o.default.version.build<2661);this._alwaysSeekKeyframe=!!(v||o.default.msedge||o.default.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return u.prototype.destroy=function(){this._progressChecker!=null&&(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},u.prototype.on=function(_,c){var v=this;_===d.default.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){v._emitter.emit(d.default.MEDIA_INFO,v.mediaInfo)}):_===d.default.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(function(){v._emitter.emit(d.default.STATISTICS_INFO,v.statisticsInfo)}),this._emitter.addListener(_,c)},u.prototype.off=function(_,c){this._emitter.removeListener(_,c)},u.prototype.attachMediaElement=function(_){var c=this;if(this._mediaElement=_,_.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),_.addEventListener("seeking",this.e.onvSeeking),_.addEventListener("canplay",this.e.onvCanPlay),_.addEventListener("stalled",this.e.onvStalled),_.addEventListener("progress",this.e.onvProgress),this._msectl=new a.default(this._config),this._msectl.on(r.default.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(r.default.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(r.default.SOURCE_OPEN,function(){c._mseSourceOpened=!0,c._hasPendingLoad&&(c._hasPendingLoad=!1,c.load())}),this._msectl.on(r.default.ERROR,function(v){c._emitter.emit(d.default.ERROR,t.ErrorTypes.MEDIA_ERROR,t.ErrorDetails.MEDIA_MSE_ERROR,v)}),this._msectl.attachMediaElement(_),this._pendingSeekTime!=null)try{_.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},u.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)},u.prototype.load=function(){var _=this;if(!this._mediaElement)throw new i.IllegalStateException("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new i.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new n.default(this._mediaDataSource,this._config),this._transmuxer.on(l.default.INIT_SEGMENT,function(c,v){_._msectl.appendInitSegment(v)}),this._transmuxer.on(l.default.MEDIA_SEGMENT,function(c,v){if(_._msectl.appendMediaSegment(v),_._config.lazyLoad&&!_._config.isLive){var E=_._mediaElement.currentTime;v.info.endDts>=(E+_._config.lazyLoadMaxDuration)*1e3&&_._progressChecker==null&&(f.default.v(_.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),_._suspendTransmuxer())}}),this._transmuxer.on(l.default.LOADING_COMPLETE,function(){_._msectl.endOfStream(),_._emitter.emit(d.default.LOADING_COMPLETE)}),this._transmuxer.on(l.default.RECOVERED_EARLY_EOF,function(){_._emitter.emit(d.default.RECOVERED_EARLY_EOF)}),this._transmuxer.on(l.default.IO_ERROR,function(c,v){_._emitter.emit(d.default.ERROR,t.ErrorTypes.NETWORK_ERROR,c,v)}),this._transmuxer.on(l.default.DEMUX_ERROR,function(c,v){_._emitter.emit(d.default.ERROR,t.ErrorTypes.MEDIA_ERROR,c,{code:-1,msg:v})}),this._transmuxer.on(l.default.MEDIA_INFO,function(c){_._mediaInfo=c,_._emitter.emit(d.default.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(l.default.METADATA_ARRIVED,function(c){_._emitter.emit(d.default.METADATA_ARRIVED,c)}),this._transmuxer.on(l.default.SCRIPTDATA_ARRIVED,function(c){_._emitter.emit(d.default.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(l.default.STATISTICS_INFO,function(c){_._statisticsInfo=_._fillStatisticsInfo(c),_._emitter.emit(d.default.STATISTICS_INFO,Object.assign({},_._statisticsInfo))}),this._transmuxer.on(l.default.RECOMMEND_SEEKPOINT,function(c){_._mediaElement&&!_._config.accurateSeek&&(_._requestSetTime=!0,_._mediaElement.currentTime=c/1e3)}),this._transmuxer.open()}},u.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},u.prototype.play=function(){return this._mediaElement.play()},u.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(u.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(_){this._mediaElement.volume=_},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(_){this._mediaElement.muted=_},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(_){this._mediaElement?this._internalSeek(_):this._pendingSeekTime=_},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"statisticsInfo",{get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),u.prototype._fillStatisticsInfo=function(_){if(_.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return _;var c=!0,v=0,E=0;if(this._mediaElement.getVideoPlaybackQuality){var x=this._mediaElement.getVideoPlaybackQuality();v=x.totalVideoFrames,E=x.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(v=this._mediaElement.webkitDecodedFrameCount,E=this._mediaElement.webkitDroppedFrameCount):c=!1;return c&&(_.decodedFrames=v,_.droppedFrames=E),_},u.prototype._onmseUpdateEnd=function(){if(!(!this._config.lazyLoad||this._config.isLive)){for(var _=this._mediaElement.buffered,c=this._mediaElement.currentTime,v=0,E=0;E<_.length;E++){var x=_.start(E),m=_.end(E);if(x<=c&&c<m){v=m;break}}v>=c+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(f.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},u.prototype._onmseBufferFull=function(){f.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()},u.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},u.prototype._checkProgressAndResume=function(){for(var _=this._mediaElement.currentTime,c=this._mediaElement.buffered,v=!1,E=0;E<c.length;E++){var x=c.start(E),m=c.end(E);if(_>=x&&_<m){_>=m-this._config.lazyLoadRecoverDuration&&(v=!0);break}}v&&(window.clearInterval(this._progressChecker),this._progressChecker=null,v&&(f.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},u.prototype._isTimepointBuffered=function(_){for(var c=this._mediaElement.buffered,v=0;v<c.length;v++){var E=c.start(v),x=c.end(v);if(_>=E&&_<x)return!0}return!1},u.prototype._internalSeek=function(_){var c=this._isTimepointBuffered(_),v=!1,E=0;if(_<1&&this._mediaElement.buffered.length>0){var x=this._mediaElement.buffered.start(0);(x<1&&_<x||o.default.safari)&&(v=!0,E=o.default.safari?.1:x)}if(v)this._requestSetTime=!0,this._mediaElement.currentTime=E;else if(c){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=_;else{var m=this._msectl.getNearestKeyframe(Math.floor(_*1e3));this._requestSetTime=!0,m!=null?this._mediaElement.currentTime=m.dts/1e3:this._mediaElement.currentTime=_}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(_),this._transmuxer.seek(Math.floor(_*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=_)},u.prototype._checkAndApplyUnbufferedSeekpoint=function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var _=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(_)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(_),this._transmuxer.seek(Math.floor(_*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=_))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},u.prototype._checkAndResumeStuckPlayback=function(_){var c=this._mediaElement;if(_||!this._receivedCanPlay||c.readyState<2){var v=c.buffered;v.length>0&&c.currentTime<v.start(0)&&(f.default.w(this.TAG,"Playback seems stuck at "+c.currentTime+", seek to "+v.start(0)),this._requestSetTime=!0,this._mediaElement.currentTime=v.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)},u.prototype._onvLoadedMetadata=function(_){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)},u.prototype._onvSeeking=function(_){var c=this._mediaElement.currentTime,v=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(c<1&&v.length>0){var E=v.start(0);if(E<1&&c<E||o.default.safari){this._requestSetTime=!0,this._mediaElement.currentTime=o.default.safari?.1:E;return}}if(this._isTimepointBuffered(c)){if(this._alwaysSeekKeyframe){var x=this._msectl.getNearestKeyframe(Math.floor(c*1e3));x!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=x.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:c,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},u.prototype._onvCanPlay=function(_){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)},u.prototype._onvStalled=function(_){this._checkAndResumeStuckPlayback(!0)},u.prototype._onvProgress=function(_){this._checkAndResumeStuckPlayback()},u}();S.default=e},"./src/player/native-player.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=p("./src/player/player-events.js"),o=p("./src/config.js"),d=p("./src/utils/exception.js"),n=function(){function l(a,r){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(h()),this._config=(0,o.createDefaultConfig)(),typeof r=="object"&&Object.assign(this._config,r),a.type.toLowerCase()==="flv")throw new d.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");if(a.hasOwnProperty("segments"))throw new d.InvalidArgumentException("NativePlayer("+a.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=a,this._mediaElement=null}return l.prototype.destroy=function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},l.prototype.on=function(a,r){var t=this;a===f.default.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){t._emitter.emit(f.default.MEDIA_INFO,t.mediaInfo)}):a===f.default.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){t._emitter.emit(f.default.STATISTICS_INFO,t.statisticsInfo)}),this._emitter.addListener(a,r)},l.prototype.off=function(a,r){this._emitter.removeListener(a,r)},l.prototype.attachMediaElement=function(a){if(this._mediaElement=a,a.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{a.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},l.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},l.prototype.load=function(){if(!this._mediaElement)throw new d.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)},l.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},l.prototype.play=function(){return this._mediaElement.play()},l.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(l.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(a){this._mediaElement.volume=a},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(a){this._mediaElement.muted=a},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(a){this._mediaElement?this._mediaElement.currentTime=a:this._pendingSeekTime=a},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"mediaInfo",{get:function(){var a=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",r={mimeType:a+this._mediaDataSource.type};return this._mediaElement&&(r.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(r.width=this._mediaElement.videoWidth,r.height=this._mediaElement.videoHeight)),r},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"statisticsInfo",{get:function(){var a={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return a;var r=!0,t=0,s=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();t=i.totalVideoFrames,s=i.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(t=this._mediaElement.webkitDecodedFrameCount,s=this._mediaElement.webkitDroppedFrameCount):r=!1;return r&&(a.decodedFrames=t,a.droppedFrames=s),a},enumerable:!1,configurable:!0}),l.prototype._onvLoadedMetadata=function(a){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(f.default.MEDIA_INFO,this.mediaInfo)},l.prototype._reportStatisticsInfo=function(){this._emitter.emit(f.default.STATISTICS_INFO,this.statisticsInfo)},l}();S.default=n},"./src/player/player-errors.js":function(I,S,p){p.r(S),p.d(S,{ErrorTypes:function(){return f},ErrorDetails:function(){return o}});var y=p("./src/io/loader.js"),h=p("./src/demux/demux-errors.js"),f={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},o={NETWORK_EXCEPTION:y.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:y.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:y.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:y.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:h.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:h.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:h.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js":function(I,S,p){p.r(S);var y={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"};S.default=y},"./src/remux/aac-silent.js":function(I,S,p){p.r(S);var y=function(){function h(){}return h.getSilentFrame=function(f,o){if(f==="mp4a.40.2"){if(o===1)return new Uint8Array([0,200,0,128,35,128]);if(o===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(o===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(o===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(o===5)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(o===6)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(o===1)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(o===2)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(o===3)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},h}();S.default=y},"./src/remux/mp4-generator.js":function(I,S,p){p.r(S);var y=function(){function h(){}return h.init=function(){h.types={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:[],".mp3":[]};for(var f in h.types)h.types.hasOwnProperty(f)&&(h.types[f]=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)]);var o=h.constants={};o.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),o.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),o.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),o.STSC=o.STCO=o.STTS,o.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),o.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]),o.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]),o.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),o.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},h.box=function(f){for(var o=8,d=null,n=Array.prototype.slice.call(arguments,1),l=n.length,a=0;a<l;a++)o+=n[a].byteLength;d=new Uint8Array(o),d[0]=o>>>24&255,d[1]=o>>>16&255,d[2]=o>>>8&255,d[3]=o&255,d.set(f,4);for(var r=8,a=0;a<l;a++)d.set(n[a],r),r+=n[a].byteLength;return d},h.generateInitSegment=function(f){var o=h.box(h.types.ftyp,h.constants.FTYP),d=h.moov(f),n=new Uint8Array(o.byteLength+d.byteLength);return n.set(o,0),n.set(d,o.byteLength),n},h.moov=function(f){var o=h.mvhd(f.timescale,f.duration),d=h.trak(f),n=h.mvex(f);return h.box(h.types.moov,o,d,n)},h.mvhd=function(f,o){return h.box(h.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,f>>>24&255,f>>>16&255,f>>>8&255,f&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,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]))},h.trak=function(f){return h.box(h.types.trak,h.tkhd(f),h.mdia(f))},h.tkhd=function(f){var o=f.id,d=f.duration,n=f.presentWidth,l=f.presentHeight;return h.box(h.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255,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,n>>>8&255,n&255,0,0,l>>>8&255,l&255,0,0]))},h.mdia=function(f){return h.box(h.types.mdia,h.mdhd(f),h.hdlr(f),h.minf(f))},h.mdhd=function(f){var o=f.timescale,d=f.duration;return h.box(h.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,85,196,0,0]))},h.hdlr=function(f){var o=null;return f.type==="audio"?o=h.constants.HDLR_AUDIO:o=h.constants.HDLR_VIDEO,h.box(h.types.hdlr,o)},h.minf=function(f){var o=null;return f.type==="audio"?o=h.box(h.types.smhd,h.constants.SMHD):o=h.box(h.types.vmhd,h.constants.VMHD),h.box(h.types.minf,o,h.dinf(),h.stbl(f))},h.dinf=function(){var f=h.box(h.types.dinf,h.box(h.types.dref,h.constants.DREF));return f},h.stbl=function(f){var o=h.box(h.types.stbl,h.stsd(f),h.box(h.types.stts,h.constants.STTS),h.box(h.types.stsc,h.constants.STSC),h.box(h.types.stsz,h.constants.STSZ),h.box(h.types.stco,h.constants.STCO));return o},h.stsd=function(f){return f.type==="audio"?f.codec==="mp3"?h.box(h.types.stsd,h.constants.STSD_PREFIX,h.mp3(f)):h.box(h.types.stsd,h.constants.STSD_PREFIX,h.mp4a(f)):h.box(h.types.stsd,h.constants.STSD_PREFIX,h.avc1(f))},h.mp3=function(f){var o=f.channelCount,d=f.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,o,0,16,0,0,0,0,d>>>8&255,d&255,0,0]);return h.box(h.types[".mp3"],n)},h.mp4a=function(f){var o=f.channelCount,d=f.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,o,0,16,0,0,0,0,d>>>8&255,d&255,0,0]);return h.box(h.types.mp4a,n,h.esds(f))},h.esds=function(f){var o=f.config||[],d=o.length,n=new Uint8Array([0,0,0,0,3,23+d,0,1,0,4,15+d,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([d]).concat(o).concat([6,1,2]));return h.box(h.types.esds,n)},h.avc1=function(f){var o=f.avcc,d=f.codecWidth,n=f.codecHeight,l=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>>8&255,d&255,n>>>8&255,n&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return h.box(h.types.avc1,l,h.box(h.types.avcC,o))},h.mvex=function(f){return h.box(h.types.mvex,h.trex(f))},h.trex=function(f){var o=f.id,d=new Uint8Array([0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return h.box(h.types.trex,d)},h.moof=function(f,o){return h.box(h.types.moof,h.mfhd(f.sequenceNumber),h.traf(f,o))},h.mfhd=function(f){var o=new Uint8Array([0,0,0,0,f>>>24&255,f>>>16&255,f>>>8&255,f&255]);return h.box(h.types.mfhd,o)},h.traf=function(f,o){var d=f.id,n=h.box(h.types.tfhd,new Uint8Array([0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255])),l=h.box(h.types.tfdt,new Uint8Array([0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255])),a=h.sdtp(f),r=h.trun(f,a.byteLength+16+16+8+16+8+8);return h.box(h.types.traf,n,l,r,a)},h.sdtp=function(f){for(var o=f.samples||[],d=o.length,n=new Uint8Array(4+d),l=0;l<d;l++){var a=o[l].flags;n[l+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return h.box(h.types.sdtp,n)},h.trun=function(f,o){var d=f.samples||[],n=d.length,l=12+16*n,a=new Uint8Array(l);o+=8+l,a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,n&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255],0);for(var r=0;r<n;r++){var t=d[r].duration,s=d[r].size,i=d[r].flags,e=d[r].cts;a.set([t>>>24&255,t>>>16&255,t>>>8&255,t&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.isNonSync,0,0,e>>>24&255,e>>>16&255,e>>>8&255,e&255],12+16*r)}return h.box(h.types.trun,a)},h.mdat=function(f){return h.box(h.types.mdat,f)},h}();y.init(),S.default=y},"./src/remux/mp4-remuxer.js":function(I,S,p){p.r(S);var y=p("./src/utils/logger.js"),h=p("./src/remux/mp4-generator.js"),f=p("./src/remux/aac-silent.js"),o=p("./src/utils/browser.js"),d=p("./src/core/media-segment-info.js"),n=p("./src/utils/exception.js"),l=function(){function a(r){this.TAG="MP4Remuxer",this._config=r,this._isLive=r.isLive===!0,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 d.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new d.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(o.default.chrome&&(o.default.version.major<50||o.default.version.major===50&&o.default.version.build<2661)),this._fillSilentAfterSeek=o.default.msedge||o.default.msie,this._mp3UseMpegAudio=!o.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return a.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},a.prototype.bindDataSource=function(r){return r.onDataAvailable=this.remux.bind(this),r.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(a.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(r){this._onInitSegment=r},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(r){this._onMediaSegment=r},enumerable:!1,configurable:!0}),a.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},a.prototype.seek=function(r){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},a.prototype.remux=function(r,t){if(!this._onMediaSegment)throw new n.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(r,t),this._remuxVideo(t),this._remuxAudio(r)},a.prototype._onTrackMetadataReceived=function(r,t){var s=null,i="mp4",e=t.codec;if(r==="audio")this._audioMeta=t,t.codec==="mp3"&&this._mp3UseMpegAudio?(i="mpeg",e="",s=new Uint8Array):s=h.default.generateInitSegment(t);else if(r==="video")this._videoMeta=t,s=h.default.generateInitSegment(t);else return;if(!this._onInitSegment)throw new n.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(r,{type:r,data:s.buffer,codec:e,container:r+"/"+i,mediaDuration:t.duration})},a.prototype._calculateDtsBase=function(r,t){this._dtsBaseInited||(r.samples&&r.samples.length&&(this._audioDtsBase=r.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)},a.prototype.flushStashedSamples=function(){var r=this._videoStashedLastSample,t=this._audioStashedLastSample,s={type:"video",id:1,sequenceNumber:0,samples:[],length:0};r!=null&&(s.samples.push(r),s.length=r.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};t!=null&&(i.samples.push(t),i.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(s,!0),this._remuxAudio(i,!0)},a.prototype._remuxAudio=function(r,t){if(this._audioMeta!=null){var s=r,i=s.samples,e=void 0,u=-1,_=-1,c=this._audioMeta.refSampleDuration,v=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,E=this._dtsBaseInited&&this._audioNextDts===void 0,x=!1;if(!(!i||i.length===0)&&!(i.length===1&&!t)){var m=0,g=null,L=0;v?(m=0,L=s.length):(m=8,L=8+s.length);var R=null;if(i.length>1&&(R=i.pop(),L-=R.length),this._audioStashedLastSample!=null){var A=this._audioStashedLastSample;this._audioStashedLastSample=null,i.unshift(A),L+=A.length}R!=null&&(this._audioStashedLastSample=R);var T=i[0].dts-this._dtsBase;if(this._audioNextDts)e=T-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())e=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(x=!0);else{var B=this._audioSegmentInfoList.getLastSampleBefore(T);if(B!=null){var k=T-(B.originalDts+B.duration);k<=3&&(k=0);var P=B.dts+B.duration+k;e=T-P}else e=0}if(x){var j=T-e,W=this._videoSegmentInfoList.getLastSegmentBefore(T);if(W!=null&&W.beginDts<j){var M=f.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(M){var N=W.beginDts,q=j-W.beginDts;y.default.v(this.TAG,"InsertPrefixSilentAudio: dts: "+N+", duration: "+q),i.unshift({unit:M,dts:N,pts:N}),L+=M.byteLength}}else x=!1}for(var G=[],K=0;K<i.length;K++){var A=i[K],Z=A.unit,X=A.dts-this._dtsBase,N=X,Q=!1,re=null,V=0;if(!(X<-.001)){if(this._audioMeta.codec!=="mp3"){var w=X,J=3;if(this._audioNextDts&&(w=this._audioNextDts),e=X-w,e<=-J*c){y.default.w(this.TAG,"Dropping 1 audio frame (originalDts: "+X+" ms ,curRefDts: "+w+" ms) due to dtsCorrection: "+e+" ms overlap.");continue}else if(e>=J*c&&this._fillAudioTimestampGap&&!o.default.safari){Q=!0;var ee=Math.floor(e/c);y.default.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
9
+ `+("originalDts: "+X+" ms, curRefDts: "+w+" ms, ")+("dtsCorrection: "+Math.round(e)+" ms, generate: "+ee+" frames")),N=Math.floor(w),V=Math.floor(w+c)-N;var M=f.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);M==null&&(y.default.w(this.TAG,"Unable to generate silent frame for "+(this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame")),M=Z),re=[];for(var ae=0;ae<ee;ae++){w=w+c;var ie=Math.floor(w),oe=Math.floor(w+c)-ie,le={dts:ie,pts:ie,cts:0,unit:M,size:M.byteLength,duration:oe,originalDts:X,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};re.push(le),L+=le.size}this._audioNextDts=w+c}else N=Math.floor(w),V=Math.floor(w+c)-N,this._audioNextDts=w+c}else{if(N=X-e,K!==i.length-1){var fe=i[K+1].dts-this._dtsBase-e;V=fe-N}else if(R!=null){var fe=R.dts-this._dtsBase-e;V=fe-N}else G.length>=1?V=G[G.length-1].duration:V=Math.floor(c);this._audioNextDts=N+V}u===-1&&(u=N),G.push({dts:N,pts:N,cts:0,unit:A.unit,size:A.unit.byteLength,duration:V,originalDts:X,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Q&&G.push.apply(G,re)}}if(G.length===0){s.samples=[],s.length=0;return}v?g=new Uint8Array(L):(g=new Uint8Array(L),g[0]=L>>>24&255,g[1]=L>>>16&255,g[2]=L>>>8&255,g[3]=L&255,g.set(h.default.types.mdat,4));for(var K=0;K<G.length;K++){var Z=G[K].unit;g.set(Z,m),m+=Z.byteLength}var te=G[G.length-1];_=te.dts+te.duration;var $=new d.MediaSegmentInfo;$.beginDts=u,$.endDts=_,$.beginPts=u,$.endPts=_,$.originalBeginDts=G[0].originalDts,$.originalEndDts=te.originalDts+te.duration,$.firstSample=new d.SampleInfo(G[0].dts,G[0].pts,G[0].duration,G[0].originalDts,!1),$.lastSample=new d.SampleInfo(te.dts,te.pts,te.duration,te.originalDts,!1),this._isLive||this._audioSegmentInfoList.append($),s.samples=G,s.sequenceNumber++;var he=null;v?he=new Uint8Array:he=h.default.moof(s,u),s.samples=[],s.length=0;var ce={type:"audio",data:this._mergeBoxes(he,g).buffer,sampleCount:G.length,info:$};v&&E&&(ce.timestampOffset=u),this._onMediaSegment("audio",ce)}}},a.prototype._remuxVideo=function(r,t){if(this._videoMeta!=null){var s=r,i=s.samples,e=void 0,u=-1,_=-1,c=-1,v=-1;if(!(!i||i.length===0)&&!(i.length===1&&!t)){var E=8,x=null,m=8+r.length,g=null;if(i.length>1&&(g=i.pop(),m-=g.length),this._videoStashedLastSample!=null){var L=this._videoStashedLastSample;this._videoStashedLastSample=null,i.unshift(L),m+=L.length}g!=null&&(this._videoStashedLastSample=g);var R=i[0].dts-this._dtsBase;if(this._videoNextDts)e=R-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())e=0;else{var A=this._videoSegmentInfoList.getLastSampleBefore(R);if(A!=null){var T=R-(A.originalDts+A.duration);T<=3&&(T=0);var B=A.dts+A.duration+T;e=R-B}else e=0}for(var k=new d.MediaSegmentInfo,P=[],j=0;j<i.length;j++){var L=i[j],W=L.dts-this._dtsBase,M=L.isKeyframe,N=W-e,q=L.cts,G=N+q;u===-1&&(u=N,c=G);var K=0;if(j!==i.length-1){var Z=i[j+1].dts-this._dtsBase-e;K=Z-N}else if(g!=null){var Z=g.dts-this._dtsBase-e;K=Z-N}else P.length>=1?K=P[P.length-1].duration:K=Math.floor(this._videoMeta.refSampleDuration);if(M){var X=new d.SampleInfo(N,G,K,L.dts,!0);X.fileposition=L.fileposition,k.appendSyncPoint(X)}P.push({dts:N,pts:G,cts:q,units:L.units,size:L.length,isKeyframe:M,duration:K,originalDts:W,flags:{isLeading:0,dependsOn:M?2:1,isDependedOn:M?1:0,hasRedundancy:0,isNonSync:M?0:1}})}x=new Uint8Array(m),x[0]=m>>>24&255,x[1]=m>>>16&255,x[2]=m>>>8&255,x[3]=m&255,x.set(h.default.types.mdat,4);for(var j=0;j<P.length;j++)for(var Q=P[j].units;Q.length;){var re=Q.shift(),V=re.data;x.set(V,E),E+=V.byteLength}var w=P[P.length-1];if(_=w.dts+w.duration,v=w.pts+w.duration,this._videoNextDts=_,k.beginDts=u,k.endDts=_,k.beginPts=c,k.endPts=v,k.originalBeginDts=P[0].originalDts,k.originalEndDts=w.originalDts+w.duration,k.firstSample=new d.SampleInfo(P[0].dts,P[0].pts,P[0].duration,P[0].originalDts,P[0].isKeyframe),k.lastSample=new d.SampleInfo(w.dts,w.pts,w.duration,w.originalDts,w.isKeyframe),this._isLive||this._videoSegmentInfoList.append(k),s.samples=P,s.sequenceNumber++,this._forceFirstIDR){var J=P[0].flags;J.dependsOn=2,J.isNonSync=0}var ee=h.default.moof(s,u);s.samples=[],s.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(ee,x).buffer,sampleCount:P.length,info:k})}}},a.prototype._mergeBoxes=function(r,t){var s=new Uint8Array(r.byteLength+t.byteLength);return s.set(r,0),s.set(t,r.byteLength),s},a}();S.default=l},"./src/utils/browser.js":function(I,S,p){p.r(S);var y={};function h(){var f=self.navigator.userAgent.toLowerCase(),o=/(edge)\/([\w.]+)/.exec(f)||/(opr)[\/]([\w.]+)/.exec(f)||/(chrome)[ \/]([\w.]+)/.exec(f)||/(iemobile)[\/]([\w.]+)/.exec(f)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(f)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(f)||/(webkit)[ \/]([\w.]+)/.exec(f)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(f)||/(msie) ([\w.]+)/.exec(f)||f.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(f)||f.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(f)||[],d=/(ipad)/.exec(f)||/(ipod)/.exec(f)||/(windows phone)/.exec(f)||/(iphone)/.exec(f)||/(kindle)/.exec(f)||/(android)/.exec(f)||/(windows)/.exec(f)||/(mac)/.exec(f)||/(linux)/.exec(f)||/(cros)/.exec(f)||[],n={browser:o[5]||o[3]||o[1]||"",version:o[2]||o[4]||"0",majorVersion:o[4]||o[2]||"0",platform:d[0]||""},l={};if(n.browser){l[n.browser]=!0;var a=n.majorVersion.split(".");l.version={major:parseInt(n.majorVersion,10),string:n.version},a.length>1&&(l.version.minor=parseInt(a[1],10)),a.length>2&&(l.version.build=parseInt(a[2],10))}if(n.platform&&(l[n.platform]=!0),(l.chrome||l.opr||l.safari)&&(l.webkit=!0),l.rv||l.iemobile){l.rv&&delete l.rv;var r="msie";n.browser=r,l[r]=!0}if(l.edge){delete l.edge;var t="msedge";n.browser=t,l[t]=!0}if(l.opr){var s="opera";n.browser=s,l[s]=!0}if(l.safari&&l.android){var i="android";n.browser=i,l[i]=!0}l.name=n.browser,l.platform=n.platform;for(var e in y)y.hasOwnProperty(e)&&delete y[e];Object.assign(y,l)}h(),S.default=y},"./src/utils/exception.js":function(I,S,p){p.r(S),p.d(S,{RuntimeException:function(){return h},IllegalStateException:function(){return f},InvalidArgumentException:function(){return o},NotImplementedException:function(){return d}});var y=function(){var n=function(l,a){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])},n(l,a)};return function(l,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");n(l,a);function r(){this.constructor=l}l.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),h=function(){function n(l){this._message=l}return Object.defineProperty(n.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return this.name+": "+this.message},n}(),f=function(n){y(l,n);function l(a){return n.call(this,a)||this}return Object.defineProperty(l.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),l}(h),o=function(n){y(l,n);function l(a){return n.call(this,a)||this}return Object.defineProperty(l.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),l}(h),d=function(n){y(l,n);function l(a){return n.call(this,a)||this}return Object.defineProperty(l.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),l}(h)},"./src/utils/logger.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=function(){function o(){}return o.e=function(d,n){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var l="["+d+"] > "+n;o.ENABLE_CALLBACK&&o.emitter.emit("log","error",l),o.ENABLE_ERROR&&(console.error?console.error(l):console.warn?console.warn(l):console.log(l))},o.i=function(d,n){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var l="["+d+"] > "+n;o.ENABLE_CALLBACK&&o.emitter.emit("log","info",l),o.ENABLE_INFO&&(console.info?console.info(l):console.log(l))},o.w=function(d,n){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var l="["+d+"] > "+n;o.ENABLE_CALLBACK&&o.emitter.emit("log","warn",l),o.ENABLE_WARN&&(console.warn?console.warn(l):console.log(l))},o.d=function(d,n){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var l="["+d+"] > "+n;o.ENABLE_CALLBACK&&o.emitter.emit("log","debug",l),o.ENABLE_DEBUG&&(console.debug?console.debug(l):console.log(l))},o.v=function(d,n){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var l="["+d+"] > "+n;o.ENABLE_CALLBACK&&o.emitter.emit("log","verbose",l),o.ENABLE_VERBOSE&&console.log(l)},o}();f.GLOBAL_TAG="flv.js",f.FORCE_GLOBAL_TAG=!1,f.ENABLE_ERROR=!0,f.ENABLE_INFO=!0,f.ENABLE_WARN=!0,f.ENABLE_DEBUG=!0,f.ENABLE_VERBOSE=!0,f.ENABLE_CALLBACK=!1,f.emitter=new(h()),S.default=f},"./src/utils/logging-control.js":function(I,S,p){p.r(S);var y=p("./node_modules/events/events.js"),h=p.n(y),f=p("./src/utils/logger.js"),o=function(){function d(){}return Object.defineProperty(d,"forceGlobalTag",{get:function(){return f.default.FORCE_GLOBAL_TAG},set:function(n){f.default.FORCE_GLOBAL_TAG=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"globalTag",{get:function(){return f.default.GLOBAL_TAG},set:function(n){f.default.GLOBAL_TAG=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableAll",{get:function(){return f.default.ENABLE_VERBOSE&&f.default.ENABLE_DEBUG&&f.default.ENABLE_INFO&&f.default.ENABLE_WARN&&f.default.ENABLE_ERROR},set:function(n){f.default.ENABLE_VERBOSE=n,f.default.ENABLE_DEBUG=n,f.default.ENABLE_INFO=n,f.default.ENABLE_WARN=n,f.default.ENABLE_ERROR=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableDebug",{get:function(){return f.default.ENABLE_DEBUG},set:function(n){f.default.ENABLE_DEBUG=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableVerbose",{get:function(){return f.default.ENABLE_VERBOSE},set:function(n){f.default.ENABLE_VERBOSE=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableInfo",{get:function(){return f.default.ENABLE_INFO},set:function(n){f.default.ENABLE_INFO=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableWarn",{get:function(){return f.default.ENABLE_WARN},set:function(n){f.default.ENABLE_WARN=n,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableError",{get:function(){return f.default.ENABLE_ERROR},set:function(n){f.default.ENABLE_ERROR=n,d._notifyChange()},enumerable:!1,configurable:!0}),d.getConfig=function(){return{globalTag:f.default.GLOBAL_TAG,forceGlobalTag:f.default.FORCE_GLOBAL_TAG,enableVerbose:f.default.ENABLE_VERBOSE,enableDebug:f.default.ENABLE_DEBUG,enableInfo:f.default.ENABLE_INFO,enableWarn:f.default.ENABLE_WARN,enableError:f.default.ENABLE_ERROR,enableCallback:f.default.ENABLE_CALLBACK}},d.applyConfig=function(n){f.default.GLOBAL_TAG=n.globalTag,f.default.FORCE_GLOBAL_TAG=n.forceGlobalTag,f.default.ENABLE_VERBOSE=n.enableVerbose,f.default.ENABLE_DEBUG=n.enableDebug,f.default.ENABLE_INFO=n.enableInfo,f.default.ENABLE_WARN=n.enableWarn,f.default.ENABLE_ERROR=n.enableError,f.default.ENABLE_CALLBACK=n.enableCallback},d._notifyChange=function(){var n=d.emitter;if(n.listenerCount("change")>0){var l=d.getConfig();n.emit("change",l)}},d.registerListener=function(n){d.emitter.addListener("change",n)},d.removeListener=function(n){d.emitter.removeListener("change",n)},d.addLogListener=function(n){f.default.emitter.addListener("log",n),f.default.emitter.listenerCount("log")>0&&(f.default.ENABLE_CALLBACK=!0,d._notifyChange())},d.removeLogListener=function(n){f.default.emitter.removeListener("log",n),f.default.emitter.listenerCount("log")===0&&(f.default.ENABLE_CALLBACK=!1,d._notifyChange())},d}();o.emitter=new(h()),S.default=o},"./src/utils/polyfill.js":function(I,S,p){p.r(S);var y=function(){function h(){}return h.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(f,o){return f.__proto__=o,f},Object.assign=Object.assign||function(f){if(f==null)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(f),d=1;d<arguments.length;d++){var n=arguments[d];if(n!=null)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l])}return o},typeof self.Promise!="function"&&p("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},h}();y.install(),S.default=y},"./src/utils/utf8-conv.js":function(I,S,p){p.r(S);function y(f,o,d){var n=f;if(o+d<n.length){for(;d--;)if((n[++o]&192)!==128)return!1;return!0}else return!1}function h(f){for(var o=[],d=f,n=0,l=f.length;n<l;){if(d[n]<128){o.push(String.fromCharCode(d[n])),++n;continue}else if(!(d[n]<192)){if(d[n]<224){if(y(d,n,1)){var a=(d[n]&31)<<6|d[n+1]&63;if(a>=128){o.push(String.fromCharCode(a&65535)),n+=2;continue}}}else if(d[n]<240){if(y(d,n,2)){var a=(d[n]&15)<<12|(d[n+1]&63)<<6|d[n+2]&63;if(a>=2048&&(a&63488)!==55296){o.push(String.fromCharCode(a&65535)),n+=3;continue}}}else if(d[n]<248&&y(d,n,3)){var a=(d[n]&7)<<18|(d[n+1]&63)<<12|(d[n+2]&63)<<6|d[n+3]&63;if(a>65536&&a<1114112){a-=65536,o.push(String.fromCharCode(a>>>10|55296)),o.push(String.fromCharCode(a&1023|56320)),n+=4;continue}}}o.push(String.fromCharCode(65533)),++n}return o.join("")}S.default=h}},ue={};function z(I){var S=ue[I];if(S!==void 0)return S.exports;var p=ue[I]={exports:{}};return se[I].call(p.exports,p,p.exports,z),p.exports}z.m=se,function(){z.n=function(I){var S=I&&I.__esModule?function(){return I.default}:function(){return I};return z.d(S,{a:S}),S}}(),function(){z.d=function(I,S){for(var p in S)z.o(S,p)&&!z.o(I,p)&&Object.defineProperty(I,p,{enumerable:!0,get:S[p]})}}(),function(){z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()}(),function(){z.o=function(I,S){return Object.prototype.hasOwnProperty.call(I,S)}}(),function(){z.r=function(I){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})}}();var _e=z("./src/index.js");return _e}()})})(Ae);const Ze=Ie(Ae.exports),$e=We("<span></span>"),ft=()=>{var d,n,l;const{pathname:ve,searchParams:Ee}=De(),{proxyLink:se}=we(),ue=Me();let z=ne.objs.filter(a=>a.type===Ke.VIDEO);z.length===0&&(z=[ne.obj]);const _e=()=>{const a=z.findIndex(r=>r.name===ne.obj.name);a<z.length-1&&ue(Le(be(location.pathname),z[a+1].name)+"?auto_fullscreen="+S.fullscreen)},I=()=>{const a=z.findIndex(r=>r.name===ne.obj.name);a>0&&ue(Le(be(location.pathname),z[a-1].name)+"?auto_fullscreen="+S.fullscreen)};let S,p={id:ve(),container:"#video-player",url:ne.raw_url,title:ne.obj.name,volume:.5,autoplay:Pe("video_autoplay"),autoSize:!1,autoMini:!0,loop:!1,flip:!0,playbackRate:!0,aspectRatio:!0,setting:!0,hotkey:!0,pip:!0,mutex:!0,fullscreen:!0,fullscreenWeb:!0,subtitleOffset:!0,miniProgressBar:!1,playsInline:!0,controls:[{name:"previous-button",index:10,position:"left",html:'<svg fill="none" stroke-width="2" xmlns="http://www.w3.org/2000/svg" height="22" width="22" class="icon icon-tabler icon-tabler-player-track-prev-filled" width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" style="overflow: visible; color: currentcolor;"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M20.341 4.247l-8 7a1 1 0 0 0 0 1.506l8 7c.647 .565 1.659 .106 1.659 -.753v-14c0 -.86 -1.012 -1.318 -1.659 -.753z" stroke-width="0" fill="currentColor"></path><path d="M9.341 4.247l-8 7a1 1 0 0 0 0 1.506l8 7c.647 .565 1.659 .106 1.659 -.753v-14c0 -.86 -1.012 -1.318 -1.659 -.753z" stroke-width="0" fill="currentColor"></path></svg>',tooltip:"Previous",click:function(){I()}},{name:"next-button",index:11,position:"left",html:'<svg fill="none" stroke-width="2" xmlns="http://www.w3.org/2000/svg" height="22" width="22" class="icon icon-tabler icon-tabler-player-track-next-filled" width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" style="overflow: visible; color: currentcolor;"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M2 5v14c0 .86 1.012 1.318 1.659 .753l8 -7a1 1 0 0 0 0 -1.506l-8 -7c-.647 -.565 -1.659 -.106 -1.659 .753z" stroke-width="0" fill="currentColor"></path><path d="M13 5v14c0 .86 1.012 1.318 1.659 .753l8 -7a1 1 0 0 0 0 -1.506l-8 -7c-.647 -.565 -1.659 -.106 -1.659 .753z" stroke-width="0" fill="currentColor"></path></svg>',tooltip:"Next",click:function(){_e()}}],quality:[],plugins:[ze],whitelist:[],settings:[],moreVideoAttr:{"webkit-playsinline":!0,playsInline:!0},type:me(ne.obj.name),customType:{flv:function(a,r){const t=Ze.createPlayer({type:"flv",url:r},{referrerPolicy:"same-origin"});t.attachMediaElement(a),t.load()},m3u8:function(a,r){const t=new Ye;t.loadSource(r),t.attachMedia(a),a.src||(a.src=r)}},lang:["en","zh-cn","zh-tw"].includes(ye().toLowerCase())?ye().toLowerCase():"en",lock:!0,fastForward:!0,autoPlayback:!0,autoOrientation:!0,airplay:!0};const y=ne.related.filter(a=>{for(const r of[".srt",".ass",".vtt"])if(a.name.endsWith(r))return!0;return!1}),h=ne.related.find(a=>{for(const r of[".xml"])if(a.name.endsWith(r))return!0;return!1});if(y.length!=0){let s=function(i){switch(a?"ass":"webvtt"){case"ass":S.subtitle.show=!1,S.emit("artplayer-plugin-ass:visible",i);break;case"webvtt":default:S.subtitle.show=i,S.emit("artplayer-plugin-ass:visible",!1);break}},a=!1;const r=y[0];me(r.name).toLowerCase()==="ass"?(a=!0,(d=p.plugins)==null||d.push(Qe({subUrl:se(r,!0)}))):p.subtitle={url:se(r,!0),type:me(r.name)};const t=[{id:"setting_subtitle_display",html:"Display",tooltip:"Show",switch:!0,onSwitch:function(i){var u;i.tooltip=i.switch?"Hide":"Show",s(!i.switch);const e=(u=p.settings)==null?void 0:u.find(_=>_.id==="setting_subtitle");return e&&(e.tooltip=i.tooltip),!i.switch}}];y.forEach((i,e)=>{t.push({default:e===0,html:(()=>{const u=$e.cloneNode(!0);return u.style.setProperty("max-width","200px"),u.style.setProperty("overflow","hidden"),u.style.setProperty("text-overflow","ellipsis"),u.style.setProperty("word-break","break-all"),u.style.setProperty("white-space","normal"),u.style.setProperty("display","-webkit-box"),u.style.setProperty("-webkit-line-clamp","2"),u.style.setProperty("-webkit-box-orient","vertical"),u.style.setProperty("font-size","12px"),Fe(u,()=>i.name),Be(()=>ke(u,"title",i.name)),u})(),name:i.name,url:se(i,!0)})}),(n=p.settings)==null||n.push({id:"setting_subtitle",html:"Subtitle",tooltip:"Show",icon:Ve({size:24}),selector:t,onSelect:function(i){var u,_;me(i.name).toLowerCase()==="ass"?(a=!0,this.emit("artplayer-plugin-ass:switch",i.url),s(!0)):(a=!1,this.subtitle.switch(i.url,{name:i.name}),this.once("subtitleLoad",s.bind(this,!0)));const e=t.find(c=>c.id==="setting_subtitle_display");return e&&!e.switch&&((_=(u=e.$html)==null?void 0:u.click)==null||_.call(u)),e==null?void 0:e.tooltip}})}h&&((l=p.plugins)==null||l.push(Je({danmuku:se(h,!0),speed:5,opacity:1,fontSize:25,color:"#FFFFFF",mode:0,margin:[0,"0%"],antiOverlap:!1,useWorker:!0,synchronousPlayback:!1,lockTime:5,maxLength:100,minWidth:200,maxWidth:400,theme:"dark",heatmap:!0}))),Ue(()=>{S=new He(p);let a;switch(Ee.auto_fullscreen){case"true":a=!0;case"false":a=!1;default:a=!1}S.on("ready",()=>{S.fullscreen=a}),S.on("video:ended",()=>{!f()||_e()})}),je(()=>{S==null||S.destroy()});const[f,o]=Ne();return Se(Xe,{onAutoNextChange:o,get children(){return Se(Ge,{w:"$full",h:"60vh",id:"video-player"})}})};export{ft as default};