@das-fed/upf-ui 6.4.0-dev.215 → 6.4.0-dev.216
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.
- package/package.json +5 -5
- package/packages/business-components/ai-panel/index-B4pMosXu.js +143 -0
- package/packages/business-components/ai-panel/index-B4pMosXu.js.gz +0 -0
- package/packages/business-components/ai-panel/{index-BybM3Q9u.js → index-BgyMyjJo.js} +711 -700
- package/packages/business-components/ai-panel/index-BgyMyjJo.js.gz +0 -0
- package/packages/business-components/ai-panel/{index-CwdJKHy0.js → index-Bw7rNZmA.js} +9 -9
- package/packages/business-components/ai-panel/index-Bw7rNZmA.js.gz +0 -0
- package/packages/business-components/ai-panel/index.js +1 -1
- package/packages/business-components/device-panel/index.js +8873 -8773
- package/packages/business-components/device-panel/index.js.gz +0 -0
- package/packages/business-components/echarts/index.js +2056 -2049
- package/packages/business-components/echarts/index.js.gz +0 -0
- package/packages/business-components/process-configuration/index.js +50 -50
- package/packages/business-components/process-configuration/index.js.gz +0 -0
- package/packages/business-components/process-form/index.js +149 -149
- package/packages/business-components/process-form/index.js.gz +0 -0
- package/packages/business-components/process-search-form/index.js +60 -60
- package/packages/business-components/process-search-form/index.js.gz +0 -0
- package/packages/business-components/process-table/index.js +130 -128
- package/packages/business-components/process-table/index.js.gz +0 -0
- package/packages/business-components/urgent-panel/index.js +904 -896
- package/packages/business-components/urgent-panel/index.js.gz +0 -0
- package/packages/business-components/user-org-dialog/index.js +249 -246
- package/packages/business-components/user-org-dialog/index.js.gz +0 -0
- package/packages/business-components/video-dialog/index.js +1 -0
- package/packages/business-components/video-dialog/index.js.gz +0 -0
- package/packages/components/autocomplete/index.js +12 -6
- package/packages/components/autocomplete/index.js.gz +0 -0
- package/packages/components/calendar/index.js +104 -104
- package/packages/components/calendar/index.js.gz +0 -0
- package/packages/components/cascader/index.js +27 -27
- package/packages/components/cascader/index.js.gz +0 -0
- package/packages/components/checkbox/index.js +54 -54
- package/packages/components/checkbox/index.js.gz +0 -0
- package/packages/components/date-picker/index.js +459 -459
- package/packages/components/date-picker/index.js.gz +0 -0
- package/packages/components/dimple-layout/index.js +63 -61
- package/packages/components/dimple-layout/index.js.gz +0 -0
- package/packages/components/dropdown/index.js +23 -22
- package/packages/components/dropdown/index.js.gz +0 -0
- package/packages/components/edit-table/index.js +224 -223
- package/packages/components/edit-table/index.js.gz +0 -0
- package/packages/components/error-overlay-model/index.js +44 -42
- package/packages/components/error-overlay-model/index.js.gz +0 -0
- package/packages/components/form-item/index.js +67 -63
- package/packages/components/form-item/index.js.gz +0 -0
- package/packages/components/image-viewer/index.js +32 -32
- package/packages/components/image-viewer/index.js.gz +0 -0
- package/packages/components/input/index.js +51 -51
- package/packages/components/input/index.js.gz +0 -0
- package/packages/components/input-number/index.js +44 -44
- package/packages/components/input-number/index.js.gz +0 -0
- package/packages/components/live-player/index.js +834 -832
- package/packages/components/live-player/index.js.gz +0 -0
- package/packages/components/map/index.js +437 -431
- package/packages/components/map/index.js.gz +0 -0
- package/packages/components/menu-aside/index.js +1 -1
- package/packages/components/menu-aside/index.js.gz +0 -0
- package/packages/components/message/index.js +6 -6
- package/packages/components/message/index.js.gz +0 -0
- package/packages/components/radio-tabs/index.js +33 -33
- package/packages/components/radio-tabs/index.js.gz +0 -0
- package/packages/components/rich-editor/index.js +4586 -4556
- package/packages/components/rich-editor/index.js.gz +0 -0
- package/packages/components/scrollbar/index.js +135 -135
- package/packages/components/scrollbar/index.js.gz +0 -0
- package/packages/components/search/index.js +2 -2
- package/packages/components/search/index.js.gz +0 -0
- package/packages/components/select/index.js +92 -92
- package/packages/components/select/index.js.gz +0 -0
- package/packages/components/select-list/index.js +10 -6
- package/packages/components/select-list/index.js.gz +0 -0
- package/packages/components/special-range-picker-month/index.js +16 -14
- package/packages/components/special-range-picker-month/index.js.gz +0 -0
- package/packages/components/special-range-picker-year/index.js +53 -51
- package/packages/components/special-range-picker-year/index.js.gz +0 -0
- package/packages/components/spin/index.js +35 -35
- package/packages/components/spin/index.js.gz +0 -0
- package/packages/components/split-panel/index.js +102 -101
- package/packages/components/split-panel/index.js.gz +0 -0
- package/packages/components/table/index.js +604 -599
- package/packages/components/table/index.js.gz +0 -0
- package/packages/components/time-line/index.js +1 -1
- package/packages/components/time-line/index.js.gz +0 -0
- package/packages/components/tree/index.js +182 -173
- package/packages/components/tree/index.js.gz +0 -0
- package/packages/components/tree-select/index.js +81 -81
- package/packages/components/tree-select/index.js.gz +0 -0
- package/packages/components/tree-table/index.js +2 -2
- package/packages/components/tree-table/index.js.gz +0 -0
- package/packages/components/tree-v2/index.js +1240 -1208
- package/packages/components/tree-v2/index.js.gz +0 -0
- package/packages/business-components/ai-panel/index-BybM3Q9u.js.gz +0 -0
- package/packages/business-components/ai-panel/index-CgWRv2Ge.js +0 -142
- package/packages/business-components/ai-panel/index-CgWRv2Ge.js.gz +0 -0
- package/packages/business-components/ai-panel/index-CwdJKHy0.js.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@das-fed/upf-ui/packages/components/live-player/style.css';
|
|
2
|
-
import { defineComponent as Yt, useCssVars as Jt, toRefs as Zt, computed as ot, ref as Xe, onMounted as $t, onBeforeUnmount as Qt, withDirectives as ei, openBlock as dt, createElementBlock as ut, unref as We, normalizeStyle as ti, renderSlot as ii, createTextVNode as ri, toDisplayString as
|
|
3
|
-
import { withInstall as
|
|
2
|
+
import { defineComponent as Yt, useCssVars as Jt, toRefs as Zt, computed as ot, ref as Xe, onMounted as $t, onBeforeUnmount as Qt, withDirectives as ei, openBlock as dt, createElementBlock as ut, unref as We, normalizeStyle as ti, renderSlot as ii, createTextVNode as ri, toDisplayString as ai } from "vue";
|
|
3
|
+
import { withInstall as ni } from "@das-fed/upf-utils/with-install/index";
|
|
4
4
|
import { ElLoadingDirective as si } from "element-plus/es";
|
|
5
5
|
import "element-plus/es/components/base/style/css";
|
|
6
6
|
import "element-plus/es/components/loading/style/css";
|
|
@@ -15,56 +15,56 @@ var Tt = { exports: {} };
|
|
|
15
15
|
})(window, function() {
|
|
16
16
|
return function(fe) {
|
|
17
17
|
var Z = {};
|
|
18
|
-
function O(
|
|
19
|
-
if (Z[
|
|
20
|
-
var B = Z[
|
|
21
|
-
return fe[
|
|
18
|
+
function O(x) {
|
|
19
|
+
if (Z[x]) return Z[x].exports;
|
|
20
|
+
var B = Z[x] = { i: x, l: !1, exports: {} };
|
|
21
|
+
return fe[x].call(B.exports, B, B.exports, O), B.l = !0, B.exports;
|
|
22
22
|
}
|
|
23
|
-
return O.m = fe, O.c = Z, O.d = function(
|
|
24
|
-
O.o(
|
|
25
|
-
}, O.r = function(
|
|
26
|
-
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(
|
|
27
|
-
}, O.t = function(
|
|
28
|
-
if (1 & B && (
|
|
23
|
+
return O.m = fe, O.c = Z, O.d = function(x, B, m) {
|
|
24
|
+
O.o(x, B) || Object.defineProperty(x, B, { enumerable: !0, get: m });
|
|
25
|
+
}, O.r = function(x) {
|
|
26
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(x, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(x, "__esModule", { value: !0 });
|
|
27
|
+
}, O.t = function(x, B) {
|
|
28
|
+
if (1 & B && (x = O(x)), 8 & B || 4 & B && typeof x == "object" && x && x.__esModule) return x;
|
|
29
29
|
var m = /* @__PURE__ */ Object.create(null);
|
|
30
|
-
if (O.r(m), Object.defineProperty(m, "default", { enumerable: !0, value:
|
|
31
|
-
return
|
|
30
|
+
if (O.r(m), Object.defineProperty(m, "default", { enumerable: !0, value: x }), 2 & B && typeof x != "string") for (var b in x) O.d(m, b, (function(y) {
|
|
31
|
+
return x[y];
|
|
32
32
|
}).bind(null, b));
|
|
33
33
|
return m;
|
|
34
|
-
}, O.n = function(
|
|
35
|
-
var B =
|
|
36
|
-
return
|
|
34
|
+
}, O.n = function(x) {
|
|
35
|
+
var B = x && x.__esModule ? function() {
|
|
36
|
+
return x.default;
|
|
37
37
|
} : function() {
|
|
38
|
-
return
|
|
38
|
+
return x;
|
|
39
39
|
};
|
|
40
40
|
return O.d(B, "a", B), B;
|
|
41
|
-
}, O.o = function(
|
|
42
|
-
return Object.prototype.hasOwnProperty.call(
|
|
41
|
+
}, O.o = function(x, B) {
|
|
42
|
+
return Object.prototype.hasOwnProperty.call(x, B);
|
|
43
43
|
}, O.p = "", O(O.s = 14);
|
|
44
44
|
}([function(fe, Z, O) {
|
|
45
|
-
var
|
|
45
|
+
var x = O(6), B = O.n(x), m = function() {
|
|
46
46
|
function b() {
|
|
47
47
|
}
|
|
48
48
|
return b.e = function(y, f) {
|
|
49
49
|
y && !b.FORCE_GLOBAL_TAG || (y = b.GLOBAL_TAG);
|
|
50
|
-
var
|
|
51
|
-
b.ENABLE_CALLBACK && b.emitter.emit("log", "error",
|
|
50
|
+
var k = "[" + y + "] > " + f;
|
|
51
|
+
b.ENABLE_CALLBACK && b.emitter.emit("log", "error", k), b.ENABLE_ERROR && (console.error ? console.error(k) : console.warn ? console.warn(k) : console.log(k));
|
|
52
52
|
}, b.i = function(y, f) {
|
|
53
53
|
y && !b.FORCE_GLOBAL_TAG || (y = b.GLOBAL_TAG);
|
|
54
|
-
var
|
|
55
|
-
b.ENABLE_CALLBACK && b.emitter.emit("log", "info",
|
|
54
|
+
var k = "[" + y + "] > " + f;
|
|
55
|
+
b.ENABLE_CALLBACK && b.emitter.emit("log", "info", k), b.ENABLE_INFO && (console.info ? console.info(k) : console.log(k));
|
|
56
56
|
}, b.w = function(y, f) {
|
|
57
57
|
y && !b.FORCE_GLOBAL_TAG || (y = b.GLOBAL_TAG);
|
|
58
|
-
var
|
|
59
|
-
b.ENABLE_CALLBACK && b.emitter.emit("log", "warn",
|
|
58
|
+
var k = "[" + y + "] > " + f;
|
|
59
|
+
b.ENABLE_CALLBACK && b.emitter.emit("log", "warn", k), b.ENABLE_WARN && (console.warn ? console.warn(k) : console.log(k));
|
|
60
60
|
}, b.d = function(y, f) {
|
|
61
61
|
y && !b.FORCE_GLOBAL_TAG || (y = b.GLOBAL_TAG);
|
|
62
|
-
var
|
|
63
|
-
b.ENABLE_CALLBACK && b.emitter.emit("log", "debug",
|
|
62
|
+
var k = "[" + y + "] > " + f;
|
|
63
|
+
b.ENABLE_CALLBACK && b.emitter.emit("log", "debug", k), b.ENABLE_DEBUG && (console.debug ? console.debug(k) : console.log(k));
|
|
64
64
|
}, b.v = function(y, f) {
|
|
65
65
|
y && !b.FORCE_GLOBAL_TAG || (y = b.GLOBAL_TAG);
|
|
66
|
-
var
|
|
67
|
-
b.ENABLE_CALLBACK && b.emitter.emit("log", "verbose",
|
|
66
|
+
var k = "[" + y + "] > " + f;
|
|
67
|
+
b.ENABLE_CALLBACK && b.emitter.emit("log", "verbose", k), b.ENABLE_VERBOSE && console.log(k);
|
|
68
68
|
}, b;
|
|
69
69
|
}();
|
|
70
70
|
m.GLOBAL_TAG = "mpegts.js", m.FORCE_GLOBAL_TAG = !1, m.ENABLE_ERROR = !0, m.ENABLE_INFO = !0, m.ENABLE_WARN = !0, m.ENABLE_DEBUG = !0, m.ENABLE_VERBOSE = !0, m.ENABLE_CALLBACK = !1, m.emitter = new B.a(), Z.a = m;
|
|
@@ -78,7 +78,7 @@ var Tt = { exports: {} };
|
|
|
78
78
|
}), O.d(Z, "a", function() {
|
|
79
79
|
return b;
|
|
80
80
|
});
|
|
81
|
-
var
|
|
81
|
+
var x = O(3), B = { kIdle: 0, kConnecting: 1, kBuffering: 2, kError: 3, kComplete: 4 }, m = { OK: "OK", EXCEPTION: "Exception", HTTP_STATUS_CODE_INVALID: "HttpStatusCodeInvalid", CONNECTING_TIMEOUT: "ConnectingTimeout", EARLY_EOF: "EarlyEof", UNRECOVERABLE_EARLY_EOF: "UnrecoverableEarlyEof" }, b = function() {
|
|
82
82
|
function y(f) {
|
|
83
83
|
this._type = f || "undefined", this._status = B.kIdle, this._needStash = !1, this._onContentLengthKnown = null, this._onURLRedirect = null, this._onDataArrival = null, this._onError = null, this._onComplete = null;
|
|
84
84
|
}
|
|
@@ -112,10 +112,10 @@ var Tt = { exports: {} };
|
|
|
112
112
|
return this._onComplete;
|
|
113
113
|
}, set: function(f) {
|
|
114
114
|
this._onComplete = f;
|
|
115
|
-
}, enumerable: !1, configurable: !0 }), y.prototype.open = function(f,
|
|
116
|
-
throw new
|
|
115
|
+
}, enumerable: !1, configurable: !0 }), y.prototype.open = function(f, k) {
|
|
116
|
+
throw new x.c("Unimplemented abstract function!");
|
|
117
117
|
}, y.prototype.abort = function() {
|
|
118
|
-
throw new
|
|
118
|
+
throw new x.c("Unimplemented abstract function!");
|
|
119
119
|
}, y;
|
|
120
120
|
}();
|
|
121
121
|
}, function(fe, Z, O) {
|
|
@@ -128,70 +128,70 @@ var Tt = { exports: {} };
|
|
|
128
128
|
}), O.d(Z, "c", function() {
|
|
129
129
|
return f;
|
|
130
130
|
});
|
|
131
|
-
var
|
|
132
|
-
return (
|
|
131
|
+
var x, B = (x = function(k, U) {
|
|
132
|
+
return (x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(C, V) {
|
|
133
133
|
C.__proto__ = V;
|
|
134
134
|
} || function(C, V) {
|
|
135
135
|
for (var H in V) V.hasOwnProperty(H) && (C[H] = V[H]);
|
|
136
|
-
})(
|
|
137
|
-
}, function(
|
|
136
|
+
})(k, U);
|
|
137
|
+
}, function(k, U) {
|
|
138
138
|
function C() {
|
|
139
|
-
this.constructor =
|
|
139
|
+
this.constructor = k;
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
x(k, U), k.prototype = U === null ? Object.create(U) : (C.prototype = U.prototype, new C());
|
|
142
142
|
}), m = function() {
|
|
143
|
-
function
|
|
144
|
-
this._message =
|
|
143
|
+
function k(U) {
|
|
144
|
+
this._message = U;
|
|
145
145
|
}
|
|
146
|
-
return Object.defineProperty(
|
|
146
|
+
return Object.defineProperty(k.prototype, "name", { get: function() {
|
|
147
147
|
return "RuntimeException";
|
|
148
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
148
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(k.prototype, "message", { get: function() {
|
|
149
149
|
return this._message;
|
|
150
|
-
}, enumerable: !1, configurable: !0 }),
|
|
150
|
+
}, enumerable: !1, configurable: !0 }), k.prototype.toString = function() {
|
|
151
151
|
return this.name + ": " + this.message;
|
|
152
|
-
},
|
|
153
|
-
}(), b = function(
|
|
154
|
-
function
|
|
155
|
-
return
|
|
152
|
+
}, k;
|
|
153
|
+
}(), b = function(k) {
|
|
154
|
+
function U(C) {
|
|
155
|
+
return k.call(this, C) || this;
|
|
156
156
|
}
|
|
157
|
-
return B(
|
|
157
|
+
return B(U, k), Object.defineProperty(U.prototype, "name", { get: function() {
|
|
158
158
|
return "IllegalStateException";
|
|
159
|
-
}, enumerable: !1, configurable: !0 }),
|
|
160
|
-
}(m), y = function(
|
|
161
|
-
function
|
|
162
|
-
return
|
|
159
|
+
}, enumerable: !1, configurable: !0 }), U;
|
|
160
|
+
}(m), y = function(k) {
|
|
161
|
+
function U(C) {
|
|
162
|
+
return k.call(this, C) || this;
|
|
163
163
|
}
|
|
164
|
-
return B(
|
|
164
|
+
return B(U, k), Object.defineProperty(U.prototype, "name", { get: function() {
|
|
165
165
|
return "InvalidArgumentException";
|
|
166
|
-
}, enumerable: !1, configurable: !0 }),
|
|
167
|
-
}(m), f = function(
|
|
168
|
-
function
|
|
169
|
-
return
|
|
166
|
+
}, enumerable: !1, configurable: !0 }), U;
|
|
167
|
+
}(m), f = function(k) {
|
|
168
|
+
function U(C) {
|
|
169
|
+
return k.call(this, C) || this;
|
|
170
170
|
}
|
|
171
|
-
return B(
|
|
171
|
+
return B(U, k), Object.defineProperty(U.prototype, "name", { get: function() {
|
|
172
172
|
return "NotImplementedException";
|
|
173
|
-
}, enumerable: !1, configurable: !0 }),
|
|
173
|
+
}, enumerable: !1, configurable: !0 }), U;
|
|
174
174
|
}(m);
|
|
175
175
|
}, function(fe, Z, O) {
|
|
176
|
-
var
|
|
176
|
+
var x = {};
|
|
177
177
|
(function() {
|
|
178
178
|
var B = self.navigator.userAgent.toLowerCase(), m = /(edge)\/([\w.]+)/.exec(B) || /(opr)[\/]([\w.]+)/.exec(B) || /(chrome)[ \/]([\w.]+)/.exec(B) || /(iemobile)[\/]([\w.]+)/.exec(B) || /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(B) || /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(B) || /(webkit)[ \/]([\w.]+)/.exec(B) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(B) || /(msie) ([\w.]+)/.exec(B) || B.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(B) || B.indexOf("compatible") < 0 && /(firefox)[ \/]([\w.]+)/.exec(B) || [], b = /(ipad)/.exec(B) || /(ipod)/.exec(B) || /(windows phone)/.exec(B) || /(iphone)/.exec(B) || /(kindle)/.exec(B) || /(android)/.exec(B) || /(windows)/.exec(B) || /(mac)/.exec(B) || /(linux)/.exec(B) || /(cros)/.exec(B) || [], y = { browser: m[5] || m[3] || m[1] || "", version: m[2] || m[4] || "0", majorVersion: m[4] || m[2] || "0", platform: b[0] || "" }, f = {};
|
|
179
179
|
if (y.browser) {
|
|
180
180
|
f[y.browser] = !0;
|
|
181
|
-
var
|
|
182
|
-
f.version = { major: parseInt(y.majorVersion, 10), string: y.version },
|
|
181
|
+
var k = y.majorVersion.split(".");
|
|
182
|
+
f.version = { major: parseInt(y.majorVersion, 10), string: y.version }, k.length > 1 && (f.version.minor = parseInt(k[1], 10)), k.length > 2 && (f.version.build = parseInt(k[2], 10));
|
|
183
183
|
}
|
|
184
184
|
y.platform && (f[y.platform] = !0), (f.chrome || f.opr || f.safari) && (f.webkit = !0), (f.rv || f.iemobile) && (f.rv && delete f.rv, y.browser = "msie", f.msie = !0), f.edge && (delete f.edge, y.browser = "msedge", f.msedge = !0), f.opr && (y.browser = "opera", f.opera = !0), f.safari && f.android && (y.browser = "android", f.android = !0);
|
|
185
|
-
for (var
|
|
186
|
-
Object.assign(
|
|
187
|
-
})(), Z.a =
|
|
185
|
+
for (var U in f.name = y.browser, f.platform = y.platform, x) x.hasOwnProperty(U) && delete x[U];
|
|
186
|
+
Object.assign(x, f);
|
|
187
|
+
})(), Z.a = x;
|
|
188
188
|
}, function(fe, Z, O) {
|
|
189
189
|
Z.a = { OK: "OK", FORMAT_ERROR: "FormatError", FORMAT_UNSUPPORTED: "FormatUnsupported", CODEC_UNSUPPORTED: "CodecUnsupported" };
|
|
190
190
|
}, function(fe, Z, O) {
|
|
191
|
-
var
|
|
191
|
+
var x, B = typeof Reflect == "object" ? Reflect : null, m = B && typeof B.apply == "function" ? B.apply : function(v, G, T) {
|
|
192
192
|
return Function.prototype.apply.call(v, G, T);
|
|
193
193
|
};
|
|
194
|
-
|
|
194
|
+
x = B && typeof B.ownKeys == "function" ? B.ownKeys : Object.getOwnPropertySymbols ? function(v) {
|
|
195
195
|
return Object.getOwnPropertyNames(v).concat(Object.getOwnPropertySymbols(v));
|
|
196
196
|
} : function(v) {
|
|
197
197
|
return Object.getOwnPropertyNames(v);
|
|
@@ -210,25 +210,25 @@ var Tt = { exports: {} };
|
|
|
210
210
|
function _() {
|
|
211
211
|
typeof v.removeListener == "function" && v.removeListener("error", u), T([].slice.call(arguments));
|
|
212
212
|
}
|
|
213
|
-
|
|
214
|
-
typeof c.on == "function" &&
|
|
213
|
+
ae(v, G, _, { once: !0 }), G !== "error" && function(c, P, D) {
|
|
214
|
+
typeof c.on == "function" && ae(c, "error", P, D);
|
|
215
215
|
}(v, u, { once: !0 });
|
|
216
216
|
});
|
|
217
217
|
}, y.EventEmitter = y, y.prototype._events = void 0, y.prototype._eventsCount = 0, y.prototype._maxListeners = void 0;
|
|
218
218
|
var f = 10;
|
|
219
|
-
function
|
|
219
|
+
function k(v) {
|
|
220
220
|
if (typeof v != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof v);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function U(v) {
|
|
223
223
|
return v._maxListeners === void 0 ? y.defaultMaxListeners : v._maxListeners;
|
|
224
224
|
}
|
|
225
225
|
function C(v, G, T, l) {
|
|
226
226
|
var u, _, c, P;
|
|
227
|
-
if (
|
|
228
|
-
else if (typeof c == "function" ? c = _[G] = l ? [T, c] : [c, T] : l ? c.unshift(T) : c.push(T), (u =
|
|
227
|
+
if (k(T), (_ = v._events) === void 0 ? (_ = v._events = /* @__PURE__ */ Object.create(null), v._eventsCount = 0) : (_.newListener !== void 0 && (v.emit("newListener", G, T.listener ? T.listener : T), _ = v._events), c = _[G]), c === void 0) c = _[G] = T, ++v._eventsCount;
|
|
228
|
+
else if (typeof c == "function" ? c = _[G] = l ? [T, c] : [c, T] : l ? c.unshift(T) : c.push(T), (u = U(v)) > 0 && c.length > u && !c.warned) {
|
|
229
229
|
c.warned = !0;
|
|
230
230
|
var D = new Error("Possible EventEmitter memory leak detected. " + c.length + " " + String(G) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
231
|
-
D.name = "MaxListenersExceededWarning", D.emitter = v, D.type = G, D.count = c.length, P = D;
|
|
231
|
+
D.name = "MaxListenersExceededWarning", D.emitter = v, D.type = G, D.count = c.length, P = D, console && console.warn && console.warn(P);
|
|
232
232
|
}
|
|
233
233
|
return v;
|
|
234
234
|
}
|
|
@@ -261,7 +261,7 @@ var Tt = { exports: {} };
|
|
|
261
261
|
for (var T = new Array(G), l = 0; l < G; ++l) T[l] = v[l];
|
|
262
262
|
return T;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function ae(v, G, T, l) {
|
|
265
265
|
if (typeof v.on == "function") l.once ? v.once(G, T) : v.on(G, T);
|
|
266
266
|
else {
|
|
267
267
|
if (typeof v.addEventListener != "function") throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof v);
|
|
@@ -281,7 +281,7 @@ var Tt = { exports: {} };
|
|
|
281
281
|
if (typeof v != "number" || v < 0 || b(v)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + v + ".");
|
|
282
282
|
return this._maxListeners = v, this;
|
|
283
283
|
}, y.prototype.getMaxListeners = function() {
|
|
284
|
-
return
|
|
284
|
+
return U(this);
|
|
285
285
|
}, y.prototype.emit = function(v) {
|
|
286
286
|
for (var G = [], T = 1; T < arguments.length; T++) G.push(arguments[T]);
|
|
287
287
|
var l = v === "error", u = this._events;
|
|
@@ -306,12 +306,12 @@ var Tt = { exports: {} };
|
|
|
306
306
|
}, y.prototype.on = y.prototype.addListener, y.prototype.prependListener = function(v, G) {
|
|
307
307
|
return C(this, v, G, !0);
|
|
308
308
|
}, y.prototype.once = function(v, G) {
|
|
309
|
-
return
|
|
309
|
+
return k(G), this.on(v, H(this, v, G)), this;
|
|
310
310
|
}, y.prototype.prependOnceListener = function(v, G) {
|
|
311
|
-
return
|
|
311
|
+
return k(G), this.prependListener(v, H(this, v, G)), this;
|
|
312
312
|
}, y.prototype.removeListener = function(v, G) {
|
|
313
313
|
var T, l, u, _, c;
|
|
314
|
-
if (
|
|
314
|
+
if (k(G), (l = this._events) === void 0) return this;
|
|
315
315
|
if ((T = l[v]) === void 0) return this;
|
|
316
316
|
if (T === G || T.listener === G) --this._eventsCount == 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete l[v], l.removeListener && this.emit("removeListener", v, T.listener || G));
|
|
317
317
|
else if (typeof T != "function") {
|
|
@@ -345,11 +345,11 @@ var Tt = { exports: {} };
|
|
|
345
345
|
}, y.listenerCount = function(v, G) {
|
|
346
346
|
return typeof v.listenerCount == "function" ? v.listenerCount(G) : se.call(v, G);
|
|
347
347
|
}, y.prototype.listenerCount = se, y.prototype.eventNames = function() {
|
|
348
|
-
return this._eventsCount > 0 ?
|
|
348
|
+
return this._eventsCount > 0 ? x(this._events) : [];
|
|
349
349
|
};
|
|
350
350
|
}, function(fe, Z, O) {
|
|
351
351
|
O.d(Z, "d", function() {
|
|
352
|
-
return
|
|
352
|
+
return x;
|
|
353
353
|
}), O.d(Z, "b", function() {
|
|
354
354
|
return B;
|
|
355
355
|
}), O.d(Z, "a", function() {
|
|
@@ -357,8 +357,8 @@ var Tt = { exports: {} };
|
|
|
357
357
|
}), O.d(Z, "c", function() {
|
|
358
358
|
return b;
|
|
359
359
|
});
|
|
360
|
-
var
|
|
361
|
-
this.dts = y, this.pts = f, this.duration =
|
|
360
|
+
var x = function(y, f, k, U, C) {
|
|
361
|
+
this.dts = y, this.pts = f, this.duration = k, this.originalDts = U, this.isSyncPoint = C, this.fileposition = null;
|
|
362
362
|
}, B = function() {
|
|
363
363
|
function y() {
|
|
364
364
|
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;
|
|
@@ -373,19 +373,19 @@ var Tt = { exports: {} };
|
|
|
373
373
|
return y.prototype.clear = function() {
|
|
374
374
|
this._list = [];
|
|
375
375
|
}, y.prototype.appendArray = function(f) {
|
|
376
|
-
var
|
|
377
|
-
f.length !== 0 && (
|
|
376
|
+
var k = this._list;
|
|
377
|
+
f.length !== 0 && (k.length > 0 && f[0].originalDts < k[k.length - 1].originalDts && this.clear(), Array.prototype.push.apply(k, f));
|
|
378
378
|
}, y.prototype.getLastSyncPointBeforeDts = function(f) {
|
|
379
379
|
if (this._list.length == 0) return null;
|
|
380
|
-
var
|
|
381
|
-
for (f <
|
|
382
|
-
if ((V = H + Math.floor((ue - H) / 2)) === C || f >=
|
|
383
|
-
|
|
380
|
+
var k = this._list, U = 0, C = k.length - 1, V = 0, H = 0, ue = C;
|
|
381
|
+
for (f < k[0].dts && (U = 0, H = ue + 1); H <= ue; ) {
|
|
382
|
+
if ((V = H + Math.floor((ue - H) / 2)) === C || f >= k[V].dts && f < k[V + 1].dts) {
|
|
383
|
+
U = V;
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
|
-
|
|
386
|
+
k[V].dts < f ? H = V + 1 : ue = V - 1;
|
|
387
387
|
}
|
|
388
|
-
return this._list[
|
|
388
|
+
return this._list[U];
|
|
389
389
|
}, y;
|
|
390
390
|
}(), b = function() {
|
|
391
391
|
function y(f) {
|
|
@@ -400,36 +400,36 @@ var Tt = { exports: {} };
|
|
|
400
400
|
}, y.prototype.clear = function() {
|
|
401
401
|
this._list = [], this._lastAppendLocation = -1;
|
|
402
402
|
}, y.prototype._searchNearestSegmentBefore = function(f) {
|
|
403
|
-
var
|
|
404
|
-
if (
|
|
405
|
-
var
|
|
406
|
-
if (f <
|
|
403
|
+
var k = this._list;
|
|
404
|
+
if (k.length === 0) return -2;
|
|
405
|
+
var U = k.length - 1, C = 0, V = 0, H = U, ue = 0;
|
|
406
|
+
if (f < k[0].originalBeginDts) return ue = -1;
|
|
407
407
|
for (; V <= H; ) {
|
|
408
|
-
if ((C = V + Math.floor((H - V) / 2)) ===
|
|
408
|
+
if ((C = V + Math.floor((H - V) / 2)) === U || f > k[C].lastSample.originalDts && f < k[C + 1].originalBeginDts) {
|
|
409
409
|
ue = C;
|
|
410
410
|
break;
|
|
411
411
|
}
|
|
412
|
-
|
|
412
|
+
k[C].originalBeginDts < f ? V = C + 1 : H = C - 1;
|
|
413
413
|
}
|
|
414
414
|
return ue;
|
|
415
415
|
}, y.prototype._searchNearestSegmentAfter = function(f) {
|
|
416
416
|
return this._searchNearestSegmentBefore(f) + 1;
|
|
417
417
|
}, y.prototype.append = function(f) {
|
|
418
|
-
var
|
|
419
|
-
C !== -1 && C <
|
|
418
|
+
var k = this._list, U = f, C = this._lastAppendLocation, V = 0;
|
|
419
|
+
C !== -1 && C < k.length && U.originalBeginDts >= k[C].lastSample.originalDts && (C === k.length - 1 || C < k.length - 1 && U.originalBeginDts < k[C + 1].originalBeginDts) ? V = C + 1 : k.length > 0 && (V = this._searchNearestSegmentBefore(U.originalBeginDts) + 1), this._lastAppendLocation = V, this._list.splice(V, 0, U);
|
|
420
420
|
}, y.prototype.getLastSegmentBefore = function(f) {
|
|
421
|
-
var
|
|
422
|
-
return
|
|
421
|
+
var k = this._searchNearestSegmentBefore(f);
|
|
422
|
+
return k >= 0 ? this._list[k] : null;
|
|
423
423
|
}, y.prototype.getLastSampleBefore = function(f) {
|
|
424
|
-
var
|
|
425
|
-
return
|
|
424
|
+
var k = this.getLastSegmentBefore(f);
|
|
425
|
+
return k != null ? k.lastSample : null;
|
|
426
426
|
}, y.prototype.getLastSyncPointBefore = function(f) {
|
|
427
|
-
for (var
|
|
428
|
-
return
|
|
427
|
+
for (var k = this._searchNearestSegmentBefore(f), U = this._list[k].syncPoints; U.length === 0 && k > 0; ) k--, U = this._list[k].syncPoints;
|
|
428
|
+
return U.length > 0 ? U[U.length - 1] : null;
|
|
429
429
|
}, y;
|
|
430
430
|
}();
|
|
431
431
|
}, function(fe, Z, O) {
|
|
432
|
-
var
|
|
432
|
+
var x = function() {
|
|
433
433
|
function B() {
|
|
434
434
|
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;
|
|
435
435
|
}
|
|
@@ -443,20 +443,20 @@ var Tt = { exports: {} };
|
|
|
443
443
|
var b = this.keyframesIndex, y = this._search(b.times, m);
|
|
444
444
|
return { index: y, milliseconds: b.times[y], fileposition: b.filepositions[y] };
|
|
445
445
|
}, B.prototype._search = function(m, b) {
|
|
446
|
-
var y = 0, f = m.length - 1,
|
|
447
|
-
for (b < m[0] && (y = 0,
|
|
448
|
-
if ((
|
|
449
|
-
y =
|
|
446
|
+
var y = 0, f = m.length - 1, k = 0, U = 0, C = f;
|
|
447
|
+
for (b < m[0] && (y = 0, U = C + 1); U <= C; ) {
|
|
448
|
+
if ((k = U + Math.floor((C - U) / 2)) === f || b >= m[k] && b < m[k + 1]) {
|
|
449
|
+
y = k;
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
|
-
m[
|
|
452
|
+
m[k] < b ? U = k + 1 : C = k - 1;
|
|
453
453
|
}
|
|
454
454
|
return y;
|
|
455
455
|
}, B;
|
|
456
456
|
}();
|
|
457
|
-
Z.a =
|
|
457
|
+
Z.a = x;
|
|
458
458
|
}, function(fe, Z, O) {
|
|
459
|
-
var
|
|
459
|
+
var x = O(6), B = O.n(x), m = O(0), b = function() {
|
|
460
460
|
function y() {
|
|
461
461
|
}
|
|
462
462
|
return Object.defineProperty(y, "forceGlobalTag", { get: function() {
|
|
@@ -498,8 +498,8 @@ var Tt = { exports: {} };
|
|
|
498
498
|
}, y._notifyChange = function() {
|
|
499
499
|
var f = y.emitter;
|
|
500
500
|
if (f.listenerCount("change") > 0) {
|
|
501
|
-
var
|
|
502
|
-
f.emit("change",
|
|
501
|
+
var k = y.getConfig();
|
|
502
|
+
f.emit("change", k);
|
|
503
503
|
}
|
|
504
504
|
}, y.registerListener = function(f) {
|
|
505
505
|
y.emitter.addListener("change", f);
|
|
@@ -513,7 +513,7 @@ var Tt = { exports: {} };
|
|
|
513
513
|
}();
|
|
514
514
|
b.emitter = new B.a(), Z.a = b;
|
|
515
515
|
}, function(fe, Z, O) {
|
|
516
|
-
var
|
|
516
|
+
var x = O(6), B = O.n(x), m = O(0), b = O(4), y = O(8);
|
|
517
517
|
function f(r, t, i) {
|
|
518
518
|
var e = r;
|
|
519
519
|
if (t + i < e.length) {
|
|
@@ -522,8 +522,8 @@ var Tt = { exports: {} };
|
|
|
522
522
|
}
|
|
523
523
|
return !1;
|
|
524
524
|
}
|
|
525
|
-
var
|
|
526
|
-
for (var t = [], i = r, e = 0,
|
|
525
|
+
var k, U = function(r) {
|
|
526
|
+
for (var t = [], i = r, e = 0, a = r.length; e < a; ) if (i[e] < 128) t.push(String.fromCharCode(i[e])), ++e;
|
|
527
527
|
else {
|
|
528
528
|
if (!(i[e] < 192)) {
|
|
529
529
|
if (i[e] < 224) {
|
|
@@ -547,96 +547,96 @@ var Tt = { exports: {} };
|
|
|
547
547
|
t.push("�"), ++e;
|
|
548
548
|
}
|
|
549
549
|
return t.join("");
|
|
550
|
-
}, C = O(3), V = (
|
|
550
|
+
}, C = O(3), V = (k = new ArrayBuffer(2), new DataView(k).setInt16(0, 256, !0), new Int16Array(k)[0] === 256), H = function() {
|
|
551
551
|
function r() {
|
|
552
552
|
}
|
|
553
553
|
return r.parseScriptData = function(t, i, e) {
|
|
554
|
-
var
|
|
554
|
+
var a = {};
|
|
555
555
|
try {
|
|
556
|
-
var s = r.parseValue(t, i, e),
|
|
557
|
-
|
|
556
|
+
var s = r.parseValue(t, i, e), n = r.parseValue(t, i + s.size, e - s.size);
|
|
557
|
+
a[s.data] = n.data;
|
|
558
558
|
} catch (o) {
|
|
559
559
|
m.a.e("AMF", o.toString());
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return a;
|
|
562
562
|
}, r.parseObject = function(t, i, e) {
|
|
563
563
|
if (e < 3) throw new C.a("Data not enough when parse ScriptDataObject");
|
|
564
|
-
var
|
|
565
|
-
return { data: { name:
|
|
564
|
+
var a = r.parseString(t, i, e), s = r.parseValue(t, i + a.size, e - a.size), n = s.objectEnd;
|
|
565
|
+
return { data: { name: a.data, value: s.data }, size: a.size + s.size, objectEnd: n };
|
|
566
566
|
}, r.parseVariable = function(t, i, e) {
|
|
567
567
|
return r.parseObject(t, i, e);
|
|
568
568
|
}, r.parseString = function(t, i, e) {
|
|
569
569
|
if (e < 2) throw new C.a("Data not enough when parse String");
|
|
570
|
-
var
|
|
571
|
-
return { data:
|
|
570
|
+
var a = new DataView(t, i, e).getUint16(0, !V);
|
|
571
|
+
return { data: a > 0 ? U(new Uint8Array(t, i + 2, a)) : "", size: 2 + a };
|
|
572
572
|
}, r.parseLongString = function(t, i, e) {
|
|
573
573
|
if (e < 4) throw new C.a("Data not enough when parse LongString");
|
|
574
|
-
var
|
|
575
|
-
return { data:
|
|
574
|
+
var a = new DataView(t, i, e).getUint32(0, !V);
|
|
575
|
+
return { data: a > 0 ? U(new Uint8Array(t, i + 4, a)) : "", size: 4 + a };
|
|
576
576
|
}, r.parseDate = function(t, i, e) {
|
|
577
577
|
if (e < 10) throw new C.a("Data size invalid when parse Date");
|
|
578
|
-
var
|
|
579
|
-
return { data: new Date(s += 60 *
|
|
578
|
+
var a = new DataView(t, i, e), s = a.getFloat64(0, !V), n = a.getInt16(8, !V);
|
|
579
|
+
return { data: new Date(s += 60 * n * 1e3), size: 10 };
|
|
580
580
|
}, r.parseValue = function(t, i, e) {
|
|
581
581
|
if (e < 1) throw new C.a("Data not enough when parse Value");
|
|
582
|
-
var
|
|
582
|
+
var a, s = new DataView(t, i, e), n = 1, o = s.getUint8(0), p = !1;
|
|
583
583
|
try {
|
|
584
584
|
switch (o) {
|
|
585
585
|
case 0:
|
|
586
|
-
|
|
586
|
+
a = s.getFloat64(1, !V), n += 8;
|
|
587
587
|
break;
|
|
588
588
|
case 1:
|
|
589
|
-
|
|
589
|
+
a = !!s.getUint8(1), n += 1;
|
|
590
590
|
break;
|
|
591
591
|
case 2:
|
|
592
592
|
var g = r.parseString(t, i + 1, e - 1);
|
|
593
|
-
|
|
593
|
+
a = g.data, n += g.size;
|
|
594
594
|
break;
|
|
595
595
|
case 3:
|
|
596
|
-
|
|
596
|
+
a = {};
|
|
597
597
|
var E = 0;
|
|
598
|
-
for ((16777215 & s.getUint32(e - 4, !V)) == 9 && (E = 3);
|
|
599
|
-
var A = r.parseObject(t, i +
|
|
598
|
+
for ((16777215 & s.getUint32(e - 4, !V)) == 9 && (E = 3); n < e - 4; ) {
|
|
599
|
+
var A = r.parseObject(t, i + n, e - n - E);
|
|
600
600
|
if (A.objectEnd) break;
|
|
601
|
-
|
|
601
|
+
a[A.data.name] = A.data.value, n += A.size;
|
|
602
602
|
}
|
|
603
|
-
|
|
603
|
+
n <= e - 3 && (16777215 & s.getUint32(n - 1, !V)) === 9 && (n += 3);
|
|
604
604
|
break;
|
|
605
605
|
case 8:
|
|
606
|
-
for (
|
|
607
|
-
var S = r.parseVariable(t, i +
|
|
606
|
+
for (a = {}, n += 4, E = 0, (16777215 & s.getUint32(e - 4, !V)) == 9 && (E = 3); n < e - 8; ) {
|
|
607
|
+
var S = r.parseVariable(t, i + n, e - n - E);
|
|
608
608
|
if (S.objectEnd) break;
|
|
609
|
-
|
|
609
|
+
a[S.data.name] = S.data.value, n += S.size;
|
|
610
610
|
}
|
|
611
|
-
|
|
611
|
+
n <= e - 3 && (16777215 & s.getUint32(n - 1, !V)) === 9 && (n += 3);
|
|
612
612
|
break;
|
|
613
613
|
case 9:
|
|
614
|
-
|
|
614
|
+
a = void 0, n = 1, p = !0;
|
|
615
615
|
break;
|
|
616
616
|
case 10:
|
|
617
|
-
|
|
617
|
+
a = [];
|
|
618
618
|
var w = s.getUint32(1, !V);
|
|
619
|
-
|
|
619
|
+
n += 4;
|
|
620
620
|
for (var I = 0; I < w; I++) {
|
|
621
|
-
var z = r.parseValue(t, i +
|
|
622
|
-
|
|
621
|
+
var z = r.parseValue(t, i + n, e - n);
|
|
622
|
+
a.push(z.data), n += z.size;
|
|
623
623
|
}
|
|
624
624
|
break;
|
|
625
625
|
case 11:
|
|
626
626
|
var N = r.parseDate(t, i + 1, e - 1);
|
|
627
|
-
|
|
627
|
+
a = N.data, n += N.size;
|
|
628
628
|
break;
|
|
629
629
|
case 12:
|
|
630
630
|
var J = r.parseString(t, i + 1, e - 1);
|
|
631
|
-
|
|
631
|
+
a = J.data, n += J.size;
|
|
632
632
|
break;
|
|
633
633
|
default:
|
|
634
|
-
|
|
634
|
+
n = e, m.a.w("AMF", "Unsupported AMF value type " + o);
|
|
635
635
|
}
|
|
636
636
|
} catch (W) {
|
|
637
637
|
m.a.e("AMF", W.toString());
|
|
638
638
|
}
|
|
639
|
-
return { data:
|
|
639
|
+
return { data: a, size: n, objectEnd: p };
|
|
640
640
|
}, r;
|
|
641
641
|
}(), ue = function() {
|
|
642
642
|
function r(t) {
|
|
@@ -657,10 +657,10 @@ var Tt = { exports: {} };
|
|
|
657
657
|
}
|
|
658
658
|
var e = this._current_word_bits_left ? this._current_word : 0;
|
|
659
659
|
e >>>= 32 - this._current_word_bits_left;
|
|
660
|
-
var
|
|
660
|
+
var a = t - this._current_word_bits_left;
|
|
661
661
|
this._fillCurrentWord();
|
|
662
|
-
var s = Math.min(
|
|
663
|
-
return this._current_word <<= s, this._current_word_bits_left -= s, e = e << s |
|
|
662
|
+
var s = Math.min(a, this._current_word_bits_left), n = this._current_word >>> 32 - s;
|
|
663
|
+
return this._current_word <<= s, this._current_word_bits_left -= s, e = e << s | n;
|
|
664
664
|
}, r.prototype.readBool = function() {
|
|
665
665
|
return this.readBits(1) === 1;
|
|
666
666
|
}, r.prototype.readByte = function() {
|
|
@@ -680,14 +680,14 @@ var Tt = { exports: {} };
|
|
|
680
680
|
function r() {
|
|
681
681
|
}
|
|
682
682
|
return r._ebsp2rbsp = function(t) {
|
|
683
|
-
for (var i = t, e = i.byteLength,
|
|
684
|
-
return new Uint8Array(
|
|
683
|
+
for (var i = t, e = i.byteLength, a = new Uint8Array(e), s = 0, n = 0; n < e; n++) n >= 2 && i[n] === 3 && i[n - 1] === 0 && i[n - 2] === 0 || (a[s] = i[n], s++);
|
|
684
|
+
return new Uint8Array(a.buffer, 0, s);
|
|
685
685
|
}, r.parseSPS = function(t) {
|
|
686
|
-
for (var i = t.subarray(1, 4), e = "avc1.",
|
|
687
|
-
var s = i[
|
|
686
|
+
for (var i = t.subarray(1, 4), e = "avc1.", a = 0; a < 3; a++) {
|
|
687
|
+
var s = i[a].toString(16);
|
|
688
688
|
s.length < 2 && (s = "0" + s), e += s;
|
|
689
689
|
}
|
|
690
|
-
var
|
|
690
|
+
var n = r._ebsp2rbsp(t), o = new ue(n);
|
|
691
691
|
o.readByte();
|
|
692
692
|
var p = o.readByte();
|
|
693
693
|
o.readByte();
|
|
@@ -707,8 +707,8 @@ var Tt = { exports: {} };
|
|
|
707
707
|
o.readBits(1);
|
|
708
708
|
var he = o.readUEG(), K = o.readUEG(), Q = o.readBits(1);
|
|
709
709
|
Q === 0 && o.readBits(1), o.readBits(1);
|
|
710
|
-
var _e = 0, te = 0,
|
|
711
|
-
o.readBool() && (_e = o.readUEG(), te = o.readUEG(),
|
|
710
|
+
var _e = 0, te = 0, ne = 0, be = 0;
|
|
711
|
+
o.readBool() && (_e = o.readUEG(), te = o.readUEG(), ne = o.readUEG(), be = o.readUEG());
|
|
712
712
|
var Ae = 1, le = 1, ve = 0, Re = !0, ke = 0, Ne = 0;
|
|
713
713
|
if (o.readBool()) {
|
|
714
714
|
if (o.readBool()) {
|
|
@@ -725,11 +725,11 @@ var Tt = { exports: {} };
|
|
|
725
725
|
var Ce = 0, ge = 0;
|
|
726
726
|
S === 0 ? (Ce = 1, ge = 2 - Q) : (Ce = S === 3 ? 1 : 2, ge = (S === 1 ? 2 : 1) * (2 - Q));
|
|
727
727
|
var xe = 16 * (he + 1), Ue = 16 * (K + 1) * (2 - Q);
|
|
728
|
-
xe -= (_e + te) * Ce, Ue -= (
|
|
728
|
+
xe -= (_e + te) * Ce, Ue -= (ne + be) * ge;
|
|
729
729
|
var Je = Math.ceil(xe * Fe);
|
|
730
730
|
return o.destroy(), o = null, { codec_mimetype: e, profile_idc: p, level_idc: g, profile_string: E, level_string: A, chroma_format_idc: S, bit_depth: I, bit_depth_luma: I, bit_depth_chroma: z, ref_frames: de, chroma_format: w, chroma_format_string: r.getChromaFormatString(w), frame_rate: { fixed: Re, fps: ve, fps_den: Ne, fps_num: ke }, sar_ratio: { width: Ae, height: le }, codec_size: { width: xe, height: Ue }, present_size: { width: Je, height: Ue } };
|
|
731
731
|
}, r._skipScalingList = function(t, i) {
|
|
732
|
-
for (var e = 8,
|
|
732
|
+
for (var e = 8, a = 8, s = 0; s < i; s++) a !== 0 && (a = (e + t.readSEG() + 256) % 256), e = a === 0 ? e : a;
|
|
733
733
|
}, r.getProfileString = function(t) {
|
|
734
734
|
switch (t) {
|
|
735
735
|
case 66:
|
|
@@ -763,26 +763,26 @@ var Tt = { exports: {} };
|
|
|
763
763
|
return "Unknown";
|
|
764
764
|
}
|
|
765
765
|
}, r;
|
|
766
|
-
}(), Y = O(5),
|
|
766
|
+
}(), Y = O(5), ae = function() {
|
|
767
767
|
function r() {
|
|
768
768
|
}
|
|
769
769
|
return r._ebsp2rbsp = function(t) {
|
|
770
|
-
for (var i = t, e = i.byteLength,
|
|
771
|
-
return new Uint8Array(
|
|
770
|
+
for (var i = t, e = i.byteLength, a = new Uint8Array(e), s = 0, n = 0; n < e; n++) n >= 2 && i[n] === 3 && i[n - 1] === 0 && i[n - 2] === 0 || (a[s] = i[n], s++);
|
|
771
|
+
return new Uint8Array(a.buffer, 0, s);
|
|
772
772
|
}, r.parseVPS = function(t) {
|
|
773
773
|
var i = r._ebsp2rbsp(t), e = new ue(i);
|
|
774
774
|
return e.readByte(), e.readByte(), e.readBits(4), e.readBits(2), e.readBits(6), { num_temporal_layers: e.readBits(3) + 1, temporal_id_nested: e.readBool() };
|
|
775
775
|
}, r.parseSPS = function(t) {
|
|
776
776
|
var i = r._ebsp2rbsp(t), e = new ue(i);
|
|
777
777
|
e.readByte(), e.readByte();
|
|
778
|
-
for (var
|
|
778
|
+
for (var a = 0, s = 0, n = 0, o = 0, p = (e.readBits(4), e.readBits(3)), g = (e.readBool(), e.readBits(2)), E = e.readBool(), A = e.readBits(5), S = e.readByte(), w = e.readByte(), I = e.readByte(), z = e.readByte(), N = e.readByte(), J = e.readByte(), W = e.readByte(), q = e.readByte(), de = e.readByte(), he = e.readByte(), K = e.readByte(), Q = [], _e = [], te = 0; te < p; te++) Q.push(e.readBool()), _e.push(e.readBool());
|
|
779
779
|
if (p > 0) for (te = p; te < 8; te++) e.readBits(2);
|
|
780
780
|
for (te = 0; te < p; te++) Q[te] && (e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte(), e.readByte()), _e[te] && e.readByte();
|
|
781
781
|
e.readUEG();
|
|
782
|
-
var
|
|
783
|
-
|
|
782
|
+
var ne = e.readUEG();
|
|
783
|
+
ne == 3 && e.readBits(1);
|
|
784
784
|
var be = e.readUEG(), Ae = e.readUEG();
|
|
785
|
-
e.readBool() && (
|
|
785
|
+
e.readBool() && (a += e.readUEG(), s += e.readUEG(), n += e.readUEG(), o += e.readUEG());
|
|
786
786
|
var le = e.readUEG(), ve = e.readUEG(), Re = e.readUEG();
|
|
787
787
|
for (te = e.readBool() ? 0 : p; te <= p; te++) e.readUEG(), e.readUEG(), e.readUEG();
|
|
788
788
|
if (e.readUEG(), e.readUEG(), e.readUEG(), e.readUEG(), e.readUEG(), e.readUEG(), e.readBool() && e.readBool()) for (var ke = 0; ke < 4; ke++) for (var Ne = 0; Ne < (ke === 3 ? 2 : 6); Ne++)
|
|
@@ -821,27 +821,27 @@ var Tt = { exports: {} };
|
|
|
821
821
|
Ke > 0 && Ke <= 16 ? (He = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2][Ke - 1], qe = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1][Ke - 1]) : Ke === 255 && (He = e.readBits(16), qe = e.readBits(16));
|
|
822
822
|
}
|
|
823
823
|
if (e.readBool() && e.readBool(), e.readBool() && (e.readBits(3), e.readBool(), e.readBool() && (e.readByte(), e.readByte(), e.readByte())), e.readBool() && (e.readUEG(), e.readUEG()), e.readBool(), e.readBool(), e.readBool(), e.readBool() && (e.readUEG(), e.readUEG(), e.readUEG(), e.readUEG()), e.readBool() && (it = e.readBits(32), rt = e.readBits(32), e.readBool() && (e.readUEG(), e.readBool()))) {
|
|
824
|
-
var
|
|
825
|
-
for (
|
|
824
|
+
var at = !1, nt = !1, Ze = !1;
|
|
825
|
+
for (at = e.readBool(), nt = e.readBool(), (at || nt) && ((Ze = e.readBool()) && (e.readByte(), e.readBits(5), e.readBool(), e.readBits(5)), e.readBits(4), e.readBits(4), Ze && e.readBits(4), e.readBits(5), e.readBits(5), e.readBits(5)), te = 0; te <= p; te++) {
|
|
826
826
|
var gt = e.readBool();
|
|
827
827
|
mt = gt;
|
|
828
828
|
var yt = !1, st = 1;
|
|
829
829
|
gt || (yt = e.readBool());
|
|
830
830
|
var vt = !1;
|
|
831
|
-
if (yt ? e.readSEG() : vt = e.readBool(), vt || (st = e.readUEG() + 1),
|
|
832
|
-
if (
|
|
831
|
+
if (yt ? e.readSEG() : vt = e.readBool(), vt || (st = e.readUEG() + 1), at) for (ge = 0; ge < st; ge++) e.readUEG(), e.readUEG(), Ze && (e.readUEG(), e.readUEG());
|
|
832
|
+
if (nt) for (ge = 0; ge < st; ge++) e.readUEG(), e.readUEG(), Ze && (e.readUEG(), e.readUEG());
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
e.readBool() && (e.readBool(), e.readBool(), e.readBool(), pt = e.readUEG(), e.readUEG(), e.readUEG(), e.readUEG(), e.readUEG());
|
|
836
836
|
}
|
|
837
837
|
e.readBool();
|
|
838
|
-
var Xt = "hvc1." + A + ".1.L" + K + ".B0", bt = be - (
|
|
839
|
-
return He !== 1 && qe !== 1 && (Et = He / qe), e.destroy(), e = null, { codec_mimetype: Xt, level_string: r.getLevelString(K), profile_idc: A, bit_depth: le + 8, ref_frames: 1, chroma_format:
|
|
838
|
+
var Xt = "hvc1." + A + ".1.L" + K + ".B0", bt = be - (a + s) * (ne === 1 || ne === 2 ? 2 : 1), St = Ae - (n + o) * (ne === 1 ? 2 : 1), Et = 1;
|
|
839
|
+
return He !== 1 && qe !== 1 && (Et = He / qe), e.destroy(), e = null, { codec_mimetype: Xt, level_string: r.getLevelString(K), profile_idc: A, bit_depth: le + 8, ref_frames: 1, chroma_format: ne, chroma_format_string: r.getChromaFormatString(ne), general_level_idc: K, general_profile_space: g, general_tier_flag: E, general_profile_idc: A, general_profile_compatibility_flags_1: S, general_profile_compatibility_flags_2: w, general_profile_compatibility_flags_3: I, general_profile_compatibility_flags_4: z, general_constraint_indicator_flags_1: N, general_constraint_indicator_flags_2: J, general_constraint_indicator_flags_3: W, general_constraint_indicator_flags_4: q, general_constraint_indicator_flags_5: de, general_constraint_indicator_flags_6: he, min_spatial_segmentation_idc: pt, constant_frame_rate: 0, chroma_format_idc: ne, bit_depth_luma_minus8: le, bit_depth_chroma_minus8: ve, frame_rate: { fixed: mt, fps: rt / it, fps_den: it, fps_num: rt }, sar_ratio: { width: He, height: qe }, codec_size: { width: bt, height: St }, present_size: { width: bt * Et, height: St } };
|
|
840
840
|
}, r.parsePPS = function(t) {
|
|
841
841
|
var i = r._ebsp2rbsp(t), e = new ue(i);
|
|
842
842
|
e.readByte(), e.readByte(), e.readUEG(), e.readUEG(), e.readBool(), e.readBool(), e.readBits(3), e.readBool(), e.readBool(), e.readUEG(), e.readUEG(), e.readSEG(), e.readBool(), e.readBool(), e.readBool() && e.readUEG(), e.readSEG(), e.readSEG(), e.readBool(), e.readBool(), e.readBool(), e.readBool();
|
|
843
|
-
var
|
|
844
|
-
return s &&
|
|
843
|
+
var a = e.readBool(), s = e.readBool(), n = 1;
|
|
844
|
+
return s && a ? n = 0 : s ? n = 3 : a && (n = 2), { parallelismType: n };
|
|
845
845
|
}, r.getChromaFormatString = function(t) {
|
|
846
846
|
switch (t) {
|
|
847
847
|
case 0:
|
|
@@ -906,8 +906,8 @@ var Tt = { exports: {} };
|
|
|
906
906
|
if (i.byteLength < 9) return { needMoreData: !0 };
|
|
907
907
|
var e = { match: !1 };
|
|
908
908
|
if (i[0] !== 70 || i[1] !== 76 || i[2] !== 86 || i[3] !== 1) return e;
|
|
909
|
-
var
|
|
910
|
-
return p < 9 ? e : { match: !0, consumed: p, dataOffset: p, hasAudioTrack:
|
|
909
|
+
var a, s, n = (4 & i[4]) >>> 2 != 0, o = (1 & i[4]) != 0, p = (a = i)[s = 5] << 24 | a[s + 1] << 16 | a[s + 2] << 8 | a[s + 3];
|
|
910
|
+
return p < 9 ? e : { match: !0, consumed: p, dataOffset: p, hasAudioTrack: n, hasVideoTrack: o };
|
|
911
911
|
}, r.prototype.bindDataSource = function(t) {
|
|
912
912
|
return t.onDataArrival = this.parseChunks.bind(this), this;
|
|
913
913
|
}, Object.defineProperty(r.prototype, "onTrackMetadata", { get: function() {
|
|
@@ -952,22 +952,22 @@ var Tt = { exports: {} };
|
|
|
952
952
|
return this._hasAudio && this._hasVideo ? this._audioInitialMetadataDispatched && this._videoInitialMetadataDispatched : this._hasAudio && !this._hasVideo ? this._audioInitialMetadataDispatched : !(this._hasAudio || !this._hasVideo) && this._videoInitialMetadataDispatched;
|
|
953
953
|
}, r.prototype.parseChunks = function(t, i) {
|
|
954
954
|
if (!(this._onError && this._onMediaInfo && this._onTrackMetadata && this._onDataAvailable)) throw new C.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");
|
|
955
|
-
var e = 0,
|
|
955
|
+
var e = 0, a = this._littleEndian;
|
|
956
956
|
if (i === 0) {
|
|
957
957
|
if (!(t.byteLength > 13)) return 0;
|
|
958
958
|
e = r.probe(t).dataOffset;
|
|
959
959
|
}
|
|
960
|
-
for (this._firstParse && (this._firstParse = !1, i + e !== this._dataOffset && m.a.w(this.TAG, "First time parsing but chunk byteStart invalid!"), (s = new DataView(t, e)).getUint32(0, !
|
|
960
|
+
for (this._firstParse && (this._firstParse = !1, i + e !== this._dataOffset && m.a.w(this.TAG, "First time parsing but chunk byteStart invalid!"), (s = new DataView(t, e)).getUint32(0, !a) !== 0 && m.a.w(this.TAG, "PrevTagSize0 !== 0 !!!"), e += 4); e < t.byteLength; ) {
|
|
961
961
|
this._dispatch = !0;
|
|
962
962
|
var s = new DataView(t, e);
|
|
963
963
|
if (e + 11 + 4 > t.byteLength) break;
|
|
964
|
-
var
|
|
964
|
+
var n = s.getUint8(0), o = 16777215 & s.getUint32(0, !a);
|
|
965
965
|
if (e + 11 + o + 4 > t.byteLength) break;
|
|
966
|
-
if (
|
|
966
|
+
if (n === 8 || n === 9 || n === 18) {
|
|
967
967
|
var p = s.getUint8(4), g = s.getUint8(5), E = s.getUint8(6) | g << 8 | p << 16 | s.getUint8(7) << 24;
|
|
968
|
-
16777215 & s.getUint32(7, !
|
|
968
|
+
16777215 & s.getUint32(7, !a) && m.a.w(this.TAG, "Meet tag which has StreamID != 0!");
|
|
969
969
|
var A = e + 11;
|
|
970
|
-
switch (
|
|
970
|
+
switch (n) {
|
|
971
971
|
case 8:
|
|
972
972
|
this._parseAudioData(t, A, o, E);
|
|
973
973
|
break;
|
|
@@ -977,21 +977,21 @@ var Tt = { exports: {} };
|
|
|
977
977
|
case 18:
|
|
978
978
|
this._parseScriptData(t, A, o);
|
|
979
979
|
}
|
|
980
|
-
var S = s.getUint32(11 + o, !
|
|
980
|
+
var S = s.getUint32(11 + o, !a);
|
|
981
981
|
S !== 11 + o && m.a.w(this.TAG, "Invalid PrevTagSize " + S), e += 11 + o + 4;
|
|
982
|
-
} else m.a.w(this.TAG, "Unsupported tag type " +
|
|
982
|
+
} else m.a.w(this.TAG, "Unsupported tag type " + n + ", skipped"), e += 11 + o + 4;
|
|
983
983
|
}
|
|
984
984
|
return this._isInitialMetadataDispatched() && this._dispatch && (this._audioTrack.length || this._videoTrack.length) && this._onDataAvailable(this._audioTrack, this._videoTrack), e;
|
|
985
985
|
}, r.prototype._parseScriptData = function(t, i, e) {
|
|
986
|
-
var
|
|
987
|
-
if (
|
|
988
|
-
if (
|
|
989
|
-
this._metadata && m.a.w(this.TAG, "Found another onMetaData tag!"), this._metadata =
|
|
986
|
+
var a = H.parseScriptData(t, i, e);
|
|
987
|
+
if (a.hasOwnProperty("onMetaData")) {
|
|
988
|
+
if (a.onMetaData == null || typeof a.onMetaData != "object") return void m.a.w(this.TAG, "Invalid onMetaData structure!");
|
|
989
|
+
this._metadata && m.a.w(this.TAG, "Found another onMetaData tag!"), this._metadata = a;
|
|
990
990
|
var s = this._metadata.onMetaData;
|
|
991
991
|
if (this._onMetaDataArrived && this._onMetaDataArrived(Object.assign({}, s)), typeof s.hasAudio == "boolean" && this._hasAudioFlagOverrided === !1 && (this._hasAudio = s.hasAudio, this._mediaInfo.hasAudio = this._hasAudio), typeof s.hasVideo == "boolean" && this._hasVideoFlagOverrided === !1 && (this._hasVideo = s.hasVideo, this._mediaInfo.hasVideo = this._hasVideo), typeof s.audiodatarate == "number" && (this._mediaInfo.audioDataRate = s.audiodatarate), typeof s.videodatarate == "number" && (this._mediaInfo.videoDataRate = s.videodatarate), typeof s.width == "number" && (this._mediaInfo.width = s.width), typeof s.height == "number" && (this._mediaInfo.height = s.height), typeof s.duration == "number") {
|
|
992
992
|
if (!this._durationOverrided) {
|
|
993
|
-
var
|
|
994
|
-
this._duration =
|
|
993
|
+
var n = Math.floor(s.duration * this._timescale);
|
|
994
|
+
this._duration = n, this._mediaInfo.duration = n;
|
|
995
995
|
}
|
|
996
996
|
} else this._mediaInfo.duration = 0;
|
|
997
997
|
if (typeof s.framerate == "number") {
|
|
@@ -1008,24 +1008,24 @@ var Tt = { exports: {} };
|
|
|
1008
1008
|
} else this._mediaInfo.hasKeyframesIndex = !1;
|
|
1009
1009
|
this._dispatch = !1, this._mediaInfo.metadata = s, m.a.v(this.TAG, "Parsed onMetaData"), this._mediaInfo.isComplete() && this._onMediaInfo(this._mediaInfo);
|
|
1010
1010
|
}
|
|
1011
|
-
Object.keys(
|
|
1011
|
+
Object.keys(a).length > 0 && this._onScriptDataArrived && this._onScriptDataArrived(Object.assign({}, a));
|
|
1012
1012
|
}, r.prototype._parseKeyframesIndex = function(t) {
|
|
1013
|
-
for (var i = [], e = [],
|
|
1014
|
-
var s = this._timestampBase + Math.floor(1e3 * t.times[
|
|
1015
|
-
i.push(s), e.push(t.filepositions[
|
|
1013
|
+
for (var i = [], e = [], a = 1; a < t.times.length; a++) {
|
|
1014
|
+
var s = this._timestampBase + Math.floor(1e3 * t.times[a]);
|
|
1015
|
+
i.push(s), e.push(t.filepositions[a]);
|
|
1016
1016
|
}
|
|
1017
1017
|
return { times: i, filepositions: e };
|
|
1018
|
-
}, r.prototype._parseAudioData = function(t, i, e,
|
|
1018
|
+
}, r.prototype._parseAudioData = function(t, i, e, a) {
|
|
1019
1019
|
if (e <= 1) m.a.w(this.TAG, "Flv: Invalid audio packet, missing SoundData payload!");
|
|
1020
1020
|
else if (this._hasAudioFlagOverrided !== !0 || this._hasAudio !== !1) {
|
|
1021
1021
|
this._littleEndian;
|
|
1022
|
-
var s = new DataView(t, i, e).getUint8(0),
|
|
1023
|
-
if (
|
|
1022
|
+
var s = new DataView(t, i, e).getUint8(0), n = s >>> 4;
|
|
1023
|
+
if (n === 2 || n === 10) {
|
|
1024
1024
|
var o = 0, p = (12 & s) >>> 2;
|
|
1025
1025
|
if (p >= 0 && p <= 4) {
|
|
1026
1026
|
o = this._flvSoundRateTable[p];
|
|
1027
1027
|
var g = 1 & s, E = this._audioMetadata, A = this._audioTrack;
|
|
1028
|
-
if (E || (this._hasAudio === !1 && this._hasAudioFlagOverrided === !1 && (this._hasAudio = !0, this._mediaInfo.hasAudio = !0), (E = this._audioMetadata = {}).type = "audio", E.id = A.id, E.timescale = this._timescale, E.duration = this._duration, E.audioSampleRate = o, E.channelCount = g === 0 ? 1 : 2),
|
|
1028
|
+
if (E || (this._hasAudio === !1 && this._hasAudioFlagOverrided === !1 && (this._hasAudio = !0, this._mediaInfo.hasAudio = !0), (E = this._audioMetadata = {}).type = "audio", E.id = A.id, E.timescale = this._timescale, E.duration = this._duration, E.audioSampleRate = o, E.channelCount = g === 0 ? 1 : 2), n === 10) {
|
|
1029
1029
|
var S = this._parseAACAudioData(t, i + 1, e - 1);
|
|
1030
1030
|
if (S == null) return;
|
|
1031
1031
|
if (S.packetType === 0) {
|
|
@@ -1036,10 +1036,10 @@ var Tt = { exports: {} };
|
|
|
1036
1036
|
var w = S.data;
|
|
1037
1037
|
E.audioSampleRate = w.samplingRate, E.channelCount = w.channelCount, E.codec = w.codec, E.originalCodec = w.originalCodec, E.config = w.config, E.refSampleDuration = 1024 / E.audioSampleRate * E.timescale, m.a.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", E), (N = this._mediaInfo).audioCodec = E.originalCodec, N.audioSampleRate = E.audioSampleRate, N.audioChannelCount = E.channelCount, N.hasVideo ? N.videoCodec != null && (N.mimeType = 'video/x-flv; codecs="' + N.videoCodec + "," + N.audioCodec + '"') : N.mimeType = 'video/x-flv; codecs="' + N.audioCodec + '"', N.isComplete() && this._onMediaInfo(N);
|
|
1038
1038
|
} else if (S.packetType === 1) {
|
|
1039
|
-
var I = this._timestampBase +
|
|
1039
|
+
var I = this._timestampBase + a, z = { unit: S.data, length: S.data.byteLength, dts: I, pts: I };
|
|
1040
1040
|
A.samples.push(z), A.length += S.data.length;
|
|
1041
1041
|
} else m.a.e(this.TAG, "Flv: Unsupported AAC data type " + S.packetType);
|
|
1042
|
-
} else if (
|
|
1042
|
+
} else if (n === 2) {
|
|
1043
1043
|
if (!E.codec) {
|
|
1044
1044
|
var N;
|
|
1045
1045
|
if ((w = this._parseMP3AudioData(t, i + 1, e - 1, !0)) == null) return;
|
|
@@ -1047,36 +1047,36 @@ var Tt = { exports: {} };
|
|
|
1047
1047
|
}
|
|
1048
1048
|
var J = this._parseMP3AudioData(t, i + 1, e - 1, !1);
|
|
1049
1049
|
if (J == null) return;
|
|
1050
|
-
I = this._timestampBase +
|
|
1050
|
+
I = this._timestampBase + a;
|
|
1051
1051
|
var W = { unit: J, length: J.byteLength, dts: I, pts: I };
|
|
1052
1052
|
A.samples.push(W), A.length += J.length;
|
|
1053
1053
|
}
|
|
1054
1054
|
} else this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid audio sample rate idx: " + p);
|
|
1055
|
-
} else this._onError(Y.a.CODEC_UNSUPPORTED, "Flv: Unsupported audio codec idx: " +
|
|
1055
|
+
} else this._onError(Y.a.CODEC_UNSUPPORTED, "Flv: Unsupported audio codec idx: " + n);
|
|
1056
1056
|
}
|
|
1057
1057
|
}, r.prototype._parseAACAudioData = function(t, i, e) {
|
|
1058
1058
|
if (!(e <= 1)) {
|
|
1059
|
-
var
|
|
1060
|
-
return
|
|
1059
|
+
var a = {}, s = new Uint8Array(t, i, e);
|
|
1060
|
+
return a.packetType = s[0], s[0] === 0 ? a.data = this._parseAACAudioSpecificConfig(t, i + 1, e - 1) : a.data = s.subarray(1), a;
|
|
1061
1061
|
}
|
|
1062
1062
|
m.a.w(this.TAG, "Flv: Invalid AAC packet, missing AACPacketType or/and Data!");
|
|
1063
1063
|
}, r.prototype._parseAACAudioSpecificConfig = function(t, i, e) {
|
|
1064
|
-
var
|
|
1065
|
-
if (p =
|
|
1064
|
+
var a, s, n = new Uint8Array(t, i, e), o = null, p = 0, g = null;
|
|
1065
|
+
if (p = a = n[0] >>> 3, (s = (7 & n[0]) << 1 | n[1] >>> 7) < 0 || s >= this._mpegSamplingRates.length) this._onError(Y.a.FORMAT_ERROR, "Flv: AAC invalid sampling frequency index!");
|
|
1066
1066
|
else {
|
|
1067
|
-
var E = this._mpegSamplingRates[s], A = (120 &
|
|
1067
|
+
var E = this._mpegSamplingRates[s], A = (120 & n[1]) >>> 3;
|
|
1068
1068
|
if (!(A < 0 || A >= 8)) {
|
|
1069
|
-
p === 5 && (g = (7 &
|
|
1069
|
+
p === 5 && (g = (7 & n[1]) << 1 | n[2] >>> 7, (124 & n[2]) >>> 2);
|
|
1070
1070
|
var S = self.navigator.userAgent.toLowerCase();
|
|
1071
|
-
return S.indexOf("firefox") !== -1 ? s >= 6 ? (p = 5, o = new Array(4), g = s - 3) : (p = 2, o = new Array(2), g = s) : S.indexOf("android") !== -1 ? (p = 2, o = new Array(2), g = s) : (p = 5, g = s, o = new Array(4), s >= 6 ? g = s - 3 : A === 1 && (p = 2, o = new Array(2), g = s)), o[0] = p << 3, o[0] |= (15 & s) >>> 1, o[1] = (15 & s) << 7, o[1] |= (15 & A) << 3, p === 5 && (o[1] |= (15 & g) >>> 1, o[2] = (1 & g) << 7, o[2] |= 8, o[3] = 0), { config: o, samplingRate: E, channelCount: A, codec: "mp4a.40." + p, originalCodec: "mp4a.40." +
|
|
1071
|
+
return S.indexOf("firefox") !== -1 ? s >= 6 ? (p = 5, o = new Array(4), g = s - 3) : (p = 2, o = new Array(2), g = s) : S.indexOf("android") !== -1 ? (p = 2, o = new Array(2), g = s) : (p = 5, g = s, o = new Array(4), s >= 6 ? g = s - 3 : A === 1 && (p = 2, o = new Array(2), g = s)), o[0] = p << 3, o[0] |= (15 & s) >>> 1, o[1] = (15 & s) << 7, o[1] |= (15 & A) << 3, p === 5 && (o[1] |= (15 & g) >>> 1, o[2] = (1 & g) << 7, o[2] |= 8, o[3] = 0), { config: o, samplingRate: E, channelCount: A, codec: "mp4a.40." + p, originalCodec: "mp4a.40." + a };
|
|
1072
1072
|
}
|
|
1073
1073
|
this._onError(Y.a.FORMAT_ERROR, "Flv: AAC invalid channel configuration");
|
|
1074
1074
|
}
|
|
1075
|
-
}, r.prototype._parseMP3AudioData = function(t, i, e,
|
|
1075
|
+
}, r.prototype._parseMP3AudioData = function(t, i, e, a) {
|
|
1076
1076
|
if (!(e < 4)) {
|
|
1077
1077
|
this._littleEndian;
|
|
1078
|
-
var s = new Uint8Array(t, i, e),
|
|
1079
|
-
if (
|
|
1078
|
+
var s = new Uint8Array(t, i, e), n = null;
|
|
1079
|
+
if (a) {
|
|
1080
1080
|
if (s[0] !== 255) return;
|
|
1081
1081
|
var o = s[1] >>> 3 & 3, p = (6 & s[1]) >> 1, g = (240 & s[2]) >>> 4, E = (12 & s[2]) >>> 2, A = (s[3] >>> 6 & 3) !== 3 ? 2 : 1, S = 0, w = 0;
|
|
1082
1082
|
switch (o) {
|
|
@@ -1099,96 +1099,96 @@ var Tt = { exports: {} };
|
|
|
1099
1099
|
case 3:
|
|
1100
1100
|
g < this._mpegAudioL1BitRateTable.length && (w = this._mpegAudioL1BitRateTable[g]);
|
|
1101
1101
|
}
|
|
1102
|
-
|
|
1103
|
-
} else
|
|
1104
|
-
return
|
|
1102
|
+
n = { bitRate: w, samplingRate: S, channelCount: A, codec: "mp3", originalCodec: "mp3" };
|
|
1103
|
+
} else n = s;
|
|
1104
|
+
return n;
|
|
1105
1105
|
}
|
|
1106
1106
|
m.a.w(this.TAG, "Flv: Invalid MP3 packet, header missing!");
|
|
1107
|
-
}, r.prototype._parseVideoData = function(t, i, e,
|
|
1107
|
+
}, r.prototype._parseVideoData = function(t, i, e, a, s) {
|
|
1108
1108
|
if (e <= 1) m.a.w(this.TAG, "Flv: Invalid video packet, missing VideoData payload!");
|
|
1109
1109
|
else if (this._hasVideoFlagOverrided !== !0 || this._hasVideo !== !1) {
|
|
1110
|
-
var
|
|
1111
|
-
if (128 &
|
|
1112
|
-
var p = 15 &
|
|
1110
|
+
var n = new Uint8Array(t, i, e)[0], o = (112 & n) >>> 4;
|
|
1111
|
+
if (128 & n) {
|
|
1112
|
+
var p = 15 & n, g = String.fromCharCode.apply(String, new Uint8Array(t, i, e).slice(1, 5));
|
|
1113
1113
|
if (g !== "hvc1") return void this._onError(Y.a.CODEC_UNSUPPORTED, "Flv: Unsupported codec in video frame: " + g);
|
|
1114
|
-
this._parseEnhancedHEVCVideoPacket(t, i + 5, e - 5,
|
|
1114
|
+
this._parseEnhancedHEVCVideoPacket(t, i + 5, e - 5, a, s, o, p);
|
|
1115
1115
|
} else {
|
|
1116
|
-
var E = 15 &
|
|
1117
|
-
if (E === 7) this._parseAVCVideoPacket(t, i + 1, e - 1,
|
|
1116
|
+
var E = 15 & n;
|
|
1117
|
+
if (E === 7) this._parseAVCVideoPacket(t, i + 1, e - 1, a, s, o);
|
|
1118
1118
|
else {
|
|
1119
1119
|
if (E !== 12) return void this._onError(Y.a.CODEC_UNSUPPORTED, "Flv: Unsupported codec in video frame: " + E);
|
|
1120
|
-
this._parseHEVCVideoPacket(t, i + 1, e - 1,
|
|
1120
|
+
this._parseHEVCVideoPacket(t, i + 1, e - 1, a, s, o);
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
|
-
}, r.prototype._parseAVCVideoPacket = function(t, i, e,
|
|
1124
|
+
}, r.prototype._parseAVCVideoPacket = function(t, i, e, a, s, n) {
|
|
1125
1125
|
if (e < 4) m.a.w(this.TAG, "Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");
|
|
1126
1126
|
else {
|
|
1127
1127
|
var o = this._littleEndian, p = new DataView(t, i, e), g = p.getUint8(0), E = (16777215 & p.getUint32(0, !o)) << 8 >> 8;
|
|
1128
1128
|
if (g === 0) this._parseAVCDecoderConfigurationRecord(t, i + 4, e - 4);
|
|
1129
|
-
else if (g === 1) this._parseAVCVideoData(t, i + 4, e - 4,
|
|
1129
|
+
else if (g === 1) this._parseAVCVideoData(t, i + 4, e - 4, a, s, n, E);
|
|
1130
1130
|
else if (g !== 2) return void this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid video packet type " + g);
|
|
1131
1131
|
}
|
|
1132
|
-
}, r.prototype._parseHEVCVideoPacket = function(t, i, e,
|
|
1132
|
+
}, r.prototype._parseHEVCVideoPacket = function(t, i, e, a, s, n) {
|
|
1133
1133
|
if (e < 4) m.a.w(this.TAG, "Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");
|
|
1134
1134
|
else {
|
|
1135
1135
|
var o = this._littleEndian, p = new DataView(t, i, e), g = p.getUint8(0), E = (16777215 & p.getUint32(0, !o)) << 8 >> 8;
|
|
1136
1136
|
if (g === 0) this._parseHEVCDecoderConfigurationRecord(t, i + 4, e - 4);
|
|
1137
|
-
else if (g === 1) this._parseHEVCVideoData(t, i + 4, e - 4,
|
|
1137
|
+
else if (g === 1) this._parseHEVCVideoData(t, i + 4, e - 4, a, s, n, E);
|
|
1138
1138
|
else if (g !== 2) return void this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid video packet type " + g);
|
|
1139
1139
|
}
|
|
1140
|
-
}, r.prototype._parseEnhancedHEVCVideoPacket = function(t, i, e,
|
|
1140
|
+
}, r.prototype._parseEnhancedHEVCVideoPacket = function(t, i, e, a, s, n, o) {
|
|
1141
1141
|
if (e < 4) m.a.w(this.TAG, "Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");
|
|
1142
1142
|
else {
|
|
1143
1143
|
var p = this._littleEndian, g = new DataView(t, i, e);
|
|
1144
1144
|
if (o === 0) this._parseHEVCDecoderConfigurationRecord(t, i, e);
|
|
1145
1145
|
else if (o === 1) {
|
|
1146
1146
|
var E = (4294967040 & g.getUint32(0, !p)) >> 8;
|
|
1147
|
-
this._parseHEVCVideoData(t, i + 3, e - 3,
|
|
1148
|
-
} else if (o === 3) this._parseHEVCVideoData(t, i, e,
|
|
1147
|
+
this._parseHEVCVideoData(t, i + 3, e - 3, a, s, n, E);
|
|
1148
|
+
} else if (o === 3) this._parseHEVCVideoData(t, i, e, a, s, n, 0);
|
|
1149
1149
|
else if (o !== 2) return void this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid video packet type " + o);
|
|
1150
1150
|
}
|
|
1151
1151
|
}, r.prototype._parseAVCDecoderConfigurationRecord = function(t, i, e) {
|
|
1152
1152
|
if (e < 7) m.a.w(this.TAG, "Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");
|
|
1153
1153
|
else {
|
|
1154
|
-
var
|
|
1155
|
-
if (
|
|
1156
|
-
if (
|
|
1154
|
+
var a = this._videoMetadata, s = this._videoTrack, n = this._littleEndian, o = new DataView(t, i, e);
|
|
1155
|
+
if (a) {
|
|
1156
|
+
if (a.avcc !== void 0) {
|
|
1157
1157
|
var p = new Uint8Array(t, i, e);
|
|
1158
|
-
if (l(p,
|
|
1158
|
+
if (l(p, a.avcc)) return;
|
|
1159
1159
|
m.a.w(this.TAG, "AVCDecoderConfigurationRecord has been changed, re-generate initialization segment");
|
|
1160
1160
|
}
|
|
1161
|
-
} else this._hasVideo === !1 && this._hasVideoFlagOverrided === !1 && (this._hasVideo = !0, this._mediaInfo.hasVideo = !0), (
|
|
1161
|
+
} else this._hasVideo === !1 && this._hasVideoFlagOverrided === !1 && (this._hasVideo = !0, this._mediaInfo.hasVideo = !0), (a = this._videoMetadata = {}).type = "video", a.id = s.id, a.timescale = this._timescale, a.duration = this._duration;
|
|
1162
1162
|
var g = o.getUint8(0), E = o.getUint8(1);
|
|
1163
1163
|
if (o.getUint8(2), o.getUint8(3), g === 1 && E !== 0) if (this._naluLengthSize = 1 + (3 & o.getUint8(4)), this._naluLengthSize === 3 || this._naluLengthSize === 4) {
|
|
1164
1164
|
var A = 31 & o.getUint8(5);
|
|
1165
1165
|
if (A !== 0) {
|
|
1166
1166
|
A > 1 && m.a.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: SPS Count = " + A);
|
|
1167
1167
|
for (var S = 6, w = 0; w < A; w++) {
|
|
1168
|
-
var I = o.getUint16(S, !
|
|
1168
|
+
var I = o.getUint16(S, !n);
|
|
1169
1169
|
if (S += 2, I !== 0) {
|
|
1170
1170
|
var z = new Uint8Array(t, i + S, I);
|
|
1171
1171
|
S += I;
|
|
1172
1172
|
var N = se.parseSPS(z);
|
|
1173
1173
|
if (w === 0) {
|
|
1174
|
-
|
|
1175
|
-
var J =
|
|
1176
|
-
|
|
1174
|
+
a.codecWidth = N.codec_size.width, a.codecHeight = N.codec_size.height, a.presentWidth = N.present_size.width, a.presentHeight = N.present_size.height, a.profile = N.profile_string, a.level = N.level_string, a.bitDepth = N.bit_depth, a.chromaFormat = N.chroma_format, a.sarRatio = N.sar_ratio, a.frameRate = N.frame_rate, N.frame_rate.fixed !== !1 && N.frame_rate.fps_num !== 0 && N.frame_rate.fps_den !== 0 || (a.frameRate = this._referenceFrameRate);
|
|
1175
|
+
var J = a.frameRate.fps_den, W = a.frameRate.fps_num;
|
|
1176
|
+
a.refSampleDuration = a.timescale * (J / W);
|
|
1177
1177
|
for (var q = z.subarray(1, 4), de = "avc1.", he = 0; he < 3; he++) {
|
|
1178
1178
|
var K = q[he].toString(16);
|
|
1179
1179
|
K.length < 2 && (K = "0" + K), de += K;
|
|
1180
1180
|
}
|
|
1181
|
-
|
|
1181
|
+
a.codec = de;
|
|
1182
1182
|
var Q = this._mediaInfo;
|
|
1183
|
-
Q.width =
|
|
1183
|
+
Q.width = a.codecWidth, Q.height = a.codecHeight, Q.fps = a.frameRate.fps, Q.profile = a.profile, Q.level = a.level, Q.refFrames = N.ref_frames, Q.chromaFormat = N.chroma_format_string, Q.sarNum = a.sarRatio.width, Q.sarDen = a.sarRatio.height, Q.videoCodec = de, Q.hasAudio ? Q.audioCodec != null && (Q.mimeType = 'video/x-flv; codecs="' + Q.videoCodec + "," + Q.audioCodec + '"') : Q.mimeType = 'video/x-flv; codecs="' + Q.videoCodec + '"', Q.isComplete() && this._onMediaInfo(Q);
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
var _e = o.getUint8(S);
|
|
1188
1188
|
if (_e !== 0) {
|
|
1189
1189
|
for (_e > 1 && m.a.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: PPS Count = " + _e), S++, w = 0; w < _e; w++)
|
|
1190
|
-
I = o.getUint16(S, !
|
|
1191
|
-
|
|
1190
|
+
I = o.getUint16(S, !n), S += 2, I !== 0 && (S += I);
|
|
1191
|
+
a.avcc = new Uint8Array(e), a.avcc.set(new Uint8Array(t, i, e), 0), m.a.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", a);
|
|
1192
1192
|
} else this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No PPS");
|
|
1193
1193
|
} else this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No SPS");
|
|
1194
1194
|
} else this._onError(Y.a.FORMAT_ERROR, "Flv: Strange NaluLengthSizeMinusOne: " + (this._naluLengthSize - 1));
|
|
@@ -1197,39 +1197,39 @@ var Tt = { exports: {} };
|
|
|
1197
1197
|
}, r.prototype._parseHEVCDecoderConfigurationRecord = function(t, i, e) {
|
|
1198
1198
|
if (e < 22) m.a.w(this.TAG, "Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");
|
|
1199
1199
|
else {
|
|
1200
|
-
var
|
|
1201
|
-
if (
|
|
1202
|
-
if (
|
|
1200
|
+
var a = this._videoMetadata, s = this._videoTrack, n = this._littleEndian, o = new DataView(t, i, e);
|
|
1201
|
+
if (a) {
|
|
1202
|
+
if (a.hvcc !== void 0) {
|
|
1203
1203
|
var p = new Uint8Array(t, i, e);
|
|
1204
|
-
if (l(p,
|
|
1204
|
+
if (l(p, a.hvcc)) return;
|
|
1205
1205
|
m.a.w(this.TAG, "HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment");
|
|
1206
1206
|
}
|
|
1207
|
-
} else this._hasVideo === !1 && this._hasVideoFlagOverrided === !1 && (this._hasVideo = !0, this._mediaInfo.hasVideo = !0), (
|
|
1207
|
+
} else this._hasVideo === !1 && this._hasVideoFlagOverrided === !1 && (this._hasVideo = !0, this._mediaInfo.hasVideo = !0), (a = this._videoMetadata = {}).type = "video", a.id = s.id, a.timescale = this._timescale, a.duration = this._duration;
|
|
1208
1208
|
var g = o.getUint8(0), E = 31 & o.getUint8(1);
|
|
1209
1209
|
if (g === 1 && E !== 0) if (this._naluLengthSize = 1 + (3 & o.getUint8(21)), this._naluLengthSize === 3 || this._naluLengthSize === 4) {
|
|
1210
1210
|
for (var A = o.getUint8(22), S = 0, w = 23; S < A; S++) {
|
|
1211
|
-
var I = 63 & o.getUint8(w + 0), z = o.getUint16(w + 1, !
|
|
1211
|
+
var I = 63 & o.getUint8(w + 0), z = o.getUint16(w + 1, !n);
|
|
1212
1212
|
w += 3;
|
|
1213
1213
|
for (var N = 0; N < z; N++) {
|
|
1214
|
-
var J = o.getUint16(w + 0, !
|
|
1214
|
+
var J = o.getUint16(w + 0, !n);
|
|
1215
1215
|
if (N === 0) if (I === 33) {
|
|
1216
1216
|
w += 2;
|
|
1217
|
-
var W = new Uint8Array(t, i + w, J), q =
|
|
1218
|
-
|
|
1219
|
-
var de =
|
|
1220
|
-
|
|
1217
|
+
var W = new Uint8Array(t, i + w, J), q = ae.parseSPS(W);
|
|
1218
|
+
a.codecWidth = q.codec_size.width, a.codecHeight = q.codec_size.height, a.presentWidth = q.present_size.width, a.presentHeight = q.present_size.height, a.profile = q.profile_string, a.level = q.level_string, a.bitDepth = q.bit_depth, a.chromaFormat = q.chroma_format, a.sarRatio = q.sar_ratio, a.frameRate = q.frame_rate, q.frame_rate.fixed !== !1 && q.frame_rate.fps_num !== 0 && q.frame_rate.fps_den !== 0 || (a.frameRate = this._referenceFrameRate);
|
|
1219
|
+
var de = a.frameRate.fps_den, he = a.frameRate.fps_num;
|
|
1220
|
+
a.refSampleDuration = a.timescale * (de / he), a.codec = q.codec_mimetype;
|
|
1221
1221
|
var K = this._mediaInfo;
|
|
1222
|
-
K.width =
|
|
1222
|
+
K.width = a.codecWidth, K.height = a.codecHeight, K.fps = a.frameRate.fps, K.profile = a.profile, K.level = a.level, K.refFrames = q.ref_frames, K.chromaFormat = q.chroma_format_string, K.sarNum = a.sarRatio.width, K.sarDen = a.sarRatio.height, K.videoCodec = q.codec_mimetype, K.hasAudio ? K.audioCodec != null && (K.mimeType = 'video/x-flv; codecs="' + K.videoCodec + "," + K.audioCodec + '"') : K.mimeType = 'video/x-flv; codecs="' + K.videoCodec + '"', K.isComplete() && this._onMediaInfo(K), w += J;
|
|
1223
1223
|
} else w += 2 + J;
|
|
1224
1224
|
else w += 2 + J;
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
-
|
|
1227
|
+
a.hvcc = new Uint8Array(e), a.hvcc.set(new Uint8Array(t, i, e), 0), m.a.v(this.TAG, "Parsed HEVCDecoderConfigurationRecord"), 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", a);
|
|
1228
1228
|
} else this._onError(Y.a.FORMAT_ERROR, "Flv: Strange NaluLengthSizeMinusOne: " + (this._naluLengthSize - 1));
|
|
1229
1229
|
else this._onError(Y.a.FORMAT_ERROR, "Flv: Invalid HEVCDecoderConfigurationRecord");
|
|
1230
1230
|
}
|
|
1231
|
-
}, r.prototype._parseAVCVideoData = function(t, i, e,
|
|
1232
|
-
for (var p = this._littleEndian, g = new DataView(t, i, e), E = [], A = 0, S = 0, w = this._naluLengthSize, I = this._timestampBase +
|
|
1231
|
+
}, r.prototype._parseAVCVideoData = function(t, i, e, a, s, n, o) {
|
|
1232
|
+
for (var p = this._littleEndian, g = new DataView(t, i, e), E = [], A = 0, S = 0, w = this._naluLengthSize, I = this._timestampBase + a, z = n === 1; S < e; ) {
|
|
1233
1233
|
if (S + 4 >= e) {
|
|
1234
1234
|
m.a.w(this.TAG, "Malformed Nalu near timestamp " + I + ", offset = " + S + ", dataSize = " + e);
|
|
1235
1235
|
break;
|
|
@@ -1245,8 +1245,8 @@ var Tt = { exports: {} };
|
|
|
1245
1245
|
var de = this._videoTrack, he = { units: E, length: A, isKeyframe: z, dts: I, cts: o, pts: I + o };
|
|
1246
1246
|
z && (he.fileposition = s), de.samples.push(he), de.length += A;
|
|
1247
1247
|
}
|
|
1248
|
-
}, r.prototype._parseHEVCVideoData = function(t, i, e,
|
|
1249
|
-
for (var p = this._littleEndian, g = new DataView(t, i, e), E = [], A = 0, S = 0, w = this._naluLengthSize, I = this._timestampBase +
|
|
1248
|
+
}, r.prototype._parseHEVCVideoData = function(t, i, e, a, s, n, o) {
|
|
1249
|
+
for (var p = this._littleEndian, g = new DataView(t, i, e), E = [], A = 0, S = 0, w = this._naluLengthSize, I = this._timestampBase + a, z = n === 1; S < e; ) {
|
|
1250
1250
|
if (S + 4 >= e) {
|
|
1251
1251
|
m.a.w(this.TAG, "Malformed Nalu near timestamp " + I + ", offset = " + S + ", dataSize = " + e);
|
|
1252
1252
|
break;
|
|
@@ -1285,7 +1285,7 @@ var Tt = { exports: {} };
|
|
|
1285
1285
|
(function(r) {
|
|
1286
1286
|
r[r.kUnspecified = 0] = "kUnspecified", r[r.kSliceNonIDR = 1] = "kSliceNonIDR", r[r.kSliceDPA = 2] = "kSliceDPA", r[r.kSliceDPB = 3] = "kSliceDPB", r[r.kSliceDPC = 4] = "kSliceDPC", r[r.kSliceIDR = 5] = "kSliceIDR", r[r.kSliceSEI = 6] = "kSliceSEI", r[r.kSliceSPS = 7] = "kSliceSPS", r[r.kSlicePPS = 8] = "kSlicePPS", r[r.kSliceAUD = 9] = "kSliceAUD", r[r.kEndOfSequence = 10] = "kEndOfSequence", r[r.kEndOfStream = 11] = "kEndOfStream", r[r.kFiller = 12] = "kFiller", r[r.kSPSExt = 13] = "kSPSExt", r[r.kReserved0 = 14] = "kReserved0";
|
|
1287
1287
|
})(D || (D = {}));
|
|
1288
|
-
var
|
|
1288
|
+
var L, d, h = function() {
|
|
1289
1289
|
}, R = function(r) {
|
|
1290
1290
|
var t = r.data.byteLength;
|
|
1291
1291
|
this.type = r.type, this.data = new Uint8Array(4 + t), new DataView(this.data.buffer).setUint32(0, t), this.data.set(r.data, 4);
|
|
@@ -1296,32 +1296,32 @@ var Tt = { exports: {} };
|
|
|
1296
1296
|
return r.prototype.findNextStartCodeOffset = function(t) {
|
|
1297
1297
|
for (var i = t, e = this.data_; ; ) {
|
|
1298
1298
|
if (i + 3 >= e.byteLength) return this.eof_flag_ = !0, e.byteLength;
|
|
1299
|
-
var
|
|
1300
|
-
if (
|
|
1299
|
+
var a = e[i + 0] << 24 | e[i + 1] << 16 | e[i + 2] << 8 | e[i + 3], s = e[i + 0] << 16 | e[i + 1] << 8 | e[i + 2];
|
|
1300
|
+
if (a === 1 || s === 1) return i;
|
|
1301
1301
|
i++;
|
|
1302
1302
|
}
|
|
1303
1303
|
}, r.prototype.readNextNaluPayload = function() {
|
|
1304
1304
|
for (var t = this.data_, i = null; i == null && !this.eof_flag_; ) {
|
|
1305
|
-
var e = this.current_startcode_offset_,
|
|
1306
|
-
if (this.current_startcode_offset_ =
|
|
1307
|
-
var o = t.subarray(e,
|
|
1308
|
-
(i = new h()).type =
|
|
1305
|
+
var e = this.current_startcode_offset_, a = 31 & t[e += (t[e] << 24 | t[e + 1] << 16 | t[e + 2] << 8 | t[e + 3]) === 1 ? 4 : 3], s = (128 & t[e]) >>> 7, n = this.findNextStartCodeOffset(e);
|
|
1306
|
+
if (this.current_startcode_offset_ = n, !(a >= D.kReserved0) && s === 0) {
|
|
1307
|
+
var o = t.subarray(e, n);
|
|
1308
|
+
(i = new h()).type = a, i.data = o;
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
1311
|
return i;
|
|
1312
1312
|
}, r;
|
|
1313
1313
|
}(), oe = function() {
|
|
1314
1314
|
function r(t, i, e) {
|
|
1315
|
-
var
|
|
1316
|
-
t[3] !== 66 && t[3] !== 77 && t[3] !== 88 && (s = !0,
|
|
1317
|
-
var
|
|
1318
|
-
|
|
1315
|
+
var a = 8 + t.byteLength + 1 + 2 + i.byteLength, s = !1;
|
|
1316
|
+
t[3] !== 66 && t[3] !== 77 && t[3] !== 88 && (s = !0, a += 4);
|
|
1317
|
+
var n = this.data = new Uint8Array(a);
|
|
1318
|
+
n[0] = 1, n[1] = t[1], n[2] = t[2], n[3] = t[3], n[4] = 255, n[5] = 225;
|
|
1319
1319
|
var o = t.byteLength;
|
|
1320
|
-
|
|
1320
|
+
n[6] = o >>> 8, n[7] = 255 & o;
|
|
1321
1321
|
var p = 8;
|
|
1322
|
-
|
|
1322
|
+
n.set(t, 8), n[p += o] = 1;
|
|
1323
1323
|
var g = i.byteLength;
|
|
1324
|
-
|
|
1324
|
+
n[p + 1] = g >>> 8, n[p + 2] = 255 & g, n.set(i, p + 3), p += 3 + g, s && (n[p] = 252 | e.chroma_format_idc, n[p + 1] = 248 | e.bit_depth_luma - 8, n[p + 2] = 248 | e.bit_depth_chroma - 8, n[p + 3] = 0, p += 4);
|
|
1325
1325
|
}
|
|
1326
1326
|
return r.prototype.getData = function() {
|
|
1327
1327
|
return this.data;
|
|
@@ -1329,14 +1329,14 @@ var Tt = { exports: {} };
|
|
|
1329
1329
|
}();
|
|
1330
1330
|
(function(r) {
|
|
1331
1331
|
r[r.kNull = 0] = "kNull", r[r.kAACMain = 1] = "kAACMain", r[r.kAAC_LC = 2] = "kAAC_LC", r[r.kAAC_SSR = 3] = "kAAC_SSR", r[r.kAAC_LTP = 4] = "kAAC_LTP", r[r.kAAC_SBR = 5] = "kAAC_SBR", r[r.kAAC_Scalable = 6] = "kAAC_Scalable", r[r.kLayer1 = 32] = "kLayer1", r[r.kLayer2 = 33] = "kLayer2", r[r.kLayer3 = 34] = "kLayer3";
|
|
1332
|
-
})(
|
|
1332
|
+
})(L || (L = {})), function(r) {
|
|
1333
1333
|
r[r.k96000Hz = 0] = "k96000Hz", r[r.k88200Hz = 1] = "k88200Hz", r[r.k64000Hz = 2] = "k64000Hz", r[r.k48000Hz = 3] = "k48000Hz", r[r.k44100Hz = 4] = "k44100Hz", r[r.k32000Hz = 5] = "k32000Hz", r[r.k24000Hz = 6] = "k24000Hz", r[r.k22050Hz = 7] = "k22050Hz", r[r.k16000Hz = 8] = "k16000Hz", r[r.k12000Hz = 9] = "k12000Hz", r[r.k11025Hz = 10] = "k11025Hz", r[r.k8000Hz = 11] = "k8000Hz", r[r.k7350Hz = 12] = "k7350Hz";
|
|
1334
1334
|
}(d || (d = {}));
|
|
1335
1335
|
var me, Se, De = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], Te = (me = function(r, t) {
|
|
1336
1336
|
return (me = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, e) {
|
|
1337
1337
|
i.__proto__ = e;
|
|
1338
1338
|
} || function(i, e) {
|
|
1339
|
-
for (var
|
|
1339
|
+
for (var a in e) e.hasOwnProperty(a) && (i[a] = e[a]);
|
|
1340
1340
|
})(r, t);
|
|
1341
1341
|
}, function(r, t) {
|
|
1342
1342
|
function i() {
|
|
@@ -1361,15 +1361,15 @@ var Tt = { exports: {} };
|
|
|
1361
1361
|
}
|
|
1362
1362
|
}, r.prototype.readNextAACFrame = function() {
|
|
1363
1363
|
for (var t = this.data_, i = null; i == null && !this.eof_flag_; ) {
|
|
1364
|
-
var e = this.current_syncword_offset_,
|
|
1364
|
+
var e = this.current_syncword_offset_, a = (8 & t[e + 1]) >>> 3, s = (6 & t[e + 1]) >>> 1, n = 1 & t[e + 1], o = (192 & t[e + 2]) >>> 6, p = (60 & t[e + 2]) >>> 2, g = (1 & t[e + 2]) << 2 | (192 & t[e + 3]) >>> 6, E = (3 & t[e + 3]) << 11 | t[e + 4] << 3 | (224 & t[e + 5]) >>> 5;
|
|
1365
1365
|
if (t[e + 6], e + E > this.data_.byteLength) {
|
|
1366
1366
|
this.eof_flag_ = !0, this.has_last_incomplete_data = !0;
|
|
1367
1367
|
break;
|
|
1368
1368
|
}
|
|
1369
|
-
var A =
|
|
1369
|
+
var A = n === 1 ? 7 : 9, S = E - A;
|
|
1370
1370
|
e += A;
|
|
1371
1371
|
var w = this.findNextSyncwordOffset(e + S);
|
|
1372
|
-
if (this.current_syncword_offset_ = w, (
|
|
1372
|
+
if (this.current_syncword_offset_ = w, (a === 0 || a === 1) && s === 0) {
|
|
1373
1373
|
var I = t.subarray(e, e + S);
|
|
1374
1374
|
(i = new M()).audio_object_type = o + 1, i.sampling_freq_index = p, i.sampling_frequency = De[p], i.channel_config = g, i.data = I;
|
|
1375
1375
|
}
|
|
@@ -1391,72 +1391,74 @@ var Tt = { exports: {} };
|
|
|
1391
1391
|
i++;
|
|
1392
1392
|
}
|
|
1393
1393
|
}, r.prototype.getLATMValue = function(t) {
|
|
1394
|
-
for (var i = t.readBits(2), e = 0,
|
|
1394
|
+
for (var i = t.readBits(2), e = 0, a = 0; a <= i; a++) e <<= 8, e |= t.readByte();
|
|
1395
1395
|
return e;
|
|
1396
1396
|
}, r.prototype.readNextAACFrame = function(t) {
|
|
1397
1397
|
for (var i = this.data_, e = null; e == null && !this.eof_flag_; ) {
|
|
1398
|
-
var
|
|
1399
|
-
if (
|
|
1398
|
+
var a = this.current_syncword_offset_, s = (31 & i[a + 1]) << 8 | i[a + 2];
|
|
1399
|
+
if (a + 3 + s >= this.data_.byteLength) {
|
|
1400
1400
|
this.eof_flag_ = !0, this.has_last_incomplete_data = !0;
|
|
1401
1401
|
break;
|
|
1402
1402
|
}
|
|
1403
|
-
var
|
|
1404
|
-
if (
|
|
1403
|
+
var n = new ue(i.subarray(a + 3, a + 3 + s)), o = null;
|
|
1404
|
+
if (n.readBool()) {
|
|
1405
1405
|
if (t == null) {
|
|
1406
|
-
m.a.w(this.TAG, "StreamMuxConfig Missing"), this.current_syncword_offset_ = this.findNextSyncwordOffset(
|
|
1406
|
+
m.a.w(this.TAG, "StreamMuxConfig Missing"), this.current_syncword_offset_ = this.findNextSyncwordOffset(a + 3 + s), n.destroy();
|
|
1407
1407
|
continue;
|
|
1408
1408
|
}
|
|
1409
1409
|
o = t;
|
|
1410
1410
|
} else {
|
|
1411
|
-
var p =
|
|
1412
|
-
if (p &&
|
|
1413
|
-
m.a.e(this.TAG, "audioMuxVersionA is Not Supported"),
|
|
1411
|
+
var p = n.readBool();
|
|
1412
|
+
if (p && n.readBool()) {
|
|
1413
|
+
m.a.e(this.TAG, "audioMuxVersionA is Not Supported"), n.destroy();
|
|
1414
1414
|
break;
|
|
1415
1415
|
}
|
|
1416
|
-
if (p && this.getLATMValue(
|
|
1417
|
-
m.a.e(this.TAG, "allStreamsSameTimeFraming zero is Not Supported"),
|
|
1416
|
+
if (p && this.getLATMValue(n), !n.readBool()) {
|
|
1417
|
+
m.a.e(this.TAG, "allStreamsSameTimeFraming zero is Not Supported"), n.destroy();
|
|
1418
1418
|
break;
|
|
1419
1419
|
}
|
|
1420
|
-
if (
|
|
1421
|
-
m.a.e(this.TAG, "more than 2 numSubFrames Not Supported"),
|
|
1420
|
+
if (n.readBits(6) !== 0) {
|
|
1421
|
+
m.a.e(this.TAG, "more than 2 numSubFrames Not Supported"), n.destroy();
|
|
1422
1422
|
break;
|
|
1423
1423
|
}
|
|
1424
|
-
if (
|
|
1425
|
-
m.a.e(this.TAG, "more than 2 numProgram Not Supported"),
|
|
1424
|
+
if (n.readBits(4) !== 0) {
|
|
1425
|
+
m.a.e(this.TAG, "more than 2 numProgram Not Supported"), n.destroy();
|
|
1426
1426
|
break;
|
|
1427
1427
|
}
|
|
1428
|
-
if (
|
|
1429
|
-
m.a.e(this.TAG, "more than 2 numLayer Not Supported"),
|
|
1428
|
+
if (n.readBits(3) !== 0) {
|
|
1429
|
+
m.a.e(this.TAG, "more than 2 numLayer Not Supported"), n.destroy();
|
|
1430
1430
|
break;
|
|
1431
1431
|
}
|
|
1432
|
-
var g = p ? this.getLATMValue(
|
|
1432
|
+
var g = p ? this.getLATMValue(n) : 0, E = n.readBits(5);
|
|
1433
1433
|
g -= 5;
|
|
1434
|
-
var A =
|
|
1434
|
+
var A = n.readBits(4);
|
|
1435
1435
|
g -= 4;
|
|
1436
|
-
var S =
|
|
1437
|
-
g -= 4,
|
|
1438
|
-
var w =
|
|
1436
|
+
var S = n.readBits(4);
|
|
1437
|
+
g -= 4, n.readBits(3), (g -= 3) > 0 && n.readBits(g);
|
|
1438
|
+
var w = n.readBits(3);
|
|
1439
1439
|
if (w !== 0) {
|
|
1440
|
-
m.a.e(this.TAG, "frameLengthType = " + w + ". Only frameLengthType = 0 Supported"),
|
|
1440
|
+
m.a.e(this.TAG, "frameLengthType = " + w + ". Only frameLengthType = 0 Supported"), n.destroy();
|
|
1441
1441
|
break;
|
|
1442
1442
|
}
|
|
1443
|
-
|
|
1444
|
-
var I =
|
|
1445
|
-
if (I) if (p) this.getLATMValue(
|
|
1446
|
-
else
|
|
1443
|
+
n.readByte();
|
|
1444
|
+
var I = n.readBool();
|
|
1445
|
+
if (I) if (p) this.getLATMValue(n);
|
|
1446
|
+
else {
|
|
1447
1447
|
for (var z = 0; ; ) {
|
|
1448
1448
|
z <<= 8;
|
|
1449
|
-
var N =
|
|
1450
|
-
if (z +=
|
|
1449
|
+
var N = n.readBool();
|
|
1450
|
+
if (z += n.readByte(), !N) break;
|
|
1451
1451
|
}
|
|
1452
|
-
|
|
1452
|
+
console.log(z);
|
|
1453
|
+
}
|
|
1454
|
+
n.readBool() && n.readByte(), (o = new j()).audio_object_type = E, o.sampling_freq_index = A, o.sampling_frequency = De[o.sampling_freq_index], o.channel_config = S, o.other_data_present = I;
|
|
1453
1455
|
}
|
|
1454
1456
|
for (var J = 0; ; ) {
|
|
1455
|
-
var W =
|
|
1457
|
+
var W = n.readByte();
|
|
1456
1458
|
if (J += W, W !== 255) break;
|
|
1457
1459
|
}
|
|
1458
|
-
for (var q = new Uint8Array(J), de = 0; de < J; de++) q[de] =
|
|
1459
|
-
(e = new j()).audio_object_type = o.audio_object_type, e.sampling_freq_index = o.sampling_freq_index, e.sampling_frequency = De[o.sampling_freq_index], e.channel_config = o.channel_config, e.other_data_present = o.other_data_present, e.data = q, this.current_syncword_offset_ = this.findNextSyncwordOffset(
|
|
1460
|
+
for (var q = new Uint8Array(J), de = 0; de < J; de++) q[de] = n.readByte();
|
|
1461
|
+
(e = new j()).audio_object_type = o.audio_object_type, e.sampling_freq_index = o.sampling_freq_index, e.sampling_frequency = De[o.sampling_freq_index], e.channel_config = o.channel_config, e.other_data_present = o.other_data_present, e.data = q, this.current_syncword_offset_ = this.findNextSyncwordOffset(a + 3 + s);
|
|
1460
1462
|
}
|
|
1461
1463
|
return e;
|
|
1462
1464
|
}, r.prototype.hasIncompleteData = function() {
|
|
@@ -1465,8 +1467,8 @@ var Tt = { exports: {} };
|
|
|
1465
1467
|
return this.has_last_incomplete_data ? this.data_.subarray(this.current_syncword_offset_) : null;
|
|
1466
1468
|
}, r;
|
|
1467
1469
|
}(), re = function(r) {
|
|
1468
|
-
var t = null, i = r.audio_object_type, e = r.audio_object_type,
|
|
1469
|
-
o.indexOf("firefox") !== -1 ?
|
|
1470
|
+
var t = null, i = r.audio_object_type, e = r.audio_object_type, a = r.sampling_freq_index, s = r.channel_config, n = 0, o = navigator.userAgent.toLowerCase();
|
|
1471
|
+
o.indexOf("firefox") !== -1 ? a >= 6 ? (e = 5, t = new Array(4), n = a - 3) : (e = 2, t = new Array(2), n = a) : o.indexOf("android") !== -1 ? (e = 2, t = new Array(2), n = a) : (e = 5, n = a, t = new Array(4), a >= 6 ? n = a - 3 : s === 1 && (e = 2, t = new Array(2), n = a)), t[0] = e << 3, t[0] |= (15 & a) >>> 1, t[1] = (15 & a) << 7, t[1] |= (15 & s) << 3, e === 5 && (t[1] |= (15 & n) >>> 1, t[2] = (1 & n) << 7, t[2] |= 8, t[3] = 0), this.config = t, this.sampling_rate = De[a], this.channel_count = s, this.codec_mimetype = "mp4a.40." + e, this.original_codec_mimetype = "mp4a.40." + i;
|
|
1470
1472
|
}, ce = function() {
|
|
1471
1473
|
}, we = function() {
|
|
1472
1474
|
};
|
|
@@ -1492,67 +1494,67 @@ var Tt = { exports: {} };
|
|
|
1492
1494
|
if (e.out_of_network_indicator = r.readBool(), e.program_splice_flag = r.readBool(), e.duration_flag = r.readBool(), r.readBits(5), e.program_splice_flag) e.utc_splice_time = r.readBits(32);
|
|
1493
1495
|
else {
|
|
1494
1496
|
e.component_count = r.readBits(8), e.components = [];
|
|
1495
|
-
for (var
|
|
1497
|
+
for (var a = 0; a < e.component_count; a++) e.components.push(Qe(r));
|
|
1496
1498
|
}
|
|
1497
1499
|
return e.duration_flag && (e.break_duration = Be(r)), e.unique_program_id = r.readBits(16), e.avail_num = r.readBits(8), e.avails_expected = r.readBits(8), e;
|
|
1498
1500
|
}, tt = function(r, t, i, e) {
|
|
1499
1501
|
return { descriptor_tag: r, descriptor_length: t, identifier: i, provider_avail_id: e.readBits(32) };
|
|
1500
1502
|
}, wt = function(r, t, i, e) {
|
|
1501
|
-
var
|
|
1503
|
+
var a = e.readBits(8), s = e.readBits(3);
|
|
1502
1504
|
e.readBits(5);
|
|
1503
|
-
for (var
|
|
1504
|
-
return { descriptor_tag: r, descriptor_length: t, identifier: i, preroll:
|
|
1505
|
+
for (var n = "", o = 0; o < s; o++) n += String.fromCharCode(e.readBits(8));
|
|
1506
|
+
return { descriptor_tag: r, descriptor_length: t, identifier: i, preroll: a, dtmf_count: s, DTMF_char: n };
|
|
1505
1507
|
}, kt = function(r) {
|
|
1506
1508
|
var t = r.readBits(8);
|
|
1507
1509
|
return r.readBits(7), { component_tag: t, pts_offset: 4 * r.readBits(31) + r.readBits(2) };
|
|
1508
1510
|
}, Lt = function(r, t, i, e) {
|
|
1509
|
-
var
|
|
1511
|
+
var a = e.readBits(32), s = e.readBool();
|
|
1510
1512
|
e.readBits(7);
|
|
1511
|
-
var
|
|
1512
|
-
if (s) return
|
|
1513
|
-
if (
|
|
1514
|
-
|
|
1515
|
-
for (var o = 0; o <
|
|
1513
|
+
var n = { descriptor_tag: r, descriptor_length: t, identifier: i, segmentation_event_id: a, segmentation_event_cancel_indicator: s };
|
|
1514
|
+
if (s) return n;
|
|
1515
|
+
if (n.program_segmentation_flag = e.readBool(), n.segmentation_duration_flag = e.readBool(), n.delivery_not_restricted_flag = e.readBool(), n.delivery_not_restricted_flag ? e.readBits(5) : (n.web_delivery_allowed_flag = e.readBool(), n.no_regional_blackout_flag = e.readBool(), n.archive_allowed_flag = e.readBool(), n.device_restrictions = e.readBits(2)), !n.program_segmentation_flag) {
|
|
1516
|
+
n.component_count = e.readBits(8), n.components = [];
|
|
1517
|
+
for (var o = 0; o < n.component_count; o++) n.components.push(kt(e));
|
|
1516
1518
|
}
|
|
1517
|
-
|
|
1518
|
-
var p = new Uint8Array(
|
|
1519
|
-
for (o = 0; o <
|
|
1520
|
-
return
|
|
1519
|
+
n.segmentation_duration_flag && (n.segmentation_duration = e.readBits(40)), n.segmentation_upid_type = e.readBits(8), n.segmentation_upid_length = e.readBits(8);
|
|
1520
|
+
var p = new Uint8Array(n.segmentation_upid_length);
|
|
1521
|
+
for (o = 0; o < n.segmentation_upid_length; o++) p[o] = e.readBits(8);
|
|
1522
|
+
return n.segmentation_upid = p.buffer, n.segmentation_type_id = e.readBits(8), n.segment_num = e.readBits(8), n.segments_expected = e.readBits(8), n.segmentation_type_id !== 52 && n.segmentation_type_id !== 54 && n.segmentation_type_id !== 56 && n.segmentation_type_id !== 58 || (n.sub_segment_num = e.readBits(8), n.sub_segments_expected = e.readBits(8)), n;
|
|
1521
1523
|
}, Dt = function(r, t, i, e) {
|
|
1522
1524
|
return { descriptor_tag: r, descriptor_length: t, identifier: i, TAI_seconds: e.readBits(48), TAI_ns: e.readBits(32), UTC_offset: e.readBits(16) };
|
|
1523
1525
|
}, Ct = function(r) {
|
|
1524
1526
|
return { component_tag: r.readBits(8), ISO_code: String.fromCharCode(r.readBits(8), r.readBits(8), r.readBits(8)), Bit_Stream_Mode: r.readBits(3), Num_Channels: r.readBits(4), Full_Srvc_Audio: r.readBool() };
|
|
1525
1527
|
}, Bt = function(r, t, i, e) {
|
|
1526
|
-
for (var
|
|
1527
|
-
return { descriptor_tag: r, descriptor_length: t, identifier: i, audio_count:
|
|
1528
|
+
for (var a = e.readBits(4), s = [], n = 0; n < a; n++) s.push(Ct(e));
|
|
1529
|
+
return { descriptor_tag: r, descriptor_length: t, identifier: i, audio_count: a, components: s };
|
|
1528
1530
|
}, It = function(r) {
|
|
1529
|
-
var t = new ue(r), i = t.readBits(8), e = t.readBool(),
|
|
1531
|
+
var t = new ue(r), i = t.readBits(8), e = t.readBool(), a = t.readBool();
|
|
1530
1532
|
t.readBits(2);
|
|
1531
|
-
var s = t.readBits(12),
|
|
1532
|
-
w === Se.kSpliceNull ? I = {} : w === Se.kSpliceSchedule ? I = function(
|
|
1533
|
-
for (var be =
|
|
1533
|
+
var s = t.readBits(12), n = t.readBits(8), o = t.readBool(), p = t.readBits(6), g = 4 * t.readBits(31) + t.readBits(2), E = t.readBits(8), A = t.readBits(12), S = t.readBits(12), w = t.readBits(8), I = null;
|
|
1534
|
+
w === Se.kSpliceNull ? I = {} : w === Se.kSpliceSchedule ? I = function(ne) {
|
|
1535
|
+
for (var be = ne.readBits(8), Ae = [], le = 0; le < be; le++) Ae.push(et(ne));
|
|
1534
1536
|
return { splice_count: be, events: Ae };
|
|
1535
|
-
}(t) : w === Se.kSpliceInsert ? I = function(
|
|
1536
|
-
var be =
|
|
1537
|
-
|
|
1537
|
+
}(t) : w === Se.kSpliceInsert ? I = function(ne) {
|
|
1538
|
+
var be = ne.readBits(32), Ae = ne.readBool();
|
|
1539
|
+
ne.readBits(7);
|
|
1538
1540
|
var le = { splice_event_id: be, splice_event_cancel_indicator: Ae };
|
|
1539
1541
|
if (Ae) return le;
|
|
1540
|
-
if (le.out_of_network_indicator =
|
|
1541
|
-
le.component_count =
|
|
1542
|
-
for (var ve = 0; ve < le.component_count; ve++) le.components.push($e(le.splice_immediate_flag,
|
|
1543
|
-
}
|
|
1544
|
-
return le.duration_flag && (le.break_duration = Be(
|
|
1545
|
-
}(t) : w === Se.kTimeSignal ? I = function(
|
|
1546
|
-
return { splice_time: Oe(
|
|
1547
|
-
}(t) : w === Se.kBandwidthReservation ? I = {} : w === Se.kPrivateCommand ? I = function(
|
|
1548
|
-
for (var Ae = String.fromCharCode(be.readBits(8), be.readBits(8), be.readBits(8), be.readBits(8)), le = new Uint8Array(
|
|
1542
|
+
if (le.out_of_network_indicator = ne.readBool(), le.program_splice_flag = ne.readBool(), le.duration_flag = ne.readBool(), le.splice_immediate_flag = ne.readBool(), ne.readBits(4), le.program_splice_flag && !le.splice_immediate_flag && (le.splice_time = Oe(ne)), !le.program_splice_flag) {
|
|
1543
|
+
le.component_count = ne.readBits(8), le.components = [];
|
|
1544
|
+
for (var ve = 0; ve < le.component_count; ve++) le.components.push($e(le.splice_immediate_flag, ne));
|
|
1545
|
+
}
|
|
1546
|
+
return le.duration_flag && (le.break_duration = Be(ne)), le.unique_program_id = ne.readBits(16), le.avail_num = ne.readBits(8), le.avails_expected = ne.readBits(8), le;
|
|
1547
|
+
}(t) : w === Se.kTimeSignal ? I = function(ne) {
|
|
1548
|
+
return { splice_time: Oe(ne) };
|
|
1549
|
+
}(t) : w === Se.kBandwidthReservation ? I = {} : w === Se.kPrivateCommand ? I = function(ne, be) {
|
|
1550
|
+
for (var Ae = String.fromCharCode(be.readBits(8), be.readBits(8), be.readBits(8), be.readBits(8)), le = new Uint8Array(ne - 4), ve = 0; ve < ne - 4; ve++) le[ve] = be.readBits(8);
|
|
1549
1551
|
return { identifier: Ae, private_data: le.buffer };
|
|
1550
1552
|
}(S, t) : t.readBits(8 * S);
|
|
1551
1553
|
for (var z = [], N = t.readBits(16), J = 0; J < N; ) {
|
|
1552
1554
|
var W = t.readBits(8), q = t.readBits(8), de = String.fromCharCode(t.readBits(8), t.readBits(8), t.readBits(8), t.readBits(8));
|
|
1553
1555
|
W === 0 ? z.push(tt(W, q, de, t)) : W === 1 ? z.push(wt(W, q, de, t)) : W === 2 ? z.push(Lt(W, q, de, t)) : W === 3 ? z.push(Dt(W, q, de, t)) : W === 4 ? z.push(Bt(W, q, de, t)) : t.readBits(8 * (q - 4)), J += 2 + q;
|
|
1554
1556
|
}
|
|
1555
|
-
var he = { table_id: i, section_syntax_indicator: e, private_indicator:
|
|
1557
|
+
var he = { table_id: i, section_syntax_indicator: e, private_indicator: a, section_length: s, protocol_version: n, encrypted_packet: o, encryption_algorithm: p, pts_adjustment: g, cw_index: E, tier: A, splice_command_length: S, splice_command_type: w, splice_command: I, descriptor_loop_length: N, splice_descriptors: z, E_CRC32: o ? t.readBits(32) : void 0, CRC32: t.readBits(32) };
|
|
1556
1558
|
if (w === Se.kSpliceInsert) {
|
|
1557
1559
|
var K = I;
|
|
1558
1560
|
if (K.splice_event_cancel_indicator) return { splice_command_type: w, detail: he, data: r };
|
|
@@ -1582,24 +1584,24 @@ var Tt = { exports: {} };
|
|
|
1582
1584
|
return r.prototype.findNextStartCodeOffset = function(t) {
|
|
1583
1585
|
for (var i = t, e = this.data_; ; ) {
|
|
1584
1586
|
if (i + 3 >= e.byteLength) return this.eof_flag_ = !0, e.byteLength;
|
|
1585
|
-
var
|
|
1586
|
-
if (
|
|
1587
|
+
var a = e[i + 0] << 24 | e[i + 1] << 16 | e[i + 2] << 8 | e[i + 3], s = e[i + 0] << 16 | e[i + 1] << 8 | e[i + 2];
|
|
1588
|
+
if (a === 1 || s === 1) return i;
|
|
1587
1589
|
i++;
|
|
1588
1590
|
}
|
|
1589
1591
|
}, r.prototype.readNextNaluPayload = function() {
|
|
1590
1592
|
for (var t = this.data_, i = null; i == null && !this.eof_flag_; ) {
|
|
1591
|
-
var e = this.current_startcode_offset_,
|
|
1592
|
-
if (this.current_startcode_offset_ =
|
|
1593
|
-
var o = t.subarray(e,
|
|
1594
|
-
(i = new Ot()).type =
|
|
1593
|
+
var e = this.current_startcode_offset_, a = t[e += (t[e] << 24 | t[e + 1] << 16 | t[e + 2] << 8 | t[e + 3]) === 1 ? 4 : 3] >> 1 & 63, s = (128 & t[e]) >>> 7, n = this.findNextStartCodeOffset(e);
|
|
1594
|
+
if (this.current_startcode_offset_ = n, s === 0) {
|
|
1595
|
+
var o = t.subarray(e, n);
|
|
1596
|
+
(i = new Ot()).type = a, i.data = o;
|
|
1595
1597
|
}
|
|
1596
1598
|
}
|
|
1597
1599
|
return i;
|
|
1598
1600
|
}, r;
|
|
1599
1601
|
}(), xt = function() {
|
|
1600
|
-
function r(t, i, e,
|
|
1601
|
-
var s = 23 + (5 + t.byteLength) + (5 + i.byteLength) + (5 + e.byteLength),
|
|
1602
|
-
|
|
1602
|
+
function r(t, i, e, a) {
|
|
1603
|
+
var s = 23 + (5 + t.byteLength) + (5 + i.byteLength) + (5 + e.byteLength), n = this.data = new Uint8Array(s);
|
|
1604
|
+
n[0] = 1, n[1] = (3 & a.general_profile_space) << 6 | (a.general_tier_flag ? 1 : 0) << 5 | 31 & a.general_profile_idc, n[2] = a.general_profile_compatibility_flags_1, n[3] = a.general_profile_compatibility_flags_2, n[4] = a.general_profile_compatibility_flags_3, n[5] = a.general_profile_compatibility_flags_4, n[6] = a.general_constraint_indicator_flags_1, n[7] = a.general_constraint_indicator_flags_2, n[8] = a.general_constraint_indicator_flags_3, n[9] = a.general_constraint_indicator_flags_4, n[10] = a.general_constraint_indicator_flags_5, n[11] = a.general_constraint_indicator_flags_6, n[12] = a.general_level_idc, n[13] = 240 | (3840 & a.min_spatial_segmentation_idc) >> 8, n[14] = 255 & a.min_spatial_segmentation_idc, n[15] = 252 | 3 & a.parallelismType, n[16] = 252 | 3 & a.chroma_format_idc, n[17] = 248 | 7 & a.bit_depth_luma_minus8, n[18] = 248 | 7 & a.bit_depth_chroma_minus8, n[19] = 0, n[20] = 0, n[21] = (3 & a.constant_frame_rate) << 6 | (7 & a.num_temporal_layers) << 3 | (a.temporal_id_nested ? 1 : 0) << 2 | 3, n[22] = 3, n[23] = 128 | Ee.kSliceVPS, n[24] = 0, n[25] = 1, n[26] = (65280 & t.byteLength) >> 8, n[27] = (255 & t.byteLength) >> 0, n.set(t, 28), n[23 + (5 + t.byteLength) + 0] = 128 | Ee.kSliceSPS, n[23 + (5 + t.byteLength) + 1] = 0, n[23 + (5 + t.byteLength) + 2] = 1, n[23 + (5 + t.byteLength) + 3] = (65280 & i.byteLength) >> 8, n[23 + (5 + t.byteLength) + 4] = (255 & i.byteLength) >> 0, n.set(i, 23 + (5 + t.byteLength) + 5), n[23 + (5 + t.byteLength + 5 + i.byteLength) + 0] = 128 | Ee.kSlicePPS, n[23 + (5 + t.byteLength + 5 + i.byteLength) + 1] = 0, n[23 + (5 + t.byteLength + 5 + i.byteLength) + 2] = 1, n[23 + (5 + t.byteLength + 5 + i.byteLength) + 3] = (65280 & e.byteLength) >> 8, n[23 + (5 + t.byteLength + 5 + i.byteLength) + 4] = (255 & e.byteLength) >> 0, n.set(e, 23 + (5 + t.byteLength + 5 + i.byteLength) + 5);
|
|
1603
1605
|
}
|
|
1604
1606
|
return r.prototype.getData = function() {
|
|
1605
1607
|
return this.data;
|
|
@@ -1619,7 +1621,7 @@ var Tt = { exports: {} };
|
|
|
1619
1621
|
}
|
|
1620
1622
|
}, r.prototype.readNextAC3Frame = function() {
|
|
1621
1623
|
for (var t = this.data_, i = null; i == null && !this.eof_flag_; ) {
|
|
1622
|
-
var e = this.current_syncword_offset_,
|
|
1624
|
+
var e = this.current_syncword_offset_, a = t[e + 4] >> 6, s = [48e3, 44200, 33e3][a], n = 63 & t[e + 4], o = 2 * Ft[a][n];
|
|
1623
1625
|
if (e + o > this.data_.byteLength) {
|
|
1624
1626
|
this.eof_flag_ = !0, this.has_last_incomplete_data = !0;
|
|
1625
1627
|
break;
|
|
@@ -1629,7 +1631,7 @@ var Tt = { exports: {} };
|
|
|
1629
1631
|
var g = t[e + 5] >> 3, E = 7 & t[e + 5], A = t[e + 6] >> 5, S = 0;
|
|
1630
1632
|
1 & A && A !== 1 && (S += 2), 4 & A && (S += 2), A === 2 && (S += 2);
|
|
1631
1633
|
var w = (t[e + 6] << 8 | t[e + 7] << 0) >> 12 - S & 1, I = [2, 1, 2, 3, 3, 4, 4, 5][A] + w;
|
|
1632
|
-
(i = new Gt()).sampling_frequency = s, i.channel_count = I, i.channel_mode = A, i.bit_stream_identification = g, i.low_frequency_effects_channel_on = w, i.bit_stream_mode = E, i.frame_size_code =
|
|
1634
|
+
(i = new Gt()).sampling_frequency = s, i.channel_count = I, i.channel_mode = A, i.bit_stream_identification = g, i.low_frequency_effects_channel_on = w, i.bit_stream_mode = E, i.frame_size_code = n, i.data = t.subarray(e, e + o);
|
|
1633
1635
|
}
|
|
1634
1636
|
return i;
|
|
1635
1637
|
}, r.prototype.hasIncompleteData = function() {
|
|
@@ -1642,10 +1644,10 @@ var Tt = { exports: {} };
|
|
|
1642
1644
|
t = [r.sampling_rate_code << 6 | r.bit_stream_identification << 1 | r.bit_stream_mode >> 2, (3 & r.bit_stream_mode) << 6 | r.channel_mode << 3 | r.low_frequency_effects_channel_on << 2 | r.frame_size_code >> 4, r.frame_size_code << 4 & 224], this.config = t, this.sampling_rate = r.sampling_frequency, this.bit_stream_identification = r.bit_stream_identification, this.bit_stream_mode = r.bit_stream_mode, this.low_frequency_effects_channel_on = r.low_frequency_effects_channel_on, this.channel_count = r.channel_count, this.channel_mode = r.channel_mode, this.codec_mimetype = "ac-3", this.original_codec_mimetype = "ac-3";
|
|
1643
1645
|
}, zt = /* @__PURE__ */ function() {
|
|
1644
1646
|
var r = function(t, i) {
|
|
1645
|
-
return (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e,
|
|
1646
|
-
e.__proto__ =
|
|
1647
|
-
} || function(e,
|
|
1648
|
-
for (var s in
|
|
1647
|
+
return (r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, a) {
|
|
1648
|
+
e.__proto__ = a;
|
|
1649
|
+
} || function(e, a) {
|
|
1650
|
+
for (var s in a) a.hasOwnProperty(s) && (e[s] = a[s]);
|
|
1649
1651
|
})(t, i);
|
|
1650
1652
|
};
|
|
1651
1653
|
return function(t, i) {
|
|
@@ -1656,89 +1658,89 @@ var Tt = { exports: {} };
|
|
|
1656
1658
|
};
|
|
1657
1659
|
}(), Ve = function() {
|
|
1658
1660
|
return (Ve = Object.assign || function(r) {
|
|
1659
|
-
for (var t, i = 1, e = arguments.length; i < e; i++) for (var
|
|
1661
|
+
for (var t, i = 1, e = arguments.length; i < e; i++) for (var a in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, a) && (r[a] = t[a]);
|
|
1660
1662
|
return r;
|
|
1661
1663
|
}).apply(this, arguments);
|
|
1662
1664
|
}, lt = function(r) {
|
|
1663
1665
|
function t(i, e) {
|
|
1664
|
-
var
|
|
1665
|
-
return
|
|
1666
|
+
var a = r.call(this) || this;
|
|
1667
|
+
return a.TAG = "TSDemuxer", a.first_parse_ = !0, a.media_info_ = new y.a(), a.timescale_ = 90, a.duration_ = 0, a.current_pmt_pid_ = -1, a.program_pmt_map_ = {}, a.pes_slice_queues_ = {}, a.section_slice_queues_ = {}, a.video_metadata_ = { vps: void 0, sps: void 0, pps: void 0, details: void 0 }, a.audio_metadata_ = { codec: void 0, audio_object_type: void 0, sampling_freq_index: void 0, sampling_frequency: void 0, channel_config: void 0 }, a.aac_last_sample_pts_ = void 0, a.aac_last_incomplete_data_ = null, a.has_video_ = !1, a.has_audio_ = !1, a.video_init_segment_dispatched_ = !1, a.audio_init_segment_dispatched_ = !1, a.video_metadata_changed_ = !1, a.audio_metadata_changed_ = !1, a.loas_previous_frame = null, a.video_track_ = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 }, a.audio_track_ = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 }, a.ts_packet_size_ = i.ts_packet_size, a.sync_offset_ = i.sync_offset, a.config_ = e, a;
|
|
1666
1668
|
}
|
|
1667
1669
|
return zt(t, r), t.prototype.destroy = function() {
|
|
1668
1670
|
this.media_info_ = null, this.pes_slice_queues_ = null, this.section_slice_queues_ = null, this.video_metadata_ = null, this.audio_metadata_ = null, this.aac_last_incomplete_data_ = null, this.video_track_ = null, this.audio_track_ = null, r.prototype.destroy.call(this);
|
|
1669
1671
|
}, t.probe = function(i) {
|
|
1670
|
-
var e = new Uint8Array(i),
|
|
1672
|
+
var e = new Uint8Array(i), a = -1, s = 188;
|
|
1671
1673
|
if (e.byteLength <= 3 * s) return { needMoreData: !0 };
|
|
1672
|
-
for (;
|
|
1673
|
-
for (var
|
|
1674
|
+
for (; a === -1; ) {
|
|
1675
|
+
for (var n = Math.min(1e3, e.byteLength - 3 * s), o = 0; o < n; ) {
|
|
1674
1676
|
if (e[o] === 71 && e[o + s] === 71 && e[o + 2 * s] === 71) {
|
|
1675
|
-
|
|
1677
|
+
a = o;
|
|
1676
1678
|
break;
|
|
1677
1679
|
}
|
|
1678
1680
|
o++;
|
|
1679
1681
|
}
|
|
1680
|
-
if (
|
|
1682
|
+
if (a === -1) if (s === 188) s = 192;
|
|
1681
1683
|
else {
|
|
1682
1684
|
if (s !== 192) break;
|
|
1683
1685
|
s = 204;
|
|
1684
1686
|
}
|
|
1685
1687
|
}
|
|
1686
|
-
return
|
|
1688
|
+
return a === -1 ? { match: !1 } : (s === 192 && a >= 4 ? (m.a.v("TSDemuxer", "ts_packet_size = 192, m2ts mode"), a -= 4) : s === 204 && m.a.v("TSDemuxer", "ts_packet_size = 204, RS encoded MPEG2-TS stream"), { match: !0, consumed: 0, ts_packet_size: s, sync_offset: a });
|
|
1687
1689
|
}, t.prototype.bindDataSource = function(i) {
|
|
1688
1690
|
return i.onDataArrival = this.parseChunks.bind(this), this;
|
|
1689
1691
|
}, t.prototype.resetMediaInfo = function() {
|
|
1690
1692
|
this.media_info_ = new y.a();
|
|
1691
1693
|
}, t.prototype.parseChunks = function(i, e) {
|
|
1692
1694
|
if (!(this.onError && this.onMediaInfo && this.onTrackMetadata && this.onDataAvailable)) throw new C.a("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");
|
|
1693
|
-
var
|
|
1694
|
-
for (this.first_parse_ && (this.first_parse_ = !1,
|
|
1695
|
-
var s = e +
|
|
1696
|
-
this.ts_packet_size_ === 192 && (
|
|
1697
|
-
var
|
|
1695
|
+
var a = 0;
|
|
1696
|
+
for (this.first_parse_ && (this.first_parse_ = !1, a = this.sync_offset_); a + this.ts_packet_size_ <= i.byteLength; ) {
|
|
1697
|
+
var s = e + a;
|
|
1698
|
+
this.ts_packet_size_ === 192 && (a += 4);
|
|
1699
|
+
var n = new Uint8Array(i, a, 188), o = n[0];
|
|
1698
1700
|
if (o !== 71) {
|
|
1699
1701
|
m.a.e(this.TAG, "sync_byte = " + o + ", not 0x47");
|
|
1700
1702
|
break;
|
|
1701
1703
|
}
|
|
1702
|
-
var p = (64 &
|
|
1704
|
+
var p = (64 & n[1]) >>> 6, g = (n[1], (31 & n[1]) << 8 | n[2]), E = (48 & n[3]) >>> 4, A = 15 & n[3], S = {}, w = 4;
|
|
1703
1705
|
if (E == 2 || E == 3) {
|
|
1704
|
-
var I =
|
|
1706
|
+
var I = n[4];
|
|
1705
1707
|
if (5 + I === 188) {
|
|
1706
|
-
|
|
1708
|
+
a += 188, this.ts_packet_size_ === 204 && (a += 16);
|
|
1707
1709
|
continue;
|
|
1708
1710
|
}
|
|
1709
|
-
I > 0 && (S = this.parseAdaptationField(i,
|
|
1711
|
+
I > 0 && (S = this.parseAdaptationField(i, a + 4, 1 + I)), w = 5 + I;
|
|
1710
1712
|
}
|
|
1711
1713
|
if (E == 1 || E == 3) {
|
|
1712
1714
|
if (g === 0 || g === this.current_pmt_pid_ || this.pmt_ != null && this.pmt_.pid_stream_type[g] === u.kSCTE35) {
|
|
1713
1715
|
var z = 188 - w;
|
|
1714
|
-
this.handleSectionSlice(i,
|
|
1716
|
+
this.handleSectionSlice(i, a + w, z, { pid: g, file_position: s, payload_unit_start_indicator: p, continuity_conunter: A, random_access_indicator: S.random_access_indicator });
|
|
1715
1717
|
} else if (this.pmt_ != null && this.pmt_.pid_stream_type[g] != null) {
|
|
1716
1718
|
z = 188 - w;
|
|
1717
1719
|
var N = this.pmt_.pid_stream_type[g];
|
|
1718
|
-
g !== this.pmt_.common_pids.h264 && g !== this.pmt_.common_pids.h265 && g !== this.pmt_.common_pids.adts_aac && g !== this.pmt_.common_pids.loas_aac && g !== this.pmt_.common_pids.ac3 && g !== this.pmt_.common_pids.opus && g !== this.pmt_.common_pids.mp3 && this.pmt_.pes_private_data_pids[g] !== !0 && this.pmt_.timed_id3_pids[g] !== !0 || this.handlePESSlice(i,
|
|
1720
|
+
g !== this.pmt_.common_pids.h264 && g !== this.pmt_.common_pids.h265 && g !== this.pmt_.common_pids.adts_aac && g !== this.pmt_.common_pids.loas_aac && g !== this.pmt_.common_pids.ac3 && g !== this.pmt_.common_pids.opus && g !== this.pmt_.common_pids.mp3 && this.pmt_.pes_private_data_pids[g] !== !0 && this.pmt_.timed_id3_pids[g] !== !0 || this.handlePESSlice(i, a + w, z, { pid: g, stream_type: N, file_position: s, payload_unit_start_indicator: p, continuity_conunter: A, random_access_indicator: S.random_access_indicator });
|
|
1719
1721
|
}
|
|
1720
1722
|
}
|
|
1721
|
-
|
|
1722
|
-
}
|
|
1723
|
-
return this.dispatchAudioVideoMediaSegment(),
|
|
1724
|
-
}, t.prototype.parseAdaptationField = function(i, e,
|
|
1725
|
-
var s = new Uint8Array(i, e,
|
|
1726
|
-
return
|
|
1727
|
-
}, t.prototype.handleSectionSlice = function(i, e,
|
|
1728
|
-
var
|
|
1723
|
+
a += 188, this.ts_packet_size_ === 204 && (a += 16);
|
|
1724
|
+
}
|
|
1725
|
+
return this.dispatchAudioVideoMediaSegment(), a;
|
|
1726
|
+
}, t.prototype.parseAdaptationField = function(i, e, a) {
|
|
1727
|
+
var s = new Uint8Array(i, e, a), n = s[0];
|
|
1728
|
+
return n > 0 ? n > 183 ? (m.a.w(this.TAG, "Illegal adaptation_field_length: " + n), {}) : { discontinuity_indicator: (128 & s[1]) >>> 7, random_access_indicator: (64 & s[1]) >>> 6, elementary_stream_priority_indicator: (32 & s[1]) >>> 5 } : {};
|
|
1729
|
+
}, t.prototype.handleSectionSlice = function(i, e, a, s) {
|
|
1730
|
+
var n = new Uint8Array(i, e, a), o = this.section_slice_queues_[s.pid];
|
|
1729
1731
|
if (s.payload_unit_start_indicator) {
|
|
1730
|
-
var p =
|
|
1732
|
+
var p = n[0];
|
|
1731
1733
|
if (o != null && o.total_length !== 0) {
|
|
1732
|
-
var g = new Uint8Array(i, e + 1, Math.min(
|
|
1734
|
+
var g = new Uint8Array(i, e + 1, Math.min(a, p));
|
|
1733
1735
|
o.slices.push(g), o.total_length += g.byteLength, o.total_length === o.expected_length ? this.emitSectionSlices(o, s) : this.clearSlices(o, s);
|
|
1734
1736
|
}
|
|
1735
|
-
for (var E = 1 + p; E <
|
|
1736
|
-
var A = (15 &
|
|
1737
|
-
this.section_slice_queues_[s.pid] = new ye(), (o = this.section_slice_queues_[s.pid]).expected_length = A + 3, o.file_position = s.file_position, o.random_access_indicator = s.random_access_indicator, g = new Uint8Array(i, e + E, Math.min(
|
|
1737
|
+
for (var E = 1 + p; E < n.byteLength && n[E + 0] !== 255; ) {
|
|
1738
|
+
var A = (15 & n[E + 1]) << 8 | n[E + 2];
|
|
1739
|
+
this.section_slice_queues_[s.pid] = new ye(), (o = this.section_slice_queues_[s.pid]).expected_length = A + 3, o.file_position = s.file_position, o.random_access_indicator = s.random_access_indicator, g = new Uint8Array(i, e + E, Math.min(a - E, o.expected_length - o.total_length)), o.slices.push(g), o.total_length += g.byteLength, o.total_length === o.expected_length ? this.emitSectionSlices(o, s) : o.total_length >= o.expected_length && this.clearSlices(o, s), E += g.byteLength;
|
|
1738
1740
|
}
|
|
1739
|
-
} else o != null && o.total_length !== 0 && (g = new Uint8Array(i, e, Math.min(
|
|
1740
|
-
}, t.prototype.handlePESSlice = function(i, e,
|
|
1741
|
-
var
|
|
1741
|
+
} else o != null && o.total_length !== 0 && (g = new Uint8Array(i, e, Math.min(a, o.expected_length - o.total_length)), o.slices.push(g), o.total_length += g.byteLength, o.total_length === o.expected_length ? this.emitSectionSlices(o, s) : o.total_length >= o.expected_length && this.clearSlices(o, s));
|
|
1742
|
+
}, t.prototype.handlePESSlice = function(i, e, a, s) {
|
|
1743
|
+
var n = new Uint8Array(i, e, a), o = n[0] << 16 | n[1] << 8 | n[2], p = (n[3], n[4] << 8 | n[5]);
|
|
1742
1744
|
if (s.payload_unit_start_indicator) {
|
|
1743
1745
|
if (o !== 1) return void m.a.e(this.TAG, "handlePESSlice: packet_start_code_prefix should be 1 but with value " + o);
|
|
1744
1746
|
var g = this.pes_slice_queues_[s.pid];
|
|
@@ -1746,40 +1748,40 @@ var Tt = { exports: {} };
|
|
|
1746
1748
|
}
|
|
1747
1749
|
if (this.pes_slice_queues_[s.pid] != null) {
|
|
1748
1750
|
var E = this.pes_slice_queues_[s.pid];
|
|
1749
|
-
E.slices.push(
|
|
1751
|
+
E.slices.push(n), s.payload_unit_start_indicator && (E.expected_length = p === 0 ? 0 : p + 6), E.total_length += n.byteLength, E.expected_length > 0 && E.expected_length === E.total_length ? this.emitPESSlices(E, s) : E.expected_length > 0 && E.expected_length < E.total_length && this.clearSlices(E, s);
|
|
1750
1752
|
}
|
|
1751
1753
|
}, t.prototype.emitSectionSlices = function(i, e) {
|
|
1752
|
-
for (var
|
|
1754
|
+
for (var a = new Uint8Array(i.total_length), s = 0, n = 0; s < i.slices.length; s++) {
|
|
1753
1755
|
var o = i.slices[s];
|
|
1754
|
-
|
|
1756
|
+
a.set(o, n), n += o.byteLength;
|
|
1755
1757
|
}
|
|
1756
1758
|
i.slices = [], i.expected_length = -1, i.total_length = 0;
|
|
1757
1759
|
var p = new pe();
|
|
1758
|
-
p.pid = e.pid, p.data =
|
|
1760
|
+
p.pid = e.pid, p.data = a, p.file_position = i.file_position, p.random_access_indicator = i.random_access_indicator, this.parseSection(p);
|
|
1759
1761
|
}, t.prototype.emitPESSlices = function(i, e) {
|
|
1760
|
-
for (var
|
|
1762
|
+
for (var a = new Uint8Array(i.total_length), s = 0, n = 0; s < i.slices.length; s++) {
|
|
1761
1763
|
var o = i.slices[s];
|
|
1762
|
-
|
|
1764
|
+
a.set(o, n), n += o.byteLength;
|
|
1763
1765
|
}
|
|
1764
1766
|
i.slices = [], i.expected_length = -1, i.total_length = 0;
|
|
1765
1767
|
var p = new ee();
|
|
1766
|
-
p.pid = e.pid, p.data =
|
|
1768
|
+
p.pid = e.pid, p.data = a, p.stream_type = e.stream_type, p.file_position = i.file_position, p.random_access_indicator = i.random_access_indicator, this.parsePES(p);
|
|
1767
1769
|
}, t.prototype.clearSlices = function(i, e) {
|
|
1768
1770
|
i.slices = [], i.expected_length = -1, i.total_length = 0;
|
|
1769
1771
|
}, t.prototype.parseSection = function(i) {
|
|
1770
|
-
var e = i.data,
|
|
1771
|
-
|
|
1772
|
+
var e = i.data, a = i.pid;
|
|
1773
|
+
a === 0 ? this.parsePAT(e) : a === this.current_pmt_pid_ ? this.parsePMT(e) : this.pmt_ != null && this.pmt_.scte_35_pids[a] && this.parseSCTE35(e);
|
|
1772
1774
|
}, t.prototype.parsePES = function(i) {
|
|
1773
|
-
var e = i.data,
|
|
1774
|
-
if (
|
|
1775
|
+
var e = i.data, a = e[0] << 16 | e[1] << 8 | e[2], s = e[3], n = e[4] << 8 | e[5];
|
|
1776
|
+
if (a === 1)
|
|
1775
1777
|
if (s !== 188 && s !== 190 && s !== 191 && s !== 240 && s !== 241 && s !== 255 && s !== 242 && s !== 248) {
|
|
1776
1778
|
e[6];
|
|
1777
1779
|
var o = (192 & e[7]) >>> 6, p = e[8], g = void 0, E = void 0;
|
|
1778
1780
|
o !== 2 && o !== 3 || (g = 536870912 * (14 & e[9]) + 4194304 * (255 & e[10]) + 16384 * (254 & e[11]) + 128 * (255 & e[12]) + (254 & e[13]) / 2, E = o === 3 ? 536870912 * (14 & e[14]) + 4194304 * (255 & e[15]) + 16384 * (254 & e[16]) + 128 * (255 & e[17]) + (254 & e[18]) / 2 : g);
|
|
1779
1781
|
var A = 9 + p, S = void 0;
|
|
1780
|
-
if (
|
|
1781
|
-
if (
|
|
1782
|
-
S =
|
|
1782
|
+
if (n !== 0) {
|
|
1783
|
+
if (n < 3 + p) return void m.a.v(this.TAG, "Malformed PES: PES_packet_length < 3 + PES_header_data_length");
|
|
1784
|
+
S = n - 3 - p;
|
|
1783
1785
|
} else S = e.byteLength - A;
|
|
1784
1786
|
var w = e.subarray(A, A + S);
|
|
1785
1787
|
switch (i.stream_type) {
|
|
@@ -1808,28 +1810,28 @@ var Tt = { exports: {} };
|
|
|
1808
1810
|
case u.kH265:
|
|
1809
1811
|
this.parseH265Payload(w, g, E, i.file_position, i.random_access_indicator);
|
|
1810
1812
|
}
|
|
1811
|
-
} else (s === 188 || s === 191 || s === 240 || s === 241 || s === 255 || s === 242 || s === 248) && i.stream_type === u.kPESPrivateData && (A = 6, S = void 0, S =
|
|
1812
|
-
else m.a.e(this.TAG, "parsePES: packet_start_code_prefix should be 1 but with value " +
|
|
1813
|
+
} else (s === 188 || s === 191 || s === 240 || s === 241 || s === 255 || s === 242 || s === 248) && i.stream_type === u.kPESPrivateData && (A = 6, S = void 0, S = n !== 0 ? n : e.byteLength - A, w = e.subarray(A, A + S), this.parsePESPrivateDataPayload(w, void 0, void 0, i.pid, s));
|
|
1814
|
+
else m.a.e(this.TAG, "parsePES: packet_start_code_prefix should be 1 but with value " + a);
|
|
1813
1815
|
}, t.prototype.parsePAT = function(i) {
|
|
1814
1816
|
var e = i[0];
|
|
1815
1817
|
if (e === 0) {
|
|
1816
|
-
var
|
|
1817
|
-
if (
|
|
1818
|
+
var a = (15 & i[1]) << 8 | i[2], s = (i[3], i[4], (62 & i[5]) >>> 1), n = 1 & i[5], o = i[6], p = (i[7], null);
|
|
1819
|
+
if (n === 1 && o === 0) (p = new P()).version_number = s;
|
|
1818
1820
|
else if ((p = this.pat_) == null) return;
|
|
1819
|
-
for (var g =
|
|
1821
|
+
for (var g = a - 5 - 4, E = -1, A = -1, S = 8; S < 8 + g; S += 4) {
|
|
1820
1822
|
var w = i[S] << 8 | i[S + 1], I = (31 & i[S + 2]) << 8 | i[S + 3];
|
|
1821
1823
|
w === 0 ? p.network_pid = I : (p.program_pmt_pid[w] = I, E === -1 && (E = w), A === -1 && (A = I));
|
|
1822
1824
|
}
|
|
1823
|
-
|
|
1825
|
+
n === 1 && o === 0 && (this.pat_ == null && m.a.v(this.TAG, "Parsed first PAT: " + JSON.stringify(p)), this.pat_ = p, this.current_program_ = E, this.current_pmt_pid_ = A);
|
|
1824
1826
|
} else m.a.e(this.TAG, "parsePAT: table_id " + e + " is not corresponded to PAT!");
|
|
1825
1827
|
}, t.prototype.parsePMT = function(i) {
|
|
1826
1828
|
var e = i[0];
|
|
1827
1829
|
if (e === 2) {
|
|
1828
|
-
var
|
|
1829
|
-
if (o === 1 && p === 0) (g = new F()).program_number = s, g.version_number =
|
|
1830
|
+
var a = (15 & i[1]) << 8 | i[2], s = i[3] << 8 | i[4], n = (62 & i[5]) >>> 1, o = 1 & i[5], p = i[6], g = (i[7], null);
|
|
1831
|
+
if (o === 1 && p === 0) (g = new F()).program_number = s, g.version_number = n, this.program_pmt_map_[s] = g;
|
|
1830
1832
|
else if ((g = this.program_pmt_map_[s]) == null) return;
|
|
1831
1833
|
i[8], i[9];
|
|
1832
|
-
for (var E = (15 & i[10]) << 8 | i[11], A = 12 + E, S =
|
|
1834
|
+
for (var E = (15 & i[10]) << 8 | i[11], A = 12 + E, S = a - 9 - E - 4, w = A; w < A + S; ) {
|
|
1833
1835
|
var I = i[w], z = (31 & i[w + 1]) << 8 | i[w + 2], N = (15 & i[w + 3]) << 8 | i[w + 4];
|
|
1834
1836
|
g.pid_stream_type[z] = I;
|
|
1835
1837
|
var J = g.common_pids.h264 || g.common_pids.h265, W = g.common_pids.adts_aac || g.common_pids.loas_aac || g.common_pids.ac3 || g.common_pids.opus || g.common_pids.mp3;
|
|
@@ -1851,8 +1853,8 @@ var Tt = { exports: {} };
|
|
|
1851
1853
|
}
|
|
1852
1854
|
q += 2 + he;
|
|
1853
1855
|
}
|
|
1854
|
-
var
|
|
1855
|
-
this.dispatchPESPrivateDataDescriptor(z, I,
|
|
1856
|
+
var ne = i.subarray(w + 5, w + 5 + N);
|
|
1857
|
+
this.dispatchPESPrivateDataDescriptor(z, I, ne);
|
|
1856
1858
|
}
|
|
1857
1859
|
} else I === u.kID3 ? g.timed_id3_pids[z] = !0 : I === u.kSCTE35 && (g.scte_35_pids[z] = !0);
|
|
1858
1860
|
else g.common_pids.mp3 = z;
|
|
@@ -1868,36 +1870,36 @@ var Tt = { exports: {} };
|
|
|
1868
1870
|
}, t.prototype.parseSCTE35 = function(i) {
|
|
1869
1871
|
var e = It(i);
|
|
1870
1872
|
if (e.pts != null) {
|
|
1871
|
-
var
|
|
1872
|
-
e.pts =
|
|
1873
|
+
var a = Math.floor(e.pts / this.timescale_);
|
|
1874
|
+
e.pts = a;
|
|
1873
1875
|
} else e.nearest_pts = this.aac_last_sample_pts_;
|
|
1874
1876
|
this.onSCTE35Metadata && this.onSCTE35Metadata(e);
|
|
1875
|
-
}, t.prototype.parseH264Payload = function(i, e,
|
|
1877
|
+
}, t.prototype.parseH264Payload = function(i, e, a, s, n) {
|
|
1876
1878
|
for (var o = new X(i), p = null, g = [], E = 0, A = !1; (p = o.readNextNaluPayload()) != null; ) {
|
|
1877
1879
|
var S = new R(p);
|
|
1878
1880
|
if (S.type === D.kSliceSPS) {
|
|
1879
1881
|
var w = se.parseSPS(p.data);
|
|
1880
1882
|
this.video_init_segment_dispatched_ ? this.detectVideoMetadataChange(S, w) === !0 && (m.a.v(this.TAG, "H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"), this.video_metadata_changed_ = !0, this.video_metadata_ = { vps: void 0, sps: S, pps: void 0, details: w }) : (this.video_metadata_.sps = S, this.video_metadata_.details = w);
|
|
1881
|
-
} else S.type === D.kSlicePPS ? this.video_init_segment_dispatched_ && !this.video_metadata_changed_ || (this.video_metadata_.pps = S, this.video_metadata_.sps && this.video_metadata_.pps && (this.video_metadata_changed_ && this.dispatchVideoMediaSegment(), this.dispatchVideoInitSegment())) : (S.type === D.kSliceIDR || S.type === D.kSliceNonIDR &&
|
|
1883
|
+
} else S.type === D.kSlicePPS ? this.video_init_segment_dispatched_ && !this.video_metadata_changed_ || (this.video_metadata_.pps = S, this.video_metadata_.sps && this.video_metadata_.pps && (this.video_metadata_changed_ && this.dispatchVideoMediaSegment(), this.dispatchVideoInitSegment())) : (S.type === D.kSliceIDR || S.type === D.kSliceNonIDR && n === 1) && (A = !0);
|
|
1882
1884
|
this.video_init_segment_dispatched_ && (g.push(S), E += S.data.byteLength);
|
|
1883
1885
|
}
|
|
1884
|
-
var I = Math.floor(e / this.timescale_), z = Math.floor(
|
|
1886
|
+
var I = Math.floor(e / this.timescale_), z = Math.floor(a / this.timescale_);
|
|
1885
1887
|
if (g.length) {
|
|
1886
1888
|
var N = this.video_track_, J = { units: g, length: E, isKeyframe: A, dts: z, pts: I, cts: I - z, file_position: s };
|
|
1887
1889
|
N.samples.push(J), N.length += E;
|
|
1888
1890
|
}
|
|
1889
|
-
}, t.prototype.parseH265Payload = function(i, e,
|
|
1891
|
+
}, t.prototype.parseH265Payload = function(i, e, a, s, n) {
|
|
1890
1892
|
for (var o = new Mt(i), p = null, g = [], E = 0, A = !1; (p = o.readNextNaluPayload()) != null; ) {
|
|
1891
1893
|
var S = new Pt(p);
|
|
1892
1894
|
if (S.type === Ee.kSliceVPS) {
|
|
1893
1895
|
if (!this.video_init_segment_dispatched_) {
|
|
1894
|
-
var w =
|
|
1896
|
+
var w = ae.parseVPS(p.data);
|
|
1895
1897
|
this.video_metadata_.vps = S, this.video_metadata_.details = Ve(Ve({}, this.video_metadata_.details), w);
|
|
1896
1898
|
}
|
|
1897
|
-
} else S.type === Ee.kSliceSPS ? (w =
|
|
1899
|
+
} else S.type === Ee.kSliceSPS ? (w = ae.parseSPS(p.data), this.video_init_segment_dispatched_ ? this.detectVideoMetadataChange(S, w) === !0 && (m.a.v(this.TAG, "H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"), this.video_metadata_changed_ = !0, this.video_metadata_ = { vps: void 0, sps: S, pps: void 0, details: w }) : (this.video_metadata_.sps = S, this.video_metadata_.details = Ve(Ve({}, this.video_metadata_.details), w))) : S.type === Ee.kSlicePPS ? (!this.video_init_segment_dispatched_ || this.video_metadata_changed_) && (w = ae.parsePPS(p.data), this.video_metadata_.pps = S, this.video_metadata_.details = Ve(Ve({}, this.video_metadata_.details), w), this.video_metadata_.vps && this.video_metadata_.sps && this.video_metadata_.pps && (this.video_metadata_changed_ && this.dispatchVideoMediaSegment(), this.dispatchVideoInitSegment())) : S.type !== Ee.kSliceIDR_W_RADL && S.type !== Ee.kSliceIDR_N_LP && S.type !== Ee.kSliceCRA_NUT || (A = !0);
|
|
1898
1900
|
this.video_init_segment_dispatched_ && (g.push(S), E += S.data.byteLength);
|
|
1899
1901
|
}
|
|
1900
|
-
var I = Math.floor(e / this.timescale_), z = Math.floor(
|
|
1902
|
+
var I = Math.floor(e / this.timescale_), z = Math.floor(a / this.timescale_);
|
|
1901
1903
|
if (g.length) {
|
|
1902
1904
|
var N = this.video_track_, J = { units: g, length: E, isKeyframe: A, dts: z, pts: I, cts: I - z, file_position: s };
|
|
1903
1905
|
N.samples.push(J), N.length += E;
|
|
@@ -1905,8 +1907,8 @@ var Tt = { exports: {} };
|
|
|
1905
1907
|
}, t.prototype.detectVideoMetadataChange = function(i, e) {
|
|
1906
1908
|
if (e.codec_mimetype !== this.video_metadata_.details.codec_mimetype) return m.a.v(this.TAG, "Video: Codec mimeType changed from " + this.video_metadata_.details.codec_mimetype + " to " + e.codec_mimetype), !0;
|
|
1907
1909
|
if (e.codec_size.width !== this.video_metadata_.details.codec_size.width || e.codec_size.height !== this.video_metadata_.details.codec_size.height) {
|
|
1908
|
-
var
|
|
1909
|
-
return m.a.v(this.TAG, "Video: Coded Resolution changed from " +
|
|
1910
|
+
var a = this.video_metadata_.details.codec_size, s = e.codec_size;
|
|
1911
|
+
return m.a.v(this.TAG, "Video: Coded Resolution changed from " + a.width + "x" + a.height + " to " + s.width + "x" + s.height), !0;
|
|
1910
1912
|
}
|
|
1911
1913
|
return e.present_size.width !== this.video_metadata_.details.present_size.width && (m.a.v(this.TAG, "Video: Present resolution width changed from " + this.video_metadata_.details.present_size.width + " to " + e.present_size.width), !0);
|
|
1912
1914
|
}, t.prototype.isInitSegmentDispatched = function() {
|
|
@@ -1914,9 +1916,9 @@ var Tt = { exports: {} };
|
|
|
1914
1916
|
}, t.prototype.dispatchVideoInitSegment = function() {
|
|
1915
1917
|
var i = this.video_metadata_.details, e = { type: "video" };
|
|
1916
1918
|
e.id = this.video_track_.id, e.timescale = 1e3, e.duration = this.duration_, e.codecWidth = i.codec_size.width, e.codecHeight = i.codec_size.height, e.presentWidth = i.present_size.width, e.presentHeight = i.present_size.height, e.profile = i.profile_string, e.level = i.level_string, e.bitDepth = i.bit_depth, e.chromaFormat = i.chroma_format, e.sarRatio = i.sar_ratio, e.frameRate = i.frame_rate;
|
|
1917
|
-
var
|
|
1918
|
-
if (e.refSampleDuration =
|
|
1919
|
-
var
|
|
1919
|
+
var a = e.frameRate.fps_den, s = e.frameRate.fps_num;
|
|
1920
|
+
if (e.refSampleDuration = a / s * 1e3, e.codec = i.codec_mimetype, this.video_metadata_.vps) {
|
|
1921
|
+
var n = this.video_metadata_.vps.data.subarray(4), o = this.video_metadata_.sps.data.subarray(4), p = this.video_metadata_.pps.data.subarray(4), g = new xt(n, o, p, i);
|
|
1920
1922
|
e.hvcc = g.getData(), this.video_init_segment_dispatched_ == 0 && m.a.v(this.TAG, "Generated first HEVCDecoderConfigurationRecord for mimeType: " + e.codec);
|
|
1921
1923
|
} else {
|
|
1922
1924
|
o = this.video_metadata_.sps.data.subarray(4), p = this.video_metadata_.pps.data.subarray(4);
|
|
@@ -1935,20 +1937,20 @@ var Tt = { exports: {} };
|
|
|
1935
1937
|
}, t.prototype.parseADTSAACPayload = function(i, e) {
|
|
1936
1938
|
if (!this.has_video_ || this.video_init_segment_dispatched_) {
|
|
1937
1939
|
if (this.aac_last_incomplete_data_) {
|
|
1938
|
-
var
|
|
1939
|
-
|
|
1940
|
+
var a = new Uint8Array(i.byteLength + this.aac_last_incomplete_data_.byteLength);
|
|
1941
|
+
a.set(this.aac_last_incomplete_data_, 0), a.set(i, this.aac_last_incomplete_data_.byteLength), i = a;
|
|
1940
1942
|
}
|
|
1941
|
-
var s,
|
|
1942
|
-
if (e != null && (
|
|
1943
|
-
if (e == null && this.aac_last_sample_pts_ != null) s = 1024 / this.audio_metadata_.sampling_frequency * 1e3,
|
|
1943
|
+
var s, n;
|
|
1944
|
+
if (e != null && (n = e / this.timescale_), this.audio_metadata_.codec === "aac") {
|
|
1945
|
+
if (e == null && this.aac_last_sample_pts_ != null) s = 1024 / this.audio_metadata_.sampling_frequency * 1e3, n = this.aac_last_sample_pts_ + s;
|
|
1944
1946
|
else if (e == null) return void m.a.w(this.TAG, "AAC: Unknown pts");
|
|
1945
1947
|
if (this.aac_last_incomplete_data_ && this.aac_last_sample_pts_) {
|
|
1946
1948
|
s = 1024 / this.audio_metadata_.sampling_frequency * 1e3;
|
|
1947
1949
|
var o = this.aac_last_sample_pts_ + s;
|
|
1948
|
-
Math.abs(o -
|
|
1950
|
+
Math.abs(o - n) > 1 && (m.a.w(this.TAG, "AAC: Detected pts overlapped, expected: " + o + "ms, PES pts: " + n + "ms"), n = o);
|
|
1949
1951
|
}
|
|
1950
1952
|
}
|
|
1951
|
-
for (var p, g = new $(i), E = null, A =
|
|
1953
|
+
for (var p, g = new $(i), E = null, A = n; (E = g.readNextAACFrame()) != null; ) {
|
|
1952
1954
|
s = 1024 / E.sampling_frequency * 1e3;
|
|
1953
1955
|
var S = { codec: "aac", data: E };
|
|
1954
1956
|
this.audio_init_segment_dispatched_ == 0 ? (this.audio_metadata_ = { codec: "aac", audio_object_type: E.audio_object_type, sampling_freq_index: E.sampling_freq_index, sampling_frequency: E.sampling_frequency, channel_config: E.channel_config }, this.dispatchAudioInitSegment(S)) : this.detectAudioMetadataChange(S) && (this.dispatchAudioMediaSegment(), this.dispatchAudioInitSegment(S)), p = A;
|
|
@@ -1958,66 +1960,66 @@ var Tt = { exports: {} };
|
|
|
1958
1960
|
g.hasIncompleteData() && (this.aac_last_incomplete_data_ = g.getIncompleteData()), p && (this.aac_last_sample_pts_ = p);
|
|
1959
1961
|
}
|
|
1960
1962
|
}, t.prototype.parseLOASAACPayload = function(i, e) {
|
|
1961
|
-
var
|
|
1963
|
+
var a;
|
|
1962
1964
|
if (!this.has_video_ || this.video_init_segment_dispatched_) {
|
|
1963
1965
|
if (this.aac_last_incomplete_data_) {
|
|
1964
1966
|
var s = new Uint8Array(i.byteLength + this.aac_last_incomplete_data_.byteLength);
|
|
1965
1967
|
s.set(this.aac_last_incomplete_data_, 0), s.set(i, this.aac_last_incomplete_data_.byteLength), i = s;
|
|
1966
1968
|
}
|
|
1967
|
-
var
|
|
1969
|
+
var n, o;
|
|
1968
1970
|
if (e != null && (o = e / this.timescale_), this.audio_metadata_.codec === "aac") {
|
|
1969
|
-
if (e == null && this.aac_last_sample_pts_ != null)
|
|
1971
|
+
if (e == null && this.aac_last_sample_pts_ != null) n = 1024 / this.audio_metadata_.sampling_frequency * 1e3, o = this.aac_last_sample_pts_ + n;
|
|
1970
1972
|
else if (e == null) return void m.a.w(this.TAG, "AAC: Unknown pts");
|
|
1971
1973
|
if (this.aac_last_incomplete_data_ && this.aac_last_sample_pts_) {
|
|
1972
|
-
|
|
1973
|
-
var p = this.aac_last_sample_pts_ +
|
|
1974
|
+
n = 1024 / this.audio_metadata_.sampling_frequency * 1e3;
|
|
1975
|
+
var p = this.aac_last_sample_pts_ + n;
|
|
1974
1976
|
Math.abs(p - o) > 1 && (m.a.w(this.TAG, "AAC: Detected pts overlapped, expected: " + p + "ms, PES pts: " + o + "ms"), o = p);
|
|
1975
1977
|
}
|
|
1976
1978
|
}
|
|
1977
|
-
for (var g, E = new ie(i), A = null, S = o; (A = E.readNextAACFrame((
|
|
1978
|
-
this.loas_previous_frame = A,
|
|
1979
|
+
for (var g, E = new ie(i), A = null, S = o; (A = E.readNextAACFrame((a = this.loas_previous_frame) !== null && a !== void 0 ? a : void 0)) != null; ) {
|
|
1980
|
+
this.loas_previous_frame = A, n = 1024 / A.sampling_frequency * 1e3;
|
|
1979
1981
|
var w = { codec: "aac", data: A };
|
|
1980
1982
|
this.audio_init_segment_dispatched_ == 0 ? (this.audio_metadata_ = { codec: "aac", audio_object_type: A.audio_object_type, sampling_freq_index: A.sampling_freq_index, sampling_frequency: A.sampling_frequency, channel_config: A.channel_config }, this.dispatchAudioInitSegment(w)) : this.detectAudioMetadataChange(w) && (this.dispatchAudioMediaSegment(), this.dispatchAudioInitSegment(w)), g = S;
|
|
1981
1983
|
var I = Math.floor(S), z = { unit: A.data, length: A.data.byteLength, pts: I, dts: I };
|
|
1982
|
-
this.audio_track_.samples.push(z), this.audio_track_.length += A.data.byteLength, S +=
|
|
1984
|
+
this.audio_track_.samples.push(z), this.audio_track_.length += A.data.byteLength, S += n;
|
|
1983
1985
|
}
|
|
1984
1986
|
E.hasIncompleteData() && (this.aac_last_incomplete_data_ = E.getIncompleteData()), g && (this.aac_last_sample_pts_ = g);
|
|
1985
1987
|
}
|
|
1986
1988
|
}, t.prototype.parseAC3Payload = function(i, e) {
|
|
1987
1989
|
if (!this.has_video_ || this.video_init_segment_dispatched_) {
|
|
1988
|
-
var
|
|
1990
|
+
var a, s;
|
|
1989
1991
|
if (e != null && (s = e / this.timescale_), this.audio_metadata_.codec === "ac-3") {
|
|
1990
|
-
if (e == null && this.aac_last_sample_pts_ != null)
|
|
1992
|
+
if (e == null && this.aac_last_sample_pts_ != null) a = 1536 / this.audio_metadata_.sampling_frequency * 1e3, s = this.aac_last_sample_pts_ + a;
|
|
1991
1993
|
else if (e == null) return void m.a.w(this.TAG, "Opus: Unknown pts");
|
|
1992
1994
|
}
|
|
1993
|
-
for (var
|
|
1994
|
-
|
|
1995
|
+
for (var n, o = new Vt(i), p = null, g = s; (p = o.readNextAC3Frame()) != null; ) {
|
|
1996
|
+
a = 1536 / p.sampling_frequency * 1e3;
|
|
1995
1997
|
var E = { codec: "ac-3", data: p };
|
|
1996
|
-
this.audio_init_segment_dispatched_ == 0 ? (this.audio_metadata_ = { codec: "ac-3", sampling_frequency: p.sampling_frequency, bit_stream_identification: p.bit_stream_identification, bit_stream_mode: p.bit_stream_mode, low_frequency_effects_channel_on: p.low_frequency_effects_channel_on, channel_mode: p.channel_mode }, this.dispatchAudioInitSegment(E)) : this.detectAudioMetadataChange(E) && (this.dispatchAudioMediaSegment(), this.dispatchAudioInitSegment(E)),
|
|
1998
|
+
this.audio_init_segment_dispatched_ == 0 ? (this.audio_metadata_ = { codec: "ac-3", sampling_frequency: p.sampling_frequency, bit_stream_identification: p.bit_stream_identification, bit_stream_mode: p.bit_stream_mode, low_frequency_effects_channel_on: p.low_frequency_effects_channel_on, channel_mode: p.channel_mode }, console.log(JSON.stringify(this.audio_metadata_)), this.dispatchAudioInitSegment(E)) : this.detectAudioMetadataChange(E) && (this.dispatchAudioMediaSegment(), this.dispatchAudioInitSegment(E)), n = g;
|
|
1997
1999
|
var A = Math.floor(g), S = { unit: p.data, length: p.data.byteLength, pts: A, dts: A };
|
|
1998
|
-
this.audio_track_.samples.push(S), this.audio_track_.length += p.data.byteLength, g +=
|
|
2000
|
+
this.audio_track_.samples.push(S), this.audio_track_.length += p.data.byteLength, g += a;
|
|
1999
2001
|
}
|
|
2000
|
-
|
|
2002
|
+
n && (this.aac_last_sample_pts_ = n);
|
|
2001
2003
|
}
|
|
2002
2004
|
}, t.prototype.parseOpusPayload = function(i, e) {
|
|
2003
2005
|
if (!this.has_video_ || this.video_init_segment_dispatched_) {
|
|
2004
|
-
var
|
|
2006
|
+
var a, s;
|
|
2005
2007
|
if (e != null && (s = e / this.timescale_), this.audio_metadata_.codec === "opus") {
|
|
2006
|
-
if (e == null && this.aac_last_sample_pts_ != null)
|
|
2008
|
+
if (e == null && this.aac_last_sample_pts_ != null) a = 20, s = this.aac_last_sample_pts_ + a;
|
|
2007
2009
|
else if (e == null) return void m.a.w(this.TAG, "Opus: Unknown pts");
|
|
2008
2010
|
}
|
|
2009
|
-
for (var
|
|
2010
|
-
|
|
2011
|
+
for (var n, o = s, p = 0; p < i.length; ) {
|
|
2012
|
+
a = 20;
|
|
2011
2013
|
for (var g = (16 & i[p + 1]) != 0, E = (8 & i[p + 1]) != 0, A = p + 2, S = 0; i[A] === 255; ) S += 255, A += 1;
|
|
2012
|
-
S += i[A], A += 1, A += g ? 2 : 0, A += E ? 2 : 0,
|
|
2014
|
+
S += i[A], A += 1, A += g ? 2 : 0, A += E ? 2 : 0, n = o;
|
|
2013
2015
|
var w = Math.floor(o), I = i.slice(A, A + S), z = { unit: I, length: I.byteLength, pts: w, dts: w };
|
|
2014
|
-
this.audio_track_.samples.push(z), this.audio_track_.length += I.byteLength, o +=
|
|
2016
|
+
this.audio_track_.samples.push(z), this.audio_track_.length += I.byteLength, o += a, p = A + S;
|
|
2015
2017
|
}
|
|
2016
|
-
|
|
2018
|
+
n && (this.aac_last_sample_pts_ = n);
|
|
2017
2019
|
}
|
|
2018
2020
|
}, t.prototype.parseMP3Payload = function(i, e) {
|
|
2019
2021
|
if (!this.has_video_ || this.video_init_segment_dispatched_) {
|
|
2020
|
-
var
|
|
2022
|
+
var a = [0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1], s = [0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1], n = [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1], o = i[1] >>> 3 & 3, p = (6 & i[1]) >> 1, g = (240 & i[2]) >>> 4, E = (12 & i[2]) >>> 2, A = (i[3] >>> 6 & 3) !== 3 ? 2 : 1, S = 0, w = 34;
|
|
2021
2023
|
switch (o) {
|
|
2022
2024
|
case 0:
|
|
2023
2025
|
S = [11025, 12e3, 8e3, 0][E];
|
|
@@ -2030,13 +2032,13 @@ var Tt = { exports: {} };
|
|
|
2030
2032
|
}
|
|
2031
2033
|
switch (p) {
|
|
2032
2034
|
case 1:
|
|
2033
|
-
w = 34, g <
|
|
2035
|
+
w = 34, g < n.length && n[g];
|
|
2034
2036
|
break;
|
|
2035
2037
|
case 2:
|
|
2036
2038
|
w = 33, g < s.length && s[g];
|
|
2037
2039
|
break;
|
|
2038
2040
|
case 3:
|
|
2039
|
-
w = 32, g <
|
|
2041
|
+
w = 32, g < a.length && a[g];
|
|
2040
2042
|
}
|
|
2041
2043
|
var I = new Nt();
|
|
2042
2044
|
I.object_type = w, I.sample_rate = S, I.channel_count = A, I.data = i;
|
|
@@ -2059,60 +2061,60 @@ var Tt = { exports: {} };
|
|
|
2059
2061
|
if (e.channel_mode !== this.audio_metadata_.channel_mode) return m.a.v(this.TAG, "AC3: Channel Mode changed from " + this.audio_metadata_.channel_mode + " to " + e.channel_mode), !0;
|
|
2060
2062
|
if (e.low_frequency_effects_channel_on !== this.audio_metadata_.low_frequency_effects_channel_on) return m.a.v(this.TAG, "AC3: Low Frequency Effects Channel On changed from " + this.audio_metadata_.low_frequency_effects_channel_on + " to " + e.low_frequency_effects_channel_on), !0;
|
|
2061
2063
|
} else if (i.codec === "opus" && this.audio_metadata_.codec === "opus") {
|
|
2062
|
-
if ((
|
|
2063
|
-
if (
|
|
2064
|
+
if ((a = i.meta).sample_rate !== this.audio_metadata_.sample_rate) return m.a.v(this.TAG, "Opus: SamplingFrequencyIndex changed from " + this.audio_metadata_.sample_rate + " to " + a.sample_rate), !0;
|
|
2065
|
+
if (a.channel_count !== this.audio_metadata_.channel_count) return m.a.v(this.TAG, "Opus: Channel count changed from " + this.audio_metadata_.channel_count + " to " + a.channel_count), !0;
|
|
2064
2066
|
} else if (i.codec === "mp3" && this.audio_metadata_.codec === "mp3") {
|
|
2065
|
-
var
|
|
2066
|
-
if ((
|
|
2067
|
-
if (
|
|
2068
|
-
if (
|
|
2067
|
+
var a;
|
|
2068
|
+
if ((a = i.data).object_type !== this.audio_metadata_.object_type) return m.a.v(this.TAG, "MP3: AudioObjectType changed from " + this.audio_metadata_.object_type + " to " + a.object_type), !0;
|
|
2069
|
+
if (a.sample_rate !== this.audio_metadata_.sample_rate) return m.a.v(this.TAG, "MP3: SamplingFrequencyIndex changed from " + this.audio_metadata_.sample_rate + " to " + a.sample_rate), !0;
|
|
2070
|
+
if (a.channel_count !== this.audio_metadata_.channel_count) return m.a.v(this.TAG, "MP3: Channel count changed from " + this.audio_metadata_.channel_count + " to " + a.channel_count), !0;
|
|
2069
2071
|
}
|
|
2070
2072
|
return !1;
|
|
2071
2073
|
}, t.prototype.dispatchAudioInitSegment = function(i) {
|
|
2072
2074
|
var e = { type: "audio" };
|
|
2073
2075
|
if (e.id = this.audio_track_.id, e.timescale = 1e3, e.duration = this.duration_, this.audio_metadata_.codec === "aac") {
|
|
2074
|
-
var
|
|
2076
|
+
var a = i.codec === "aac" ? i.data : null, s = new re(a);
|
|
2075
2077
|
e.audioSampleRate = s.sampling_rate, e.channelCount = s.channel_count, e.codec = s.codec_mimetype, e.originalCodec = s.original_codec_mimetype, e.config = s.config, e.refSampleDuration = 1024 / e.audioSampleRate * e.timescale;
|
|
2076
2078
|
} else if (this.audio_metadata_.codec === "ac-3") {
|
|
2077
|
-
var
|
|
2079
|
+
var n = i.codec === "ac-3" ? i.data : null, o = new jt(n);
|
|
2078
2080
|
e.audioSampleRate = o.sampling_rate, e.channelCount = o.channel_count, e.codec = o.codec_mimetype, e.originalCodec = o.original_codec_mimetype, e.config = o.config, e.refSampleDuration = 1536 / e.audioSampleRate * e.timescale;
|
|
2079
2081
|
} else this.audio_metadata_.codec === "opus" ? (e.audioSampleRate = this.audio_metadata_.sample_rate, e.channelCount = this.audio_metadata_.channel_count, e.channelConfigCode = this.audio_metadata_.channel_config_code, e.codec = "opus", e.originalCodec = "opus", e.config = void 0, e.refSampleDuration = 20) : this.audio_metadata_.codec === "mp3" && (e.audioSampleRate = this.audio_metadata_.sample_rate, e.channelCount = this.audio_metadata_.channel_count, e.codec = "mp3", e.originalCodec = "mp3", e.config = void 0);
|
|
2080
2082
|
this.audio_init_segment_dispatched_ == 0 && m.a.v(this.TAG, "Generated first AudioSpecificConfig for mimeType: " + e.codec), this.onTrackMetadata("audio", e), this.audio_init_segment_dispatched_ = !0, this.video_metadata_changed_ = !1;
|
|
2081
2083
|
var p = this.media_info_;
|
|
2082
2084
|
p.hasAudio = !0, p.audioCodec = e.originalCodec, p.audioSampleRate = e.audioSampleRate, p.audioChannelCount = e.channelCount, p.hasVideo && p.videoCodec ? p.mimeType = 'video/mp2t; codecs="' + p.videoCodec + "," + p.audioCodec + '"' : p.mimeType = 'video/mp2t; codecs="' + p.audioCodec + '"', p.isComplete() && this.onMediaInfo(p);
|
|
2083
|
-
}, t.prototype.dispatchPESPrivateDataDescriptor = function(i, e,
|
|
2085
|
+
}, t.prototype.dispatchPESPrivateDataDescriptor = function(i, e, a) {
|
|
2084
2086
|
var s = new we();
|
|
2085
|
-
s.pid = i, s.stream_type = e, s.descriptor =
|
|
2086
|
-
}, t.prototype.parsePESPrivateDataPayload = function(i, e,
|
|
2087
|
+
s.pid = i, s.stream_type = e, s.descriptor = a, this.onPESPrivateDataDescriptor && this.onPESPrivateDataDescriptor(s);
|
|
2088
|
+
}, t.prototype.parsePESPrivateDataPayload = function(i, e, a, s, n) {
|
|
2087
2089
|
var o = new ce();
|
|
2088
|
-
if (o.pid = s, o.stream_id =
|
|
2090
|
+
if (o.pid = s, o.stream_id = n, o.len = i.byteLength, o.data = i, e != null) {
|
|
2089
2091
|
var p = Math.floor(e / this.timescale_);
|
|
2090
2092
|
o.pts = p;
|
|
2091
2093
|
} else o.nearest_pts = this.aac_last_sample_pts_;
|
|
2092
|
-
if (
|
|
2093
|
-
var g = Math.floor(
|
|
2094
|
+
if (a != null) {
|
|
2095
|
+
var g = Math.floor(a / this.timescale_);
|
|
2094
2096
|
o.dts = g;
|
|
2095
2097
|
}
|
|
2096
2098
|
this.onPESPrivateData && this.onPESPrivateData(o);
|
|
2097
|
-
}, t.prototype.parseTimedID3MetadataPayload = function(i, e,
|
|
2099
|
+
}, t.prototype.parseTimedID3MetadataPayload = function(i, e, a, s, n) {
|
|
2098
2100
|
var o = new ce();
|
|
2099
|
-
if (o.pid = s, o.stream_id =
|
|
2101
|
+
if (o.pid = s, o.stream_id = n, o.len = i.byteLength, o.data = i, e != null) {
|
|
2100
2102
|
var p = Math.floor(e / this.timescale_);
|
|
2101
2103
|
o.pts = p;
|
|
2102
2104
|
}
|
|
2103
|
-
if (
|
|
2104
|
-
var g = Math.floor(
|
|
2105
|
+
if (a != null) {
|
|
2106
|
+
var g = Math.floor(a / this.timescale_);
|
|
2105
2107
|
o.dts = g;
|
|
2106
2108
|
}
|
|
2107
2109
|
this.onTimedID3Metadata && this.onTimedID3Metadata(o);
|
|
2108
|
-
}, t.prototype.parseSMPTE2038MetadataPayload = function(i, e,
|
|
2110
|
+
}, t.prototype.parseSMPTE2038MetadataPayload = function(i, e, a, s, n) {
|
|
2109
2111
|
var o = new Ut();
|
|
2110
|
-
if (o.pid = s, o.stream_id =
|
|
2112
|
+
if (o.pid = s, o.stream_id = n, o.len = i.byteLength, o.data = i, e != null) {
|
|
2111
2113
|
var p = Math.floor(e / this.timescale_);
|
|
2112
2114
|
o.pts = p;
|
|
2113
2115
|
}
|
|
2114
|
-
if (o.nearest_pts = this.aac_last_sample_pts_,
|
|
2115
|
-
var g = Math.floor(
|
|
2116
|
+
if (o.nearest_pts = this.aac_last_sample_pts_, a != null) {
|
|
2117
|
+
var g = Math.floor(a / this.timescale_);
|
|
2116
2118
|
o.dts = g;
|
|
2117
2119
|
}
|
|
2118
2120
|
o.ancillaries = function(E) {
|
|
@@ -2142,8 +2144,8 @@ var Tt = { exports: {} };
|
|
|
2142
2144
|
}, t;
|
|
2143
2145
|
}(c), Ht = function() {
|
|
2144
2146
|
for (var r = 0, t = 0, i = arguments.length; t < i; t++) r += arguments[t].length;
|
|
2145
|
-
var e = Array(r),
|
|
2146
|
-
for (t = 0; t < i; t++) for (var s = arguments[t],
|
|
2147
|
+
var e = Array(r), a = 0;
|
|
2148
|
+
for (t = 0; t < i; t++) for (var s = arguments[t], n = 0, o = s.length; n < o; n++, a++) e[a] = s[n];
|
|
2147
2149
|
return e;
|
|
2148
2150
|
}, _t = function() {
|
|
2149
2151
|
function r() {
|
|
@@ -2153,24 +2155,24 @@ var Tt = { exports: {} };
|
|
|
2153
2155
|
var i = r.constants = {};
|
|
2154
2156
|
i.FTYP = new Uint8Array([105, 115, 111, 109, 0, 0, 0, 1, 105, 115, 111, 109, 97, 118, 99, 49]), i.STSD_PREFIX = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]), i.STTS = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]), i.STSC = i.STCO = i.STTS, i.STSZ = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), i.HDLR_VIDEO = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0]), i.HDLR_AUDIO = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0]), i.DREF = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1]), i.SMHD = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]), i.VMHD = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
2155
2157
|
}, r.box = function(t) {
|
|
2156
|
-
for (var i = 8, e = null,
|
|
2158
|
+
for (var i = 8, e = null, a = Array.prototype.slice.call(arguments, 1), s = a.length, n = 0; n < s; n++) i += a[n].byteLength;
|
|
2157
2159
|
(e = new Uint8Array(i))[0] = i >>> 24 & 255, e[1] = i >>> 16 & 255, e[2] = i >>> 8 & 255, e[3] = 255 & i, e.set(t, 4);
|
|
2158
2160
|
var o = 8;
|
|
2159
|
-
for (
|
|
2161
|
+
for (n = 0; n < s; n++) e.set(a[n], o), o += a[n].byteLength;
|
|
2160
2162
|
return e;
|
|
2161
2163
|
}, r.generateInitSegment = function(t) {
|
|
2162
|
-
var i = r.box(r.types.ftyp, r.constants.FTYP), e = r.moov(t),
|
|
2163
|
-
return
|
|
2164
|
+
var i = r.box(r.types.ftyp, r.constants.FTYP), e = r.moov(t), a = new Uint8Array(i.byteLength + e.byteLength);
|
|
2165
|
+
return a.set(i, 0), a.set(e, i.byteLength), a;
|
|
2164
2166
|
}, r.moov = function(t) {
|
|
2165
|
-
var i = r.mvhd(t.timescale, t.duration), e = r.trak(t),
|
|
2166
|
-
return r.box(r.types.moov, i, e,
|
|
2167
|
+
var i = r.mvhd(t.timescale, t.duration), e = r.trak(t), a = r.mvex(t);
|
|
2168
|
+
return r.box(r.types.moov, i, e, a);
|
|
2167
2169
|
}, r.mvhd = function(t, i) {
|
|
2168
2170
|
return r.box(r.types.mvhd, new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t, i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, 255 & i, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255]));
|
|
2169
2171
|
}, r.trak = function(t) {
|
|
2170
2172
|
return r.box(r.types.trak, r.tkhd(t), r.mdia(t));
|
|
2171
2173
|
}, r.tkhd = function(t) {
|
|
2172
|
-
var i = t.id, e = t.duration,
|
|
2173
|
-
return r.box(r.types.tkhd, new Uint8Array([0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, 255 & i, 0, 0, 0, 0, e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, 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,
|
|
2174
|
+
var i = t.id, e = t.duration, a = t.presentWidth, s = t.presentHeight;
|
|
2175
|
+
return r.box(r.types.tkhd, new Uint8Array([0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, 255 & i, 0, 0, 0, 0, e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, 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, a >>> 8 & 255, 255 & a, 0, 0, s >>> 8 & 255, 255 & s, 0, 0]));
|
|
2174
2176
|
}, r.mdia = function(t) {
|
|
2175
2177
|
return r.box(r.types.mdia, r.mdhd(t), r.hdlr(t), r.minf(t));
|
|
2176
2178
|
}, r.mdhd = function(t) {
|
|
@@ -2189,23 +2191,23 @@ var Tt = { exports: {} };
|
|
|
2189
2191
|
}, r.stsd = function(t) {
|
|
2190
2192
|
return t.type === "audio" ? t.codec === "mp3" ? r.box(r.types.stsd, r.constants.STSD_PREFIX, r.mp3(t)) : t.codec === "ac-3" ? r.box(r.types.stsd, r.constants.STSD_PREFIX, r.ac3(t)) : t.codec === "opus" ? r.box(r.types.stsd, r.constants.STSD_PREFIX, r.Opus(t)) : r.box(r.types.stsd, r.constants.STSD_PREFIX, r.mp4a(t)) : t.type === "video" && t.codec.startsWith("hvc1") ? r.box(r.types.stsd, r.constants.STSD_PREFIX, r.hvc1(t)) : r.box(r.types.stsd, r.constants.STSD_PREFIX, r.avc1(t));
|
|
2191
2193
|
}, r.mp3 = function(t) {
|
|
2192
|
-
var i = t.channelCount, e = t.audioSampleRate,
|
|
2193
|
-
return r.box(r.types[".mp3"],
|
|
2194
|
+
var i = t.channelCount, e = t.audioSampleRate, a = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 16, 0, 0, 0, 0, e >>> 8 & 255, 255 & e, 0, 0]);
|
|
2195
|
+
return r.box(r.types[".mp3"], a);
|
|
2194
2196
|
}, r.mp4a = function(t) {
|
|
2195
|
-
var i = t.channelCount, e = t.audioSampleRate,
|
|
2196
|
-
return r.box(r.types.mp4a,
|
|
2197
|
+
var i = t.channelCount, e = t.audioSampleRate, a = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 16, 0, 0, 0, 0, e >>> 8 & 255, 255 & e, 0, 0]);
|
|
2198
|
+
return r.box(r.types.mp4a, a, r.esds(t));
|
|
2197
2199
|
}, r.ac3 = function(t) {
|
|
2198
|
-
var i = t.channelCount, e = t.audioSampleRate,
|
|
2199
|
-
return r.box(r.types["ac-3"],
|
|
2200
|
+
var i = t.channelCount, e = t.audioSampleRate, a = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 16, 0, 0, 0, 0, e >>> 8 & 255, 255 & e, 0, 0]);
|
|
2201
|
+
return r.box(r.types["ac-3"], a, r.box(r.types.dac3, new Uint8Array(t.config)));
|
|
2200
2202
|
}, r.esds = function(t) {
|
|
2201
|
-
var i = t.config || [], e = i.length,
|
|
2202
|
-
return r.box(r.types.esds,
|
|
2203
|
+
var i = t.config || [], e = i.length, a = new Uint8Array([0, 0, 0, 0, 3, 23 + e, 0, 1, 0, 4, 15 + e, 64, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5].concat([e]).concat(i).concat([6, 1, 2]));
|
|
2204
|
+
return r.box(r.types.esds, a);
|
|
2203
2205
|
}, r.Opus = function(t) {
|
|
2204
|
-
var i = t.channelCount, e = t.audioSampleRate,
|
|
2205
|
-
return r.box(r.types.Opus,
|
|
2206
|
+
var i = t.channelCount, e = t.audioSampleRate, a = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 16, 0, 0, 0, 0, e >>> 8 & 255, 255 & e, 0, 0]);
|
|
2207
|
+
return r.box(r.types.Opus, a, r.dOps(t));
|
|
2206
2208
|
}, r.dOps = function(t) {
|
|
2207
|
-
var i = t.channelCount, e = t.channelConfigCode,
|
|
2208
|
-
if (t.config) return r.box(r.types.dOps,
|
|
2209
|
+
var i = t.channelCount, e = t.channelConfigCode, a = t.audioSampleRate;
|
|
2210
|
+
if (t.config) return r.box(r.types.dOps, n);
|
|
2209
2211
|
var s = [];
|
|
2210
2212
|
switch (e) {
|
|
2211
2213
|
case 1:
|
|
@@ -2257,13 +2259,13 @@ var Tt = { exports: {} };
|
|
|
2257
2259
|
case 136:
|
|
2258
2260
|
s = [1, 1, 8, 0, 1, 2, 3, 4, 5, 6, 7];
|
|
2259
2261
|
}
|
|
2260
|
-
var
|
|
2261
|
-
return r.box(r.types.dOps,
|
|
2262
|
+
var n = new Uint8Array(Ht([0, i, 0, 0, a >>> 24 & 255, a >>> 17 & 255, a >>> 8 & 255, a >>> 0 & 255, 0, 0], s));
|
|
2263
|
+
return r.box(r.types.dOps, n);
|
|
2262
2264
|
}, r.avc1 = function(t) {
|
|
2263
|
-
var i = t.avcc, e = t.codecWidth,
|
|
2265
|
+
var i = t.avcc, e = t.codecWidth, a = t.codecHeight, s = 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, e >>> 8 & 255, 255 & e, a >>> 8 & 255, 255 & a, 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]);
|
|
2264
2266
|
return r.box(r.types.avc1, s, r.box(r.types.avcC, i));
|
|
2265
2267
|
}, r.hvc1 = function(t) {
|
|
2266
|
-
var i = t.hvcc, e = t.codecWidth,
|
|
2268
|
+
var i = t.hvcc, e = t.codecWidth, a = t.codecHeight, s = 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, e >>> 8 & 255, 255 & e, a >>> 8 & 255, 255 & a, 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]);
|
|
2267
2269
|
return r.box(r.types.hvc1, s, r.box(r.types.hvcC, i));
|
|
2268
2270
|
}, r.mvex = function(t) {
|
|
2269
2271
|
return r.box(r.types.mvex, r.trex(t));
|
|
@@ -2276,22 +2278,22 @@ var Tt = { exports: {} };
|
|
|
2276
2278
|
var i = new Uint8Array([0, 0, 0, 0, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]);
|
|
2277
2279
|
return r.box(r.types.mfhd, i);
|
|
2278
2280
|
}, r.traf = function(t, i) {
|
|
2279
|
-
var e = t.id,
|
|
2280
|
-
return r.box(r.types.traf,
|
|
2281
|
+
var e = t.id, a = r.box(r.types.tfhd, new Uint8Array([0, 0, 0, 0, e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e])), s = r.box(r.types.tfdt, new Uint8Array([0, 0, 0, 0, i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, 255 & i])), n = r.sdtp(t), o = r.trun(t, n.byteLength + 16 + 16 + 8 + 16 + 8 + 8);
|
|
2282
|
+
return r.box(r.types.traf, a, s, o, n);
|
|
2281
2283
|
}, r.sdtp = function(t) {
|
|
2282
|
-
for (var i = t.samples || [], e = i.length,
|
|
2283
|
-
var
|
|
2284
|
-
|
|
2284
|
+
for (var i = t.samples || [], e = i.length, a = new Uint8Array(4 + e), s = 0; s < e; s++) {
|
|
2285
|
+
var n = i[s].flags;
|
|
2286
|
+
a[s + 4] = n.isLeading << 6 | n.dependsOn << 4 | n.isDependedOn << 2 | n.hasRedundancy;
|
|
2285
2287
|
}
|
|
2286
|
-
return r.box(r.types.sdtp,
|
|
2288
|
+
return r.box(r.types.sdtp, a);
|
|
2287
2289
|
}, r.trun = function(t, i) {
|
|
2288
|
-
var e = t.samples || [],
|
|
2289
|
-
i += 8 + s,
|
|
2290
|
-
for (var o = 0; o <
|
|
2290
|
+
var e = t.samples || [], a = e.length, s = 12 + 16 * a, n = new Uint8Array(s);
|
|
2291
|
+
i += 8 + s, n.set([0, 0, 15, 1, a >>> 24 & 255, a >>> 16 & 255, a >>> 8 & 255, 255 & a, i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, 255 & i], 0);
|
|
2292
|
+
for (var o = 0; o < a; o++) {
|
|
2291
2293
|
var p = e[o].duration, g = e[o].size, E = e[o].flags, A = e[o].cts;
|
|
2292
|
-
|
|
2294
|
+
n.set([p >>> 24 & 255, p >>> 16 & 255, p >>> 8 & 255, 255 & p, g >>> 24 & 255, g >>> 16 & 255, g >>> 8 & 255, 255 & g, E.isLeading << 2 | E.dependsOn, E.isDependedOn << 6 | E.hasRedundancy << 4 | E.isNonSync, 0, 0, A >>> 24 & 255, A >>> 16 & 255, A >>> 8 & 255, 255 & A], 12 + 16 * o);
|
|
2293
2295
|
}
|
|
2294
|
-
return r.box(r.types.trun,
|
|
2296
|
+
return r.box(r.types.trun, n);
|
|
2295
2297
|
}, r.mdat = function(t) {
|
|
2296
2298
|
return r.box(r.types.mdat, t);
|
|
2297
2299
|
}, r;
|
|
@@ -2339,14 +2341,14 @@ var Tt = { exports: {} };
|
|
|
2339
2341
|
if (!this._onMediaSegment) throw new C.a("MP4Remuxer: onMediaSegment callback must be specificed!");
|
|
2340
2342
|
this._dtsBaseInited || this._calculateDtsBase(t, i), i && this._remuxVideo(i), t && this._remuxAudio(t);
|
|
2341
2343
|
}, r.prototype._onTrackMetadataReceived = function(t, i) {
|
|
2342
|
-
var e = null,
|
|
2343
|
-
if (t === "audio") this._audioMeta = i, i.codec === "mp3" && this._mp3UseMpegAudio ? (
|
|
2344
|
+
var e = null, a = "mp4", s = i.codec;
|
|
2345
|
+
if (t === "audio") this._audioMeta = i, i.codec === "mp3" && this._mp3UseMpegAudio ? (a = "mpeg", s = "", e = new Uint8Array()) : e = ze.generateInitSegment(i);
|
|
2344
2346
|
else {
|
|
2345
2347
|
if (t !== "video") return;
|
|
2346
2348
|
this._videoMeta = i, e = ze.generateInitSegment(i);
|
|
2347
2349
|
}
|
|
2348
2350
|
if (!this._onInitSegment) throw new C.a("MP4Remuxer: onInitSegment callback must be specified!");
|
|
2349
|
-
this._onInitSegment(t, { type: t, data: e.buffer, codec: s, container: t + "/" +
|
|
2351
|
+
this._onInitSegment(t, { type: t, data: e.buffer, codec: s, container: t + "/" + a, mediaDuration: i.duration });
|
|
2350
2352
|
}, r.prototype._calculateDtsBase = function(t, i) {
|
|
2351
2353
|
this._dtsBaseInited || (t && t.samples && t.samples.length && (this._audioDtsBase = t.samples[0].dts), i && i.samples && i.samples.length && (this._videoDtsBase = i.samples[0].dts), this._dtsBase = Math.min(this._audioDtsBase, this._videoDtsBase), this._dtsBaseInited = !0);
|
|
2352
2354
|
}, r.prototype.getTimestampBase = function() {
|
|
@@ -2354,14 +2356,14 @@ var Tt = { exports: {} };
|
|
|
2354
2356
|
}, r.prototype.flushStashedSamples = function() {
|
|
2355
2357
|
var t = this._videoStashedLastSample, i = this._audioStashedLastSample, e = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 };
|
|
2356
2358
|
t != null && (e.samples.push(t), e.length = t.length);
|
|
2357
|
-
var
|
|
2358
|
-
i != null && (
|
|
2359
|
+
var a = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 };
|
|
2360
|
+
i != null && (a.samples.push(i), a.length = i.length), this._videoStashedLastSample = null, this._audioStashedLastSample = null, this._remuxVideo(e, !0), this._remuxAudio(a, !0);
|
|
2359
2361
|
}, r.prototype._remuxAudio = function(t, i) {
|
|
2360
2362
|
if (this._audioMeta != null) {
|
|
2361
|
-
var e,
|
|
2363
|
+
var e, a = t, s = a.samples, n = void 0, o = -1, p = this._audioMeta.refSampleDuration, g = this._audioMeta.codec === "mp3" && this._mp3UseMpegAudio, E = this._dtsBaseInited && this._audioNextDts === void 0, A = !1;
|
|
2362
2364
|
if (s && s.length !== 0 && (s.length !== 1 || i)) {
|
|
2363
2365
|
var S = 0, w = null, I = 0;
|
|
2364
|
-
g ? (S = 0, I =
|
|
2366
|
+
g ? (S = 0, I = a.length) : (S = 8, I = 8 + a.length);
|
|
2365
2367
|
var z = null;
|
|
2366
2368
|
if (s.length > 1 && (I -= (z = s.pop()).length), this._audioStashedLastSample != null) {
|
|
2367
2369
|
var N = this._audioStashedLastSample;
|
|
@@ -2369,17 +2371,17 @@ var Tt = { exports: {} };
|
|
|
2369
2371
|
}
|
|
2370
2372
|
z != null && (this._audioStashedLastSample = z);
|
|
2371
2373
|
var J = s[0].dts - this._dtsBase;
|
|
2372
|
-
if (this._audioNextDts)
|
|
2373
|
-
else if (this._audioSegmentInfoList.isEmpty())
|
|
2374
|
+
if (this._audioNextDts) n = J - this._audioNextDts;
|
|
2375
|
+
else if (this._audioSegmentInfoList.isEmpty()) n = 0, this._fillSilentAfterSeek && !this._videoSegmentInfoList.isEmpty() && this._audioMeta.originalCodec !== "mp3" && (A = !0);
|
|
2374
2376
|
else {
|
|
2375
2377
|
var W = this._audioSegmentInfoList.getLastSampleBefore(J);
|
|
2376
2378
|
if (W != null) {
|
|
2377
2379
|
var q = J - (W.originalDts + W.duration);
|
|
2378
|
-
q <= 3 && (q = 0),
|
|
2379
|
-
} else
|
|
2380
|
+
q <= 3 && (q = 0), n = J - (W.dts + W.duration + q);
|
|
2381
|
+
} else n = 0;
|
|
2380
2382
|
}
|
|
2381
2383
|
if (A) {
|
|
2382
|
-
var de = J -
|
|
2384
|
+
var de = J - n, he = this._videoSegmentInfoList.getLastSegmentBefore(J);
|
|
2383
2385
|
if (he != null && he.beginDts < de) {
|
|
2384
2386
|
if (ke = ht.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount)) {
|
|
2385
2387
|
var K = he.beginDts, Q = de - he.beginDts;
|
|
@@ -2388,19 +2390,19 @@ var Tt = { exports: {} };
|
|
|
2388
2390
|
} else A = !1;
|
|
2389
2391
|
}
|
|
2390
2392
|
for (var _e = [], te = 0; te < s.length; te++) {
|
|
2391
|
-
var
|
|
2393
|
+
var ne = (N = s[te]).unit, be = N.dts - this._dtsBase, Ae = (K = be, !1), le = null, ve = 0;
|
|
2392
2394
|
if (!(be < -1e-3)) {
|
|
2393
2395
|
if (this._audioMeta.codec !== "mp3") {
|
|
2394
2396
|
var Re = be;
|
|
2395
|
-
if (this._audioNextDts && (Re = this._audioNextDts), (
|
|
2396
|
-
m.a.w(this.TAG, "Dropping 1 audio frame (originalDts: " + be + " ms ,curRefDts: " + Re + " ms) due to dtsCorrection: " +
|
|
2397
|
+
if (this._audioNextDts && (Re = this._audioNextDts), (n = be - Re) <= -3 * p) {
|
|
2398
|
+
m.a.w(this.TAG, "Dropping 1 audio frame (originalDts: " + be + " ms ,curRefDts: " + Re + " ms) due to dtsCorrection: " + n + " ms overlap.");
|
|
2397
2399
|
continue;
|
|
2398
2400
|
}
|
|
2399
|
-
if (
|
|
2401
|
+
if (n >= 3 * p && this._fillAudioTimestampGap && !b.a.safari) {
|
|
2400
2402
|
Ae = !0;
|
|
2401
|
-
var ke, Ne = Math.floor(
|
|
2403
|
+
var ke, Ne = Math.floor(n / p);
|
|
2402
2404
|
m.a.w(this.TAG, `Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
2403
|
-
originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.round(
|
|
2405
|
+
originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.round(n) + " ms, generate: " + Ne + " frames"), K = Math.floor(Re), ve = Math.floor(Re + p) - K, (ke = ht.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount)) == null && (m.a.w(this.TAG, "Unable to generate silent frame for " + this._audioMeta.originalCodec + " with " + this._audioMeta.channelCount + " channels, repeat last frame"), ke = ne), le = [];
|
|
2404
2406
|
for (var Pe = 0; Pe < Ne; Pe++) {
|
|
2405
2407
|
Re += p;
|
|
2406
2408
|
var Ge = Math.floor(Re), je = Math.floor(Re + p) - Ge, Fe = { dts: Ge, pts: Ge, cts: 0, unit: ke, size: ke.byteLength, duration: je, originalDts: be, flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0 } };
|
|
@@ -2409,34 +2411,34 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2409
2411
|
this._audioNextDts = Re + p;
|
|
2410
2412
|
} else K = Math.floor(Re), ve = Math.floor(Re + p) - K, this._audioNextDts = Re + p;
|
|
2411
2413
|
} else
|
|
2412
|
-
K = be -
|
|
2414
|
+
K = be - n, te !== s.length - 1 ? ve = s[te + 1].dts - this._dtsBase - n - K : z != null ? ve = z.dts - this._dtsBase - n - K : ve = _e.length >= 1 ? _e[_e.length - 1].duration : Math.floor(p), this._audioNextDts = K + ve;
|
|
2413
2415
|
o === -1 && (o = K), _e.push({ dts: K, pts: K, cts: 0, unit: N.unit, size: N.unit.byteLength, duration: ve, originalDts: be, flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0 } }), Ae && _e.push.apply(_e, le);
|
|
2414
2416
|
}
|
|
2415
2417
|
}
|
|
2416
|
-
if (_e.length === 0) return
|
|
2418
|
+
if (_e.length === 0) return a.samples = [], void (a.length = 0);
|
|
2417
2419
|
for (g ? w = new Uint8Array(I) : ((w = new Uint8Array(I))[0] = I >>> 24 & 255, w[1] = I >>> 16 & 255, w[2] = I >>> 8 & 255, w[3] = 255 & I, w.set(ze.types.mdat, 4)), te = 0; te < _e.length; te++)
|
|
2418
|
-
|
|
2420
|
+
ne = _e[te].unit, w.set(ne, S), S += ne.byteLength;
|
|
2419
2421
|
var Ce = _e[_e.length - 1];
|
|
2420
2422
|
e = Ce.dts + Ce.duration;
|
|
2421
2423
|
var ge = new Me.b();
|
|
2422
|
-
ge.beginDts = o, ge.endDts = e, ge.beginPts = o, ge.endPts = e, ge.originalBeginDts = _e[0].originalDts, ge.originalEndDts = Ce.originalDts + Ce.duration, ge.firstSample = new Me.d(_e[0].dts, _e[0].pts, _e[0].duration, _e[0].originalDts, !1), ge.lastSample = new Me.d(Ce.dts, Ce.pts, Ce.duration, Ce.originalDts, !1), this._isLive || this._audioSegmentInfoList.append(ge),
|
|
2424
|
+
ge.beginDts = o, ge.endDts = e, ge.beginPts = o, ge.endPts = e, ge.originalBeginDts = _e[0].originalDts, ge.originalEndDts = Ce.originalDts + Ce.duration, ge.firstSample = new Me.d(_e[0].dts, _e[0].pts, _e[0].duration, _e[0].originalDts, !1), ge.lastSample = new Me.d(Ce.dts, Ce.pts, Ce.duration, Ce.originalDts, !1), this._isLive || this._audioSegmentInfoList.append(ge), a.samples = _e, a.sequenceNumber++;
|
|
2423
2425
|
var xe = null;
|
|
2424
|
-
xe = g ? new Uint8Array() : ze.moof(
|
|
2426
|
+
xe = g ? new Uint8Array() : ze.moof(a, o), a.samples = [], a.length = 0;
|
|
2425
2427
|
var Ue = { type: "audio", data: this._mergeBoxes(xe, w).buffer, sampleCount: _e.length, info: ge };
|
|
2426
2428
|
g && E && (Ue.timestampOffset = o), this._onMediaSegment("audio", Ue);
|
|
2427
2429
|
}
|
|
2428
2430
|
}
|
|
2429
2431
|
}, r.prototype._remuxVideo = function(t, i) {
|
|
2430
2432
|
if (this._videoMeta != null) {
|
|
2431
|
-
var e,
|
|
2432
|
-
if (
|
|
2433
|
+
var e, a, s = t, n = s.samples, o = void 0, p = -1, g = -1;
|
|
2434
|
+
if (n && n.length !== 0 && (n.length !== 1 || i)) {
|
|
2433
2435
|
var E = 8, A = null, S = 8 + t.length, w = null;
|
|
2434
|
-
if (
|
|
2436
|
+
if (n.length > 1 && (S -= (w = n.pop()).length), this._videoStashedLastSample != null) {
|
|
2435
2437
|
var I = this._videoStashedLastSample;
|
|
2436
|
-
this._videoStashedLastSample = null,
|
|
2438
|
+
this._videoStashedLastSample = null, n.unshift(I), S += I.length;
|
|
2437
2439
|
}
|
|
2438
2440
|
w != null && (this._videoStashedLastSample = w);
|
|
2439
|
-
var z =
|
|
2441
|
+
var z = n[0].dts - this._dtsBase;
|
|
2440
2442
|
if (this._videoNextDts) o = z - this._videoNextDts;
|
|
2441
2443
|
else if (this._videoSegmentInfoList.isEmpty()) o = 0;
|
|
2442
2444
|
else {
|
|
@@ -2446,22 +2448,22 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2446
2448
|
J <= 3 && (J = 0), o = z - (N.dts + N.duration + J);
|
|
2447
2449
|
} else o = 0;
|
|
2448
2450
|
}
|
|
2449
|
-
for (var W = new Me.b(), q = [], de = 0; de <
|
|
2450
|
-
var he = (I =
|
|
2451
|
+
for (var W = new Me.b(), q = [], de = 0; de < n.length; de++) {
|
|
2452
|
+
var he = (I = n[de]).dts - this._dtsBase, K = I.isKeyframe, Q = he - o, _e = I.cts, te = Q + _e;
|
|
2451
2453
|
p === -1 && (p = Q, g = te);
|
|
2452
|
-
var
|
|
2453
|
-
if (de !==
|
|
2454
|
-
var be = new Me.d(Q, te,
|
|
2454
|
+
var ne = 0;
|
|
2455
|
+
if (de !== n.length - 1 ? ne = n[de + 1].dts - this._dtsBase - o - Q : w != null ? ne = w.dts - this._dtsBase - o - Q : ne = q.length >= 1 ? q[q.length - 1].duration : Math.floor(this._videoMeta.refSampleDuration), K) {
|
|
2456
|
+
var be = new Me.d(Q, te, ne, I.dts, !0);
|
|
2455
2457
|
be.fileposition = I.fileposition, W.appendSyncPoint(be);
|
|
2456
2458
|
}
|
|
2457
|
-
q.push({ dts: Q, pts: te, cts: _e, units: I.units, size: I.length, isKeyframe: K, duration:
|
|
2459
|
+
q.push({ dts: Q, pts: te, cts: _e, units: I.units, size: I.length, isKeyframe: K, duration: ne, originalDts: he, flags: { isLeading: 0, dependsOn: K ? 2 : 1, isDependedOn: K ? 1 : 0, hasRedundancy: 0, isNonSync: K ? 0 : 1 } });
|
|
2458
2460
|
}
|
|
2459
2461
|
for ((A = new Uint8Array(S))[0] = S >>> 24 & 255, A[1] = S >>> 16 & 255, A[2] = S >>> 8 & 255, A[3] = 255 & S, A.set(ze.types.mdat, 4), de = 0; de < q.length; de++) for (var Ae = q[de].units; Ae.length; ) {
|
|
2460
2462
|
var le = Ae.shift().data;
|
|
2461
2463
|
A.set(le, E), E += le.byteLength;
|
|
2462
2464
|
}
|
|
2463
2465
|
var ve = q[q.length - 1];
|
|
2464
|
-
if (e = ve.dts + ve.duration,
|
|
2466
|
+
if (e = ve.dts + ve.duration, a = ve.pts + ve.duration, this._videoNextDts = e, W.beginDts = p, W.endDts = e, W.beginPts = g, W.endPts = a, W.originalBeginDts = q[0].originalDts, W.originalEndDts = ve.originalDts + ve.duration, W.firstSample = new Me.d(q[0].dts, q[0].pts, q[0].duration, q[0].originalDts, q[0].isKeyframe), W.lastSample = new Me.d(ve.dts, ve.pts, ve.duration, ve.originalDts, ve.isKeyframe), this._isLive || this._videoSegmentInfoList.append(W), s.samples = q, s.sequenceNumber++, this._forceFirstIDR) {
|
|
2465
2467
|
var Re = q[0].flags;
|
|
2466
2468
|
Re.dependsOn = 2, Re.isNonSync = 0;
|
|
2467
2469
|
}
|
|
@@ -2477,8 +2479,8 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2477
2479
|
function r(t, i) {
|
|
2478
2480
|
this.TAG = "TransmuxingController", this._emitter = new B.a(), this._config = i, t.segments || (t.segments = [{ duration: t.duration, filesize: t.filesize, url: t.url }]), typeof t.cors != "boolean" && (t.cors = !0), typeof t.withCredentials != "boolean" && (t.withCredentials = !1), this._mediaDataSource = t, this._currentSegmentIndex = 0;
|
|
2479
2481
|
var e = 0;
|
|
2480
|
-
this._mediaDataSource.segments.forEach(function(
|
|
2481
|
-
|
|
2482
|
+
this._mediaDataSource.segments.forEach(function(a) {
|
|
2483
|
+
a.timestampBase = e, e += a.duration, a.cors = t.cors, a.withCredentials = t.withCredentials, i.referrerPolicy && (a.referrerPolicy = i.referrerPolicy);
|
|
2482
2484
|
}), isNaN(e) || this._mediaDataSource.duration === e || (this._mediaDataSource.duration = e), this._mediaInfo = null, this._demuxer = null, this._remuxer = null, this._ioctl = null, this._pendingSeekTime = null, this._pendingResolveSeekPoint = null, this._statisticsReporter = null;
|
|
2483
2485
|
}
|
|
2484
2486
|
return r.prototype.destroy = function() {
|
|
@@ -2491,8 +2493,8 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2491
2493
|
this._loadSegment(0), this._enableStatisticsReporter();
|
|
2492
2494
|
}, r.prototype._loadSegment = function(t, i) {
|
|
2493
2495
|
this._currentSegmentIndex = t;
|
|
2494
|
-
var e = this._mediaDataSource.segments[t],
|
|
2495
|
-
|
|
2496
|
+
var e = this._mediaDataSource.segments[t], a = this._ioctl = new qt.a(e, this._config, t);
|
|
2497
|
+
a.onError = this._onIOException.bind(this), a.onSeeked = this._onIOSeeked.bind(this), a.onComplete = this._onIOComplete.bind(this), a.onRedirect = this._onIORedirect.bind(this), a.onRecoveredEarlyEof = this._onIORecoveredEarlyEof.bind(this), i ? this._demuxer.bindDataSource(this._ioctl) : a.onDataArrival = this._onInitChunkArrival.bind(this), a.open(i);
|
|
2496
2498
|
}, r.prototype.stop = function() {
|
|
2497
2499
|
this._internalAbort(), this._disableStatisticsReporter();
|
|
2498
2500
|
}, r.prototype._internalAbort = function() {
|
|
@@ -2508,31 +2510,31 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2508
2510
|
var e = this._mediaInfo.segments[i];
|
|
2509
2511
|
if (e == null) this._pendingSeekTime = t;
|
|
2510
2512
|
else {
|
|
2511
|
-
var
|
|
2512
|
-
this._remuxer.seek(
|
|
2513
|
+
var a = e.getNearestKeyframe(t);
|
|
2514
|
+
this._remuxer.seek(a.milliseconds), this._ioctl.seek(a.fileposition), this._pendingResolveSeekPoint = a.milliseconds;
|
|
2513
2515
|
}
|
|
2514
2516
|
} else {
|
|
2515
2517
|
var s = this._mediaInfo.segments[i];
|
|
2516
|
-
s == null ? (this._pendingSeekTime = t, this._internalAbort(), this._remuxer.seek(), this._remuxer.insertDiscontinuity(), this._loadSegment(i)) : (
|
|
2518
|
+
s == null ? (this._pendingSeekTime = t, this._internalAbort(), this._remuxer.seek(), this._remuxer.insertDiscontinuity(), this._loadSegment(i)) : (a = s.getNearestKeyframe(t), this._internalAbort(), this._remuxer.seek(t), this._remuxer.insertDiscontinuity(), this._demuxer.resetMediaInfo(), this._demuxer.timestampBase = this._mediaDataSource.segments[i].timestampBase, this._loadSegment(i, a.fileposition), this._pendingResolveSeekPoint = a.milliseconds, this._reportSegmentMediaInfo(i));
|
|
2517
2519
|
}
|
|
2518
2520
|
this._enableStatisticsReporter();
|
|
2519
2521
|
}
|
|
2520
2522
|
}, r.prototype._searchSegmentIndexContains = function(t) {
|
|
2521
|
-
for (var i = this._mediaDataSource.segments, e = i.length - 1,
|
|
2522
|
-
e =
|
|
2523
|
+
for (var i = this._mediaDataSource.segments, e = i.length - 1, a = 0; a < i.length; a++) if (t < i[a].timestampBase) {
|
|
2524
|
+
e = a - 1;
|
|
2523
2525
|
break;
|
|
2524
2526
|
}
|
|
2525
2527
|
return e;
|
|
2526
2528
|
}, r.prototype._onInitChunkArrival = function(t, i) {
|
|
2527
|
-
var e = this,
|
|
2528
|
-
if (i > 0) this._demuxer.bindDataSource(this._ioctl), this._demuxer.timestampBase = this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,
|
|
2529
|
+
var e = this, a = 0;
|
|
2530
|
+
if (i > 0) this._demuxer.bindDataSource(this._ioctl), this._demuxer.timestampBase = this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase, a = this._demuxer.parseChunks(t, i);
|
|
2529
2531
|
else {
|
|
2530
2532
|
var s = null;
|
|
2531
|
-
(s = _.probe(t)).match && (this._setupFLVDemuxerRemuxer(s),
|
|
2533
|
+
(s = _.probe(t)).match && (this._setupFLVDemuxerRemuxer(s), a = this._demuxer.parseChunks(t, i)), s.match || s.needMoreData || (s = lt.probe(t)).match && (this._setupTSDemuxerRemuxer(s), a = this._demuxer.parseChunks(t, i)), s.match || s.needMoreData || (s = null, m.a.e(this.TAG, "Non MPEG-TS/FLV, Unsupported media type!"), Promise.resolve().then(function() {
|
|
2532
2534
|
e._internalAbort();
|
|
2533
2535
|
}), this._emitter.emit(Le.a.DEMUX_ERROR, Y.a.FORMAT_UNSUPPORTED, "Non MPEG-TS/FLV, Unsupported media type!"));
|
|
2534
2536
|
}
|
|
2535
|
-
return
|
|
2537
|
+
return a;
|
|
2536
2538
|
}, r.prototype._setupFLVDemuxerRemuxer = function(t) {
|
|
2537
2539
|
this._demuxer = new _(t, this._config), this._remuxer || (this._remuxer = new ct(this._config));
|
|
2538
2540
|
var i = this._mediaDataSource;
|
|
@@ -2545,8 +2547,8 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2545
2547
|
this._mediaInfo == null && (this._mediaInfo = Object.assign({}, t), this._mediaInfo.keyframesIndex = null, this._mediaInfo.segments = [], this._mediaInfo.segmentCount = this._mediaDataSource.segments.length, Object.setPrototypeOf(this._mediaInfo, y.a.prototype));
|
|
2546
2548
|
var e = Object.assign({}, t);
|
|
2547
2549
|
Object.setPrototypeOf(e, y.a.prototype), this._mediaInfo.segments[this._currentSegmentIndex] = e, this._reportSegmentMediaInfo(this._currentSegmentIndex), this._pendingSeekTime != null && Promise.resolve().then(function() {
|
|
2548
|
-
var
|
|
2549
|
-
i._pendingSeekTime = null, i.seek(
|
|
2550
|
+
var a = i._pendingSeekTime;
|
|
2551
|
+
i._pendingSeekTime = null, i.seek(a);
|
|
2550
2552
|
});
|
|
2551
2553
|
}, r.prototype._onMetaDataArrived = function(t) {
|
|
2552
2554
|
this._emitter.emit(Le.a.METADATA_ARRIVED, t);
|
|
@@ -2584,8 +2586,8 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2584
2586
|
this._emitter.emit(Le.a.INIT_SEGMENT, t, i);
|
|
2585
2587
|
}, r.prototype._onRemuxerMediaSegmentArrival = function(t, i) {
|
|
2586
2588
|
if (this._pendingSeekTime == null && (this._emitter.emit(Le.a.MEDIA_SEGMENT, t, i), this._pendingResolveSeekPoint != null && t === "video")) {
|
|
2587
|
-
var e = i.info.syncPoints,
|
|
2588
|
-
this._pendingResolveSeekPoint = null, b.a.safari && e.length > 0 && e[0].originalDts ===
|
|
2589
|
+
var e = i.info.syncPoints, a = this._pendingResolveSeekPoint;
|
|
2590
|
+
this._pendingResolveSeekPoint = null, b.a.safari && e.length > 0 && e[0].originalDts === a && (a = e[0].pts), this._emitter.emit(Le.a.RECOMMEND_SEEKPOINT, a);
|
|
2589
2591
|
}
|
|
2590
2592
|
}, r.prototype._enableStatisticsReporter = function() {
|
|
2591
2593
|
this._statisticsReporter == null && (this._statisticsReporter = self.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval));
|
|
@@ -2601,7 +2603,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2601
2603
|
}();
|
|
2602
2604
|
Z.a = Kt;
|
|
2603
2605
|
}, function(fe, Z, O) {
|
|
2604
|
-
var
|
|
2606
|
+
var x, B = O(0), m = function() {
|
|
2605
2607
|
function T() {
|
|
2606
2608
|
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;
|
|
2607
2609
|
}
|
|
@@ -2619,8 +2621,8 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2619
2621
|
var l = (this._now() - this._firstCheckpoint) / 1e3;
|
|
2620
2622
|
return this._totalBytes / l / 1024;
|
|
2621
2623
|
}, enumerable: !1, configurable: !0 }), T;
|
|
2622
|
-
}(), b = O(2), y = O(4), f = O(3),
|
|
2623
|
-
return (
|
|
2624
|
+
}(), b = O(2), y = O(4), f = O(3), k = (x = function(T, l) {
|
|
2625
|
+
return (x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(u, _) {
|
|
2624
2626
|
u.__proto__ = _;
|
|
2625
2627
|
} || function(u, _) {
|
|
2626
2628
|
for (var c in _) _.hasOwnProperty(c) && (u[c] = _[c]);
|
|
@@ -2629,13 +2631,13 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2629
2631
|
function u() {
|
|
2630
2632
|
this.constructor = T;
|
|
2631
2633
|
}
|
|
2632
|
-
|
|
2633
|
-
}),
|
|
2634
|
+
x(T, l), T.prototype = l === null ? Object.create(l) : (u.prototype = l.prototype, new u());
|
|
2635
|
+
}), U = function(T) {
|
|
2634
2636
|
function l(u, _) {
|
|
2635
2637
|
var c = T.call(this, "fetch-stream-loader") || this;
|
|
2636
2638
|
return c.TAG = "FetchStreamLoader", c._seekHandler = u, c._config = _, c._needStash = !0, c._requestAbort = !1, c._abortController = null, c._contentLength = null, c._receivedLength = 0, c;
|
|
2637
2639
|
}
|
|
2638
|
-
return
|
|
2640
|
+
return k(l, T), l.isSupported = function() {
|
|
2639
2641
|
try {
|
|
2640
2642
|
var u = y.a.msedge && y.a.version.minor >= 15048, _ = !y.a.msedge || u;
|
|
2641
2643
|
return self.fetch && self.ReadableStream && _;
|
|
@@ -2656,22 +2658,22 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2656
2658
|
}
|
|
2657
2659
|
var ye = { method: "GET", headers: F, mode: "cors", cache: "default", referrerPolicy: "no-referrer-when-downgrade" };
|
|
2658
2660
|
if (typeof this._config.headers == "object") for (var pe in this._config.headers) F.append(pe, this._config.headers[pe]);
|
|
2659
|
-
u.cors === !1 && (ye.mode = "same-origin"), u.withCredentials && (ye.credentials = "include"), u.referrerPolicy && (ye.referrerPolicy = u.referrerPolicy), self.AbortController && (this._abortController = new self.AbortController(), ye.signal = this._abortController.signal), this._status = b.c.kConnecting, self.fetch(D.url, ye).then(function(
|
|
2660
|
-
if (c._requestAbort) return c._status = b.c.kIdle, void
|
|
2661
|
-
if (
|
|
2662
|
-
if (
|
|
2663
|
-
var d = c._seekHandler.removeURLParameters(
|
|
2661
|
+
u.cors === !1 && (ye.mode = "same-origin"), u.withCredentials && (ye.credentials = "include"), u.referrerPolicy && (ye.referrerPolicy = u.referrerPolicy), self.AbortController && (this._abortController = new self.AbortController(), ye.signal = this._abortController.signal), this._status = b.c.kConnecting, self.fetch(D.url, ye).then(function(L) {
|
|
2662
|
+
if (c._requestAbort) return c._status = b.c.kIdle, void L.body.cancel();
|
|
2663
|
+
if (L.ok && L.status >= 200 && L.status <= 299) {
|
|
2664
|
+
if (L.url !== D.url && c._onURLRedirect) {
|
|
2665
|
+
var d = c._seekHandler.removeURLParameters(L.url);
|
|
2664
2666
|
c._onURLRedirect(d);
|
|
2665
2667
|
}
|
|
2666
|
-
var h =
|
|
2667
|
-
return h != null && (c._contentLength = parseInt(h), c._contentLength !== 0 && c._onContentLengthKnown && c._onContentLengthKnown(c._contentLength)), c._pump.call(c,
|
|
2668
|
+
var h = L.headers.get("Content-Length");
|
|
2669
|
+
return h != null && (c._contentLength = parseInt(h), c._contentLength !== 0 && c._onContentLengthKnown && c._onContentLengthKnown(c._contentLength)), c._pump.call(c, L.body.getReader());
|
|
2668
2670
|
}
|
|
2669
|
-
if (c._status = b.c.kError, !c._onError) throw new f.d("FetchStreamLoader: Http code invalid, " +
|
|
2670
|
-
c._onError(b.b.HTTP_STATUS_CODE_INVALID, { code:
|
|
2671
|
-
}).catch(function(
|
|
2671
|
+
if (c._status = b.c.kError, !c._onError) throw new f.d("FetchStreamLoader: Http code invalid, " + L.status + " " + L.statusText);
|
|
2672
|
+
c._onError(b.b.HTTP_STATUS_CODE_INVALID, { code: L.status, msg: L.statusText });
|
|
2673
|
+
}).catch(function(L) {
|
|
2672
2674
|
if (!c._abortController || !c._abortController.signal.aborted) {
|
|
2673
|
-
if (c._status = b.c.kError, !c._onError) throw
|
|
2674
|
-
c._onError(b.b.EXCEPTION, { code: -1, msg:
|
|
2675
|
+
if (c._status = b.c.kError, !c._onError) throw L;
|
|
2676
|
+
c._onError(b.b.EXCEPTION, { code: -1, msg: L.message });
|
|
2675
2677
|
}
|
|
2676
2678
|
});
|
|
2677
2679
|
}, l.prototype.abort = function() {
|
|
@@ -2958,7 +2960,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
2958
2960
|
if (!this._onError) throw new f.d(_.msg);
|
|
2959
2961
|
this._onError(b.b.EXCEPTION, _);
|
|
2960
2962
|
}, l;
|
|
2961
|
-
}(b.a),
|
|
2963
|
+
}(b.a), ae = function() {
|
|
2962
2964
|
function T(l) {
|
|
2963
2965
|
this._zeroStart = l || !1;
|
|
2964
2966
|
}
|
|
@@ -3045,7 +3047,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3045
3047
|
return this._loader.type;
|
|
3046
3048
|
}, enumerable: !1, configurable: !0 }), T.prototype._selectSeekHandler = function() {
|
|
3047
3049
|
var l = this._config;
|
|
3048
|
-
if (l.seekType === "range") this._seekHandler = new
|
|
3050
|
+
if (l.seekType === "range") this._seekHandler = new ae(this._config.rangeLoadZeroStart);
|
|
3049
3051
|
else if (l.seekType === "param") {
|
|
3050
3052
|
var u = l.seekParamStart || "bstart", _ = l.seekParamEnd || "bend";
|
|
3051
3053
|
this._seekHandler = new v(u, _);
|
|
@@ -3057,7 +3059,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3057
3059
|
}, T.prototype._selectLoader = function() {
|
|
3058
3060
|
if (this._config.customLoader != null) this._loaderClass = this._config.customLoader;
|
|
3059
3061
|
else if (this._isWebSocketURL) this._loaderClass = Y;
|
|
3060
|
-
else if (
|
|
3062
|
+
else if (U.isSupported()) this._loaderClass = U;
|
|
3061
3063
|
else if (V.isSupported()) this._loaderClass = V;
|
|
3062
3064
|
else {
|
|
3063
3065
|
if (!ue.isSupported()) throw new f.d("Your browser doesn't support xhr with arraybuffer responseType!");
|
|
@@ -3180,7 +3182,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3180
3182
|
}();
|
|
3181
3183
|
Z.a = G;
|
|
3182
3184
|
}, function(fe, Z, O) {
|
|
3183
|
-
var
|
|
3185
|
+
var x = function() {
|
|
3184
3186
|
function B() {
|
|
3185
3187
|
}
|
|
3186
3188
|
return B.install = function() {
|
|
@@ -3190,82 +3192,82 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3190
3192
|
if (m == null) throw new TypeError("Cannot convert undefined or null to object");
|
|
3191
3193
|
for (var b = Object(m), y = 1; y < arguments.length; y++) {
|
|
3192
3194
|
var f = arguments[y];
|
|
3193
|
-
if (f != null) for (var
|
|
3195
|
+
if (f != null) for (var k in f) f.hasOwnProperty(k) && (b[k] = f[k]);
|
|
3194
3196
|
}
|
|
3195
3197
|
return b;
|
|
3196
3198
|
}, typeof self.Promise != "function" && O(15).polyfill();
|
|
3197
3199
|
}, B;
|
|
3198
3200
|
}();
|
|
3199
|
-
|
|
3201
|
+
x.install(), Z.a = x;
|
|
3200
3202
|
}, function(fe, Z, O) {
|
|
3201
|
-
function
|
|
3203
|
+
function x(y) {
|
|
3202
3204
|
var f = {};
|
|
3203
|
-
function
|
|
3205
|
+
function k(C) {
|
|
3204
3206
|
if (f[C]) return f[C].exports;
|
|
3205
3207
|
var V = f[C] = { i: C, l: !1, exports: {} };
|
|
3206
|
-
return y[C].call(V.exports, V, V.exports,
|
|
3208
|
+
return y[C].call(V.exports, V, V.exports, k), V.l = !0, V.exports;
|
|
3207
3209
|
}
|
|
3208
|
-
|
|
3210
|
+
k.m = y, k.c = f, k.i = function(C) {
|
|
3209
3211
|
return C;
|
|
3210
|
-
},
|
|
3211
|
-
|
|
3212
|
-
},
|
|
3212
|
+
}, k.d = function(C, V, H) {
|
|
3213
|
+
k.o(C, V) || Object.defineProperty(C, V, { configurable: !1, enumerable: !0, get: H });
|
|
3214
|
+
}, k.r = function(C) {
|
|
3213
3215
|
Object.defineProperty(C, "__esModule", { value: !0 });
|
|
3214
|
-
},
|
|
3216
|
+
}, k.n = function(C) {
|
|
3215
3217
|
var V = C && C.__esModule ? function() {
|
|
3216
3218
|
return C.default;
|
|
3217
3219
|
} : function() {
|
|
3218
3220
|
return C;
|
|
3219
3221
|
};
|
|
3220
|
-
return
|
|
3221
|
-
},
|
|
3222
|
+
return k.d(V, "a", V), V;
|
|
3223
|
+
}, k.o = function(C, V) {
|
|
3222
3224
|
return Object.prototype.hasOwnProperty.call(C, V);
|
|
3223
|
-
},
|
|
3224
|
-
throw C;
|
|
3225
|
+
}, k.p = "/", k.oe = function(C) {
|
|
3226
|
+
throw console.error(C), C;
|
|
3225
3227
|
};
|
|
3226
|
-
var
|
|
3227
|
-
return
|
|
3228
|
+
var U = k(k.s = ENTRY_MODULE);
|
|
3229
|
+
return U.default || U;
|
|
3228
3230
|
}
|
|
3229
3231
|
function B(y) {
|
|
3230
3232
|
return (y + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
3231
3233
|
}
|
|
3232
|
-
function m(y, f,
|
|
3233
|
-
var
|
|
3234
|
-
|
|
3234
|
+
function m(y, f, k) {
|
|
3235
|
+
var U = {};
|
|
3236
|
+
U[k] = [];
|
|
3235
3237
|
var C = f.toString(), V = C.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
|
|
3236
|
-
if (!V) return
|
|
3237
|
-
for (var H, ue = V[1], se = new RegExp("(\\\\n|\\W)" + B(ue) + "\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)", "g"); H = se.exec(C); ) H[3] !== "dll-reference" &&
|
|
3238
|
-
for (se = new RegExp("\\(" + B(ue) + '\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)', "g"); H = se.exec(C); ) y[H[2]] || (
|
|
3239
|
-
for (var Y,
|
|
3240
|
-
return
|
|
3238
|
+
if (!V) return U;
|
|
3239
|
+
for (var H, ue = V[1], se = new RegExp("(\\\\n|\\W)" + B(ue) + "\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)", "g"); H = se.exec(C); ) H[3] !== "dll-reference" && U[k].push(H[3]);
|
|
3240
|
+
for (se = new RegExp("\\(" + B(ue) + '\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)', "g"); H = se.exec(C); ) y[H[2]] || (U[k].push(H[1]), y[H[2]] = O(H[1]).m), U[H[2]] = U[H[2]] || [], U[H[2]].push(H[4]);
|
|
3241
|
+
for (var Y, ae = Object.keys(U), v = 0; v < ae.length; v++) for (var G = 0; G < U[ae[v]].length; G++) Y = U[ae[v]][G], isNaN(1 * Y) || (U[ae[v]][G] = 1 * U[ae[v]][G]);
|
|
3242
|
+
return U;
|
|
3241
3243
|
}
|
|
3242
3244
|
function b(y) {
|
|
3243
|
-
return Object.keys(y).reduce(function(f,
|
|
3244
|
-
return f || y[
|
|
3245
|
+
return Object.keys(y).reduce(function(f, k) {
|
|
3246
|
+
return f || y[k].length > 0;
|
|
3245
3247
|
}, !1);
|
|
3246
3248
|
}
|
|
3247
3249
|
fe.exports = function(y, f) {
|
|
3248
3250
|
f = f || {};
|
|
3249
|
-
var
|
|
3250
|
-
for (var
|
|
3251
|
-
var u = T[l], _ =
|
|
3251
|
+
var k = { main: O.m }, U = f.all ? { main: Object.keys(k.main) } : function(se, Y) {
|
|
3252
|
+
for (var ae = { main: [Y] }, v = { main: [] }, G = { main: {} }; b(ae); ) for (var T = Object.keys(ae), l = 0; l < T.length; l++) {
|
|
3253
|
+
var u = T[l], _ = ae[u].pop();
|
|
3252
3254
|
if (G[u] = G[u] || {}, !G[u][_] && se[u][_]) {
|
|
3253
3255
|
G[u][_] = !0, v[u] = v[u] || [], v[u].push(_);
|
|
3254
|
-
for (var c = m(se, se[u][_], u), P = Object.keys(c), D = 0; D < P.length; D++)
|
|
3256
|
+
for (var c = m(se, se[u][_], u), P = Object.keys(c), D = 0; D < P.length; D++) ae[P[D]] = ae[P[D]] || [], ae[P[D]] = ae[P[D]].concat(c[P[D]]);
|
|
3255
3257
|
}
|
|
3256
3258
|
}
|
|
3257
3259
|
return v;
|
|
3258
|
-
}(
|
|
3259
|
-
Object.keys(
|
|
3260
|
+
}(k, y), C = "";
|
|
3261
|
+
Object.keys(U).filter(function(se) {
|
|
3260
3262
|
return se !== "main";
|
|
3261
3263
|
}).forEach(function(se) {
|
|
3262
|
-
for (var Y = 0;
|
|
3263
|
-
|
|
3264
|
-
return JSON.stringify(
|
|
3264
|
+
for (var Y = 0; U[se][Y]; ) Y++;
|
|
3265
|
+
U[se].push(Y), k[se][Y] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", C = C + "var " + se + " = (" + x.toString().replace("ENTRY_MODULE", JSON.stringify(Y)) + ")({" + U[se].map(function(ae) {
|
|
3266
|
+
return JSON.stringify(ae) + ": " + k[se][ae].toString();
|
|
3265
3267
|
}).join(",") + `});
|
|
3266
3268
|
`;
|
|
3267
|
-
}), C = C + "new ((" +
|
|
3268
|
-
return JSON.stringify(se) + ": " +
|
|
3269
|
+
}), C = C + "new ((" + x.toString().replace("ENTRY_MODULE", JSON.stringify(y)) + ")({" + U.main.map(function(se) {
|
|
3270
|
+
return JSON.stringify(se) + ": " + k.main[se].toString();
|
|
3269
3271
|
}).join(",") + "}))(self);";
|
|
3270
3272
|
var V = new window.Blob([C], { type: "text/javascript" });
|
|
3271
3273
|
if (f.bare) return V;
|
|
@@ -3275,7 +3277,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3275
3277
|
}, function(fe, Z, O) {
|
|
3276
3278
|
fe.exports = O(19).default;
|
|
3277
3279
|
}, function(fe, Z, O) {
|
|
3278
|
-
(function(
|
|
3280
|
+
(function(x, B) {
|
|
3279
3281
|
/*!
|
|
3280
3282
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
3281
3283
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
@@ -3290,10 +3292,10 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3290
3292
|
}
|
|
3291
3293
|
var y = Array.isArray ? Array.isArray : function(M) {
|
|
3292
3294
|
return Object.prototype.toString.call(M) === "[object Array]";
|
|
3293
|
-
}, f = 0,
|
|
3294
|
-
v[f] = M, v[f + 1] = j, (f += 2) === 2 && (
|
|
3295
|
-
}, V = typeof window < "u" ? window : void 0, H = V || {}, ue = H.MutationObserver || H.WebKitMutationObserver, se = typeof self > "u" &&
|
|
3296
|
-
function
|
|
3295
|
+
}, f = 0, k = void 0, U = void 0, C = function(M, j) {
|
|
3296
|
+
v[f] = M, v[f + 1] = j, (f += 2) === 2 && (U ? U(G) : c());
|
|
3297
|
+
}, V = typeof window < "u" ? window : void 0, H = V || {}, ue = H.MutationObserver || H.WebKitMutationObserver, se = typeof self > "u" && x !== void 0 && {}.toString.call(x) === "[object process]", Y = typeof Uint8ClampedArray < "u" && typeof importScripts < "u" && typeof MessageChannel < "u";
|
|
3298
|
+
function ae() {
|
|
3297
3299
|
var M = setTimeout;
|
|
3298
3300
|
return function() {
|
|
3299
3301
|
return M(G, 1);
|
|
@@ -3323,7 +3325,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3323
3325
|
return ye(j, M), j;
|
|
3324
3326
|
}
|
|
3325
3327
|
se ? c = function() {
|
|
3326
|
-
return
|
|
3328
|
+
return x.nextTick(G);
|
|
3327
3329
|
} : ue ? (l = 0, u = new ue(G), _ = document.createTextNode(""), u.observe(_, { characterData: !0 }), c = function() {
|
|
3328
3330
|
_.data = l = ++l % 2;
|
|
3329
3331
|
}) : Y ? ((T = new MessageChannel()).port1.onmessage = G, c = function() {
|
|
@@ -3331,13 +3333,13 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3331
3333
|
}) : c = V === void 0 ? function() {
|
|
3332
3334
|
try {
|
|
3333
3335
|
var M = Function("return this")().require("vertx");
|
|
3334
|
-
return (
|
|
3335
|
-
|
|
3336
|
-
} :
|
|
3336
|
+
return (k = M.runOnLoop || M.runOnContext) !== void 0 ? function() {
|
|
3337
|
+
k(G);
|
|
3338
|
+
} : ae();
|
|
3337
3339
|
} catch {
|
|
3338
|
-
return
|
|
3340
|
+
return ae();
|
|
3339
3341
|
}
|
|
3340
|
-
}() :
|
|
3342
|
+
}() : ae();
|
|
3341
3343
|
var F = Math.random().toString(36).substring(2);
|
|
3342
3344
|
function ee() {
|
|
3343
3345
|
}
|
|
@@ -3379,14 +3381,14 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3379
3381
|
}
|
|
3380
3382
|
var ie, re;
|
|
3381
3383
|
}
|
|
3382
|
-
function
|
|
3384
|
+
function L(M) {
|
|
3383
3385
|
M._onerror && M._onerror(M._result), X(M);
|
|
3384
3386
|
}
|
|
3385
3387
|
function d(M, j) {
|
|
3386
3388
|
M._state === void 0 && (M._result = j, M._state = 1, M._subscribers.length !== 0 && C(X, M));
|
|
3387
3389
|
}
|
|
3388
3390
|
function h(M, j) {
|
|
3389
|
-
M._state === void 0 && (M._state = 2, M._result = j, C(
|
|
3391
|
+
M._state === void 0 && (M._state = 2, M._result = j, C(L, M));
|
|
3390
3392
|
}
|
|
3391
3393
|
function R(M, j, $, ie) {
|
|
3392
3394
|
var re = M._subscribers, ce = re.length;
|
|
@@ -3496,7 +3498,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3496
3498
|
var j = new this(ee);
|
|
3497
3499
|
return h(j, M), j;
|
|
3498
3500
|
}, Te._setScheduler = function(M) {
|
|
3499
|
-
|
|
3501
|
+
U = M;
|
|
3500
3502
|
}, Te._setAsap = function(M) {
|
|
3501
3503
|
C = M;
|
|
3502
3504
|
}, Te._asap = C, Te.polyfill = function() {
|
|
@@ -3522,7 +3524,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3522
3524
|
}, fe.exports = m();
|
|
3523
3525
|
}).call(this, O(16), O(17));
|
|
3524
3526
|
}, function(fe, Z) {
|
|
3525
|
-
var O,
|
|
3527
|
+
var O, x, B = fe.exports = {};
|
|
3526
3528
|
function m() {
|
|
3527
3529
|
throw new Error("setTimeout has not been defined");
|
|
3528
3530
|
}
|
|
@@ -3549,47 +3551,47 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3549
3551
|
O = m;
|
|
3550
3552
|
}
|
|
3551
3553
|
try {
|
|
3552
|
-
|
|
3554
|
+
x = typeof clearTimeout == "function" ? clearTimeout : b;
|
|
3553
3555
|
} catch {
|
|
3554
|
-
|
|
3556
|
+
x = b;
|
|
3555
3557
|
}
|
|
3556
3558
|
})();
|
|
3557
|
-
var f,
|
|
3559
|
+
var f, k = [], U = !1, C = -1;
|
|
3558
3560
|
function V() {
|
|
3559
|
-
|
|
3561
|
+
U && f && (U = !1, f.length ? k = f.concat(k) : C = -1, k.length && H());
|
|
3560
3562
|
}
|
|
3561
3563
|
function H() {
|
|
3562
|
-
if (!
|
|
3564
|
+
if (!U) {
|
|
3563
3565
|
var Y = y(V);
|
|
3564
|
-
|
|
3565
|
-
for (var
|
|
3566
|
-
for (f =
|
|
3567
|
-
C = -1,
|
|
3568
|
-
}
|
|
3569
|
-
f = null,
|
|
3570
|
-
if (
|
|
3571
|
-
if ((
|
|
3566
|
+
U = !0;
|
|
3567
|
+
for (var ae = k.length; ae; ) {
|
|
3568
|
+
for (f = k, k = []; ++C < ae; ) f && f[C].run();
|
|
3569
|
+
C = -1, ae = k.length;
|
|
3570
|
+
}
|
|
3571
|
+
f = null, U = !1, function(v) {
|
|
3572
|
+
if (x === clearTimeout) return clearTimeout(v);
|
|
3573
|
+
if ((x === b || !x) && clearTimeout) return x = clearTimeout, clearTimeout(v);
|
|
3572
3574
|
try {
|
|
3573
|
-
|
|
3575
|
+
x(v);
|
|
3574
3576
|
} catch {
|
|
3575
3577
|
try {
|
|
3576
|
-
return
|
|
3578
|
+
return x.call(null, v);
|
|
3577
3579
|
} catch {
|
|
3578
|
-
return
|
|
3580
|
+
return x.call(this, v);
|
|
3579
3581
|
}
|
|
3580
3582
|
}
|
|
3581
3583
|
}(Y);
|
|
3582
3584
|
}
|
|
3583
3585
|
}
|
|
3584
|
-
function ue(Y,
|
|
3585
|
-
this.fun = Y, this.array =
|
|
3586
|
+
function ue(Y, ae) {
|
|
3587
|
+
this.fun = Y, this.array = ae;
|
|
3586
3588
|
}
|
|
3587
3589
|
function se() {
|
|
3588
3590
|
}
|
|
3589
3591
|
B.nextTick = function(Y) {
|
|
3590
|
-
var
|
|
3591
|
-
if (arguments.length > 1) for (var v = 1; v < arguments.length; v++)
|
|
3592
|
-
|
|
3592
|
+
var ae = new Array(arguments.length - 1);
|
|
3593
|
+
if (arguments.length > 1) for (var v = 1; v < arguments.length; v++) ae[v - 1] = arguments[v];
|
|
3594
|
+
k.push(new ue(Y, ae)), k.length !== 1 || U || y(H);
|
|
3593
3595
|
}, ue.prototype.run = function() {
|
|
3594
3596
|
this.fun.apply(null, this.array);
|
|
3595
3597
|
}, B.title = "browser", B.browser = !0, B.env = {}, B.argv = [], B.version = "", B.versions = {}, B.on = se, B.addListener = se, B.once = se, B.off = se, B.removeListener = se, B.removeAllListeners = se, B.emit = se, B.prependListener = se, B.prependOnceListener = se, B.listeners = function(Y) {
|
|
@@ -3616,12 +3618,12 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3616
3618
|
fe.exports = O;
|
|
3617
3619
|
}, function(fe, Z, O) {
|
|
3618
3620
|
O.r(Z);
|
|
3619
|
-
var
|
|
3621
|
+
var x = O(9), B = O(12), m = O(10), b = O(1);
|
|
3620
3622
|
Z.default = function(y) {
|
|
3621
|
-
var f = null,
|
|
3623
|
+
var f = null, k = (function(D, F) {
|
|
3622
3624
|
y.postMessage({ msg: "logcat_callback", data: { type: D, logcat: F } });
|
|
3623
3625
|
}).bind(this);
|
|
3624
|
-
function
|
|
3626
|
+
function U(D, F) {
|
|
3625
3627
|
var ee = { msg: b.a.INIT_SEGMENT, data: { type: D, data: F } };
|
|
3626
3628
|
y.postMessage(ee, [F.data]);
|
|
3627
3629
|
}
|
|
@@ -3649,7 +3651,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3649
3651
|
var F = { msg: b.a.SCRIPTDATA_ARRIVED, data: D };
|
|
3650
3652
|
y.postMessage(F);
|
|
3651
3653
|
}
|
|
3652
|
-
function
|
|
3654
|
+
function ae(D) {
|
|
3653
3655
|
var F = { msg: b.a.TIMED_ID3_METADATA_ARRIVED, data: D };
|
|
3654
3656
|
y.postMessage(F);
|
|
3655
3657
|
}
|
|
@@ -3685,7 +3687,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3685
3687
|
B.a.install(), y.addEventListener("message", function(D) {
|
|
3686
3688
|
switch (D.data.cmd) {
|
|
3687
3689
|
case "init":
|
|
3688
|
-
(f = new m.a(D.data.param[0], D.data.param[1])).on(b.a.IO_ERROR, _.bind(this)), f.on(b.a.DEMUX_ERROR, c.bind(this)), f.on(b.a.INIT_SEGMENT,
|
|
3690
|
+
(f = new m.a(D.data.param[0], D.data.param[1])).on(b.a.IO_ERROR, _.bind(this)), f.on(b.a.DEMUX_ERROR, c.bind(this)), f.on(b.a.INIT_SEGMENT, U.bind(this)), f.on(b.a.MEDIA_SEGMENT, C.bind(this)), f.on(b.a.LOADING_COMPLETE, V.bind(this)), f.on(b.a.RECOVERED_EARLY_EOF, H.bind(this)), f.on(b.a.MEDIA_INFO, ue.bind(this)), f.on(b.a.METADATA_ARRIVED, se.bind(this)), f.on(b.a.SCRIPTDATA_ARRIVED, Y.bind(this)), f.on(b.a.TIMED_ID3_METADATA_ARRIVED, ae.bind(this)), f.on(b.a.SMPTE2038_METADATA_ARRIVED, v.bind(this)), f.on(b.a.SCTE35_METADATA_ARRIVED, G.bind(this)), f.on(b.a.PES_PRIVATE_DATA_DESCRIPTOR, T.bind(this)), f.on(b.a.PES_PRIVATE_DATA_ARRIVED, l.bind(this)), f.on(b.a.STATISTICS_INFO, u.bind(this)), f.on(b.a.RECOMMEND_SEEKPOINT, P.bind(this));
|
|
3689
3691
|
break;
|
|
3690
3692
|
case "destroy":
|
|
3691
3693
|
f && (f.destroy(), f = null), y.postMessage({ msg: "destroyed" });
|
|
@@ -3707,151 +3709,151 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3707
3709
|
break;
|
|
3708
3710
|
case "logging_config":
|
|
3709
3711
|
var F = D.data.param;
|
|
3710
|
-
|
|
3712
|
+
x.a.applyConfig(F), F.enableCallback === !0 ? x.a.addLogListener(k) : x.a.removeLogListener(k);
|
|
3711
3713
|
}
|
|
3712
3714
|
});
|
|
3713
3715
|
};
|
|
3714
3716
|
}, function(fe, Z, O) {
|
|
3715
3717
|
O.r(Z);
|
|
3716
|
-
var
|
|
3718
|
+
var x = O(12), B = O(11), m = { enableWorker: !1, enableStashBuffer: !0, stashInitialSize: void 0, isLive: !1, liveBufferLatencyChasing: !1, liveBufferLatencyMaxLatency: 1.5, liveBufferLatencyMinRemain: 0.5, lazyLoad: !0, lazyLoadMaxDuration: 180, lazyLoadRecoverDuration: 30, deferLoadAfterSourceOpen: !0, autoCleanupMaxBackwardDuration: 180, autoCleanupMinBackwardDuration: 120, statisticsInfoReportInterval: 600, fixAudioTimestampGap: !0, accurateSeek: !1, seekType: "range", seekParamStart: "bstart", seekParamEnd: "bend", rangeLoadZeroStart: !1, customSeekHandler: void 0, reuseRedirectedURL: !1, headers: void 0, customLoader: void 0 };
|
|
3717
3719
|
function b() {
|
|
3718
3720
|
return Object.assign({}, m);
|
|
3719
3721
|
}
|
|
3720
3722
|
var y = function() {
|
|
3721
|
-
function
|
|
3723
|
+
function L() {
|
|
3722
3724
|
}
|
|
3723
|
-
return
|
|
3725
|
+
return L.supportMSEH264Playback = function() {
|
|
3724
3726
|
return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
|
|
3725
|
-
},
|
|
3727
|
+
}, L.supportMSEH265Playback = function() {
|
|
3726
3728
|
return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"');
|
|
3727
|
-
},
|
|
3729
|
+
}, L.supportNetworkStreamIO = function() {
|
|
3728
3730
|
var d = new B.a({}, b()), h = d.loaderType;
|
|
3729
3731
|
return d.destroy(), h == "fetch-stream-loader" || h == "xhr-moz-chunked-loader";
|
|
3730
|
-
},
|
|
3732
|
+
}, L.getNetworkLoaderTypeName = function() {
|
|
3731
3733
|
var d = new B.a({}, b()), h = d.loaderType;
|
|
3732
3734
|
return d.destroy(), h;
|
|
3733
|
-
},
|
|
3734
|
-
|
|
3735
|
-
var h =
|
|
3735
|
+
}, L.supportNativeMediaPlayback = function(d) {
|
|
3736
|
+
L.videoElement == null && (L.videoElement = window.document.createElement("video"));
|
|
3737
|
+
var h = L.videoElement.canPlayType(d);
|
|
3736
3738
|
return h === "probably" || h == "maybe";
|
|
3737
|
-
},
|
|
3739
|
+
}, L.getFeatureList = function() {
|
|
3738
3740
|
var d = { msePlayback: !1, mseLivePlayback: !1, mseH265Playback: !1, networkStreamIO: !1, networkLoaderName: "", nativeMP4H264Playback: !1, nativeMP4H265Playback: !1, nativeWebmVP8Playback: !1, nativeWebmVP9Playback: !1 };
|
|
3739
|
-
return d.msePlayback =
|
|
3740
|
-
},
|
|
3741
|
-
}(), f = O(2),
|
|
3742
|
-
function
|
|
3743
|
-
if (this.TAG = "Transmuxer", this._emitter = new
|
|
3741
|
+
return d.msePlayback = L.supportMSEH264Playback(), d.networkStreamIO = L.supportNetworkStreamIO(), d.networkLoaderName = L.getNetworkLoaderTypeName(), d.mseLivePlayback = d.msePlayback && d.networkStreamIO, d.mseH265Playback = L.supportMSEH265Playback(), d.nativeMP4H264Playback = L.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'), d.nativeMP4H265Playback = L.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'), d.nativeWebmVP8Playback = L.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'), d.nativeWebmVP9Playback = L.supportNativeMediaPlayback('video/webm; codecs="vp9"'), d;
|
|
3742
|
+
}, L;
|
|
3743
|
+
}(), f = O(2), k = O(6), U = O.n(k), C = O(0), V = O(4), H = { ERROR: "error", LOADING_COMPLETE: "loading_complete", RECOVERED_EARLY_EOF: "recovered_early_eof", MEDIA_INFO: "media_info", METADATA_ARRIVED: "metadata_arrived", SCRIPTDATA_ARRIVED: "scriptdata_arrived", TIMED_ID3_METADATA_ARRIVED: "timed_id3_metadata_arrived", SMPTE2038_METADATA_ARRIVED: "smpte2038_metadata_arrived", SCTE35_METADATA_ARRIVED: "scte35_metadata_arrived", PES_PRIVATE_DATA_DESCRIPTOR: "pes_private_data_descriptor", PES_PRIVATE_DATA_ARRIVED: "pes_private_data_arrived", STATISTICS_INFO: "statistics_info" }, ue = O(13), se = O.n(ue), Y = O(9), ae = O(10), v = O(1), G = O(8), T = function() {
|
|
3744
|
+
function L(d, h) {
|
|
3745
|
+
if (this.TAG = "Transmuxer", this._emitter = new U.a(), h.enableWorker && typeof Worker < "u") try {
|
|
3744
3746
|
this._worker = se()(18), this._workerDestroying = !1, this._worker.addEventListener("message", this._onWorkerMessage.bind(this)), this._worker.postMessage({ cmd: "init", param: [d, h] }), this.e = { onLoggingConfigChanged: this._onLoggingConfigChanged.bind(this) }, Y.a.registerListener(this.e.onLoggingConfigChanged), this._worker.postMessage({ cmd: "logging_config", param: Y.a.getConfig() });
|
|
3745
3747
|
} catch {
|
|
3746
|
-
C.a.e(this.TAG, "Error while initialize transmuxing worker, fallback to inline transmuxing"), this._worker = null, this._controller = new
|
|
3748
|
+
C.a.e(this.TAG, "Error while initialize transmuxing worker, fallback to inline transmuxing"), this._worker = null, this._controller = new ae.a(d, h);
|
|
3747
3749
|
}
|
|
3748
|
-
else this._controller = new
|
|
3750
|
+
else this._controller = new ae.a(d, h);
|
|
3749
3751
|
if (this._controller) {
|
|
3750
3752
|
var R = this._controller;
|
|
3751
3753
|
R.on(v.a.IO_ERROR, this._onIOError.bind(this)), R.on(v.a.DEMUX_ERROR, this._onDemuxError.bind(this)), R.on(v.a.INIT_SEGMENT, this._onInitSegment.bind(this)), R.on(v.a.MEDIA_SEGMENT, this._onMediaSegment.bind(this)), R.on(v.a.LOADING_COMPLETE, this._onLoadingComplete.bind(this)), R.on(v.a.RECOVERED_EARLY_EOF, this._onRecoveredEarlyEof.bind(this)), R.on(v.a.MEDIA_INFO, this._onMediaInfo.bind(this)), R.on(v.a.METADATA_ARRIVED, this._onMetaDataArrived.bind(this)), R.on(v.a.SCRIPTDATA_ARRIVED, this._onScriptDataArrived.bind(this)), R.on(v.a.TIMED_ID3_METADATA_ARRIVED, this._onTimedID3MetadataArrived.bind(this)), R.on(v.a.SMPTE2038_METADATA_ARRIVED, this._onSMPTE2038MetadataArrived.bind(this)), R.on(v.a.SCTE35_METADATA_ARRIVED, this._onSCTE35MetadataArrived.bind(this)), R.on(v.a.PES_PRIVATE_DATA_DESCRIPTOR, this._onPESPrivateDataDescriptor.bind(this)), R.on(v.a.PES_PRIVATE_DATA_ARRIVED, this._onPESPrivateDataArrived.bind(this)), R.on(v.a.STATISTICS_INFO, this._onStatisticsInfo.bind(this)), R.on(v.a.RECOMMEND_SEEKPOINT, this._onRecommendSeekpoint.bind(this));
|
|
3752
3754
|
}
|
|
3753
3755
|
}
|
|
3754
|
-
return
|
|
3756
|
+
return L.prototype.destroy = function() {
|
|
3755
3757
|
this._worker ? this._workerDestroying || (this._workerDestroying = !0, this._worker.postMessage({ cmd: "destroy" }), Y.a.removeListener(this.e.onLoggingConfigChanged), this.e = null) : (this._controller.destroy(), this._controller = null), this._emitter.removeAllListeners(), this._emitter = null;
|
|
3756
|
-
},
|
|
3758
|
+
}, L.prototype.on = function(d, h) {
|
|
3757
3759
|
this._emitter.addListener(d, h);
|
|
3758
|
-
},
|
|
3760
|
+
}, L.prototype.off = function(d, h) {
|
|
3759
3761
|
this._emitter.removeListener(d, h);
|
|
3760
|
-
},
|
|
3762
|
+
}, L.prototype.hasWorker = function() {
|
|
3761
3763
|
return this._worker != null;
|
|
3762
|
-
},
|
|
3764
|
+
}, L.prototype.open = function() {
|
|
3763
3765
|
this._worker ? this._worker.postMessage({ cmd: "start" }) : this._controller.start();
|
|
3764
|
-
},
|
|
3766
|
+
}, L.prototype.close = function() {
|
|
3765
3767
|
this._worker ? this._worker.postMessage({ cmd: "stop" }) : this._controller.stop();
|
|
3766
|
-
},
|
|
3768
|
+
}, L.prototype.seek = function(d) {
|
|
3767
3769
|
this._worker ? this._worker.postMessage({ cmd: "seek", param: d }) : this._controller.seek(d);
|
|
3768
|
-
},
|
|
3770
|
+
}, L.prototype.pause = function() {
|
|
3769
3771
|
this._worker ? this._worker.postMessage({ cmd: "pause" }) : this._controller.pause();
|
|
3770
|
-
},
|
|
3772
|
+
}, L.prototype.resume = function() {
|
|
3771
3773
|
this._worker ? this._worker.postMessage({ cmd: "resume" }) : this._controller.resume();
|
|
3772
|
-
},
|
|
3774
|
+
}, L.prototype._onInitSegment = function(d, h) {
|
|
3773
3775
|
var R = this;
|
|
3774
3776
|
Promise.resolve().then(function() {
|
|
3775
3777
|
R._emitter.emit(v.a.INIT_SEGMENT, d, h);
|
|
3776
3778
|
});
|
|
3777
|
-
},
|
|
3779
|
+
}, L.prototype._onMediaSegment = function(d, h) {
|
|
3778
3780
|
var R = this;
|
|
3779
3781
|
Promise.resolve().then(function() {
|
|
3780
3782
|
R._emitter.emit(v.a.MEDIA_SEGMENT, d, h);
|
|
3781
3783
|
});
|
|
3782
|
-
},
|
|
3784
|
+
}, L.prototype._onLoadingComplete = function() {
|
|
3783
3785
|
var d = this;
|
|
3784
3786
|
Promise.resolve().then(function() {
|
|
3785
3787
|
d._emitter.emit(v.a.LOADING_COMPLETE);
|
|
3786
3788
|
});
|
|
3787
|
-
},
|
|
3789
|
+
}, L.prototype._onRecoveredEarlyEof = function() {
|
|
3788
3790
|
var d = this;
|
|
3789
3791
|
Promise.resolve().then(function() {
|
|
3790
3792
|
d._emitter.emit(v.a.RECOVERED_EARLY_EOF);
|
|
3791
3793
|
});
|
|
3792
|
-
},
|
|
3794
|
+
}, L.prototype._onMediaInfo = function(d) {
|
|
3793
3795
|
var h = this;
|
|
3794
3796
|
Promise.resolve().then(function() {
|
|
3795
3797
|
h._emitter.emit(v.a.MEDIA_INFO, d);
|
|
3796
3798
|
});
|
|
3797
|
-
},
|
|
3799
|
+
}, L.prototype._onMetaDataArrived = function(d) {
|
|
3798
3800
|
var h = this;
|
|
3799
3801
|
Promise.resolve().then(function() {
|
|
3800
3802
|
h._emitter.emit(v.a.METADATA_ARRIVED, d);
|
|
3801
3803
|
});
|
|
3802
|
-
},
|
|
3804
|
+
}, L.prototype._onScriptDataArrived = function(d) {
|
|
3803
3805
|
var h = this;
|
|
3804
3806
|
Promise.resolve().then(function() {
|
|
3805
3807
|
h._emitter.emit(v.a.SCRIPTDATA_ARRIVED, d);
|
|
3806
3808
|
});
|
|
3807
|
-
},
|
|
3809
|
+
}, L.prototype._onTimedID3MetadataArrived = function(d) {
|
|
3808
3810
|
var h = this;
|
|
3809
3811
|
Promise.resolve().then(function() {
|
|
3810
3812
|
h._emitter.emit(v.a.TIMED_ID3_METADATA_ARRIVED, d);
|
|
3811
3813
|
});
|
|
3812
|
-
},
|
|
3814
|
+
}, L.prototype._onSMPTE2038MetadataArrived = function(d) {
|
|
3813
3815
|
var h = this;
|
|
3814
3816
|
Promise.resolve().then(function() {
|
|
3815
3817
|
h._emitter.emit(v.a.SMPTE2038_METADATA_ARRIVED, d);
|
|
3816
3818
|
});
|
|
3817
|
-
},
|
|
3819
|
+
}, L.prototype._onSCTE35MetadataArrived = function(d) {
|
|
3818
3820
|
var h = this;
|
|
3819
3821
|
Promise.resolve().then(function() {
|
|
3820
3822
|
h._emitter.emit(v.a.SCTE35_METADATA_ARRIVED, d);
|
|
3821
3823
|
});
|
|
3822
|
-
},
|
|
3824
|
+
}, L.prototype._onPESPrivateDataDescriptor = function(d) {
|
|
3823
3825
|
var h = this;
|
|
3824
3826
|
Promise.resolve().then(function() {
|
|
3825
3827
|
h._emitter.emit(v.a.PES_PRIVATE_DATA_DESCRIPTOR, d);
|
|
3826
3828
|
});
|
|
3827
|
-
},
|
|
3829
|
+
}, L.prototype._onPESPrivateDataArrived = function(d) {
|
|
3828
3830
|
var h = this;
|
|
3829
3831
|
Promise.resolve().then(function() {
|
|
3830
3832
|
h._emitter.emit(v.a.PES_PRIVATE_DATA_ARRIVED, d);
|
|
3831
3833
|
});
|
|
3832
|
-
},
|
|
3834
|
+
}, L.prototype._onStatisticsInfo = function(d) {
|
|
3833
3835
|
var h = this;
|
|
3834
3836
|
Promise.resolve().then(function() {
|
|
3835
3837
|
h._emitter.emit(v.a.STATISTICS_INFO, d);
|
|
3836
3838
|
});
|
|
3837
|
-
},
|
|
3839
|
+
}, L.prototype._onIOError = function(d, h) {
|
|
3838
3840
|
var R = this;
|
|
3839
3841
|
Promise.resolve().then(function() {
|
|
3840
3842
|
R._emitter.emit(v.a.IO_ERROR, d, h);
|
|
3841
3843
|
});
|
|
3842
|
-
},
|
|
3844
|
+
}, L.prototype._onDemuxError = function(d, h) {
|
|
3843
3845
|
var R = this;
|
|
3844
3846
|
Promise.resolve().then(function() {
|
|
3845
3847
|
R._emitter.emit(v.a.DEMUX_ERROR, d, h);
|
|
3846
3848
|
});
|
|
3847
|
-
},
|
|
3849
|
+
}, L.prototype._onRecommendSeekpoint = function(d) {
|
|
3848
3850
|
var h = this;
|
|
3849
3851
|
Promise.resolve().then(function() {
|
|
3850
3852
|
h._emitter.emit(v.a.RECOMMEND_SEEKPOINT, d);
|
|
3851
3853
|
});
|
|
3852
|
-
},
|
|
3854
|
+
}, L.prototype._onLoggingConfigChanged = function(d) {
|
|
3853
3855
|
this._worker && this._worker.postMessage({ cmd: "logging_config", param: d });
|
|
3854
|
-
},
|
|
3856
|
+
}, L.prototype._onWorkerMessage = function(d) {
|
|
3855
3857
|
var h = d.data, R = h.data;
|
|
3856
3858
|
if (h.msg === "destroyed" || this._workerDestroying) return this._workerDestroying = !1, this._worker.terminate(), void (this._worker = null);
|
|
3857
3859
|
switch (h.msg) {
|
|
@@ -3886,22 +3888,22 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3886
3888
|
case "logcat_callback":
|
|
3887
3889
|
C.a.emitter.emit("log", R.type, R.logcat);
|
|
3888
3890
|
}
|
|
3889
|
-
},
|
|
3891
|
+
}, L;
|
|
3890
3892
|
}(), l = { ERROR: "error", SOURCE_OPEN: "source_open", UPDATE_END: "update_end", BUFFER_FULL: "buffer_full" }, u = O(7), _ = O(3), c = function() {
|
|
3891
|
-
function
|
|
3892
|
-
this.TAG = "MSEController", this._config = d, this._emitter = new
|
|
3893
|
+
function L(d) {
|
|
3894
|
+
this.TAG = "MSEController", this._config = d, this._emitter = new U.a(), 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 u.a();
|
|
3893
3895
|
}
|
|
3894
|
-
return
|
|
3896
|
+
return L.prototype.destroy = function() {
|
|
3895
3897
|
(this._mediaElement || this._mediaSource) && this.detachMediaElement(), this.e = null, this._emitter.removeAllListeners(), this._emitter = null;
|
|
3896
|
-
},
|
|
3898
|
+
}, L.prototype.on = function(d, h) {
|
|
3897
3899
|
this._emitter.addListener(d, h);
|
|
3898
|
-
},
|
|
3900
|
+
}, L.prototype.off = function(d, h) {
|
|
3899
3901
|
this._emitter.removeListener(d, h);
|
|
3900
|
-
},
|
|
3902
|
+
}, L.prototype.attachMediaElement = function(d) {
|
|
3901
3903
|
if (this._mediaSource) throw new _.a("MediaSource has been attached to an HTMLMediaElement!");
|
|
3902
3904
|
var h = this._mediaSource = new window.MediaSource();
|
|
3903
3905
|
h.addEventListener("sourceopen", this.e.onSourceOpen), h.addEventListener("sourceended", this.e.onSourceEnded), h.addEventListener("sourceclose", this.e.onSourceClose), this._mediaElement = d, this._mediaSourceObjectURL = window.URL.createObjectURL(this._mediaSource), d.src = this._mediaSourceObjectURL;
|
|
3904
|
-
},
|
|
3906
|
+
}, L.prototype.detachMediaElement = function() {
|
|
3905
3907
|
if (this._mediaSource) {
|
|
3906
3908
|
var d = this._mediaSource;
|
|
3907
3909
|
for (var h in this._sourceBuffers) {
|
|
@@ -3928,7 +3930,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3928
3930
|
d.removeEventListener("sourceopen", this.e.onSourceOpen), d.removeEventListener("sourceended", this.e.onSourceEnded), d.removeEventListener("sourceclose", this.e.onSourceClose), this._pendingSourceBufferInit = [], this._isBufferFull = !1, this._idrList.clear(), this._mediaSource = null;
|
|
3929
3931
|
}
|
|
3930
3932
|
this._mediaElement && (this._mediaElement.src = "", this._mediaElement.removeAttribute("src"), this._mediaElement = null), this._mediaSourceObjectURL && (window.URL.revokeObjectURL(this._mediaSourceObjectURL), this._mediaSourceObjectURL = null);
|
|
3931
|
-
},
|
|
3933
|
+
}, L.prototype.appendInitSegment = function(d, h) {
|
|
3932
3934
|
if (!this._mediaSource || this._mediaSource.readyState !== "open") return this._pendingSourceBufferInit.push(d), void this._pendingSegments[d.type].push(d);
|
|
3933
3935
|
var R = d, X = "" + R.container;
|
|
3934
3936
|
R.codec && R.codec.length > 0 && (X += ";codecs=" + R.codec);
|
|
@@ -3947,12 +3949,12 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3947
3949
|
this._mimeTypes[R.type] = X;
|
|
3948
3950
|
}
|
|
3949
3951
|
h || this._pendingSegments[R.type].push(R), oe || this._sourceBuffers[R.type] && !this._sourceBuffers[R.type].updating && this._doAppendSegments(), V.a.safari && R.container === "audio/mpeg" && R.mediaDuration > 0 && (this._requireSetMediaDuration = !0, this._pendingMediaDuration = R.mediaDuration / 1e3, this._updateMediaSourceDuration());
|
|
3950
|
-
},
|
|
3952
|
+
}, L.prototype.appendMediaSegment = function(d) {
|
|
3951
3953
|
var h = d;
|
|
3952
3954
|
this._pendingSegments[h.type].push(h), this._config.autoCleanupSourceBuffer && this._needCleanupSourceBuffer() && this._doCleanupSourceBuffer();
|
|
3953
3955
|
var R = this._sourceBuffers[h.type];
|
|
3954
3956
|
!R || R.updating || this._hasPendingRemoveRanges() || this._doAppendSegments();
|
|
3955
|
-
},
|
|
3957
|
+
}, L.prototype.seek = function(d) {
|
|
3956
3958
|
for (var h in this._sourceBuffers) if (this._sourceBuffers[h]) {
|
|
3957
3959
|
var R = this._sourceBuffers[h];
|
|
3958
3960
|
if (this._mediaSource.readyState === "open") try {
|
|
@@ -3973,12 +3975,12 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3973
3975
|
}
|
|
3974
3976
|
}
|
|
3975
3977
|
}
|
|
3976
|
-
},
|
|
3978
|
+
}, L.prototype.endOfStream = function() {
|
|
3977
3979
|
var d = this._mediaSource, h = this._sourceBuffers;
|
|
3978
3980
|
d && d.readyState === "open" ? h.video && h.video.updating || h.audio && h.audio.updating ? this._hasPendingEos = !0 : (this._hasPendingEos = !1, d.endOfStream()) : d && d.readyState === "closed" && this._hasPendingSegments() && (this._hasPendingEos = !0);
|
|
3979
|
-
},
|
|
3981
|
+
}, L.prototype.getNearestKeyframe = function(d) {
|
|
3980
3982
|
return this._idrList.getLastSyncPointBeforeDts(d);
|
|
3981
|
-
},
|
|
3983
|
+
}, L.prototype._needCleanupSourceBuffer = function() {
|
|
3982
3984
|
if (!this._config.autoCleanupSourceBuffer) return !1;
|
|
3983
3985
|
var d = this._mediaElement.currentTime;
|
|
3984
3986
|
for (var h in this._sourceBuffers) {
|
|
@@ -3989,7 +3991,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
3989
3991
|
}
|
|
3990
3992
|
}
|
|
3991
3993
|
return !1;
|
|
3992
|
-
},
|
|
3994
|
+
}, L.prototype._doCleanupSourceBuffer = function() {
|
|
3993
3995
|
var d = this._mediaElement.currentTime;
|
|
3994
3996
|
for (var h in this._sourceBuffers) {
|
|
3995
3997
|
var R = this._sourceBuffers[h];
|
|
@@ -4007,18 +4009,18 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4007
4009
|
oe && !R.updating && this._doRemoveRanges();
|
|
4008
4010
|
}
|
|
4009
4011
|
}
|
|
4010
|
-
},
|
|
4012
|
+
}, L.prototype._updateMediaSourceDuration = function() {
|
|
4011
4013
|
var d = this._sourceBuffers;
|
|
4012
4014
|
if (this._mediaElement.readyState !== 0 && this._mediaSource.readyState === "open" && !(d.video && d.video.updating || d.audio && d.audio.updating)) {
|
|
4013
4015
|
var h = this._mediaSource.duration, R = this._pendingMediaDuration;
|
|
4014
4016
|
R > 0 && (isNaN(h) || R > h) && (C.a.v(this.TAG, "Update MediaSource duration from " + h + " to " + R), this._mediaSource.duration = R), this._requireSetMediaDuration = !1, this._pendingMediaDuration = 0;
|
|
4015
4017
|
}
|
|
4016
|
-
},
|
|
4018
|
+
}, L.prototype._doRemoveRanges = function() {
|
|
4017
4019
|
for (var d in this._pendingRemoveRanges) if (this._sourceBuffers[d] && !this._sourceBuffers[d].updating) for (var h = this._sourceBuffers[d], R = this._pendingRemoveRanges[d]; R.length && !h.updating; ) {
|
|
4018
4020
|
var X = R.shift();
|
|
4019
4021
|
h.remove(X.start, X.end);
|
|
4020
4022
|
}
|
|
4021
|
-
},
|
|
4023
|
+
}, L.prototype._doAppendSegments = function() {
|
|
4022
4024
|
var d = this._pendingSegments;
|
|
4023
4025
|
for (var h in d) if (this._sourceBuffers[h] && !this._sourceBuffers[h].updating && d[h].length > 0) {
|
|
4024
4026
|
var R = d[h].shift();
|
|
@@ -4033,48 +4035,48 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4033
4035
|
this._pendingSegments[h].unshift(R), me.code === 22 ? (this._isBufferFull || this._emitter.emit(l.BUFFER_FULL), this._isBufferFull = !0) : (C.a.e(this.TAG, me.message), this._emitter.emit(l.ERROR, { code: me.code, msg: me.message }));
|
|
4034
4036
|
}
|
|
4035
4037
|
}
|
|
4036
|
-
},
|
|
4038
|
+
}, L.prototype._onSourceOpen = function() {
|
|
4037
4039
|
if (C.a.v(this.TAG, "MediaSource onSourceOpen"), this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen), this._pendingSourceBufferInit.length > 0) for (var d = this._pendingSourceBufferInit; d.length; ) {
|
|
4038
4040
|
var h = d.shift();
|
|
4039
4041
|
this.appendInitSegment(h, !0);
|
|
4040
4042
|
}
|
|
4041
4043
|
this._hasPendingSegments() && this._doAppendSegments(), this._emitter.emit(l.SOURCE_OPEN);
|
|
4042
|
-
},
|
|
4044
|
+
}, L.prototype._onSourceEnded = function() {
|
|
4043
4045
|
C.a.v(this.TAG, "MediaSource onSourceEnded");
|
|
4044
|
-
},
|
|
4046
|
+
}, L.prototype._onSourceClose = function() {
|
|
4045
4047
|
C.a.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));
|
|
4046
|
-
},
|
|
4048
|
+
}, L.prototype._hasPendingSegments = function() {
|
|
4047
4049
|
var d = this._pendingSegments;
|
|
4048
4050
|
return d.video.length > 0 || d.audio.length > 0;
|
|
4049
|
-
},
|
|
4051
|
+
}, L.prototype._hasPendingRemoveRanges = function() {
|
|
4050
4052
|
var d = this._pendingRemoveRanges;
|
|
4051
4053
|
return d.video.length > 0 || d.audio.length > 0;
|
|
4052
|
-
},
|
|
4054
|
+
}, L.prototype._onSourceBufferUpdateEnd = function() {
|
|
4053
4055
|
this._requireSetMediaDuration ? this._updateMediaSourceDuration() : this._hasPendingRemoveRanges() ? this._doRemoveRanges() : this._hasPendingSegments() ? this._doAppendSegments() : this._hasPendingEos && this.endOfStream(), this._emitter.emit(l.UPDATE_END);
|
|
4054
|
-
},
|
|
4056
|
+
}, L.prototype._onSourceBufferError = function(d) {
|
|
4055
4057
|
C.a.e(this.TAG, "SourceBuffer Error: " + d);
|
|
4056
|
-
},
|
|
4058
|
+
}, L;
|
|
4057
4059
|
}(), P = O(5), D = { NETWORK_ERROR: "NetworkError", MEDIA_ERROR: "MediaError", OTHER_ERROR: "OtherError" }, F = { NETWORK_EXCEPTION: f.b.EXCEPTION, NETWORK_STATUS_CODE_INVALID: f.b.HTTP_STATUS_CODE_INVALID, NETWORK_TIMEOUT: f.b.CONNECTING_TIMEOUT, NETWORK_UNRECOVERABLE_EARLY_EOF: f.b.UNRECOVERABLE_EARLY_EOF, MEDIA_MSE_ERROR: "MediaMSEError", MEDIA_FORMAT_ERROR: P.a.FORMAT_ERROR, MEDIA_FORMAT_UNSUPPORTED: P.a.FORMAT_UNSUPPORTED, MEDIA_CODEC_UNSUPPORTED: P.a.CODEC_UNSUPPORTED }, ee = function() {
|
|
4058
|
-
function
|
|
4059
|
-
this.TAG = "MSEPlayer", this._type = "MSEPlayer", this._emitter = new
|
|
4060
|
+
function L(d, h) {
|
|
4061
|
+
this.TAG = "MSEPlayer", this._type = "MSEPlayer", this._emitter = new U.a(), this._config = b(), typeof h == "object" && Object.assign(this._config, h);
|
|
4060
4062
|
var R = d.type.toLowerCase();
|
|
4061
4063
|
if (R !== "mse" && R !== "mpegts" && R !== "m2ts" && R !== "flv") throw new _.b("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");
|
|
4062
4064
|
d.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 = d, this._mediaElement = null, this._msectl = null, this._transmuxer = null, this._mseSourceOpened = !1, this._hasPendingLoad = !1, this._receivedCanPlay = !1, this._mediaInfo = null, this._statisticsInfo = null;
|
|
4063
4065
|
var X = V.a.chrome && (V.a.version.major < 50 || V.a.version.major === 50 && V.a.version.build < 2661);
|
|
4064
4066
|
this._alwaysSeekKeyframe = !!(X || V.a.msedge || V.a.msie), this._alwaysSeekKeyframe && (this._config.accurateSeek = !1);
|
|
4065
4067
|
}
|
|
4066
|
-
return
|
|
4068
|
+
return L.prototype.destroy = function() {
|
|
4067
4069
|
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;
|
|
4068
|
-
},
|
|
4070
|
+
}, L.prototype.on = function(d, h) {
|
|
4069
4071
|
var R = this;
|
|
4070
4072
|
d === H.MEDIA_INFO ? this._mediaInfo != null && Promise.resolve().then(function() {
|
|
4071
4073
|
R._emitter.emit(H.MEDIA_INFO, R.mediaInfo);
|
|
4072
4074
|
}) : d === H.STATISTICS_INFO && this._statisticsInfo != null && Promise.resolve().then(function() {
|
|
4073
4075
|
R._emitter.emit(H.STATISTICS_INFO, R.statisticsInfo);
|
|
4074
4076
|
}), this._emitter.addListener(d, h);
|
|
4075
|
-
},
|
|
4077
|
+
}, L.prototype.off = function(d, h) {
|
|
4076
4078
|
this._emitter.removeListener(d, h);
|
|
4077
|
-
},
|
|
4079
|
+
}, L.prototype.attachMediaElement = function(d) {
|
|
4078
4080
|
var h = this;
|
|
4079
4081
|
if (this._mediaElement = d, d.addEventListener("loadedmetadata", this.e.onvLoadedMetadata), d.addEventListener("seeking", this.e.onvSeeking), d.addEventListener("canplay", this.e.onvCanPlay), d.addEventListener("stalled", this.e.onvStalled), d.addEventListener("progress", this.e.onvProgress), this._msectl = new c(this._config), this._msectl.on(l.UPDATE_END, this._onmseUpdateEnd.bind(this)), this._msectl.on(l.BUFFER_FULL, this._onmseBufferFull.bind(this)), this._msectl.on(l.SOURCE_OPEN, function() {
|
|
4080
4082
|
h._mseSourceOpened = !0, h._hasPendingLoad && (h._hasPendingLoad = !1, h.load());
|
|
@@ -4084,9 +4086,9 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4084
4086
|
d.currentTime = this._pendingSeekTime, this._pendingSeekTime = null;
|
|
4085
4087
|
} catch {
|
|
4086
4088
|
}
|
|
4087
|
-
},
|
|
4089
|
+
}, L.prototype.detachMediaElement = function() {
|
|
4088
4090
|
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);
|
|
4089
|
-
},
|
|
4091
|
+
}, L.prototype.load = function() {
|
|
4090
4092
|
var d = this;
|
|
4091
4093
|
if (!this._mediaElement) throw new _.a("HTMLMediaElement must be attached before load()!");
|
|
4092
4094
|
if (this._transmuxer) throw new _.a("MSEPlayer.load() has been called, please call unload() first!");
|
|
@@ -4126,35 +4128,35 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4126
4128
|
}), this._transmuxer.on(v.a.RECOMMEND_SEEKPOINT, function(h) {
|
|
4127
4129
|
d._mediaElement && !d._config.accurateSeek && (d._requestSetTime = !0, d._mediaElement.currentTime = h / 1e3);
|
|
4128
4130
|
}), this._transmuxer.open()));
|
|
4129
|
-
},
|
|
4131
|
+
}, L.prototype.unload = function() {
|
|
4130
4132
|
this._mediaElement && this._mediaElement.pause(), this._msectl && this._msectl.seek(0), this._transmuxer && (this._transmuxer.close(), this._transmuxer.destroy(), this._transmuxer = null);
|
|
4131
|
-
},
|
|
4133
|
+
}, L.prototype.play = function() {
|
|
4132
4134
|
return this._mediaElement.play();
|
|
4133
|
-
},
|
|
4135
|
+
}, L.prototype.pause = function() {
|
|
4134
4136
|
this._mediaElement.pause();
|
|
4135
|
-
}, Object.defineProperty(
|
|
4137
|
+
}, Object.defineProperty(L.prototype, "type", { get: function() {
|
|
4136
4138
|
return this._type;
|
|
4137
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4139
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "buffered", { get: function() {
|
|
4138
4140
|
return this._mediaElement.buffered;
|
|
4139
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4141
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "duration", { get: function() {
|
|
4140
4142
|
return this._mediaElement.duration;
|
|
4141
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4143
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "volume", { get: function() {
|
|
4142
4144
|
return this._mediaElement.volume;
|
|
4143
4145
|
}, set: function(d) {
|
|
4144
4146
|
this._mediaElement.volume = d;
|
|
4145
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4147
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "muted", { get: function() {
|
|
4146
4148
|
return this._mediaElement.muted;
|
|
4147
4149
|
}, set: function(d) {
|
|
4148
4150
|
this._mediaElement.muted = d;
|
|
4149
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4151
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "currentTime", { get: function() {
|
|
4150
4152
|
return this._mediaElement ? this._mediaElement.currentTime : 0;
|
|
4151
4153
|
}, set: function(d) {
|
|
4152
4154
|
this._mediaElement ? this._internalSeek(d) : this._pendingSeekTime = d;
|
|
4153
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4155
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "mediaInfo", { get: function() {
|
|
4154
4156
|
return Object.assign({}, this._mediaInfo);
|
|
4155
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4157
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "statisticsInfo", { get: function() {
|
|
4156
4158
|
return this._statisticsInfo == null && (this._statisticsInfo = {}), this._statisticsInfo = this._fillStatisticsInfo(this._statisticsInfo), Object.assign({}, this._statisticsInfo);
|
|
4157
|
-
}, enumerable: !1, configurable: !0 }),
|
|
4159
|
+
}, enumerable: !1, configurable: !0 }), L.prototype._fillStatisticsInfo = function(d) {
|
|
4158
4160
|
if (d.playerType = this._type, !(this._mediaElement instanceof HTMLVideoElement)) return d;
|
|
4159
4161
|
var h = !0, R = 0, X = 0;
|
|
4160
4162
|
if (this._mediaElement.getVideoPlaybackQuality) {
|
|
@@ -4162,7 +4164,7 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4162
4164
|
R = oe.totalVideoFrames, X = oe.droppedVideoFrames;
|
|
4163
4165
|
} else this._mediaElement.webkitDecodedFrameCount != null ? (R = this._mediaElement.webkitDecodedFrameCount, X = this._mediaElement.webkitDroppedFrameCount) : h = !1;
|
|
4164
4166
|
return h && (d.decodedFrames = R, d.droppedFrames = X), d;
|
|
4165
|
-
},
|
|
4167
|
+
}, L.prototype._onmseUpdateEnd = function() {
|
|
4166
4168
|
var d = this._mediaElement.buffered, h = this._mediaElement.currentTime;
|
|
4167
4169
|
if (this._config.isLive && this._config.liveBufferLatencyChasing && d.length > 0 && !this._mediaElement.paused) {
|
|
4168
4170
|
var R = d.end(d.length - 1);
|
|
@@ -4181,11 +4183,11 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4181
4183
|
}
|
|
4182
4184
|
oe >= h + this._config.lazyLoadMaxDuration && this._progressChecker == null && (C.a.v(this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task"), this._suspendTransmuxer());
|
|
4183
4185
|
}
|
|
4184
|
-
},
|
|
4186
|
+
}, L.prototype._onmseBufferFull = function() {
|
|
4185
4187
|
C.a.v(this.TAG, "MSE SourceBuffer is full, suspend transmuxing task"), this._progressChecker == null && this._suspendTransmuxer();
|
|
4186
|
-
},
|
|
4188
|
+
}, L.prototype._suspendTransmuxer = function() {
|
|
4187
4189
|
this._transmuxer && (this._transmuxer.pause(), this._progressChecker == null && (this._progressChecker = window.setInterval(this._checkProgressAndResume.bind(this), 1e3)));
|
|
4188
|
-
},
|
|
4190
|
+
}, L.prototype._checkProgressAndResume = function() {
|
|
4189
4191
|
for (var d = this._mediaElement.currentTime, h = this._mediaElement.buffered, R = !1, X = 0; X < h.length; X++) {
|
|
4190
4192
|
var oe = h.start(X), me = h.end(X);
|
|
4191
4193
|
if (d >= oe && d < me) {
|
|
@@ -4194,13 +4196,13 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4194
4196
|
}
|
|
4195
4197
|
}
|
|
4196
4198
|
R && (window.clearInterval(this._progressChecker), this._progressChecker = null, R && (C.a.v(this.TAG, "Continue loading from paused position"), this._transmuxer.resume()));
|
|
4197
|
-
},
|
|
4199
|
+
}, L.prototype._isTimepointBuffered = function(d) {
|
|
4198
4200
|
for (var h = this._mediaElement.buffered, R = 0; R < h.length; R++) {
|
|
4199
4201
|
var X = h.start(R), oe = h.end(R);
|
|
4200
4202
|
if (d >= X && d < oe) return !0;
|
|
4201
4203
|
}
|
|
4202
4204
|
return !1;
|
|
4203
|
-
},
|
|
4205
|
+
}, L.prototype._internalSeek = function(d) {
|
|
4204
4206
|
var h = this._isTimepointBuffered(d), R = !1, X = 0;
|
|
4205
4207
|
if (d < 1 && this._mediaElement.buffered.length > 0) {
|
|
4206
4208
|
var oe = this._mediaElement.buffered.start(0);
|
|
@@ -4214,20 +4216,20 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4214
4216
|
} else this._requestSetTime = !0, this._mediaElement.currentTime = d;
|
|
4215
4217
|
this._progressChecker != null && this._checkProgressAndResume();
|
|
4216
4218
|
} else this._progressChecker != null && (window.clearInterval(this._progressChecker), this._progressChecker = null), this._msectl.seek(d), this._transmuxer.seek(Math.floor(1e3 * d)), this._config.accurateSeek && (this._requestSetTime = !0, this._mediaElement.currentTime = d);
|
|
4217
|
-
},
|
|
4219
|
+
}, L.prototype._checkAndApplyUnbufferedSeekpoint = function() {
|
|
4218
4220
|
if (this._seekpointRecord) if (this._seekpointRecord.recordTime <= this._now() - 100) {
|
|
4219
4221
|
var d = this._mediaElement.currentTime;
|
|
4220
4222
|
this._seekpointRecord = null, this._isTimepointBuffered(d) || (this._progressChecker != null && (window.clearTimeout(this._progressChecker), this._progressChecker = null), this._msectl.seek(d), this._transmuxer.seek(Math.floor(1e3 * d)), this._config.accurateSeek && (this._requestSetTime = !0, this._mediaElement.currentTime = d));
|
|
4221
4223
|
} else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
|
|
4222
|
-
},
|
|
4224
|
+
}, L.prototype._checkAndResumeStuckPlayback = function(d) {
|
|
4223
4225
|
var h = this._mediaElement;
|
|
4224
4226
|
if (d || !this._receivedCanPlay || h.readyState < 2) {
|
|
4225
4227
|
var R = h.buffered;
|
|
4226
4228
|
R.length > 0 && h.currentTime < R.start(0) && (C.a.w(this.TAG, "Playback seems stuck at " + h.currentTime + ", seek to " + R.start(0)), this._requestSetTime = !0, this._mediaElement.currentTime = R.start(0), this._mediaElement.removeEventListener("progress", this.e.onvProgress));
|
|
4227
4229
|
} else this._mediaElement.removeEventListener("progress", this.e.onvProgress);
|
|
4228
|
-
},
|
|
4230
|
+
}, L.prototype._onvLoadedMetadata = function(d) {
|
|
4229
4231
|
this._pendingSeekTime != null && (this._mediaElement.currentTime = this._pendingSeekTime, this._pendingSeekTime = null);
|
|
4230
|
-
},
|
|
4232
|
+
}, L.prototype._onvSeeking = function(d) {
|
|
4231
4233
|
var h = this._mediaElement.currentTime, R = this._mediaElement.buffered;
|
|
4232
4234
|
if (this._requestSetTime) this._requestSetTime = !1;
|
|
4233
4235
|
else {
|
|
@@ -4243,70 +4245,70 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4243
4245
|
this._progressChecker != null && this._checkProgressAndResume();
|
|
4244
4246
|
} else this._seekpointRecord = { seekPoint: h, recordTime: this._now() }, window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
|
|
4245
4247
|
}
|
|
4246
|
-
},
|
|
4248
|
+
}, L.prototype._onvCanPlay = function(d) {
|
|
4247
4249
|
this._receivedCanPlay = !0, this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
|
|
4248
|
-
},
|
|
4250
|
+
}, L.prototype._onvStalled = function(d) {
|
|
4249
4251
|
this._checkAndResumeStuckPlayback(!0);
|
|
4250
|
-
},
|
|
4252
|
+
}, L.prototype._onvProgress = function(d) {
|
|
4251
4253
|
this._checkAndResumeStuckPlayback();
|
|
4252
|
-
},
|
|
4254
|
+
}, L;
|
|
4253
4255
|
}(), pe = function() {
|
|
4254
|
-
function
|
|
4255
|
-
this.TAG = "NativePlayer", this._type = "NativePlayer", this._emitter = new
|
|
4256
|
+
function L(d, h) {
|
|
4257
|
+
this.TAG = "NativePlayer", this._type = "NativePlayer", this._emitter = new U.a(), this._config = b(), typeof h == "object" && Object.assign(this._config, h);
|
|
4256
4258
|
var R = d.type.toLowerCase();
|
|
4257
4259
|
if (R === "mse" || R === "mpegts" || R === "m2ts" || R === "flv") throw new _.b("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");
|
|
4258
4260
|
if (d.hasOwnProperty("segments")) throw new _.b("NativePlayer(" + d.type + ") doesn't support multipart playback!");
|
|
4259
4261
|
this.e = { onvLoadedMetadata: this._onvLoadedMetadata.bind(this) }, this._pendingSeekTime = null, this._statisticsReporter = null, this._mediaDataSource = d, this._mediaElement = null;
|
|
4260
4262
|
}
|
|
4261
|
-
return
|
|
4263
|
+
return L.prototype.destroy = function() {
|
|
4262
4264
|
this._mediaElement && (this.unload(), this.detachMediaElement()), this.e = null, this._mediaDataSource = null, this._emitter.removeAllListeners(), this._emitter = null;
|
|
4263
|
-
},
|
|
4265
|
+
}, L.prototype.on = function(d, h) {
|
|
4264
4266
|
var R = this;
|
|
4265
4267
|
d === H.MEDIA_INFO ? this._mediaElement != null && this._mediaElement.readyState !== 0 && Promise.resolve().then(function() {
|
|
4266
4268
|
R._emitter.emit(H.MEDIA_INFO, R.mediaInfo);
|
|
4267
4269
|
}) : d === H.STATISTICS_INFO && this._mediaElement != null && this._mediaElement.readyState !== 0 && Promise.resolve().then(function() {
|
|
4268
4270
|
R._emitter.emit(H.STATISTICS_INFO, R.statisticsInfo);
|
|
4269
4271
|
}), this._emitter.addListener(d, h);
|
|
4270
|
-
},
|
|
4272
|
+
}, L.prototype.off = function(d, h) {
|
|
4271
4273
|
this._emitter.removeListener(d, h);
|
|
4272
|
-
},
|
|
4274
|
+
}, L.prototype.attachMediaElement = function(d) {
|
|
4273
4275
|
if (this._mediaElement = d, d.addEventListener("loadedmetadata", this.e.onvLoadedMetadata), this._pendingSeekTime != null) try {
|
|
4274
4276
|
d.currentTime = this._pendingSeekTime, this._pendingSeekTime = null;
|
|
4275
4277
|
} catch {
|
|
4276
4278
|
}
|
|
4277
|
-
},
|
|
4279
|
+
}, L.prototype.detachMediaElement = function() {
|
|
4278
4280
|
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);
|
|
4279
|
-
},
|
|
4281
|
+
}, L.prototype.load = function() {
|
|
4280
4282
|
if (!this._mediaElement) throw new _.a("HTMLMediaElement must be attached before load()!");
|
|
4281
4283
|
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);
|
|
4282
|
-
},
|
|
4284
|
+
}, L.prototype.unload = function() {
|
|
4283
4285
|
this._mediaElement && (this._mediaElement.src = "", this._mediaElement.removeAttribute("src")), this._statisticsReporter != null && (window.clearInterval(this._statisticsReporter), this._statisticsReporter = null);
|
|
4284
|
-
},
|
|
4286
|
+
}, L.prototype.play = function() {
|
|
4285
4287
|
return this._mediaElement.play();
|
|
4286
|
-
},
|
|
4288
|
+
}, L.prototype.pause = function() {
|
|
4287
4289
|
this._mediaElement.pause();
|
|
4288
|
-
}, Object.defineProperty(
|
|
4290
|
+
}, Object.defineProperty(L.prototype, "type", { get: function() {
|
|
4289
4291
|
return this._type;
|
|
4290
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4292
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "buffered", { get: function() {
|
|
4291
4293
|
return this._mediaElement.buffered;
|
|
4292
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4294
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "duration", { get: function() {
|
|
4293
4295
|
return this._mediaElement.duration;
|
|
4294
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4296
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "volume", { get: function() {
|
|
4295
4297
|
return this._mediaElement.volume;
|
|
4296
4298
|
}, set: function(d) {
|
|
4297
4299
|
this._mediaElement.volume = d;
|
|
4298
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4300
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "muted", { get: function() {
|
|
4299
4301
|
return this._mediaElement.muted;
|
|
4300
4302
|
}, set: function(d) {
|
|
4301
4303
|
this._mediaElement.muted = d;
|
|
4302
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4304
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "currentTime", { get: function() {
|
|
4303
4305
|
return this._mediaElement ? this._mediaElement.currentTime : 0;
|
|
4304
4306
|
}, set: function(d) {
|
|
4305
4307
|
this._mediaElement ? this._mediaElement.currentTime = d : this._pendingSeekTime = d;
|
|
4306
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4308
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "mediaInfo", { get: function() {
|
|
4307
4309
|
var d = { mimeType: (this._mediaElement instanceof HTMLAudioElement ? "audio/" : "video/") + this._mediaDataSource.type };
|
|
4308
4310
|
return this._mediaElement && (d.duration = Math.floor(1e3 * this._mediaElement.duration), this._mediaElement instanceof HTMLVideoElement && (d.width = this._mediaElement.videoWidth, d.height = this._mediaElement.videoHeight)), d;
|
|
4309
|
-
}, enumerable: !1, configurable: !0 }), Object.defineProperty(
|
|
4311
|
+
}, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, "statisticsInfo", { get: function() {
|
|
4310
4312
|
var d = { playerType: this._type, url: this._mediaDataSource.url };
|
|
4311
4313
|
if (!(this._mediaElement instanceof HTMLVideoElement)) return d;
|
|
4312
4314
|
var h = !0, R = 0, X = 0;
|
|
@@ -4315,15 +4317,15 @@ originalDts: ` + be + " ms, curRefDts: " + Re + " ms, dtsCorrection: " + Math.ro
|
|
|
4315
4317
|
R = oe.totalVideoFrames, X = oe.droppedVideoFrames;
|
|
4316
4318
|
} else this._mediaElement.webkitDecodedFrameCount != null ? (R = this._mediaElement.webkitDecodedFrameCount, X = this._mediaElement.webkitDroppedFrameCount) : h = !1;
|
|
4317
4319
|
return h && (d.decodedFrames = R, d.droppedFrames = X), d;
|
|
4318
|
-
}, enumerable: !1, configurable: !0 }),
|
|
4320
|
+
}, enumerable: !1, configurable: !0 }), L.prototype._onvLoadedMetadata = function(d) {
|
|
4319
4321
|
this._pendingSeekTime != null && (this._mediaElement.currentTime = this._pendingSeekTime, this._pendingSeekTime = null), this._emitter.emit(H.MEDIA_INFO, this.mediaInfo);
|
|
4320
|
-
},
|
|
4322
|
+
}, L.prototype._reportStatisticsInfo = function() {
|
|
4321
4323
|
this._emitter.emit(H.STATISTICS_INFO, this.statisticsInfo);
|
|
4322
|
-
},
|
|
4324
|
+
}, L;
|
|
4323
4325
|
}();
|
|
4324
|
-
|
|
4325
|
-
var ye = { createPlayer: function(
|
|
4326
|
-
var h =
|
|
4326
|
+
x.a.install();
|
|
4327
|
+
var ye = { createPlayer: function(L, d) {
|
|
4328
|
+
var h = L;
|
|
4327
4329
|
if (h == null || typeof h != "object") throw new _.b("MediaDataSource must be an javascript object!");
|
|
4328
4330
|
if (!h.hasOwnProperty("type")) throw new _.b("MediaDataSource must has type field to indicate video file type!");
|
|
4329
4331
|
switch (h.type) {
|
|
@@ -4366,35 +4368,35 @@ const Rt = /* @__PURE__ */ di(ui), li = ["element-loading-text", "element-loadin
|
|
|
4366
4368
|
dc851078: G.value
|
|
4367
4369
|
}));
|
|
4368
4370
|
const Z = Ie, O = fe;
|
|
4369
|
-
let
|
|
4371
|
+
let x;
|
|
4370
4372
|
const {
|
|
4371
4373
|
fit: B,
|
|
4372
4374
|
loadingText: m = At("加载中"),
|
|
4373
4375
|
loading: b = !1,
|
|
4374
4376
|
error: y = !1,
|
|
4375
4377
|
errorText: f = At("das-ui-live-player-videoLoadFailedRetry")
|
|
4376
|
-
} = Zt(Z),
|
|
4377
|
-
const l =
|
|
4378
|
+
} = Zt(Z), k = ot(() => Z.src || ""), U = ot(() => {
|
|
4379
|
+
const l = k.value.split(".").pop() || void 0;
|
|
4378
4380
|
return Z.type ?? l ?? "flv";
|
|
4379
4381
|
}), C = ot(() => Z.config || {}), V = Xe(Z.retryTime || 0), H = Xe(null), ue = async () => {
|
|
4380
4382
|
if (!H.value) return;
|
|
4381
4383
|
const l = {
|
|
4382
|
-
type:
|
|
4384
|
+
type: U.value,
|
|
4383
4385
|
isLive: !0,
|
|
4384
|
-
url:
|
|
4386
|
+
url: k.value
|
|
4385
4387
|
};
|
|
4386
|
-
|
|
4388
|
+
x = Rt.createPlayer(l, C.value), x.attachMediaElement(H.value), x.load(), x.play(), x.on(Rt.Events.ERROR, se), O("loaded", x);
|
|
4387
4389
|
}, se = (l, u) => {
|
|
4388
|
-
Y();
|
|
4390
|
+
console.error("mpegts error:", l, u), Y();
|
|
4389
4391
|
}, Y = () => {
|
|
4390
|
-
V.value !== 0 && (V.value = V.value - 1,
|
|
4391
|
-
},
|
|
4392
|
-
|
|
4392
|
+
V.value !== 0 && (V.value = V.value - 1, ae(), ue());
|
|
4393
|
+
}, ae = () => {
|
|
4394
|
+
x && (console.log("destroy", x), x.pause(), x.unload(), x.detachMediaElement(), x.destroy(), x = null);
|
|
4393
4395
|
};
|
|
4394
4396
|
$t(() => {
|
|
4395
4397
|
ue();
|
|
4396
4398
|
}), Qt(() => {
|
|
4397
|
-
|
|
4399
|
+
ae();
|
|
4398
4400
|
}), Ye({
|
|
4399
4401
|
video: H
|
|
4400
4402
|
});
|
|
@@ -4415,7 +4417,7 @@ const Rt = /* @__PURE__ */ di(ui), li = ["element-loading-text", "element-loadin
|
|
|
4415
4417
|
onClick: T
|
|
4416
4418
|
}, [
|
|
4417
4419
|
ii(l.$slots, "error", {}, () => [
|
|
4418
|
-
ri(
|
|
4420
|
+
ri(ai(We(f)), 1)
|
|
4419
4421
|
], !0)
|
|
4420
4422
|
])) : (dt(), ut("video", {
|
|
4421
4423
|
key: 0,
|
|
@@ -4445,7 +4447,7 @@ const Rt = /* @__PURE__ */ di(ui), li = ["element-loading-text", "element-loadin
|
|
|
4445
4447
|
}
|
|
4446
4448
|
};
|
|
4447
4449
|
oi(fi);
|
|
4448
|
-
const Si =
|
|
4450
|
+
const Si = ni(ci), Ei = () => Xe(null);
|
|
4449
4451
|
export {
|
|
4450
4452
|
Si as DasLivePlayer,
|
|
4451
4453
|
Ei as getDasLivePlayerRef
|