@das-fed/ui 6.4.0-hot.42 → 6.4.0-hot.43
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/components/hls-player/style.css';
|
|
2
|
-
import { defineComponent as ya, useCssVars as Ta, toRefs as Sa, computed as va, ref as
|
|
2
|
+
import { defineComponent as ya, useCssVars as Ta, toRefs as Sa, computed as va, ref as Ze, onMounted as xa, onBeforeUnmount as Aa, createElementBlock as fs, openBlock as gs, createElementVNode as Pi, withDirectives as La, toDisplayString as Ia, unref as Ct, createCommentVNode as Ra } from "vue";
|
|
3
3
|
import { withInstall as ba } from "@das-fed/utils/with-install/index";
|
|
4
4
|
import { t as ki, setI18nRule as _a } from "@das-fed/web/packages/i18n/index";
|
|
5
5
|
import { vDasLoading as Da } from "@das-fed/ui/packages/components/loading/index";
|
|
@@ -11,7 +11,7 @@ const F = Number.isFinite || function(a) {
|
|
|
11
11
|
}, ka = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
12
12
|
let U = /* @__PURE__ */ function(a) {
|
|
13
13
|
return a.NETWORK_ERROR = "networkError", a.MEDIA_ERROR = "mediaError", a.KEY_SYSTEM_ERROR = "keySystemError", a.MUX_ERROR = "muxError", a.OTHER_ERROR = "otherError", a;
|
|
14
|
-
}({}),
|
|
14
|
+
}({}), b = /* @__PURE__ */ function(a) {
|
|
15
15
|
return a.KEY_SYSTEM_NO_KEYS = "keySystemNoKeys", a.KEY_SYSTEM_NO_ACCESS = "keySystemNoAccess", a.KEY_SYSTEM_NO_SESSION = "keySystemNoSession", a.KEY_SYSTEM_NO_CONFIGURED_LICENSE = "keySystemNoConfiguredLicense", a.KEY_SYSTEM_LICENSE_REQUEST_FAILED = "keySystemLicenseRequestFailed", a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED = "keySystemServerCertificateRequestFailed", a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED = "keySystemServerCertificateUpdateFailed", a.KEY_SYSTEM_SESSION_UPDATE_FAILED = "keySystemSessionUpdateFailed", a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED = "keySystemStatusOutputRestricted", a.KEY_SYSTEM_STATUS_INTERNAL_ERROR = "keySystemStatusInternalError", a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR = "keySystemDestroyMediaKeysError", a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR = "keySystemDestroyCloseSessionError", a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR = "keySystemDestroyRemoveSessionError", a.MANIFEST_LOAD_ERROR = "manifestLoadError", a.MANIFEST_LOAD_TIMEOUT = "manifestLoadTimeOut", a.MANIFEST_PARSING_ERROR = "manifestParsingError", a.MANIFEST_INCOMPATIBLE_CODECS_ERROR = "manifestIncompatibleCodecsError", a.LEVEL_EMPTY_ERROR = "levelEmptyError", a.LEVEL_LOAD_ERROR = "levelLoadError", a.LEVEL_LOAD_TIMEOUT = "levelLoadTimeOut", a.LEVEL_PARSING_ERROR = "levelParsingError", a.LEVEL_SWITCH_ERROR = "levelSwitchError", a.AUDIO_TRACK_LOAD_ERROR = "audioTrackLoadError", a.AUDIO_TRACK_LOAD_TIMEOUT = "audioTrackLoadTimeOut", a.SUBTITLE_LOAD_ERROR = "subtitleTrackLoadError", a.SUBTITLE_TRACK_LOAD_TIMEOUT = "subtitleTrackLoadTimeOut", a.FRAG_LOAD_ERROR = "fragLoadError", a.FRAG_LOAD_TIMEOUT = "fragLoadTimeOut", a.FRAG_DECRYPT_ERROR = "fragDecryptError", a.FRAG_PARSING_ERROR = "fragParsingError", a.FRAG_GAP = "fragGap", a.REMUX_ALLOC_ERROR = "remuxAllocError", a.KEY_LOAD_ERROR = "keyLoadError", a.KEY_LOAD_TIMEOUT = "keyLoadTimeOut", a.BUFFER_ADD_CODEC_ERROR = "bufferAddCodecError", a.BUFFER_INCOMPATIBLE_CODECS_ERROR = "bufferIncompatibleCodecsError", a.BUFFER_APPEND_ERROR = "bufferAppendError", a.BUFFER_APPENDING_ERROR = "bufferAppendingError", a.BUFFER_STALLED_ERROR = "bufferStalledError", a.BUFFER_FULL_ERROR = "bufferFullError", a.BUFFER_SEEK_OVER_HOLE = "bufferSeekOverHole", a.BUFFER_NUDGE_ON_STALL = "bufferNudgeOnStall", a.ASSET_LIST_LOAD_ERROR = "assetListLoadError", a.ASSET_LIST_LOAD_TIMEOUT = "assetListLoadTimeout", a.ASSET_LIST_PARSING_ERROR = "assetListParsingError", a.INTERSTITIAL_ASSET_ITEM_ERROR = "interstitialAssetItemError", a.INTERNAL_EXCEPTION = "internalException", a.INTERNAL_ABORTED = "aborted", a.ATTACH_MEDIA_ERROR = "attachMediaError", a.UNKNOWN = "unknown", a;
|
|
16
16
|
}({}), m = /* @__PURE__ */ function(a) {
|
|
17
17
|
return a.MEDIA_ATTACHING = "hlsMediaAttaching", a.MEDIA_ATTACHED = "hlsMediaAttached", a.MEDIA_DETACHING = "hlsMediaDetaching", a.MEDIA_DETACHED = "hlsMediaDetached", a.MEDIA_ENDED = "hlsMediaEnded", a.STALL_RESOLVED = "hlsStallResolved", a.BUFFER_RESET = "hlsBufferReset", a.BUFFER_CODECS = "hlsBufferCodecs", a.BUFFER_CREATED = "hlsBufferCreated", a.BUFFER_APPENDING = "hlsBufferAppending", a.BUFFER_APPENDED = "hlsBufferAppended", a.BUFFER_EOS = "hlsBufferEos", a.BUFFERED_TO_END = "hlsBufferedToEnd", a.BUFFER_FLUSHING = "hlsBufferFlushing", a.BUFFER_FLUSHED = "hlsBufferFlushed", a.MANIFEST_LOADING = "hlsManifestLoading", a.MANIFEST_LOADED = "hlsManifestLoaded", a.MANIFEST_PARSED = "hlsManifestParsed", a.LEVEL_SWITCHING = "hlsLevelSwitching", a.LEVEL_SWITCHED = "hlsLevelSwitched", a.LEVEL_LOADING = "hlsLevelLoading", a.LEVEL_LOADED = "hlsLevelLoaded", a.LEVEL_UPDATED = "hlsLevelUpdated", a.LEVEL_PTS_UPDATED = "hlsLevelPtsUpdated", a.LEVELS_UPDATED = "hlsLevelsUpdated", a.AUDIO_TRACKS_UPDATED = "hlsAudioTracksUpdated", a.AUDIO_TRACK_SWITCHING = "hlsAudioTrackSwitching", a.AUDIO_TRACK_SWITCHED = "hlsAudioTrackSwitched", a.AUDIO_TRACK_LOADING = "hlsAudioTrackLoading", a.AUDIO_TRACK_LOADED = "hlsAudioTrackLoaded", a.AUDIO_TRACK_UPDATED = "hlsAudioTrackUpdated", a.SUBTITLE_TRACKS_UPDATED = "hlsSubtitleTracksUpdated", a.SUBTITLE_TRACKS_CLEARED = "hlsSubtitleTracksCleared", a.SUBTITLE_TRACK_SWITCH = "hlsSubtitleTrackSwitch", a.SUBTITLE_TRACK_LOADING = "hlsSubtitleTrackLoading", a.SUBTITLE_TRACK_LOADED = "hlsSubtitleTrackLoaded", a.SUBTITLE_TRACK_UPDATED = "hlsSubtitleTrackUpdated", a.SUBTITLE_FRAG_PROCESSED = "hlsSubtitleFragProcessed", a.CUES_PARSED = "hlsCuesParsed", a.NON_NATIVE_TEXT_TRACKS_FOUND = "hlsNonNativeTextTracksFound", a.INIT_PTS_FOUND = "hlsInitPtsFound", a.FRAG_LOADING = "hlsFragLoading", a.FRAG_LOAD_EMERGENCY_ABORTED = "hlsFragLoadEmergencyAborted", a.FRAG_LOADED = "hlsFragLoaded", a.FRAG_DECRYPTED = "hlsFragDecrypted", a.FRAG_PARSING_INIT_SEGMENT = "hlsFragParsingInitSegment", a.FRAG_PARSING_USERDATA = "hlsFragParsingUserdata", a.FRAG_PARSING_METADATA = "hlsFragParsingMetadata", a.FRAG_PARSED = "hlsFragParsed", a.FRAG_BUFFERED = "hlsFragBuffered", a.FRAG_CHANGED = "hlsFragChanged", a.FPS_DROP = "hlsFpsDrop", a.FPS_DROP_LEVEL_CAPPING = "hlsFpsDropLevelCapping", a.MAX_AUTO_LEVEL_UPDATED = "hlsMaxAutoLevelUpdated", a.ERROR = "hlsError", a.DESTROYING = "hlsDestroying", a.KEY_LOADING = "hlsKeyLoading", a.KEY_LOADED = "hlsKeyLoaded", a.LIVE_BACK_BUFFER_REACHED = "hlsLiveBackBufferReached", a.BACK_BUFFER_REACHED = "hlsBackBufferReached", a.STEERING_MANIFEST_LOADED = "hlsSteeringManifestLoaded", a.ASSET_LIST_LOADING = "hlsAssetListLoading", a.ASSET_LIST_LOADED = "hlsAssetListLoaded", a.INTERSTITIALS_UPDATED = "hlsInterstitialsUpdated", a.INTERSTITIALS_BUFFERED_TO_BOUNDARY = "hlsInterstitialsBufferedToBoundary", a.INTERSTITIAL_ASSET_PLAYER_CREATED = "hlsInterstitialAssetPlayerCreated", a.INTERSTITIAL_STARTED = "hlsInterstitialStarted", a.INTERSTITIAL_ASSET_STARTED = "hlsInterstitialAssetStarted", a.INTERSTITIAL_ASSET_ENDED = "hlsInterstitialAssetEnded", a.INTERSTITIAL_ASSET_ERROR = "hlsInterstitialAssetError", a.INTERSTITIAL_ENDED = "hlsInterstitialEnded", a.INTERSTITIALS_PRIMARY_RESUMED = "hlsInterstitialsPrimaryResumed", a.PLAYOUT_LIMIT_REACHED = "hlsPlayoutLimitReached", a.EVENT_CUE_ENTER = "hlsEventCueEnter", a;
|
|
@@ -26,7 +26,7 @@ var z = {
|
|
|
26
26
|
AUDIO: "audio",
|
|
27
27
|
SUBTITLE: "subtitle"
|
|
28
28
|
};
|
|
29
|
-
class
|
|
29
|
+
class it {
|
|
30
30
|
// About half of the estimated value will be from the last |halfLife| samples by weight.
|
|
31
31
|
constructor(e, t = 0, s = 0) {
|
|
32
32
|
this.halfLife = void 0, this.alpha_ = void 0, this.estimate_ = void 0, this.totalWeight_ = void 0, this.halfLife = e, this.alpha_ = e ? Math.exp(Math.log(0.5) / e) : 0, this.estimate_ = t, this.totalWeight_ = s;
|
|
@@ -49,7 +49,7 @@ class st {
|
|
|
49
49
|
}
|
|
50
50
|
class wa {
|
|
51
51
|
constructor(e, t, s, i = 100) {
|
|
52
|
-
this.defaultEstimate_ = void 0, this.minWeight_ = void 0, this.minDelayMs_ = void 0, this.slow_ = void 0, this.fast_ = void 0, this.defaultTTFB_ = void 0, this.ttfb_ = void 0, this.defaultEstimate_ = s, this.minWeight_ = 1e-3, this.minDelayMs_ = 50, this.slow_ = new
|
|
52
|
+
this.defaultEstimate_ = void 0, this.minWeight_ = void 0, this.minDelayMs_ = void 0, this.slow_ = void 0, this.fast_ = void 0, this.defaultTTFB_ = void 0, this.ttfb_ = void 0, this.defaultEstimate_ = s, this.minWeight_ = 1e-3, this.minDelayMs_ = 50, this.slow_ = new it(e), this.fast_ = new it(t), this.defaultTTFB_ = i, this.ttfb_ = new it(e);
|
|
53
53
|
}
|
|
54
54
|
update(e, t) {
|
|
55
55
|
const {
|
|
@@ -57,7 +57,7 @@ class wa {
|
|
|
57
57
|
fast_: i,
|
|
58
58
|
ttfb_: r
|
|
59
59
|
} = this;
|
|
60
|
-
s.halfLife !== e && (this.slow_ = new
|
|
60
|
+
s.halfLife !== e && (this.slow_ = new it(e, s.getEstimate(), s.getTotalWeight())), i.halfLife !== t && (this.fast_ = new it(t, i.getEstimate(), i.getTotalWeight())), r.halfLife !== e && (this.ttfb_ = new it(e, r.getEstimate(), r.getTotalWeight()));
|
|
61
61
|
}
|
|
62
62
|
sample(e, t) {
|
|
63
63
|
e = Math.max(e, this.minDelayMs_);
|
|
@@ -286,7 +286,7 @@ function Ka() {
|
|
|
286
286
|
f.netLoc = g[1], f.path = g[2];
|
|
287
287
|
}
|
|
288
288
|
f.netLoc && !f.path && (f.path = "/");
|
|
289
|
-
var
|
|
289
|
+
var p = {
|
|
290
290
|
// 2c) Otherwise, the embedded URL inherits the scheme of
|
|
291
291
|
// the base URL.
|
|
292
292
|
scheme: f.scheme,
|
|
@@ -296,14 +296,14 @@ function Ka() {
|
|
|
296
296
|
query: d.query,
|
|
297
297
|
fragment: d.fragment
|
|
298
298
|
};
|
|
299
|
-
if (!d.netLoc && (
|
|
299
|
+
if (!d.netLoc && (p.netLoc = f.netLoc, d.path[0] !== "/"))
|
|
300
300
|
if (!d.path)
|
|
301
|
-
|
|
301
|
+
p.path = f.path, d.params || (p.params = f.params, d.query || (p.query = f.query));
|
|
302
302
|
else {
|
|
303
|
-
var
|
|
304
|
-
|
|
303
|
+
var E = f.path, y = E.substring(0, E.lastIndexOf("/") + 1) + d.path;
|
|
304
|
+
p.path = o.normalizePath(y);
|
|
305
305
|
}
|
|
306
|
-
return
|
|
306
|
+
return p.path === null && (p.path = h.alwaysNormalize ? o.normalizePath(d.path) : d.path), o.buildURLFromParts(p);
|
|
307
307
|
},
|
|
308
308
|
parseURL: function(c) {
|
|
309
309
|
var l = s.exec(c);
|
|
@@ -667,18 +667,18 @@ function Jr(a) {
|
|
|
667
667
|
const d = le(u.subarray(8, 12)), f = {
|
|
668
668
|
soun: ie.AUDIO,
|
|
669
669
|
vide: ie.VIDEO
|
|
670
|
-
}[d], g = W(r, ["mdia", "minf", "stbl", "stsd"])[0],
|
|
670
|
+
}[d], g = W(r, ["mdia", "minf", "stbl", "stsd"])[0], p = ja(g);
|
|
671
671
|
f ? (e[c] = {
|
|
672
672
|
timescale: h,
|
|
673
673
|
type: f,
|
|
674
|
-
stsd:
|
|
674
|
+
stsd: p
|
|
675
675
|
}, e[f] = te({
|
|
676
676
|
timescale: h,
|
|
677
677
|
id: c
|
|
678
|
-
},
|
|
678
|
+
}, p)) : e[c] = {
|
|
679
679
|
timescale: h,
|
|
680
680
|
type: d,
|
|
681
|
-
stsd:
|
|
681
|
+
stsd: p
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
684
|
}
|
|
@@ -748,14 +748,14 @@ function ja(a) {
|
|
|
748
748
|
case "hev1": {
|
|
749
749
|
const c = W(t, ["hvcC"])[0];
|
|
750
750
|
if (c && c.length > 12) {
|
|
751
|
-
const l = c[1], h = ["", "A", "B", "C"][l >> 6], u = l & 31, d = K(c, 2), f = (l & 32) >> 5 ? "H" : "L", g = c[12],
|
|
751
|
+
const l = c[1], h = ["", "A", "B", "C"][l >> 6], u = l & 31, d = K(c, 2), f = (l & 32) >> 5 ? "H" : "L", g = c[12], p = c.subarray(6, 12);
|
|
752
752
|
i += "." + h + u, i += "." + d.toString(16).toUpperCase(), i += "." + f + g;
|
|
753
|
-
let
|
|
754
|
-
for (let y =
|
|
755
|
-
const S =
|
|
756
|
-
(S ||
|
|
753
|
+
let E = "";
|
|
754
|
+
for (let y = p.length; y--; ) {
|
|
755
|
+
const S = p[y];
|
|
756
|
+
(S || E) && (E = "." + S.toString(16).toUpperCase() + E);
|
|
757
757
|
}
|
|
758
|
-
i +=
|
|
758
|
+
i += E;
|
|
759
759
|
}
|
|
760
760
|
r = Pt(o == "hev1" ? "dvhe" : "dvh1", t);
|
|
761
761
|
break;
|
|
@@ -779,8 +779,8 @@ function ja(a) {
|
|
|
779
779
|
case "av01": {
|
|
780
780
|
const c = W(t, ["av1C"])[0];
|
|
781
781
|
if (c && c.length > 2) {
|
|
782
|
-
const l = c[1] >>> 5, h = c[1] & 31, u = c[2] >>> 7 ? "H" : "M", d = (c[2] & 64) >> 6, f = (c[2] & 32) >> 5, g = l === 2 && d ? f ? 12 : 10 : d ? 10 : 8,
|
|
783
|
-
i += "." + l + "." + De(h) + u + "." + De(g) + "." +
|
|
782
|
+
const l = c[1] >>> 5, h = c[1] & 31, u = c[2] >>> 7 ? "H" : "M", d = (c[2] & 64) >> 6, f = (c[2] & 32) >> 5, g = l === 2 && d ? f ? 12 : 10 : d ? 10 : 8, p = (c[2] & 16) >> 4, E = (c[2] & 8) >> 3, y = (c[2] & 4) >> 2, S = c[2] & 3;
|
|
783
|
+
i += "." + l + "." + De(h) + u + "." + De(g) + "." + p + "." + E + y + S + "." + De(1) + "." + De(1) + "." + De(1) + "." + 0, r = Pt("dav1", t);
|
|
784
784
|
}
|
|
785
785
|
break;
|
|
786
786
|
}
|
|
@@ -824,7 +824,7 @@ function Xa(a, e) {
|
|
|
824
824
|
const f = en(d);
|
|
825
825
|
if (f) {
|
|
826
826
|
const g = f.subarray(8, 24);
|
|
827
|
-
g.some((
|
|
827
|
+
g.some((p) => p !== 0) || (Q.log(`[eme] Patching keyId in 'enc${c ? "a" : "v"}>sinf>>tenc' box: ${Ce.hexDump(g)} -> ${Ce.hexDump(t)}`), f.set(t, 8));
|
|
828
828
|
}
|
|
829
829
|
});
|
|
830
830
|
});
|
|
@@ -869,10 +869,10 @@ function Qa(a, e) {
|
|
|
869
869
|
const u = h.default, d = K(c, 0) | (u == null ? void 0 : u.flags);
|
|
870
870
|
let f = u == null ? void 0 : u.duration;
|
|
871
871
|
d & 8 && (d & 2 ? f = K(c, 12) : f = K(c, 8));
|
|
872
|
-
const g = h.timescale || 9e4,
|
|
873
|
-
for (let
|
|
874
|
-
if (t = Za(E
|
|
875
|
-
const y = K(E
|
|
872
|
+
const g = h.timescale || 9e4, p = W(o, ["trun"]);
|
|
873
|
+
for (let E = 0; E < p.length; E++) {
|
|
874
|
+
if (t = Za(p[E]), !t && f) {
|
|
875
|
+
const y = K(p[E], 4);
|
|
876
876
|
t = f * y;
|
|
877
877
|
}
|
|
878
878
|
h.type === ie.VIDEO ? s += t / g : h.type === ie.AUDIO && (i += t / g);
|
|
@@ -954,18 +954,18 @@ function Ni(a, e) {
|
|
|
954
954
|
W(c, ["traf"]).map((u) => {
|
|
955
955
|
const d = W(u, ["tfdt"]).map((f) => {
|
|
956
956
|
const g = f[0];
|
|
957
|
-
let
|
|
958
|
-
return g === 1 && (
|
|
957
|
+
let p = K(f, 4);
|
|
958
|
+
return g === 1 && (p *= Math.pow(2, 32), p += K(f, 8)), p / i;
|
|
959
959
|
})[0];
|
|
960
960
|
return d !== void 0 && (a = d), W(u, ["tfhd"]).map((f) => {
|
|
961
|
-
const g = K(f, 4),
|
|
961
|
+
const g = K(f, 4), p = K(f, 0) & 16777215, E = (p & 1) !== 0, y = (p & 2) !== 0, S = (p & 8) !== 0;
|
|
962
962
|
let T = 0;
|
|
963
|
-
const x = (
|
|
963
|
+
const x = (p & 16) !== 0;
|
|
964
964
|
let A = 0;
|
|
965
|
-
const _ = (
|
|
965
|
+
const _ = (p & 32) !== 0;
|
|
966
966
|
let v = 8;
|
|
967
|
-
g === r && (
|
|
968
|
-
const D =
|
|
967
|
+
g === r && (E && (v += 8), y && (v += 4), S && (T = K(f, v), v += 4), x && (A = K(f, v), v += 4), _ && (v += 4), e.type === "video" && (n = cs(e.codec)), W(u, ["trun"]).map((R) => {
|
|
968
|
+
const D = R[0], L = K(R, 0) & 16777215, P = (L & 1) !== 0;
|
|
969
969
|
let O = 0;
|
|
970
970
|
const X = (L & 4) !== 0, V = (L & 256) !== 0;
|
|
971
971
|
let $ = 0;
|
|
@@ -973,12 +973,12 @@ function Ni(a, e) {
|
|
|
973
973
|
let G = 0;
|
|
974
974
|
const B = (L & 1024) !== 0, k = (L & 2048) !== 0;
|
|
975
975
|
let w = 0;
|
|
976
|
-
const Y = K(
|
|
976
|
+
const Y = K(R, 4);
|
|
977
977
|
let H = 8;
|
|
978
|
-
P && (O = K(
|
|
978
|
+
P && (O = K(R, H), H += 4), X && (H += 4);
|
|
979
979
|
let j = O + l;
|
|
980
980
|
for (let Z = 0; Z < Y; Z++) {
|
|
981
|
-
if (V ? ($ = K(
|
|
981
|
+
if (V ? ($ = K(R, H), H += 4) : $ = T, M ? (G = K(R, H), H += 4) : G = A, B && (H += 4), k && (D === 0 ? w = K(R, H) : w = Zr(R, H), H += 4), e.type === ie.VIDEO) {
|
|
982
982
|
let ee = 0;
|
|
983
983
|
for (; ee < G; ) {
|
|
984
984
|
const ne = K(s, j);
|
|
@@ -1044,9 +1044,9 @@ function ni(a, e, t, s) {
|
|
|
1044
1044
|
if (h += 4, f === 1195456820) {
|
|
1045
1045
|
const g = i[h++];
|
|
1046
1046
|
if (g === 3) {
|
|
1047
|
-
const
|
|
1047
|
+
const p = i[h++], E = 31 & p, y = 64 & p, S = y ? 2 + E * 3 : 0, T = new Uint8Array(S);
|
|
1048
1048
|
if (y) {
|
|
1049
|
-
T[0] =
|
|
1049
|
+
T[0] = p;
|
|
1050
1050
|
for (let x = 1; x < S; x++)
|
|
1051
1051
|
T[x] = i[h++];
|
|
1052
1052
|
}
|
|
@@ -1063,8 +1063,8 @@ function ni(a, e, t, s) {
|
|
|
1063
1063
|
} else if (n === 5 && o > 16) {
|
|
1064
1064
|
const u = [];
|
|
1065
1065
|
for (let g = 0; g < 16; g++) {
|
|
1066
|
-
const
|
|
1067
|
-
u.push(
|
|
1066
|
+
const p = i[h++].toString(16);
|
|
1067
|
+
u.push(p.length == 1 ? "0" + p : p), (g === 3 || g === 5 || g === 7 || g === 9) && u.push("-");
|
|
1068
1068
|
}
|
|
1069
1069
|
const d = o - 16, f = new Uint8Array(d);
|
|
1070
1070
|
for (let g = 0; g < d; g++)
|
|
@@ -1669,13 +1669,13 @@ const To = (a) => {
|
|
|
1669
1669
|
}, ae = (a, e) => JSON.stringify(a, To(e));
|
|
1670
1670
|
function So(a, e, t, s, i) {
|
|
1671
1671
|
const r = Object.keys(a), n = s == null ? void 0 : s.channels, o = s == null ? void 0 : s.audioCodec, c = i == null ? void 0 : i.videoCodec, l = n && parseInt(n) === 2;
|
|
1672
|
-
let h = !1, u = !1, d = 1 / 0, f = 1 / 0, g = 1 / 0,
|
|
1672
|
+
let h = !1, u = !1, d = 1 / 0, f = 1 / 0, g = 1 / 0, p = 1 / 0, E = 0, y = [];
|
|
1673
1673
|
const {
|
|
1674
1674
|
preferHDR: S,
|
|
1675
1675
|
allowedVideoRanges: T
|
|
1676
1676
|
} = yo(e, i);
|
|
1677
|
-
for (let
|
|
1678
|
-
const D = a[r[
|
|
1677
|
+
for (let R = r.length; R--; ) {
|
|
1678
|
+
const D = a[r[R]];
|
|
1679
1679
|
h || (h = D.channels[2] > 0), d = Math.min(d, D.minHeight), f = Math.min(f, D.minFramerate), g = Math.min(g, D.minBitrate), T.filter((P) => D.videoRanges[P] > 0).length > 0 && (u = !0);
|
|
1680
1680
|
}
|
|
1681
1681
|
d = F(d) ? d : 0, f = F(f) ? f : 0;
|
|
@@ -1683,40 +1683,40 @@ function So(a, e, t, s, i) {
|
|
|
1683
1683
|
g = F(g) ? g : t, t = Math.max(g, t), u || (e = void 0);
|
|
1684
1684
|
const _ = r.length > 1;
|
|
1685
1685
|
return {
|
|
1686
|
-
codecSet: r.reduce((
|
|
1686
|
+
codecSet: r.reduce((R, D) => {
|
|
1687
1687
|
const L = a[D];
|
|
1688
|
-
if (D ===
|
|
1689
|
-
return
|
|
1688
|
+
if (D === R)
|
|
1689
|
+
return R;
|
|
1690
1690
|
if (y = u ? T.filter((P) => L.videoRanges[P] > 0) : [], _) {
|
|
1691
1691
|
if (L.minBitrate > t)
|
|
1692
|
-
return _e(D, `min bitrate of ${L.minBitrate} > current estimate of ${t}`),
|
|
1692
|
+
return _e(D, `min bitrate of ${L.minBitrate} > current estimate of ${t}`), R;
|
|
1693
1693
|
if (!L.hasDefaultAudio)
|
|
1694
|
-
return _e(D, "no renditions with default or auto-select sound found"),
|
|
1694
|
+
return _e(D, "no renditions with default or auto-select sound found"), R;
|
|
1695
1695
|
if (o && D.indexOf(o.substring(0, 4)) % 5 !== 0)
|
|
1696
|
-
return _e(D, `audio codec preference "${o}" not found`),
|
|
1696
|
+
return _e(D, `audio codec preference "${o}" not found`), R;
|
|
1697
1697
|
if (n && !l) {
|
|
1698
1698
|
if (!L.channels[n])
|
|
1699
|
-
return _e(D, `no renditions with ${n} channel sound found (channels options: ${Object.keys(L.channels)})`),
|
|
1699
|
+
return _e(D, `no renditions with ${n} channel sound found (channels options: ${Object.keys(L.channels)})`), R;
|
|
1700
1700
|
} else if ((!o || l) && h && L.channels[2] === 0)
|
|
1701
|
-
return _e(D, "no renditions with stereo sound found"),
|
|
1701
|
+
return _e(D, "no renditions with stereo sound found"), R;
|
|
1702
1702
|
if (L.minHeight > x)
|
|
1703
|
-
return _e(D, `min resolution of ${L.minHeight} > maximum of ${x}`),
|
|
1703
|
+
return _e(D, `min resolution of ${L.minHeight} > maximum of ${x}`), R;
|
|
1704
1704
|
if (L.minFramerate > A)
|
|
1705
|
-
return _e(D, `min framerate of ${L.minFramerate} > maximum of ${A}`),
|
|
1705
|
+
return _e(D, `min framerate of ${L.minFramerate} > maximum of ${A}`), R;
|
|
1706
1706
|
if (!y.some((P) => L.videoRanges[P] > 0))
|
|
1707
|
-
return _e(D, `no variants with VIDEO-RANGE of ${ae(y)} found`),
|
|
1707
|
+
return _e(D, `no variants with VIDEO-RANGE of ${ae(y)} found`), R;
|
|
1708
1708
|
if (c && D.indexOf(c.substring(0, 4)) % 5 !== 0)
|
|
1709
|
-
return _e(D, `video codec preference "${c}" not found`),
|
|
1710
|
-
if (L.maxScore <
|
|
1711
|
-
return _e(D, `max score of ${L.maxScore} < selected max of ${
|
|
1709
|
+
return _e(D, `video codec preference "${c}" not found`), R;
|
|
1710
|
+
if (L.maxScore < E)
|
|
1711
|
+
return _e(D, `max score of ${L.maxScore} < selected max of ${E}`), R;
|
|
1712
1712
|
}
|
|
1713
|
-
return
|
|
1713
|
+
return R && (Jt(D) >= Jt(R) || L.fragmentError > a[R].fragmentError) ? R : (p = L.minIndex, E = L.maxScore, D);
|
|
1714
1714
|
}, void 0),
|
|
1715
1715
|
videoRanges: y,
|
|
1716
1716
|
preferHDR: S,
|
|
1717
1717
|
minFramerate: f,
|
|
1718
1718
|
minBitrate: g,
|
|
1719
|
-
minIndex:
|
|
1719
|
+
minIndex: p
|
|
1720
1720
|
};
|
|
1721
1721
|
}
|
|
1722
1722
|
function _e(a, e) {
|
|
@@ -1799,12 +1799,12 @@ function ke(a, e, t) {
|
|
|
1799
1799
|
}
|
|
1800
1800
|
for (let s = 0; s < e.length; s++) {
|
|
1801
1801
|
const i = e[s];
|
|
1802
|
-
if (
|
|
1802
|
+
if (et(a, i, t))
|
|
1803
1803
|
return s;
|
|
1804
1804
|
}
|
|
1805
1805
|
return -1;
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function et(a, e, t) {
|
|
1808
1808
|
const {
|
|
1809
1809
|
groupId: s,
|
|
1810
1810
|
name: i,
|
|
@@ -1821,7 +1821,7 @@ function Ao(a, e = "") {
|
|
|
1821
1821
|
const t = a.split(","), s = e.split(",");
|
|
1822
1822
|
return t.length === s.length && !t.some((i) => s.indexOf(i) === -1);
|
|
1823
1823
|
}
|
|
1824
|
-
function
|
|
1824
|
+
function Je(a, e) {
|
|
1825
1825
|
const {
|
|
1826
1826
|
audioCodec: t,
|
|
1827
1827
|
channels: s
|
|
@@ -1830,18 +1830,18 @@ function Ze(a, e) {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
function Lo(a, e, t, s, i) {
|
|
1832
1832
|
const r = e[s], o = e.reduce((d, f, g) => {
|
|
1833
|
-
const
|
|
1834
|
-
return (d[
|
|
1833
|
+
const p = f.uri;
|
|
1834
|
+
return (d[p] || (d[p] = [])).push(g), d;
|
|
1835
1835
|
}, {})[r.uri];
|
|
1836
1836
|
o.length > 1 && (s = Math.max.apply(Math, o));
|
|
1837
1837
|
const c = r.videoRange, l = r.frameRate, h = r.codecSet.substring(0, 4), u = Yi(e, s, (d) => {
|
|
1838
1838
|
if (d.videoRange !== c || d.frameRate !== l || d.codecSet.substring(0, 4) !== h)
|
|
1839
1839
|
return !1;
|
|
1840
|
-
const f = d.audioGroups, g = t.filter((
|
|
1840
|
+
const f = d.audioGroups, g = t.filter((p) => !f || f.indexOf(p.groupId) !== -1);
|
|
1841
1841
|
return ke(a, g, i) > -1;
|
|
1842
1842
|
});
|
|
1843
1843
|
return u > -1 ? u : Yi(e, s, (d) => {
|
|
1844
|
-
const f = d.audioGroups, g = t.filter((
|
|
1844
|
+
const f = d.audioGroups, g = t.filter((p) => !f || f.indexOf(p.groupId) !== -1);
|
|
1845
1845
|
return ke(a, g, i) > -1;
|
|
1846
1846
|
});
|
|
1847
1847
|
}
|
|
@@ -1872,14 +1872,14 @@ class Io extends Ge {
|
|
|
1872
1872
|
} = n;
|
|
1873
1873
|
if (!i || !c)
|
|
1874
1874
|
return;
|
|
1875
|
-
const l = performance.now(), h = r ? r.stats : i.stats, u = r ? r.duration : i.duration, d = l - h.loading.start, f = n.minAutoLevel, g = i.level,
|
|
1875
|
+
const l = performance.now(), h = r ? r.stats : i.stats, u = r ? r.duration : i.duration, d = l - h.loading.start, f = n.minAutoLevel, g = i.level, p = this._nextAutoLevel;
|
|
1876
1876
|
if (h.aborted || h.loaded && h.loaded === h.total || g <= f) {
|
|
1877
1877
|
this.clearTimer(), this._nextAutoLevel = -1;
|
|
1878
1878
|
return;
|
|
1879
1879
|
}
|
|
1880
1880
|
if (!o)
|
|
1881
1881
|
return;
|
|
1882
|
-
const
|
|
1882
|
+
const E = p > -1 && p !== g, y = !!t || E;
|
|
1883
1883
|
if (!y && (c.paused || !c.playbackRate || !c.readyState))
|
|
1884
1884
|
return;
|
|
1885
1885
|
const S = n.mainForwardBufferInfo;
|
|
@@ -1888,13 +1888,13 @@ class Io extends Ge {
|
|
|
1888
1888
|
const T = this.bwEstimator.getEstimateTTFB(), x = Math.abs(c.playbackRate);
|
|
1889
1889
|
if (d <= Math.max(T, 1e3 * (u / (x * 2))))
|
|
1890
1890
|
return;
|
|
1891
|
-
const A = S ? S.len / x : 0, _ = h.loading.first ? h.loading.first - h.loading.start : -1, v = h.loaded && _ > -1,
|
|
1891
|
+
const A = S ? S.len / x : 0, _ = h.loading.first ? h.loading.first - h.loading.start : -1, v = h.loaded && _ > -1, R = this.getBwEstimate(), D = n.levels, L = D[g], P = Math.max(h.loaded, Math.round(u * (i.bitrate || L.averageBitrate) / 8));
|
|
1892
1892
|
let O = v ? d - _ : d;
|
|
1893
|
-
O < 1 && v && (O = Math.min(d, h.loaded * 8 /
|
|
1894
|
-
const X = v ? h.loaded * 1e3 / O : 0, V = T / 1e3, $ = X ? (P - h.loaded) / X : P * 8 /
|
|
1893
|
+
O < 1 && v && (O = Math.min(d, h.loaded * 8 / R));
|
|
1894
|
+
const X = v ? h.loaded * 1e3 / O : 0, V = T / 1e3, $ = X ? (P - h.loaded) / X : P * 8 / R + V;
|
|
1895
1895
|
if ($ <= A)
|
|
1896
1896
|
return;
|
|
1897
|
-
const M = X ? X * 8 :
|
|
1897
|
+
const M = X ? X * 8 : R, G = ((s = (t == null ? void 0 : t.details) || this.hls.latestLevelDetails) == null ? void 0 : s.live) === !0, B = this.hls.config.abrBandWidthUpFactor;
|
|
1898
1898
|
let k = Number.POSITIVE_INFINITY, w;
|
|
1899
1899
|
for (w = g - 1; w > f; w--) {
|
|
1900
1900
|
const Z = D[w].maxBitrate, ee = !D[w].details || G;
|
|
@@ -1913,7 +1913,7 @@ class Io extends Ge {
|
|
|
1913
1913
|
Estimated load time for current fragment: ${$.toFixed(3)} s
|
|
1914
1914
|
Estimated load time for down switch fragment: ${k.toFixed(3)} s
|
|
1915
1915
|
TTFB estimate: ${_ | 0} ms
|
|
1916
|
-
Current BW estimate: ${F(
|
|
1916
|
+
Current BW estimate: ${F(R) ? R | 0 : "Unknown"} bps
|
|
1917
1917
|
New BW estimate: ${this.getBwEstimate() | 0} bps
|
|
1918
1918
|
Switching to level ${w} @ ${Y | 0} bps`), n.nextLoadLevel = n.nextAutoLevel = w, this.clearTimer();
|
|
1919
1919
|
const j = () => {
|
|
@@ -1927,7 +1927,7 @@ class Io extends Ge {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
1929
1929
|
};
|
|
1930
|
-
|
|
1930
|
+
E || $ > k * 2 ? j() : this.timer = self.setInterval(j, k * 1e3), n.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED, {
|
|
1931
1931
|
frag: i,
|
|
1932
1932
|
part: r,
|
|
1933
1933
|
stats: h
|
|
@@ -1981,11 +1981,11 @@ class Io extends Ge {
|
|
|
1981
1981
|
onError(e, t) {
|
|
1982
1982
|
if (!t.fatal)
|
|
1983
1983
|
switch (t.details) {
|
|
1984
|
-
case
|
|
1985
|
-
case
|
|
1984
|
+
case b.BUFFER_ADD_CODEC_ERROR:
|
|
1985
|
+
case b.BUFFER_APPEND_ERROR:
|
|
1986
1986
|
this.lastLoadedFragLevel = -1, this.firstSelection = -1;
|
|
1987
1987
|
break;
|
|
1988
|
-
case
|
|
1988
|
+
case b.FRAG_LOAD_TIMEOUT: {
|
|
1989
1989
|
const s = t.frag, {
|
|
1990
1990
|
fragCurrent: i,
|
|
1991
1991
|
partCurrent: r
|
|
@@ -2097,20 +2097,20 @@ class Io extends Ge {
|
|
|
2097
2097
|
} = s, o = t ? t.duration : e ? e.duration : 0, c = this.getBwEstimate(), l = this.getStarvationDelay();
|
|
2098
2098
|
let h = r.abrBandWidthFactor, u = r.abrBandWidthUpFactor;
|
|
2099
2099
|
if (l) {
|
|
2100
|
-
const
|
|
2101
|
-
if (
|
|
2102
|
-
return this.rebufferNotice = -1,
|
|
2100
|
+
const E = this.findBestLevel(c, n, i, l, 0, h, u);
|
|
2101
|
+
if (E >= 0)
|
|
2102
|
+
return this.rebufferNotice = -1, E;
|
|
2103
2103
|
}
|
|
2104
2104
|
let d = o ? Math.min(o, r.maxStarvationDelay) : r.maxStarvationDelay;
|
|
2105
2105
|
if (!l) {
|
|
2106
|
-
const
|
|
2107
|
-
|
|
2106
|
+
const E = this.bitrateTestDelay;
|
|
2107
|
+
E && (d = (o ? Math.min(o, r.maxLoadingDelay) : r.maxLoadingDelay) - E, this.info(`bitrate test took ${Math.round(1e3 * E)}ms, set first fragment max fetchDuration to ${Math.round(1e3 * d)} ms`), h = u = 1);
|
|
2108
2108
|
}
|
|
2109
2109
|
const f = this.findBestLevel(c, n, i, l, d, h, u);
|
|
2110
2110
|
if (this.rebufferNotice !== f && (this.rebufferNotice = f, this.info(`${l ? "rebuffering expected" : "buffer is empty"}, optimal quality level ${f}`)), f > -1)
|
|
2111
2111
|
return f;
|
|
2112
|
-
const g = s.levels[n],
|
|
2113
|
-
return
|
|
2112
|
+
const g = s.levels[n], p = s.loadLevelObj;
|
|
2113
|
+
return p && (g == null ? void 0 : g.bitrate) < p.bitrate ? n : s.loadLevel;
|
|
2114
2114
|
}
|
|
2115
2115
|
getStarvationDelay() {
|
|
2116
2116
|
const e = this.hls, t = e.media;
|
|
@@ -2129,23 +2129,23 @@ class Io extends Ge {
|
|
|
2129
2129
|
partCurrent: f
|
|
2130
2130
|
} = this, {
|
|
2131
2131
|
levels: g,
|
|
2132
|
-
allAudioTracks:
|
|
2133
|
-
loadLevel:
|
|
2132
|
+
allAudioTracks: p,
|
|
2133
|
+
loadLevel: E,
|
|
2134
2134
|
config: y
|
|
2135
2135
|
} = this.hls;
|
|
2136
2136
|
if (g.length === 1)
|
|
2137
2137
|
return 0;
|
|
2138
|
-
const S = g[u], T = !!((c = this.hls.latestLevelDetails) != null && c.live), x =
|
|
2138
|
+
const S = g[u], T = !!((c = this.hls.latestLevelDetails) != null && c.live), x = E === -1 || h === -1;
|
|
2139
2139
|
let A, _ = "SDR", v = (S == null ? void 0 : S.frameRate) || 0;
|
|
2140
2140
|
const {
|
|
2141
|
-
audioPreference:
|
|
2141
|
+
audioPreference: R,
|
|
2142
2142
|
videoPreference: D
|
|
2143
|
-
} = y, L = this.audioTracksByGroup || (this.audioTracksByGroup = hn(
|
|
2143
|
+
} = y, L = this.audioTracksByGroup || (this.audioTracksByGroup = hn(p));
|
|
2144
2144
|
let P = -1;
|
|
2145
2145
|
if (x) {
|
|
2146
2146
|
if (this.firstSelection !== -1)
|
|
2147
2147
|
return this.firstSelection;
|
|
2148
|
-
const M = this.codecTiers || (this.codecTiers = vo(g, L, t, s)), G = So(M, _, e,
|
|
2148
|
+
const M = this.codecTiers || (this.codecTiers = vo(g, L, t, s)), G = So(M, _, e, R, D), {
|
|
2149
2149
|
codecSet: B,
|
|
2150
2150
|
videoRanges: k,
|
|
2151
2151
|
minFramerate: w,
|
|
@@ -2164,12 +2164,12 @@ class Io extends Ge {
|
|
|
2164
2164
|
continue;
|
|
2165
2165
|
if (y.useMediaCapabilities && !G.supportedResult && !G.supportedPromise) {
|
|
2166
2166
|
const ee = navigator.mediaCapabilities;
|
|
2167
|
-
typeof (ee == null ? void 0 : ee.decodingInfo) == "function" && (fo(G, L, _, v, e,
|
|
2167
|
+
typeof (ee == null ? void 0 : ee.decodingInfo) == "function" && (fo(G, L, _, v, e, R) || cs(G.videoCodec)) ? (G.supportedPromise = cn(G, L, ee), G.supportedPromise.then((ne) => {
|
|
2168
2168
|
if (!this.hls)
|
|
2169
2169
|
return;
|
|
2170
2170
|
G.supportedResult = ne;
|
|
2171
|
-
const ge = this.hls.levels,
|
|
2172
|
-
ne.error ? this.warn(`MediaCapabilities decodingInfo error: "${ne.error}" for level ${
|
|
2171
|
+
const ge = this.hls.levels, pe = ge.indexOf(G);
|
|
2172
|
+
ne.error ? this.warn(`MediaCapabilities decodingInfo error: "${ne.error}" for level ${pe} ${ae(ne)}`) : ne.supported || (this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${pe} ${ae(ne)}`), pe > -1 && ge.length > 1 && (this.log(`Removing unsupported level ${pe}`), this.hls.removeLevel(pe), this.hls.loadLevel === -1 && (this.hls.nextLoadLevel = 0)));
|
|
2173
2173
|
})) : G.supportedResult = on;
|
|
2174
2174
|
}
|
|
2175
2175
|
if ((A && G.codecSet !== A || _ && G.videoRange !== _ || B && v > G.frameRate || !B && v > 0 && v < G.frameRate || G.supportedResult && !(($ = G.supportedResult.decodingInfoResults) != null && $[0].smooth)) && (!x || M !== P)) {
|
|
@@ -2189,7 +2189,7 @@ class Io extends Ge {
|
|
|
2189
2189
|
(j <= X || !F(j) || T && !this.bitrateTestDelay || j < l)
|
|
2190
2190
|
) {
|
|
2191
2191
|
const ee = this.forcedAutoLevel;
|
|
2192
|
-
return M !==
|
|
2192
|
+
return M !== E && (ee === -1 || ee !== E) && (V.length && this.trace(`Skipped level(s) ${V.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${g[V[0]].codecs}" ${g[V[0]].videoRange}; not compatible with "${A}" ${_}`), this.info(`switch candidate:${u}->${M} adjustedbw(${Math.round(Y)})-bitrate=${Math.round(Y - H)} ttfb:${X.toFixed(1)} avgDuration:${w.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${j.toFixed(1)} firstSelection:${x} codecSet:${G.codecSet} videoRange:${G.videoRange} hls.loadLevel:${E}`)), x && (this.firstSelection = M), M;
|
|
2193
2193
|
}
|
|
2194
2194
|
}
|
|
2195
2195
|
return -1;
|
|
@@ -2254,7 +2254,7 @@ function Ro(a, e, t) {
|
|
|
2254
2254
|
}
|
|
2255
2255
|
return null;
|
|
2256
2256
|
}
|
|
2257
|
-
function
|
|
2257
|
+
function tt(a, e, t = 0, s = 0, i = 5e-3) {
|
|
2258
2258
|
let r = null;
|
|
2259
2259
|
if (a) {
|
|
2260
2260
|
r = e[1 + a.sn - e[0].sn] || null;
|
|
@@ -2302,10 +2302,10 @@ function Do(a, e, t) {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
function is(a) {
|
|
2304
2304
|
switch (a.details) {
|
|
2305
|
-
case
|
|
2306
|
-
case
|
|
2307
|
-
case
|
|
2308
|
-
case
|
|
2305
|
+
case b.FRAG_LOAD_TIMEOUT:
|
|
2306
|
+
case b.KEY_LOAD_TIMEOUT:
|
|
2307
|
+
case b.LEVEL_LOAD_TIMEOUT:
|
|
2308
|
+
case b.MANIFEST_LOAD_TIMEOUT:
|
|
2309
2309
|
return !0;
|
|
2310
2310
|
}
|
|
2311
2311
|
return !1;
|
|
@@ -2378,38 +2378,38 @@ class Po extends Ge {
|
|
|
2378
2378
|
return;
|
|
2379
2379
|
const i = this.hls, r = t.context;
|
|
2380
2380
|
switch (t.details) {
|
|
2381
|
-
case
|
|
2382
|
-
case
|
|
2383
|
-
case
|
|
2384
|
-
case
|
|
2381
|
+
case b.FRAG_LOAD_ERROR:
|
|
2382
|
+
case b.FRAG_LOAD_TIMEOUT:
|
|
2383
|
+
case b.KEY_LOAD_ERROR:
|
|
2384
|
+
case b.KEY_LOAD_TIMEOUT:
|
|
2385
2385
|
t.errorAction = this.getFragRetryOrSwitchAction(t);
|
|
2386
2386
|
return;
|
|
2387
|
-
case
|
|
2387
|
+
case b.FRAG_PARSING_ERROR:
|
|
2388
2388
|
if ((s = t.frag) != null && s.gap) {
|
|
2389
2389
|
t.errorAction = At();
|
|
2390
2390
|
return;
|
|
2391
2391
|
}
|
|
2392
|
-
case
|
|
2393
|
-
case
|
|
2392
|
+
case b.FRAG_GAP:
|
|
2393
|
+
case b.FRAG_DECRYPT_ERROR: {
|
|
2394
2394
|
t.errorAction = this.getFragRetryOrSwitchAction(t), t.errorAction.action = fe.SendAlternateToPenaltyBox;
|
|
2395
2395
|
return;
|
|
2396
2396
|
}
|
|
2397
|
-
case
|
|
2398
|
-
case
|
|
2397
|
+
case b.LEVEL_EMPTY_ERROR:
|
|
2398
|
+
case b.LEVEL_PARSING_ERROR:
|
|
2399
2399
|
{
|
|
2400
2400
|
var n, o;
|
|
2401
2401
|
const l = t.parent === N.MAIN ? t.level : i.loadLevel;
|
|
2402
|
-
t.details ===
|
|
2402
|
+
t.details === b.LEVEL_EMPTY_ERROR && ((n = t.context) != null && (o = n.levelDetails) != null && o.live) ? t.errorAction = this.getPlaylistRetryOrSwitchAction(t, l) : (t.levelRetry = !1, t.errorAction = this.getLevelSwitchAction(t, l));
|
|
2403
2403
|
}
|
|
2404
2404
|
return;
|
|
2405
|
-
case
|
|
2406
|
-
case
|
|
2405
|
+
case b.LEVEL_LOAD_ERROR:
|
|
2406
|
+
case b.LEVEL_LOAD_TIMEOUT:
|
|
2407
2407
|
typeof (r == null ? void 0 : r.level) == "number" && (t.errorAction = this.getPlaylistRetryOrSwitchAction(t, r.level));
|
|
2408
2408
|
return;
|
|
2409
|
-
case
|
|
2410
|
-
case
|
|
2411
|
-
case
|
|
2412
|
-
case
|
|
2409
|
+
case b.AUDIO_TRACK_LOAD_ERROR:
|
|
2410
|
+
case b.AUDIO_TRACK_LOAD_TIMEOUT:
|
|
2411
|
+
case b.SUBTITLE_LOAD_ERROR:
|
|
2412
|
+
case b.SUBTITLE_TRACK_LOAD_TIMEOUT:
|
|
2413
2413
|
if (r) {
|
|
2414
2414
|
const l = i.loadLevelObj;
|
|
2415
2415
|
if (l && (r.type === z.AUDIO_TRACK && l.hasAudioGroup(r.groupId) || r.type === z.SUBTITLE_TRACK && l.hasSubtitleGroup(r.groupId))) {
|
|
@@ -2418,7 +2418,7 @@ class Po extends Ge {
|
|
|
2418
2418
|
}
|
|
2419
2419
|
}
|
|
2420
2420
|
return;
|
|
2421
|
-
case
|
|
2421
|
+
case b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:
|
|
2422
2422
|
{
|
|
2423
2423
|
const l = i.loadLevelObj, h = l == null ? void 0 : l.attrs["HDCP-LEVEL"];
|
|
2424
2424
|
h ? t.errorAction = {
|
|
@@ -2428,21 +2428,21 @@ class Po extends Ge {
|
|
|
2428
2428
|
} : this.keySystemError(t);
|
|
2429
2429
|
}
|
|
2430
2430
|
return;
|
|
2431
|
-
case
|
|
2432
|
-
case
|
|
2433
|
-
case
|
|
2431
|
+
case b.BUFFER_ADD_CODEC_ERROR:
|
|
2432
|
+
case b.REMUX_ALLOC_ERROR:
|
|
2433
|
+
case b.BUFFER_APPEND_ERROR:
|
|
2434
2434
|
if (!t.errorAction) {
|
|
2435
2435
|
var c;
|
|
2436
2436
|
t.errorAction = this.getLevelSwitchAction(t, (c = t.level) != null ? c : i.loadLevel);
|
|
2437
2437
|
}
|
|
2438
2438
|
return;
|
|
2439
|
-
case
|
|
2440
|
-
case
|
|
2441
|
-
case
|
|
2442
|
-
case
|
|
2443
|
-
case
|
|
2444
|
-
case
|
|
2445
|
-
case
|
|
2439
|
+
case b.INTERNAL_EXCEPTION:
|
|
2440
|
+
case b.BUFFER_APPENDING_ERROR:
|
|
2441
|
+
case b.BUFFER_FULL_ERROR:
|
|
2442
|
+
case b.LEVEL_SWITCH_ERROR:
|
|
2443
|
+
case b.BUFFER_STALLED_ERROR:
|
|
2444
|
+
case b.BUFFER_SEEK_OVER_HOLE:
|
|
2445
|
+
case b.BUFFER_NUDGE_ON_STALL:
|
|
2446
2446
|
t.errorAction = At();
|
|
2447
2447
|
return;
|
|
2448
2448
|
}
|
|
@@ -2469,7 +2469,7 @@ class Po extends Ge {
|
|
|
2469
2469
|
fragLoadPolicy: r,
|
|
2470
2470
|
keyLoadPolicy: n
|
|
2471
2471
|
} = t.config, o = qi(e.details.startsWith("key") ? n : r, e), c = t.levels.reduce((h, u) => h + u.fragmentError, 0);
|
|
2472
|
-
if (i && (e.details !==
|
|
2472
|
+
if (i && (e.details !== b.FRAG_GAP && i.fragmentError++, rs(o, c, is(e), e.response)))
|
|
2473
2473
|
return {
|
|
2474
2474
|
action: fe.RetryRequest,
|
|
2475
2475
|
flags: be.None,
|
|
@@ -2486,7 +2486,7 @@ class Po extends Ge {
|
|
|
2486
2486
|
if (i) {
|
|
2487
2487
|
var r, n;
|
|
2488
2488
|
const l = e.details;
|
|
2489
|
-
i.loadError++, l ===
|
|
2489
|
+
i.loadError++, l === b.BUFFER_APPEND_ERROR && i.fragmentError++;
|
|
2490
2490
|
let h = -1;
|
|
2491
2491
|
const {
|
|
2492
2492
|
levels: u,
|
|
@@ -2495,9 +2495,9 @@ class Po extends Ge {
|
|
|
2495
2495
|
maxAutoLevel: g
|
|
2496
2496
|
} = s;
|
|
2497
2497
|
s.autoLevelEnabled || (s.loadLevel = -1);
|
|
2498
|
-
const
|
|
2498
|
+
const p = (r = e.frag) == null ? void 0 : r.type, y = (p === N.AUDIO && l === b.FRAG_PARSING_ERROR || e.sourceBufferName === "audio" && (l === b.BUFFER_ADD_CODEC_ERROR || l === b.BUFFER_APPEND_ERROR)) && u.some(({
|
|
2499
2499
|
audioCodec: _
|
|
2500
|
-
}) => i.audioCodec !== _), T = e.sourceBufferName === "video" && (l ===
|
|
2500
|
+
}) => i.audioCodec !== _), T = e.sourceBufferName === "video" && (l === b.BUFFER_ADD_CODEC_ERROR || l === b.BUFFER_APPEND_ERROR) && u.some(({
|
|
2501
2501
|
codecSet: _,
|
|
2502
2502
|
audioCodec: v
|
|
2503
2503
|
}) => i.codecSet !== _ && i.audioCodec === v), {
|
|
@@ -2508,18 +2508,18 @@ class Po extends Ge {
|
|
|
2508
2508
|
const v = (_ + d) % u.length;
|
|
2509
2509
|
if (v !== d && v >= f && v <= g && u[v].loadError === 0) {
|
|
2510
2510
|
var o, c;
|
|
2511
|
-
const
|
|
2512
|
-
if (l ===
|
|
2511
|
+
const R = u[v];
|
|
2512
|
+
if (l === b.FRAG_GAP && p === N.MAIN && e.frag) {
|
|
2513
2513
|
const D = u[v].details;
|
|
2514
2514
|
if (D) {
|
|
2515
|
-
const L =
|
|
2515
|
+
const L = tt(e.frag, D.fragments, e.frag.start);
|
|
2516
2516
|
if (L != null && L.gap)
|
|
2517
2517
|
continue;
|
|
2518
2518
|
}
|
|
2519
2519
|
} else {
|
|
2520
|
-
if (x === z.AUDIO_TRACK &&
|
|
2520
|
+
if (x === z.AUDIO_TRACK && R.hasAudioGroup(A) || x === z.SUBTITLE_TRACK && R.hasSubtitleGroup(A))
|
|
2521
2521
|
continue;
|
|
2522
|
-
if (
|
|
2522
|
+
if (p === N.AUDIO && (o = i.audioGroups) != null && o.some((D) => R.hasAudioGroup(D)) || p === N.SUBTITLE && (c = i.subtitleGroups) != null && c.some((D) => R.hasSubtitleGroup(D)) || y && i.audioCodec === R.audioCodec || !y && i.audioCodec !== R.audioCodec || T && i.codecSet === R.codecSet)
|
|
2523
2523
|
continue;
|
|
2524
2524
|
}
|
|
2525
2525
|
h = v;
|
|
@@ -2544,7 +2544,7 @@ class Po extends Ge {
|
|
|
2544
2544
|
case fe.DoNothing:
|
|
2545
2545
|
break;
|
|
2546
2546
|
case fe.SendAlternateToPenaltyBox:
|
|
2547
|
-
this.sendAlternateToPenaltyBox(t), !t.errorAction.resolved && t.details !==
|
|
2547
|
+
this.sendAlternateToPenaltyBox(t), !t.errorAction.resolved && t.details !== b.FRAG_GAP ? t.fatal = !0 : /MediaSource readyState: ended/.test(t.error.message) && (this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`), this.hls.recoverMediaError());
|
|
2548
2548
|
break;
|
|
2549
2549
|
}
|
|
2550
2550
|
if (t.fatal) {
|
|
@@ -2572,7 +2572,7 @@ class Po extends Ge {
|
|
|
2572
2572
|
s.resolved || this.switchLevel(e, n);
|
|
2573
2573
|
}
|
|
2574
2574
|
switchLevel(e, t) {
|
|
2575
|
-
if (t !== void 0 && e.errorAction && (this.warn(`switching to level ${t} after ${e.details}`), this.hls.nextAutoLevel = t, e.errorAction.resolved = !0, this.hls.nextLoadLevel = this.hls.nextAutoLevel, e.details ===
|
|
2575
|
+
if (t !== void 0 && e.errorAction && (this.warn(`switching to level ${t} after ${e.details}`), this.hls.nextAutoLevel = t, e.errorAction.resolved = !0, this.hls.nextLoadLevel = this.hls.nextAutoLevel, e.details === b.BUFFER_ADD_CODEC_ERROR && e.mimeType && e.sourceBufferName !== "audiovideo")) {
|
|
2576
2576
|
const s = an(e.mimeType), i = this.hls.levels;
|
|
2577
2577
|
for (let r = i.length; r--; )
|
|
2578
2578
|
i[r][`${e.sourceBufferName}Codec`] === s && this.hls.removeLevel(r);
|
|
@@ -2689,7 +2689,7 @@ class ko {
|
|
|
2689
2689
|
const t = this.timeRanges;
|
|
2690
2690
|
if (!t || e.frag.sn === "initSegment")
|
|
2691
2691
|
return;
|
|
2692
|
-
const s = e.frag, i =
|
|
2692
|
+
const s = e.frag, i = rt(s), r = this.fragments[i];
|
|
2693
2693
|
if (!r || r.buffered && s.gap)
|
|
2694
2694
|
return;
|
|
2695
2695
|
const n = !s.relurl;
|
|
@@ -2706,7 +2706,7 @@ class ko {
|
|
|
2706
2706
|
s && (this.activePartLists[t] = Xi(s, (i) => i.fragment.sn >= e));
|
|
2707
2707
|
}
|
|
2708
2708
|
fragBuffered(e, t) {
|
|
2709
|
-
const s =
|
|
2709
|
+
const s = rt(e);
|
|
2710
2710
|
let i = this.fragments[s];
|
|
2711
2711
|
!i && t && (i = this.fragments[s] = {
|
|
2712
2712
|
body: e,
|
|
@@ -2759,7 +2759,7 @@ class ko {
|
|
|
2759
2759
|
return t !== void 0 && (t.buffered || wt(t));
|
|
2760
2760
|
}
|
|
2761
2761
|
getState(e) {
|
|
2762
|
-
const t =
|
|
2762
|
+
const t = rt(e), s = this.fragments[t];
|
|
2763
2763
|
return s ? s.buffered ? wt(s) ? ce.PARTIAL : ce.OK : ce.APPENDING : ce.NOT_LOADED;
|
|
2764
2764
|
}
|
|
2765
2765
|
isTimeBuffered(e, t, s) {
|
|
@@ -2778,7 +2778,7 @@ class ko {
|
|
|
2778
2778
|
onFragLoaded(e, t) {
|
|
2779
2779
|
if (t.frag.sn === "initSegment" || t.frag.bitrateTest)
|
|
2780
2780
|
return;
|
|
2781
|
-
const s = t.frag, i = t.part ? null : t, r =
|
|
2781
|
+
const s = t.frag, i = t.part ? null : t, r = rt(s);
|
|
2782
2782
|
this.fragments[r] = {
|
|
2783
2783
|
body: s,
|
|
2784
2784
|
appendedPTS: null,
|
|
@@ -2809,7 +2809,7 @@ class ko {
|
|
|
2809
2809
|
this.detectPartialFragments(t);
|
|
2810
2810
|
}
|
|
2811
2811
|
hasFragment(e) {
|
|
2812
|
-
const t =
|
|
2812
|
+
const t = rt(e);
|
|
2813
2813
|
return !!this.fragments[t];
|
|
2814
2814
|
}
|
|
2815
2815
|
hasFragments(e) {
|
|
@@ -2839,7 +2839,7 @@ class ko {
|
|
|
2839
2839
|
});
|
|
2840
2840
|
}
|
|
2841
2841
|
removeFragment(e) {
|
|
2842
|
-
const t =
|
|
2842
|
+
const t = rt(e);
|
|
2843
2843
|
e.clearElementaryStreamInfo();
|
|
2844
2844
|
const s = this.activePartLists[e.type];
|
|
2845
2845
|
if (s) {
|
|
@@ -2859,7 +2859,7 @@ function wt(a) {
|
|
|
2859
2859
|
var e, t, s;
|
|
2860
2860
|
return a.buffered && (a.body.gap || ((e = a.range.video) == null ? void 0 : e.partial) || ((t = a.range.audio) == null ? void 0 : t.partial) || ((s = a.range.audiovideo) == null ? void 0 : s.partial));
|
|
2861
2861
|
}
|
|
2862
|
-
function
|
|
2862
|
+
function rt(a) {
|
|
2863
2863
|
return `${a.type}_${a.level}_${a.sn}`;
|
|
2864
2864
|
}
|
|
2865
2865
|
function Xi(a, e) {
|
|
@@ -2916,15 +2916,15 @@ class Fo {
|
|
|
2916
2916
|
}
|
|
2917
2917
|
initTable() {
|
|
2918
2918
|
const e = this.sBox, t = this.invSBox, s = this.subMix, i = s[0], r = s[1], n = s[2], o = s[3], c = this.invSubMix, l = c[0], h = c[1], u = c[2], d = c[3], f = new Uint32Array(256);
|
|
2919
|
-
let g = 0,
|
|
2920
|
-
for (
|
|
2921
|
-
|
|
2922
|
-
for (
|
|
2923
|
-
let y =
|
|
2919
|
+
let g = 0, p = 0, E = 0;
|
|
2920
|
+
for (E = 0; E < 256; E++)
|
|
2921
|
+
E < 128 ? f[E] = E << 1 : f[E] = E << 1 ^ 283;
|
|
2922
|
+
for (E = 0; E < 256; E++) {
|
|
2923
|
+
let y = p ^ p << 1 ^ p << 2 ^ p << 3 ^ p << 4;
|
|
2924
2924
|
y = y >>> 8 ^ y & 255 ^ 99, e[g] = y, t[y] = g;
|
|
2925
2925
|
const S = f[g], T = f[S], x = f[T];
|
|
2926
2926
|
let A = f[y] * 257 ^ y * 16843008;
|
|
2927
|
-
i[g] = A << 24 | A >>> 8, r[g] = A << 16 | A >>> 16, n[g] = A << 8 | A >>> 24, o[g] = A, A = x * 16843009 ^ T * 65537 ^ S * 257 ^ g * 16843008, l[y] = A << 24 | A >>> 8, h[y] = A << 16 | A >>> 16, u[y] = A << 8 | A >>> 24, d[y] = A, g ? (g = S ^ f[f[f[x ^ S]]],
|
|
2927
|
+
i[g] = A << 24 | A >>> 8, r[g] = A << 16 | A >>> 16, n[g] = A << 8 | A >>> 24, o[g] = A, A = x * 16843009 ^ T * 65537 ^ S * 257 ^ g * 16843008, l[y] = A << 24 | A >>> 8, h[y] = A << 16 | A >>> 16, u[y] = A << 8 | A >>> 24, d[y] = A, g ? (g = S ^ f[f[f[x ^ S]]], p ^= f[f[p]]) : g = p = 1;
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
expandKey(e) {
|
|
@@ -2940,7 +2940,7 @@ class Fo {
|
|
|
2940
2940
|
throw new Error("Invalid aes key size=" + r);
|
|
2941
2941
|
const n = this.ksRows = (r + 6 + 1) * 4;
|
|
2942
2942
|
let o, c;
|
|
2943
|
-
const l = this.keySchedule = new Uint32Array(n), h = this.invKeySchedule = new Uint32Array(n), u = this.sBox, d = this.rcon, f = this.invSubMix, g = f[0],
|
|
2943
|
+
const l = this.keySchedule = new Uint32Array(n), h = this.invKeySchedule = new Uint32Array(n), u = this.sBox, d = this.rcon, f = this.invSubMix, g = f[0], p = f[1], E = f[2], y = f[3];
|
|
2944
2944
|
let S, T;
|
|
2945
2945
|
for (o = 0; o < n; o++) {
|
|
2946
2946
|
if (o < r) {
|
|
@@ -2950,7 +2950,7 @@ class Fo {
|
|
|
2950
2950
|
T = S, o % r === 0 ? (T = T << 8 | T >>> 24, T = u[T >>> 24] << 24 | u[T >>> 16 & 255] << 16 | u[T >>> 8 & 255] << 8 | u[T & 255], T ^= d[o / r | 0] << 24) : r > 6 && o % r === 4 && (T = u[T >>> 24] << 24 | u[T >>> 16 & 255] << 16 | u[T >>> 8 & 255] << 8 | u[T & 255]), l[o] = S = (l[o - r] ^ T) >>> 0;
|
|
2951
2951
|
}
|
|
2952
2952
|
for (c = 0; c < n; c++)
|
|
2953
|
-
o = n - c, c & 3 ? T = l[o] : T = l[o - 4], c < 4 || o <= 4 ? h[c] = T : h[c] = g[u[T >>> 24]] ^
|
|
2953
|
+
o = n - c, c & 3 ? T = l[o] : T = l[o - 4], c < 4 || o <= 4 ? h[c] = T : h[c] = g[u[T >>> 24]] ^ p[u[T >>> 16 & 255]] ^ E[u[T >>> 8 & 255]] ^ y[u[T & 255]], h[c] = h[c] >>> 0;
|
|
2954
2954
|
}
|
|
2955
2955
|
// Adding this as a method greatly improves performance.
|
|
2956
2956
|
networkToHostOrderSwap(e) {
|
|
@@ -2958,14 +2958,14 @@ class Fo {
|
|
|
2958
2958
|
}
|
|
2959
2959
|
decrypt(e, t, s) {
|
|
2960
2960
|
const i = this.keySize + 6, r = this.invKeySchedule, n = this.invSBox, o = this.invSubMix, c = o[0], l = o[1], h = o[2], u = o[3], d = this.uint8ArrayToUint32Array_(s);
|
|
2961
|
-
let f = d[0], g = d[1],
|
|
2961
|
+
let f = d[0], g = d[1], p = d[2], E = d[3];
|
|
2962
2962
|
const y = new Int32Array(e), S = new Int32Array(y.length);
|
|
2963
|
-
let T, x, A, _, v,
|
|
2963
|
+
let T, x, A, _, v, R, D, L, P, O, X, V, $, M;
|
|
2964
2964
|
const G = this.networkToHostOrderSwap;
|
|
2965
2965
|
for (; t < y.length; ) {
|
|
2966
|
-
for (P = G(y[t]), O = G(y[t + 1]), X = G(y[t + 2]), V = G(y[t + 3]), v = P ^ r[0],
|
|
2967
|
-
T = c[v >>> 24] ^ l[
|
|
2968
|
-
T = n[v >>> 24] << 24 ^ n[
|
|
2966
|
+
for (P = G(y[t]), O = G(y[t + 1]), X = G(y[t + 2]), V = G(y[t + 3]), v = P ^ r[0], R = V ^ r[1], D = X ^ r[2], L = O ^ r[3], $ = 4, M = 1; M < i; M++)
|
|
2967
|
+
T = c[v >>> 24] ^ l[R >> 16 & 255] ^ h[D >> 8 & 255] ^ u[L & 255] ^ r[$], x = c[R >>> 24] ^ l[D >> 16 & 255] ^ h[L >> 8 & 255] ^ u[v & 255] ^ r[$ + 1], A = c[D >>> 24] ^ l[L >> 16 & 255] ^ h[v >> 8 & 255] ^ u[R & 255] ^ r[$ + 2], _ = c[L >>> 24] ^ l[v >> 16 & 255] ^ h[R >> 8 & 255] ^ u[D & 255] ^ r[$ + 3], v = T, R = x, D = A, L = _, $ = $ + 4;
|
|
2968
|
+
T = n[v >>> 24] << 24 ^ n[R >> 16 & 255] << 16 ^ n[D >> 8 & 255] << 8 ^ n[L & 255] ^ r[$], x = n[R >>> 24] << 24 ^ n[D >> 16 & 255] << 16 ^ n[L >> 8 & 255] << 8 ^ n[v & 255] ^ r[$ + 1], A = n[D >>> 24] << 24 ^ n[L >> 16 & 255] << 16 ^ n[v >> 8 & 255] << 8 ^ n[R & 255] ^ r[$ + 2], _ = n[L >>> 24] << 24 ^ n[v >> 16 & 255] << 16 ^ n[R >> 8 & 255] << 8 ^ n[D & 255] ^ r[$ + 3], S[t] = G(T ^ f), S[t + 1] = G(_ ^ g), S[t + 2] = G(A ^ p), S[t + 3] = G(x ^ E), f = P, g = O, p = X, E = V, t = t + 4;
|
|
2969
2969
|
}
|
|
2970
2970
|
return S.buffer;
|
|
2971
2971
|
}
|
|
@@ -3094,7 +3094,7 @@ class Uo {
|
|
|
3094
3094
|
if (!s)
|
|
3095
3095
|
return Promise.reject(new Be({
|
|
3096
3096
|
type: U.NETWORK_ERROR,
|
|
3097
|
-
details:
|
|
3097
|
+
details: b.FRAG_LOAD_ERROR,
|
|
3098
3098
|
fatal: !1,
|
|
3099
3099
|
frag: e,
|
|
3100
3100
|
error: new Error(`Fragment does not have a ${s ? "part list" : "url"}`),
|
|
@@ -3121,20 +3121,20 @@ class Uo {
|
|
|
3121
3121
|
};
|
|
3122
3122
|
e.stats = l.stats;
|
|
3123
3123
|
const f = {
|
|
3124
|
-
onSuccess: (g,
|
|
3124
|
+
onSuccess: (g, p, E, y) => {
|
|
3125
3125
|
this.resetLoader(e, l);
|
|
3126
3126
|
let S = g.data;
|
|
3127
|
-
|
|
3127
|
+
E.resetIV && e.decryptdata && (e.decryptdata.iv = new Uint8Array(S.slice(0, 16)), S = S.slice(16)), o({
|
|
3128
3128
|
frag: e,
|
|
3129
3129
|
part: null,
|
|
3130
3130
|
payload: S,
|
|
3131
3131
|
networkDetails: y
|
|
3132
3132
|
});
|
|
3133
3133
|
},
|
|
3134
|
-
onError: (g,
|
|
3134
|
+
onError: (g, p, E, y) => {
|
|
3135
3135
|
this.resetLoader(e, l), c(new Be({
|
|
3136
3136
|
type: U.NETWORK_ERROR,
|
|
3137
|
-
details:
|
|
3137
|
+
details: b.FRAG_LOAD_ERROR,
|
|
3138
3138
|
fatal: !1,
|
|
3139
3139
|
frag: e,
|
|
3140
3140
|
response: te({
|
|
@@ -3142,37 +3142,37 @@ class Uo {
|
|
|
3142
3142
|
data: void 0
|
|
3143
3143
|
}, g),
|
|
3144
3144
|
error: new Error(`HTTP Error ${g.code} ${g.text}`),
|
|
3145
|
-
networkDetails:
|
|
3145
|
+
networkDetails: E,
|
|
3146
3146
|
stats: y
|
|
3147
3147
|
}));
|
|
3148
3148
|
},
|
|
3149
|
-
onAbort: (g,
|
|
3149
|
+
onAbort: (g, p, E) => {
|
|
3150
3150
|
this.resetLoader(e, l), c(new Be({
|
|
3151
3151
|
type: U.NETWORK_ERROR,
|
|
3152
|
-
details:
|
|
3152
|
+
details: b.INTERNAL_ABORTED,
|
|
3153
3153
|
fatal: !1,
|
|
3154
3154
|
frag: e,
|
|
3155
3155
|
error: new Error("Aborted"),
|
|
3156
|
-
networkDetails:
|
|
3156
|
+
networkDetails: E,
|
|
3157
3157
|
stats: g
|
|
3158
3158
|
}));
|
|
3159
3159
|
},
|
|
3160
|
-
onTimeout: (g,
|
|
3160
|
+
onTimeout: (g, p, E) => {
|
|
3161
3161
|
this.resetLoader(e, l), c(new Be({
|
|
3162
3162
|
type: U.NETWORK_ERROR,
|
|
3163
|
-
details:
|
|
3163
|
+
details: b.FRAG_LOAD_TIMEOUT,
|
|
3164
3164
|
fatal: !1,
|
|
3165
3165
|
frag: e,
|
|
3166
3166
|
error: new Error(`Timeout after ${d.timeout}ms`),
|
|
3167
|
-
networkDetails:
|
|
3167
|
+
networkDetails: E,
|
|
3168
3168
|
stats: g
|
|
3169
3169
|
}));
|
|
3170
3170
|
}
|
|
3171
3171
|
};
|
|
3172
|
-
t && (f.onProgress = (g,
|
|
3172
|
+
t && (f.onProgress = (g, p, E, y) => t({
|
|
3173
3173
|
frag: e,
|
|
3174
3174
|
part: null,
|
|
3175
|
-
payload:
|
|
3175
|
+
payload: E,
|
|
3176
3176
|
networkDetails: y
|
|
3177
3177
|
})), l.load(h, d, f);
|
|
3178
3178
|
});
|
|
@@ -3196,20 +3196,20 @@ class Uo {
|
|
|
3196
3196
|
highWaterMark: zi
|
|
3197
3197
|
};
|
|
3198
3198
|
t.stats = l.stats, l.load(h, d, {
|
|
3199
|
-
onSuccess: (f, g,
|
|
3199
|
+
onSuccess: (f, g, p, E) => {
|
|
3200
3200
|
this.resetLoader(e, l), this.updateStatsFromPart(e, t);
|
|
3201
3201
|
const y = {
|
|
3202
3202
|
frag: e,
|
|
3203
3203
|
part: t,
|
|
3204
3204
|
payload: f.data,
|
|
3205
|
-
networkDetails:
|
|
3205
|
+
networkDetails: E
|
|
3206
3206
|
};
|
|
3207
3207
|
s(y), o(y);
|
|
3208
3208
|
},
|
|
3209
|
-
onError: (f, g,
|
|
3209
|
+
onError: (f, g, p, E) => {
|
|
3210
3210
|
this.resetLoader(e, l), c(new Be({
|
|
3211
3211
|
type: U.NETWORK_ERROR,
|
|
3212
|
-
details:
|
|
3212
|
+
details: b.FRAG_LOAD_ERROR,
|
|
3213
3213
|
fatal: !1,
|
|
3214
3214
|
frag: e,
|
|
3215
3215
|
part: t,
|
|
@@ -3218,31 +3218,31 @@ class Uo {
|
|
|
3218
3218
|
data: void 0
|
|
3219
3219
|
}, f),
|
|
3220
3220
|
error: new Error(`HTTP Error ${f.code} ${f.text}`),
|
|
3221
|
-
networkDetails:
|
|
3222
|
-
stats:
|
|
3221
|
+
networkDetails: p,
|
|
3222
|
+
stats: E
|
|
3223
3223
|
}));
|
|
3224
3224
|
},
|
|
3225
|
-
onAbort: (f, g,
|
|
3225
|
+
onAbort: (f, g, p) => {
|
|
3226
3226
|
e.stats.aborted = t.stats.aborted, this.resetLoader(e, l), c(new Be({
|
|
3227
3227
|
type: U.NETWORK_ERROR,
|
|
3228
|
-
details:
|
|
3228
|
+
details: b.INTERNAL_ABORTED,
|
|
3229
3229
|
fatal: !1,
|
|
3230
3230
|
frag: e,
|
|
3231
3231
|
part: t,
|
|
3232
3232
|
error: new Error("Aborted"),
|
|
3233
|
-
networkDetails:
|
|
3233
|
+
networkDetails: p,
|
|
3234
3234
|
stats: f
|
|
3235
3235
|
}));
|
|
3236
3236
|
},
|
|
3237
|
-
onTimeout: (f, g,
|
|
3237
|
+
onTimeout: (f, g, p) => {
|
|
3238
3238
|
this.resetLoader(e, l), c(new Be({
|
|
3239
3239
|
type: U.NETWORK_ERROR,
|
|
3240
|
-
details:
|
|
3240
|
+
details: b.FRAG_LOAD_TIMEOUT,
|
|
3241
3241
|
fatal: !1,
|
|
3242
3242
|
frag: e,
|
|
3243
3243
|
part: t,
|
|
3244
3244
|
error: new Error(`Timeout after ${d.timeout}ms`),
|
|
3245
|
-
networkDetails:
|
|
3245
|
+
networkDetails: p,
|
|
3246
3246
|
stats: f
|
|
3247
3247
|
}));
|
|
3248
3248
|
}
|
|
@@ -3287,7 +3287,7 @@ function Qi(a, e = null) {
|
|
|
3287
3287
|
function Zi(a, e) {
|
|
3288
3288
|
const t = new Error(`GAP ${a.gap ? "tag" : "attribute"} found`), s = {
|
|
3289
3289
|
type: U.MEDIA_ERROR,
|
|
3290
|
-
details:
|
|
3290
|
+
details: b.FRAG_GAP,
|
|
3291
3291
|
fatal: !1,
|
|
3292
3292
|
frag: a,
|
|
3293
3293
|
error: t,
|
|
@@ -4100,7 +4100,7 @@ class we {
|
|
|
4100
4100
|
if (h) {
|
|
4101
4101
|
const u = o[h], d = r[h] || [];
|
|
4102
4102
|
r[h] = d;
|
|
4103
|
-
const f = l.LANGUAGE, g = l["ASSOC-LANGUAGE"],
|
|
4103
|
+
const f = l.LANGUAGE, g = l["ASSOC-LANGUAGE"], p = l.CHANNELS, E = l.CHARACTERISTICS, y = l["INSTREAM-ID"], S = {
|
|
4104
4104
|
attrs: l,
|
|
4105
4105
|
bitrate: 0,
|
|
4106
4106
|
id: c++,
|
|
@@ -4113,7 +4113,7 @@ class we {
|
|
|
4113
4113
|
lang: f,
|
|
4114
4114
|
url: l.URI ? we.resolve(l.URI, t) : ""
|
|
4115
4115
|
};
|
|
4116
|
-
if (g && (S.assocLang = g),
|
|
4116
|
+
if (g && (S.assocLang = g), p && (S.channels = p), E && (S.characteristics = E), y && (S.instreamId = y), u != null && u.length) {
|
|
4117
4117
|
const T = we.findGroup(u, S.groupId) || u[0];
|
|
4118
4118
|
lr(S, T, "audioCodec"), lr(S, T, "textCodec");
|
|
4119
4119
|
}
|
|
@@ -4127,11 +4127,11 @@ class we {
|
|
|
4127
4127
|
const c = {
|
|
4128
4128
|
url: t
|
|
4129
4129
|
}, l = new qo(t), h = l.fragments, u = [];
|
|
4130
|
-
let d = null, f = 0, g = 0,
|
|
4130
|
+
let d = null, f = 0, g = 0, p = 0, E = 0, y = 0, S = null, T = new ps(i, c), x, A, _, v = -1, R = !1, D = null, L;
|
|
4131
4131
|
if (As.lastIndex = 0, l.m3u8 = e, l.hasVariableRefs = er(e), ((o = As.exec(e)) == null ? void 0 : o[0]) !== "#EXTM3U")
|
|
4132
4132
|
return l.playlistParsingError = new Error("Missing format identifier #EXTM3U"), l;
|
|
4133
4133
|
for (; (x = As.exec(e)) !== null; ) {
|
|
4134
|
-
|
|
4134
|
+
R && (R = !1, T = new ps(i, c), T.playlistOffset = p, T.start = p, T.sn = f, T.cc = E, y && (T.bitrate = y), T.level = s, d && (T.initSegment = d, d.rawProgramDateTime && (T.rawProgramDateTime = d.rawProgramDateTime, d.rawProgramDateTime = null), D && (T.setByteRange(D), D = null)));
|
|
4135
4135
|
const V = x[1];
|
|
4136
4136
|
if (V) {
|
|
4137
4137
|
T.duration = parseFloat(V);
|
|
@@ -4139,9 +4139,9 @@ class we {
|
|
|
4139
4139
|
T.title = $ || null, T.tagList.push($ ? ["INF", V, $] : ["INF", V]);
|
|
4140
4140
|
} else if (x[3]) {
|
|
4141
4141
|
if (F(T.duration)) {
|
|
4142
|
-
T.playlistOffset =
|
|
4142
|
+
T.playlistOffset = p, T.start = p, _ && hr(T, _, l), T.sn = f, T.level = s, T.cc = E, h.push(T);
|
|
4143
4143
|
const $ = (" " + x[3]).slice(1);
|
|
4144
|
-
T.relurl = Vs(l, $), Ys(T, S, u), S = T,
|
|
4144
|
+
T.relurl = Vs(l, $), Ys(T, S, u), S = T, p += T.duration, f++, g = 0, R = !0;
|
|
4145
4145
|
}
|
|
4146
4146
|
} else {
|
|
4147
4147
|
if (x = x[0].match(sl), !x) {
|
|
@@ -4192,7 +4192,7 @@ class we {
|
|
|
4192
4192
|
(M || G) && T.tagList.push(G ? [M, G] : [M]);
|
|
4193
4193
|
break;
|
|
4194
4194
|
case "DISCONTINUITY":
|
|
4195
|
-
|
|
4195
|
+
E++, T.tagList.push(["DIS"]);
|
|
4196
4196
|
break;
|
|
4197
4197
|
case "GAP":
|
|
4198
4198
|
T.gap = !0, T.tagList.push([$]);
|
|
@@ -4213,7 +4213,7 @@ class we {
|
|
|
4213
4213
|
break;
|
|
4214
4214
|
}
|
|
4215
4215
|
case "DISCONTINUITY-SEQUENCE":
|
|
4216
|
-
l.startCC !== 0 ? Me(l, $, x) : h.length > 0 && ur(l, $, x), l.startCC =
|
|
4216
|
+
l.startCC !== 0 ? Me(l, $, x) : h.length > 0 && ur(l, $, x), l.startCC = E = parseInt(M);
|
|
4217
4217
|
break;
|
|
4218
4218
|
case "KEY": {
|
|
4219
4219
|
const B = nr(M, t, l);
|
|
@@ -4242,9 +4242,9 @@ class we {
|
|
|
4242
4242
|
D = `${k - w}@${w}`;
|
|
4243
4243
|
} else
|
|
4244
4244
|
D = null;
|
|
4245
|
-
cr(T, B, s, _), d = T,
|
|
4245
|
+
cr(T, B, s, _), d = T, R = !0;
|
|
4246
4246
|
}
|
|
4247
|
-
d.cc =
|
|
4247
|
+
d.cc = E;
|
|
4248
4248
|
break;
|
|
4249
4249
|
}
|
|
4250
4250
|
case "SERVER-CONTROL": {
|
|
@@ -4280,15 +4280,15 @@ class we {
|
|
|
4280
4280
|
}
|
|
4281
4281
|
}
|
|
4282
4282
|
}
|
|
4283
|
-
S && !S.relurl ? (h.pop(),
|
|
4283
|
+
S && !S.relurl ? (h.pop(), p -= S.duration, l.partList && (l.fragmentHint = S)) : l.partList && (Ys(T, S, u), T.cc = E, l.fragmentHint = T, _ && hr(T, _, l)), l.targetduration || (l.playlistParsingError = new Error("#EXT-X-TARGETDURATION is required"));
|
|
4284
4284
|
const P = h.length, O = h[0], X = h[P - 1];
|
|
4285
|
-
if (
|
|
4286
|
-
l.averagetargetduration =
|
|
4285
|
+
if (p += l.skippedSegments * l.targetduration, p > 0 && P && X) {
|
|
4286
|
+
l.averagetargetduration = p / P;
|
|
4287
4287
|
const V = X.sn;
|
|
4288
4288
|
l.endSN = V !== "initSegment" ? V : 0, l.live || (X.endList = !0), O && l.startCC === void 0 && (l.startCC = O.cc), v > 0 && (rl(h, v), O && u.unshift(O));
|
|
4289
4289
|
} else
|
|
4290
4290
|
l.endSN = 0, l.startCC = 0;
|
|
4291
|
-
return l.fragmentHint && (
|
|
4291
|
+
return l.fragmentHint && (p += l.fragmentHint.duration), l.totalduration = p, u.length && l.dateRangeTagCount && O && En(u, l), l.endCC = E, l;
|
|
4292
4292
|
}
|
|
4293
4293
|
}
|
|
4294
4294
|
function En(a, e) {
|
|
@@ -4390,8 +4390,8 @@ function yn(a, e, t, s, i, r) {
|
|
|
4390
4390
|
let o = t, c = s;
|
|
4391
4391
|
const l = e.startPTS, h = e.endPTS;
|
|
4392
4392
|
if (F(l)) {
|
|
4393
|
-
const
|
|
4394
|
-
F(e.deltaPTS) ? e.deltaPTS = Math.max(
|
|
4393
|
+
const E = Math.abs(l - t);
|
|
4394
|
+
F(e.deltaPTS) ? e.deltaPTS = Math.max(E, e.deltaPTS) : e.deltaPTS = E, o = Math.max(t, l), t = Math.min(t, l), i = Math.min(i, e.startDTS), c = Math.min(s, h), s = Math.max(s, h), r = Math.max(r, e.endDTS);
|
|
4395
4395
|
}
|
|
4396
4396
|
const u = t - e.start;
|
|
4397
4397
|
e.start !== 0 && e.setStart(t), e.setDuration(s - e.start), e.startPTS = t, e.maxStartPTS = o, e.startDTS = i, e.endPTS = s, e.minEndPTS = c, e.endDTS = r;
|
|
@@ -4399,12 +4399,12 @@ function yn(a, e, t, s, i, r) {
|
|
|
4399
4399
|
if (!a || d < a.startSN || d > a.endSN)
|
|
4400
4400
|
return 0;
|
|
4401
4401
|
let f;
|
|
4402
|
-
const g = d - a.startSN,
|
|
4403
|
-
for (
|
|
4404
|
-
Ls(
|
|
4405
|
-
for (f = g; f <
|
|
4406
|
-
Ls(
|
|
4407
|
-
return a.fragmentHint && Ls(
|
|
4402
|
+
const g = d - a.startSN, p = a.fragments;
|
|
4403
|
+
for (p[g] = e, f = g; f > 0; f--)
|
|
4404
|
+
Ls(p[f], p[f - 1]);
|
|
4405
|
+
for (f = g; f < p.length - 1; f++)
|
|
4406
|
+
Ls(p[f], p[f + 1]);
|
|
4407
|
+
return a.fragmentHint && Ls(p[p.length - 1], a.fragmentHint), a.PTSKnown = a.alignedSliding = !0, u;
|
|
4408
4408
|
}
|
|
4409
4409
|
function nl(a, e) {
|
|
4410
4410
|
if (a === e)
|
|
@@ -4424,8 +4424,8 @@ function nl(a, e) {
|
|
|
4424
4424
|
if (!e.startCC && l.cc !== c.cc) {
|
|
4425
4425
|
var d, f;
|
|
4426
4426
|
const g = c.cc - l.cc;
|
|
4427
|
-
for (let
|
|
4428
|
-
u[
|
|
4427
|
+
for (let p = h; p < u.length; p++)
|
|
4428
|
+
u[p].cc += g;
|
|
4429
4429
|
e.startCC = (d = (f = vn(a, e.startSN - 1)) == null ? void 0 : f.cc) != null ? d : u[0].cc, e.endCC = u[u.length - 1].cc;
|
|
4430
4430
|
}
|
|
4431
4431
|
F(c.startPTS) && F(c.endPTS) && (l.setStart(l.startPTS = c.startPTS), l.startDTS = c.startDTS, l.maxStartPTS = c.maxStartPTS, l.endPTS = c.endPTS, l.endDTS = c.endDTS, l.minEndPTS = c.minEndPTS, l.setDuration(c.endPTS - c.startPTS), l.duration && (i = l), e.PTSKnown = e.alignedSliding = !0), c.hasStreams && (l.elementaryStreams = c.elementaryStreams), l.loader = c.loader, c.hasStats && (l.stats = c.stats), c.initSegment && (l.initSegment = c.initSegment, t = c.initSegment);
|
|
@@ -4653,18 +4653,18 @@ class di extends dn {
|
|
|
4653
4653
|
if (this.log(`media seeking to ${F(u) ? u.toFixed(3) : u}, state: ${h}`), this.state === C.ENDED)
|
|
4654
4654
|
this.resetLoadingState();
|
|
4655
4655
|
else if (o) {
|
|
4656
|
-
const f = n.maxFragLookUpTolerance, g = o.start - f,
|
|
4657
|
-
if (!d.len ||
|
|
4658
|
-
const
|
|
4659
|
-
(u < g ||
|
|
4656
|
+
const f = n.maxFragLookUpTolerance, g = o.start - f, p = o.start + o.duration + f;
|
|
4657
|
+
if (!d.len || p < d.start || g > d.end) {
|
|
4658
|
+
const E = u > p;
|
|
4659
|
+
(u < g || E) && (E && o.loader && (this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"), o.abortRequests(), this.resetLoadingState()), this.fragPrevious = null);
|
|
4660
4660
|
}
|
|
4661
4661
|
}
|
|
4662
4662
|
if (c) {
|
|
4663
4663
|
this.fragmentTracker.removeFragmentsInRange(u, 1 / 0, this.playlistType, !0);
|
|
4664
4664
|
const f = this.lastCurrentTime;
|
|
4665
4665
|
if (u > f && (this.lastCurrentTime = u), !this.loadingParts) {
|
|
4666
|
-
const g = Math.max(d.end, u),
|
|
4667
|
-
|
|
4666
|
+
const g = Math.max(d.end, u), p = this.shouldLoadParts(this.getLevelDetails(), g);
|
|
4667
|
+
p && (this.log(`LL-Part loading ON after seeking to ${u.toFixed(2)} with buffer @${g.toFixed(2)}`), this.loadingParts = p);
|
|
4668
4668
|
}
|
|
4669
4669
|
}
|
|
4670
4670
|
!this.hls.hasEnoughToStart && !d.len && (this.log(`setting startPosition to ${u} because of seek before start`), this.nextLoadPosition = this.startPosition = u), this.tickImmediate();
|
|
@@ -4865,7 +4865,7 @@ class di extends dn {
|
|
|
4865
4865
|
return this.decrypter.decrypt(new Uint8Array(n), o.key.buffer, o.iv.buffer, hi(o.method)).catch((l) => {
|
|
4866
4866
|
throw i.trigger(m.ERROR, {
|
|
4867
4867
|
type: U.MEDIA_ERROR,
|
|
4868
|
-
details:
|
|
4868
|
+
details: b.FRAG_DECRYPT_ERROR,
|
|
4869
4869
|
fatal: !1,
|
|
4870
4870
|
error: l,
|
|
4871
4871
|
reason: l.message,
|
|
@@ -4961,7 +4961,7 @@ class di extends dn {
|
|
|
4961
4961
|
const f = u[d];
|
|
4962
4962
|
e = this.fragCurrent = f.fragment, this.log(`Loading ${e.type} sn: ${e.sn} part: ${f.index} (${d}/${u.length - 1}) of ${this.fragInfo(e, !1, f)}) cc: ${e.cc} [${n.startSN}-${n.endSN}], target: ${parseFloat(s.toFixed(3))}`), this.nextLoadPosition = f.start + f.duration, this.state = C.FRAG_LOADING;
|
|
4963
4963
|
let g;
|
|
4964
|
-
return o ? g = o.then((
|
|
4964
|
+
return o ? g = o.then((p) => !p || this.fragContextChanged(p.frag) ? null : this.doFragPartsLoad(e, f, t, i)).catch((p) => this.handleFragLoadError(p)) : g = this.doFragPartsLoad(e, f, t, i).catch((p) => this.handleFragLoadError(p)), this.hls.trigger(m.FRAG_LOADING, {
|
|
4965
4965
|
frag: e,
|
|
4966
4966
|
part: f,
|
|
4967
4967
|
targetBufferTime: s
|
|
@@ -5007,11 +5007,11 @@ class di extends dn {
|
|
|
5007
5007
|
handleFragLoadError(e) {
|
|
5008
5008
|
if ("data" in e) {
|
|
5009
5009
|
const t = e.data;
|
|
5010
|
-
e.data && t.details ===
|
|
5010
|
+
e.data && t.details === b.INTERNAL_ABORTED ? this.handleFragLoadAborted(t.frag, t.part) : this.hls.trigger(m.ERROR, t);
|
|
5011
5011
|
} else
|
|
5012
5012
|
this.hls.trigger(m.ERROR, {
|
|
5013
5013
|
type: U.OTHER_ERROR,
|
|
5014
|
-
details:
|
|
5014
|
+
details: b.INTERNAL_EXCEPTION,
|
|
5015
5015
|
err: e,
|
|
5016
5016
|
error: e,
|
|
5017
5017
|
fatal: !0
|
|
@@ -5277,13 +5277,13 @@ class di extends dn {
|
|
|
5277
5277
|
let d;
|
|
5278
5278
|
if (e < t) {
|
|
5279
5279
|
var f;
|
|
5280
|
-
const
|
|
5281
|
-
d =
|
|
5280
|
+
const p = e < this.lastCurrentTime || e > t - l || (f = this.media) != null && f.paused || !this.startFragRequested ? 0 : l;
|
|
5281
|
+
d = tt(r, n, e, p);
|
|
5282
5282
|
} else
|
|
5283
5283
|
d = n[n.length - 1];
|
|
5284
5284
|
if (d) {
|
|
5285
|
-
const g = d.sn - s.startSN,
|
|
5286
|
-
if ((
|
|
5285
|
+
const g = d.sn - s.startSN, p = this.fragmentTracker.getState(d);
|
|
5286
|
+
if ((p === ce.OK || p === ce.PARTIAL && d.gap) && (r = d), r && d.sn === r.sn && (!u || h[0].fragment.sn > d.sn || !s.live && !u) && r && d.level === r.level) {
|
|
5287
5287
|
const y = n[g + 1];
|
|
5288
5288
|
d.sn < o && this.fragmentTracker.getState(y) !== ce.OK ? d = y : d = null;
|
|
5289
5289
|
}
|
|
@@ -5342,7 +5342,7 @@ class di extends dn {
|
|
|
5342
5342
|
this.warn(`Frag load error must match current frag to retry ${s.url} > ${(i = this.fragCurrent) == null ? void 0 : i.url}`);
|
|
5343
5343
|
return;
|
|
5344
5344
|
}
|
|
5345
|
-
const r = t.details ===
|
|
5345
|
+
const r = t.details === b.FRAG_GAP;
|
|
5346
5346
|
r && this.fragmentTracker.fragBuffered(s, !0);
|
|
5347
5347
|
const n = t.errorAction, {
|
|
5348
5348
|
action: o,
|
|
@@ -5430,7 +5430,7 @@ class di extends dn {
|
|
|
5430
5430
|
const c = new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);
|
|
5431
5431
|
if (this.warn(c.message), this.hls.trigger(m.ERROR, {
|
|
5432
5432
|
type: U.MEDIA_ERROR,
|
|
5433
|
-
details:
|
|
5433
|
+
details: b.FRAG_PARSING_ERROR,
|
|
5434
5434
|
fatal: !1,
|
|
5435
5435
|
error: c,
|
|
5436
5436
|
frag: e,
|
|
@@ -5543,47 +5543,47 @@ function fl() {
|
|
|
5543
5543
|
var h = t ? t + l : l, u = this._events[h];
|
|
5544
5544
|
return u ? u.fn ? 1 : u.length : 0;
|
|
5545
5545
|
}, o.prototype.emit = function(l, h, u, d, f, g) {
|
|
5546
|
-
var
|
|
5547
|
-
if (!this._events[
|
|
5548
|
-
var
|
|
5549
|
-
if (
|
|
5550
|
-
switch (
|
|
5546
|
+
var p = t ? t + l : l;
|
|
5547
|
+
if (!this._events[p]) return !1;
|
|
5548
|
+
var E = this._events[p], y = arguments.length, S, T;
|
|
5549
|
+
if (E.fn) {
|
|
5550
|
+
switch (E.once && this.removeListener(l, E.fn, void 0, !0), y) {
|
|
5551
5551
|
case 1:
|
|
5552
|
-
return
|
|
5552
|
+
return E.fn.call(E.context), !0;
|
|
5553
5553
|
case 2:
|
|
5554
|
-
return
|
|
5554
|
+
return E.fn.call(E.context, h), !0;
|
|
5555
5555
|
case 3:
|
|
5556
|
-
return
|
|
5556
|
+
return E.fn.call(E.context, h, u), !0;
|
|
5557
5557
|
case 4:
|
|
5558
|
-
return
|
|
5558
|
+
return E.fn.call(E.context, h, u, d), !0;
|
|
5559
5559
|
case 5:
|
|
5560
|
-
return
|
|
5560
|
+
return E.fn.call(E.context, h, u, d, f), !0;
|
|
5561
5561
|
case 6:
|
|
5562
|
-
return
|
|
5562
|
+
return E.fn.call(E.context, h, u, d, f, g), !0;
|
|
5563
5563
|
}
|
|
5564
5564
|
for (T = 1, S = new Array(y - 1); T < y; T++)
|
|
5565
5565
|
S[T - 1] = arguments[T];
|
|
5566
|
-
|
|
5566
|
+
E.fn.apply(E.context, S);
|
|
5567
5567
|
} else {
|
|
5568
|
-
var x =
|
|
5568
|
+
var x = E.length, A;
|
|
5569
5569
|
for (T = 0; T < x; T++)
|
|
5570
|
-
switch (
|
|
5570
|
+
switch (E[T].once && this.removeListener(l, E[T].fn, void 0, !0), y) {
|
|
5571
5571
|
case 1:
|
|
5572
|
-
|
|
5572
|
+
E[T].fn.call(E[T].context);
|
|
5573
5573
|
break;
|
|
5574
5574
|
case 2:
|
|
5575
|
-
|
|
5575
|
+
E[T].fn.call(E[T].context, h);
|
|
5576
5576
|
break;
|
|
5577
5577
|
case 3:
|
|
5578
|
-
|
|
5578
|
+
E[T].fn.call(E[T].context, h, u);
|
|
5579
5579
|
break;
|
|
5580
5580
|
case 4:
|
|
5581
|
-
|
|
5581
|
+
E[T].fn.call(E[T].context, h, u, d);
|
|
5582
5582
|
break;
|
|
5583
5583
|
default:
|
|
5584
5584
|
if (!S) for (A = 1, S = new Array(y - 1); A < y; A++)
|
|
5585
5585
|
S[A - 1] = arguments[A];
|
|
5586
|
-
|
|
5586
|
+
E[T].fn.apply(E[T].context, S);
|
|
5587
5587
|
}
|
|
5588
5588
|
}
|
|
5589
5589
|
return !0;
|
|
@@ -5600,9 +5600,9 @@ function fl() {
|
|
|
5600
5600
|
if (g.fn)
|
|
5601
5601
|
g.fn === h && (!d || g.once) && (!u || g.context === u) && n(this, f);
|
|
5602
5602
|
else {
|
|
5603
|
-
for (var
|
|
5604
|
-
(g[
|
|
5605
|
-
|
|
5603
|
+
for (var p = 0, E = [], y = g.length; p < y; p++)
|
|
5604
|
+
(g[p].fn !== h || d && !g[p].once || u && g[p].context !== u) && E.push(g[p]);
|
|
5605
|
+
E.length ? this._events[f] = E.length === 1 ? E[0] : E : n(this, f);
|
|
5606
5606
|
}
|
|
5607
5607
|
return this;
|
|
5608
5608
|
}, o.prototype.removeAllListeners = function(l) {
|
|
@@ -5677,7 +5677,7 @@ function Tl(a, e, t, s) {
|
|
|
5677
5677
|
const f = new Error(`invalid ADTS sampling index:${n}`);
|
|
5678
5678
|
a.emit(m.ERROR, m.ERROR, {
|
|
5679
5679
|
type: U.MEDIA_ERROR,
|
|
5680
|
-
details:
|
|
5680
|
+
details: b.FRAG_PARSING_ERROR,
|
|
5681
5681
|
fatal: !0,
|
|
5682
5682
|
error: f,
|
|
5683
5683
|
reason: f.message
|
|
@@ -5759,12 +5759,12 @@ function kn(a, e, t, s, i) {
|
|
|
5759
5759
|
headerLength: d
|
|
5760
5760
|
} = o, f = d + u, g = Math.max(0, t + f - e.length);
|
|
5761
5761
|
g ? (c = new Uint8Array(f - d), c.set(e.subarray(t + d, e.length), 0)) : c = e.subarray(t + d, t + f);
|
|
5762
|
-
const
|
|
5762
|
+
const p = {
|
|
5763
5763
|
unit: c,
|
|
5764
5764
|
pts: n
|
|
5765
5765
|
};
|
|
5766
|
-
return g || a.samples.push(
|
|
5767
|
-
sample:
|
|
5766
|
+
return g || a.samples.push(p), {
|
|
5767
|
+
sample: p,
|
|
5768
5768
|
length: f,
|
|
5769
5769
|
missing: g
|
|
5770
5770
|
};
|
|
@@ -6130,7 +6130,7 @@ function Mn(a, e, t, s, i) {
|
|
|
6130
6130
|
function Nn(a, e) {
|
|
6131
6131
|
const t = a[e + 1] >> 3 & 3, s = a[e + 1] >> 1 & 3, i = a[e + 2] >> 4 & 15, r = a[e + 2] >> 2 & 3;
|
|
6132
6132
|
if (t !== 1 && i !== 0 && i !== 15 && r !== 3) {
|
|
6133
|
-
const n = a[e + 2] >> 1 & 1, o = a[e + 3] >> 6, c = t === 3 ? 3 - s : s === 3 ? 3 : 4, l = Gl[c * 14 + i - 1] * 1e3, u = Kl[(t === 3 ? 0 : t === 2 ? 1 : 2) * 3 + r], d = o === 3 ? 1 : 2, f = Vl[t][s], g = Hl[s],
|
|
6133
|
+
const n = a[e + 2] >> 1 & 1, o = a[e + 3] >> 6, c = t === 3 ? 3 - s : s === 3 ? 3 : 4, l = Gl[c * 14 + i - 1] * 1e3, u = Kl[(t === 3 ? 0 : t === 2 ? 1 : 2) * 3 + r], d = o === 3 ? 1 : 2, f = Vl[t][s], g = Hl[s], p = f * 8 * g, E = Math.floor(f * l / u + n) * g;
|
|
6134
6134
|
if (Ut === null) {
|
|
6135
6135
|
const T = (navigator.userAgent || "").match(/Chrome\/(\d+)/i);
|
|
6136
6136
|
Ut = T ? parseInt(T[1]) : 0;
|
|
@@ -6138,8 +6138,8 @@ function Nn(a, e) {
|
|
|
6138
6138
|
return !!Ut && Ut <= 87 && s === 2 && l >= 224e3 && o === 0 && (a[e + 3] = a[e + 3] | 128), {
|
|
6139
6139
|
sampleRate: u,
|
|
6140
6140
|
channelCount: d,
|
|
6141
|
-
frameLength:
|
|
6142
|
-
samplesPerFrame:
|
|
6141
|
+
frameLength: E,
|
|
6142
|
+
samplesPerFrame: p
|
|
6143
6143
|
};
|
|
6144
6144
|
}
|
|
6145
6145
|
}
|
|
@@ -6269,8 +6269,8 @@ function Gn(a, e, t, s, i) {
|
|
|
6269
6269
|
const u = e[t + 6] >> 5;
|
|
6270
6270
|
let d = 0;
|
|
6271
6271
|
u === 2 ? d += 2 : (u & 1 && u !== 1 && (d += 2), u & 4 && (d += 2));
|
|
6272
|
-
const f = (e[t + 6] << 8 | e[t + 7]) >> 12 - d & 1,
|
|
6273
|
-
return a.config = S, a.channelCount =
|
|
6272
|
+
const f = (e[t + 6] << 8 | e[t + 7]) >> 12 - d & 1, p = [2, 1, 2, 3, 3, 4, 4, 5][u] + f, E = e[t + 5] >> 3, y = e[t + 5] & 7, S = new Uint8Array([r << 6 | E << 1 | y >> 2, (y & 3) << 6 | u << 3 | f << 2 | c >> 4, c << 4 & 224]), T = 1536 / o * 9e4, x = s + i * T, A = e.subarray(t, t + h);
|
|
6273
|
+
return a.config = S, a.channelCount = p, a.samplerate = o, a.samples.push({
|
|
6274
6274
|
unit: A,
|
|
6275
6275
|
pts: x
|
|
6276
6276
|
}), h;
|
|
@@ -6654,18 +6654,18 @@ class yr extends Kn {
|
|
|
6654
6654
|
var h, u;
|
|
6655
6655
|
switch (l.type) {
|
|
6656
6656
|
case 1: {
|
|
6657
|
-
let
|
|
6657
|
+
let p = !1;
|
|
6658
6658
|
o = !0;
|
|
6659
|
-
const
|
|
6660
|
-
if (c &&
|
|
6661
|
-
const y = this.readSliceType(
|
|
6662
|
-
(y === 2 || y === 4 || y === 7 || y === 9) && (
|
|
6659
|
+
const E = l.data;
|
|
6660
|
+
if (c && E.length > 4) {
|
|
6661
|
+
const y = this.readSliceType(E);
|
|
6662
|
+
(y === 2 || y === 4 || y === 7 || y === 9) && (p = !0);
|
|
6663
6663
|
}
|
|
6664
|
-
if (
|
|
6664
|
+
if (p) {
|
|
6665
6665
|
var d;
|
|
6666
6666
|
(d = n) != null && d.frame && !n.key && (this.pushAccessUnit(n, e), n = this.VideoSample = null);
|
|
6667
6667
|
}
|
|
6668
|
-
n || (n = this.VideoSample = this.createVideoSample(!0, s.pts, s.dts)), n.frame = !0, n.key =
|
|
6668
|
+
n || (n = this.VideoSample = this.createVideoSample(!0, s.pts, s.dts)), n.frame = !0, n.key = p;
|
|
6669
6669
|
break;
|
|
6670
6670
|
}
|
|
6671
6671
|
case 5:
|
|
@@ -6678,10 +6678,10 @@ class yr extends Kn {
|
|
|
6678
6678
|
case 7: {
|
|
6679
6679
|
var f, g;
|
|
6680
6680
|
o = !0, c = !0;
|
|
6681
|
-
const
|
|
6682
|
-
if (!e.sps || e.width !==
|
|
6683
|
-
e.width =
|
|
6684
|
-
const y =
|
|
6681
|
+
const p = l.data, E = this.readSPS(p);
|
|
6682
|
+
if (!e.sps || e.width !== E.width || e.height !== E.height || ((f = e.pixelRatio) == null ? void 0 : f[0]) !== E.pixelRatio[0] || ((g = e.pixelRatio) == null ? void 0 : g[1]) !== E.pixelRatio[1]) {
|
|
6683
|
+
e.width = E.width, e.height = E.height, e.pixelRatio = E.pixelRatio, e.sps = [p];
|
|
6684
|
+
const y = p.subarray(1, 4);
|
|
6685
6685
|
let S = "avc1.";
|
|
6686
6686
|
for (let T = 0; T < 3; T++) {
|
|
6687
6687
|
let x = y[T].toString(16);
|
|
@@ -6736,23 +6736,23 @@ class yr extends Kn {
|
|
|
6736
6736
|
readSPS(e) {
|
|
6737
6737
|
const t = new Tt(e);
|
|
6738
6738
|
let s = 0, i = 0, r = 0, n = 0, o, c, l;
|
|
6739
|
-
const h = t.readUByte.bind(t), u = t.readBits.bind(t), d = t.readUEG.bind(t), f = t.readBoolean.bind(t), g = t.skipBits.bind(t),
|
|
6739
|
+
const h = t.readUByte.bind(t), u = t.readBits.bind(t), d = t.readUEG.bind(t), f = t.readBoolean.bind(t), g = t.skipBits.bind(t), p = t.skipEG.bind(t), E = t.skipUEG.bind(t), y = this.skipScalingList.bind(this);
|
|
6740
6740
|
h();
|
|
6741
6741
|
const S = h();
|
|
6742
|
-
if (u(5), g(3), h(),
|
|
6743
|
-
const
|
|
6744
|
-
if (
|
|
6745
|
-
for (c =
|
|
6742
|
+
if (u(5), g(3), h(), E(), S === 100 || S === 110 || S === 122 || S === 244 || S === 44 || S === 83 || S === 86 || S === 118 || S === 128) {
|
|
6743
|
+
const R = d();
|
|
6744
|
+
if (R === 3 && g(1), E(), E(), g(1), f())
|
|
6745
|
+
for (c = R !== 3 ? 8 : 12, l = 0; l < c; l++)
|
|
6746
6746
|
f() && (l < 6 ? y(16, t) : y(64, t));
|
|
6747
6747
|
}
|
|
6748
|
-
|
|
6748
|
+
E();
|
|
6749
6749
|
const T = d();
|
|
6750
6750
|
if (T === 0)
|
|
6751
6751
|
d();
|
|
6752
6752
|
else if (T === 1)
|
|
6753
|
-
for (g(1),
|
|
6754
|
-
|
|
6755
|
-
|
|
6753
|
+
for (g(1), p(), p(), o = d(), l = 0; l < o; l++)
|
|
6754
|
+
p();
|
|
6755
|
+
E(), g(1);
|
|
6756
6756
|
const x = d(), A = d(), _ = u(1);
|
|
6757
6757
|
_ === 0 && g(1), g(1), f() && (s = d(), i = d(), r = d(), n = d());
|
|
6758
6758
|
let v = [1, 1];
|
|
@@ -6926,7 +6926,7 @@ class Tr extends Kn {
|
|
|
6926
6926
|
t.readUByte(), t.readUByte(), t.readBits(4);
|
|
6927
6927
|
const s = t.readBits(3);
|
|
6928
6928
|
t.readBoolean();
|
|
6929
|
-
const i = t.readBits(2), r = t.readBoolean(), n = t.readBits(5), o = t.readUByte(), c = t.readUByte(), l = t.readUByte(), h = t.readUByte(), u = t.readUByte(), d = t.readUByte(), f = t.readUByte(), g = t.readUByte(),
|
|
6929
|
+
const i = t.readBits(2), r = t.readBoolean(), n = t.readBits(5), o = t.readUByte(), c = t.readUByte(), l = t.readUByte(), h = t.readUByte(), u = t.readUByte(), d = t.readUByte(), f = t.readUByte(), g = t.readUByte(), p = t.readUByte(), E = t.readUByte(), y = t.readUByte(), S = [], T = [];
|
|
6930
6930
|
for (let J = 0; J < s; J++)
|
|
6931
6931
|
S.push(t.readBoolean()), T.push(t.readBoolean());
|
|
6932
6932
|
if (s > 0)
|
|
@@ -6938,8 +6938,8 @@ class Tr extends Kn {
|
|
|
6938
6938
|
const x = t.readUEG();
|
|
6939
6939
|
x == 3 && t.skipBits(1);
|
|
6940
6940
|
const A = t.readUEG(), _ = t.readUEG(), v = t.readBoolean();
|
|
6941
|
-
let
|
|
6942
|
-
v && (
|
|
6941
|
+
let R = 0, D = 0, L = 0, P = 0;
|
|
6942
|
+
v && (R += t.readUEG(), D += t.readUEG(), L += t.readUEG(), P += t.readUEG());
|
|
6943
6943
|
const O = t.readUEG(), X = t.readUEG(), V = t.readUEG(), $ = t.readBoolean();
|
|
6944
6944
|
for (let J = $ ? 0 : s; J <= s; J++)
|
|
6945
6945
|
t.skipUEG(), t.skipUEG(), t.skipUEG();
|
|
@@ -6951,7 +6951,7 @@ class Tr extends Kn {
|
|
|
6951
6951
|
else {
|
|
6952
6952
|
const Ie = Math.min(64, 1 << 4 + (de << 1));
|
|
6953
6953
|
de > 1 && t.readEG();
|
|
6954
|
-
for (let
|
|
6954
|
+
for (let st = 0; st < Ie; st++)
|
|
6955
6955
|
t.readEG();
|
|
6956
6956
|
}
|
|
6957
6957
|
t.readBoolean(), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.skipUEG(), t.skipUEG(), t.readBoolean());
|
|
@@ -6964,8 +6964,8 @@ class Tr extends Kn {
|
|
|
6964
6964
|
let ve = 0;
|
|
6965
6965
|
for (let Xe = 0; Xe <= k; Xe++) {
|
|
6966
6966
|
const Ie = t.readBoolean();
|
|
6967
|
-
let
|
|
6968
|
-
Ie || (
|
|
6967
|
+
let st = !1;
|
|
6968
|
+
Ie || (st = t.readBoolean()), (Ie || st) && ve++;
|
|
6969
6969
|
}
|
|
6970
6970
|
k = ve;
|
|
6971
6971
|
} else {
|
|
@@ -6993,7 +6993,7 @@ class Tr extends Kn {
|
|
|
6993
6993
|
const ze = t.readUByte(), Ri = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], Dt = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
|
|
6994
6994
|
ze > 0 && ze < 16 ? (H = Ri[ze - 1], j = Dt[ze - 1]) : ze === 255 && (H = t.readBits(16), j = t.readBits(16));
|
|
6995
6995
|
}
|
|
6996
|
-
if (t.readBoolean() && t.readBoolean(), t.readBoolean() && (t.readBits(3), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.readUByte(), t.readUByte())), t.readBoolean() && (t.readUEG(), t.readUEG()), t.readBoolean(), t.readBoolean(), t.readBoolean(), ge = t.readBoolean(), ge && (
|
|
6996
|
+
if (t.readBoolean() && t.readBoolean(), t.readBoolean() && (t.readBits(3), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.readUByte(), t.readUByte())), t.readBoolean() && (t.readUEG(), t.readUEG()), t.readBoolean(), t.readBoolean(), t.readBoolean(), ge = t.readBoolean(), ge && (R += t.readUEG(), D += t.readUEG(), L += t.readUEG(), P += t.readUEG()), t.readBoolean() && (ee = t.readBits(32), ne = t.readBits(32), t.readBoolean() && t.readUEG(), t.readBoolean())) {
|
|
6997
6997
|
const Dt = t.readBoolean(), bi = t.readBoolean();
|
|
6998
6998
|
let gt = !1;
|
|
6999
6999
|
(Dt || bi) && (gt = t.readBoolean(), gt && (t.readUByte(), t.readBits(5), t.readBoolean(), t.readBits(5)), t.readBits(4), t.readBits(4), gt && t.readBits(4), t.readBits(5), t.readBits(5), t.readBits(5));
|
|
@@ -7016,7 +7016,7 @@ class Tr extends Kn {
|
|
|
7016
7016
|
let Ke = A, Ii = _;
|
|
7017
7017
|
if (v || ge) {
|
|
7018
7018
|
let J = 1, de = 1;
|
|
7019
|
-
x === 1 ? J = de = 2 : x == 2 && (J = 2), Ke = A - J * D - J *
|
|
7019
|
+
x === 1 ? J = de = 2 : x == 2 && (J = 2), Ke = A - J * D - J * R, Ii = _ - de * P - de * L;
|
|
7020
7020
|
}
|
|
7021
7021
|
const ma = i ? ["A", "B", "C"][i] : "", pa = o << 24 | c << 16 | l << 8 | h;
|
|
7022
7022
|
let us = 0;
|
|
@@ -7030,7 +7030,7 @@ class Tr extends Kn {
|
|
|
7030
7030
|
general_profile_idc: n,
|
|
7031
7031
|
general_profile_space: i,
|
|
7032
7032
|
general_profile_compatibility_flags: [o, c, l, h],
|
|
7033
|
-
general_constraint_indicator_flags: [u, d, f, g,
|
|
7033
|
+
general_constraint_indicator_flags: [u, d, f, g, p, E],
|
|
7034
7034
|
general_level_idc: y,
|
|
7035
7035
|
bit_depth: O + 8,
|
|
7036
7036
|
bit_depth_luma_minus8: O,
|
|
@@ -7124,7 +7124,7 @@ class We {
|
|
|
7124
7124
|
s || (this.sampleAes = null);
|
|
7125
7125
|
let r;
|
|
7126
7126
|
const n = this._videoTrack, o = this._audioTrack, c = this._id3Track, l = this._txtTrack;
|
|
7127
|
-
let h = n.pid, u = n.pesData, d = o.pid, f = c.pid, g = o.pesData,
|
|
7127
|
+
let h = n.pid, u = n.pesData, d = o.pid, f = c.pid, g = o.pesData, p = c.pesData, E = null, y = this.pmtParsed, S = this._pmtId, T = e.length;
|
|
7128
7128
|
if (this.remainderData && (e = Le(this.remainderData, e), T = e.length, this.remainderData = null), T < he && !i)
|
|
7129
7129
|
return this.remainderData = e, {
|
|
7130
7130
|
audioTrack: o,
|
|
@@ -7137,7 +7137,7 @@ class We {
|
|
|
7137
7137
|
let A = 0;
|
|
7138
7138
|
for (let v = x; v < T; v += he)
|
|
7139
7139
|
if (e[v] === 71) {
|
|
7140
|
-
const
|
|
7140
|
+
const R = !!(e[v + 1] & 64), D = qs(e, v), L = (e[v + 3] & 48) >> 4;
|
|
7141
7141
|
let P;
|
|
7142
7142
|
if (L > 1) {
|
|
7143
7143
|
if (P = v + 5 + e[v + 4], P === v + he)
|
|
@@ -7146,8 +7146,8 @@ class We {
|
|
|
7146
7146
|
P = v + 4;
|
|
7147
7147
|
switch (D) {
|
|
7148
7148
|
case h:
|
|
7149
|
-
if (
|
|
7150
|
-
if (u && (r =
|
|
7149
|
+
if (R) {
|
|
7150
|
+
if (u && (r = nt(u, this.logger))) {
|
|
7151
7151
|
if (this.videoParser === null)
|
|
7152
7152
|
switch (n.segmentCodec) {
|
|
7153
7153
|
case "avc":
|
|
@@ -7167,8 +7167,8 @@ class We {
|
|
|
7167
7167
|
u && (u.data.push(e.subarray(P, v + he)), u.size += v + he - P);
|
|
7168
7168
|
break;
|
|
7169
7169
|
case d:
|
|
7170
|
-
if (
|
|
7171
|
-
if (g && (r =
|
|
7170
|
+
if (R) {
|
|
7171
|
+
if (g && (r = nt(g, this.logger)))
|
|
7172
7172
|
switch (o.segmentCodec) {
|
|
7173
7173
|
case "aac":
|
|
7174
7174
|
this.parseAACPES(o, r);
|
|
@@ -7188,30 +7188,30 @@ class We {
|
|
|
7188
7188
|
g && (g.data.push(e.subarray(P, v + he)), g.size += v + he - P);
|
|
7189
7189
|
break;
|
|
7190
7190
|
case f:
|
|
7191
|
-
|
|
7191
|
+
R && (p && (r = nt(p, this.logger)) && this.parseID3PES(c, r), p = {
|
|
7192
7192
|
data: [],
|
|
7193
7193
|
size: 0
|
|
7194
|
-
}),
|
|
7194
|
+
}), p && (p.data.push(e.subarray(P, v + he)), p.size += v + he - P);
|
|
7195
7195
|
break;
|
|
7196
7196
|
case 0:
|
|
7197
|
-
|
|
7197
|
+
R && (P += e[P] + 1), S = this._pmtId = Zl(e, P);
|
|
7198
7198
|
break;
|
|
7199
7199
|
case S: {
|
|
7200
|
-
|
|
7200
|
+
R && (P += e[P] + 1);
|
|
7201
7201
|
const O = Jl(e, P, this.typeSupported, s, this.observer, this.logger);
|
|
7202
|
-
h = O.videoPid, h > 0 && (n.pid = h, n.segmentCodec = O.segmentVideoCodec), d = O.audioPid, d > 0 && (o.pid = d, o.segmentCodec = O.segmentAudioCodec), f = O.id3Pid, f > 0 && (c.pid = f),
|
|
7202
|
+
h = O.videoPid, h > 0 && (n.pid = h, n.segmentCodec = O.segmentVideoCodec), d = O.audioPid, d > 0 && (o.pid = d, o.segmentCodec = O.segmentAudioCodec), f = O.id3Pid, f > 0 && (c.pid = f), E !== null && !y && (this.logger.warn(`MPEG-TS PMT found at ${v} after unknown PID '${E}'. Backtracking to sync byte @${x} to parse all TS packets.`), E = null, v = x - 188), y = this.pmtParsed = !0;
|
|
7203
7203
|
break;
|
|
7204
7204
|
}
|
|
7205
7205
|
case 17:
|
|
7206
7206
|
case 8191:
|
|
7207
7207
|
break;
|
|
7208
7208
|
default:
|
|
7209
|
-
|
|
7209
|
+
E = D;
|
|
7210
7210
|
break;
|
|
7211
7211
|
}
|
|
7212
7212
|
} else
|
|
7213
7213
|
A++;
|
|
7214
|
-
A > 0 && js(this.observer, new Error(`Found ${A} TS packet/s that do not start with 0x47`), void 0, this.logger), n.pesData = u, o.pesData = g, c.pesData =
|
|
7214
|
+
A > 0 && js(this.observer, new Error(`Found ${A} TS packet/s that do not start with 0x47`), void 0, this.logger), n.pesData = u, o.pesData = g, c.pesData = p;
|
|
7215
7215
|
const _ = {
|
|
7216
7216
|
audioTrack: o,
|
|
7217
7217
|
videoTrack: n,
|
|
@@ -7241,7 +7241,7 @@ class We {
|
|
|
7241
7241
|
textTrack: r
|
|
7242
7242
|
} = e, n = s.pesData, o = t.pesData, c = i.pesData;
|
|
7243
7243
|
let l;
|
|
7244
|
-
if (n && (l =
|
|
7244
|
+
if (n && (l = nt(n, this.logger))) {
|
|
7245
7245
|
if (this.videoParser === null)
|
|
7246
7246
|
switch (s.segmentCodec) {
|
|
7247
7247
|
case "avc":
|
|
@@ -7254,7 +7254,7 @@ class We {
|
|
|
7254
7254
|
this.videoParser !== null && (this.videoParser.parsePES(s, r, l, !0), s.pesData = null);
|
|
7255
7255
|
} else
|
|
7256
7256
|
s.pesData = n;
|
|
7257
|
-
if (o && (l =
|
|
7257
|
+
if (o && (l = nt(o, this.logger))) {
|
|
7258
7258
|
switch (t.segmentCodec) {
|
|
7259
7259
|
case "aac":
|
|
7260
7260
|
this.parseAACPES(t, l);
|
|
@@ -7269,7 +7269,7 @@ class We {
|
|
|
7269
7269
|
t.pesData = null;
|
|
7270
7270
|
} else
|
|
7271
7271
|
o != null && o.size && this.logger.log("last AAC PES packet truncated,might overlap between fragments"), t.pesData = o;
|
|
7272
|
-
c && (l =
|
|
7272
|
+
c && (l = nt(c, this.logger)) ? (this.parseID3PES(i, l), i.pesData = null) : i.pesData = c;
|
|
7273
7273
|
}
|
|
7274
7274
|
demuxSampleAes(e, t, s) {
|
|
7275
7275
|
const i = this.demux(e, s, !0, !this.config.progressive), r = this.sampleAes = new Ql(this.observer, this.config, t);
|
|
@@ -7436,8 +7436,8 @@ function Jl(a, e, t, s, i, r) {
|
|
|
7436
7436
|
t.ac3 !== !0 ? r.log("AC-3 audio found, not supported in this browser for now") : (n.audioPid = h, n.segmentAudioCodec = "ac3");
|
|
7437
7437
|
break;
|
|
7438
7438
|
}
|
|
7439
|
-
const
|
|
7440
|
-
d +=
|
|
7439
|
+
const p = a[d + 1] + 2;
|
|
7440
|
+
d += p, f -= p;
|
|
7441
7441
|
}
|
|
7442
7442
|
}
|
|
7443
7443
|
break;
|
|
@@ -7455,7 +7455,7 @@ function Jl(a, e, t, s, i, r) {
|
|
|
7455
7455
|
function js(a, e, t, s) {
|
|
7456
7456
|
s.warn(`parsing error: ${e.message}`), a.emit(m.ERROR, m.ERROR, {
|
|
7457
7457
|
type: U.MEDIA_ERROR,
|
|
7458
|
-
details:
|
|
7458
|
+
details: b.FRAG_PARSING_ERROR,
|
|
7459
7459
|
fatal: !1,
|
|
7460
7460
|
levelRetry: t,
|
|
7461
7461
|
error: e,
|
|
@@ -7465,7 +7465,7 @@ function js(a, e, t, s) {
|
|
|
7465
7465
|
function bs(a, e) {
|
|
7466
7466
|
e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`);
|
|
7467
7467
|
}
|
|
7468
|
-
function
|
|
7468
|
+
function nt(a, e) {
|
|
7469
7469
|
let t = 0, s, i, r, n, o;
|
|
7470
7470
|
const c = a.data;
|
|
7471
7471
|
if (!a || a.size === 0)
|
|
@@ -7492,14 +7492,14 @@ function rt(a, e) {
|
|
|
7492
7492
|
const d = new Uint8Array(a.size);
|
|
7493
7493
|
for (let f = 0, g = c.length; f < g; f++) {
|
|
7494
7494
|
s = c[f];
|
|
7495
|
-
let
|
|
7495
|
+
let p = s.byteLength;
|
|
7496
7496
|
if (u)
|
|
7497
|
-
if (u >
|
|
7498
|
-
u -=
|
|
7497
|
+
if (u > p) {
|
|
7498
|
+
u -= p;
|
|
7499
7499
|
continue;
|
|
7500
7500
|
} else
|
|
7501
|
-
s = s.subarray(u),
|
|
7502
|
-
d.set(s, t), t +=
|
|
7501
|
+
s = s.subarray(u), p -= u, u = 0;
|
|
7502
|
+
d.set(s, t), t += p;
|
|
7503
7503
|
}
|
|
7504
7504
|
return i && (i -= r + 3), {
|
|
7505
7505
|
data: d,
|
|
@@ -8559,16 +8559,16 @@ class I {
|
|
|
8559
8559
|
let n = r.length;
|
|
8560
8560
|
for (let g = 0; g < s.length; g += 1) {
|
|
8561
8561
|
n += 3;
|
|
8562
|
-
for (let
|
|
8563
|
-
n += 2 + s[g][
|
|
8562
|
+
for (let p = 0; p < s[g].length; p += 1)
|
|
8563
|
+
n += 2 + s[g][p].length;
|
|
8564
8564
|
}
|
|
8565
8565
|
const o = new Uint8Array(n);
|
|
8566
8566
|
o.set(r, 0), n = r.length;
|
|
8567
8567
|
const c = s.length - 1;
|
|
8568
8568
|
for (let g = 0; g < s.length; g += 1) {
|
|
8569
8569
|
o.set(new Uint8Array([32 + g | (g === c ? 128 : 0), 0, s[g].length]), n), n += 3;
|
|
8570
|
-
for (let
|
|
8571
|
-
o.set(new Uint8Array([s[g][
|
|
8570
|
+
for (let p = 0; p < s[g].length; p += 1)
|
|
8571
|
+
o.set(new Uint8Array([s[g][p].length >> 8, s[g][p].length & 255]), n), n += 2, o.set(s[g][p], n), n += s[g][p].length;
|
|
8572
8572
|
}
|
|
8573
8573
|
const l = I.box(I.types.hvcC, o), h = e.width, u = e.height, d = e.pixelRatio[0], f = e.pixelRatio[1];
|
|
8574
8574
|
return I.box(
|
|
@@ -8728,7 +8728,7 @@ function sc(a, e = 1) {
|
|
|
8728
8728
|
return Ti(a, Vn, 1 / e);
|
|
8729
8729
|
}
|
|
8730
8730
|
const ic = 10 * 1e3, rc = 1024, nc = 1152, ac = 1536;
|
|
8731
|
-
let
|
|
8731
|
+
let at = null, _s = null;
|
|
8732
8732
|
function Sr(a, e, t, s) {
|
|
8733
8733
|
return {
|
|
8734
8734
|
duration: e,
|
|
@@ -8746,9 +8746,9 @@ function Sr(a, e, t, s) {
|
|
|
8746
8746
|
}
|
|
8747
8747
|
class qt {
|
|
8748
8748
|
constructor(e, t, s, i) {
|
|
8749
|
-
if (this.logger = void 0, this.observer = void 0, this.config = void 0, this.typeSupported = void 0, this.ISGenerated = !1, this._initPTS = null, this._initDTS = null, this.nextAvcDts = null, this.nextAudioPts = null, this.videoSampleDuration = null, this.isAudioContiguous = !1, this.isVideoContiguous = !1, this.videoTrackConfig = void 0, this.observer = e, this.config = t, this.typeSupported = s, this.logger = i, this.ISGenerated = !1,
|
|
8749
|
+
if (this.logger = void 0, this.observer = void 0, this.config = void 0, this.typeSupported = void 0, this.ISGenerated = !1, this._initPTS = null, this._initDTS = null, this.nextAvcDts = null, this.nextAudioPts = null, this.videoSampleDuration = null, this.isAudioContiguous = !1, this.isVideoContiguous = !1, this.videoTrackConfig = void 0, this.observer = e, this.config = t, this.typeSupported = s, this.logger = i, this.ISGenerated = !1, at === null) {
|
|
8750
8750
|
const n = (navigator.userAgent || "").match(/Chrome\/(\d+)/i);
|
|
8751
|
-
|
|
8751
|
+
at = n ? parseInt(n[1]) : 0;
|
|
8752
8752
|
}
|
|
8753
8753
|
if (_s === null) {
|
|
8754
8754
|
const r = navigator.userAgent.match(/Safari\/(\d+)/i);
|
|
@@ -8776,13 +8776,13 @@ class qt {
|
|
|
8776
8776
|
return t && this.logger.debug("PTS rollover detected"), i;
|
|
8777
8777
|
}
|
|
8778
8778
|
remux(e, t, s, i, r, n, o, c) {
|
|
8779
|
-
let l, h, u, d, f, g,
|
|
8779
|
+
let l, h, u, d, f, g, p = r, E = r;
|
|
8780
8780
|
const y = e.pid > -1, S = t.pid > -1, T = t.samples.length, x = e.samples.length > 0, A = o && T > 0 || T > 1;
|
|
8781
8781
|
if ((!y || x) && (!S || A) || this.ISGenerated || o) {
|
|
8782
8782
|
if (this.ISGenerated) {
|
|
8783
|
-
var v,
|
|
8783
|
+
var v, R, D, L;
|
|
8784
8784
|
const V = this.videoTrackConfig;
|
|
8785
|
-
(V && (t.width !== V.width || t.height !== V.height || ((v = t.pixelRatio) == null ? void 0 : v[0]) !== ((
|
|
8785
|
+
(V && (t.width !== V.width || t.height !== V.height || ((v = t.pixelRatio) == null ? void 0 : v[0]) !== ((R = V.pixelRatio) == null ? void 0 : R[0]) || ((D = t.pixelRatio) == null ? void 0 : D[1]) !== ((L = V.pixelRatio) == null ? void 0 : L[1])) || !V && A || this.nextAudioPts === null && x) && this.resetInitSegment();
|
|
8786
8786
|
}
|
|
8787
8787
|
this.ISGenerated || (u = this.generateIS(e, t, r, n));
|
|
8788
8788
|
const P = this.isVideoContiguous;
|
|
@@ -8791,19 +8791,19 @@ class qt {
|
|
|
8791
8791
|
if (g = !0, O > 0) {
|
|
8792
8792
|
this.logger.warn(`[mp4-remuxer]: Dropped ${O} out of ${T} video samples due to a missing keyframe`);
|
|
8793
8793
|
const V = this.getVideoStartPts(t.samples);
|
|
8794
|
-
t.samples = t.samples.slice(O), t.dropped += O,
|
|
8794
|
+
t.samples = t.samples.slice(O), t.dropped += O, E += (t.samples[0].pts - V) / t.inputTimeScale, X = E;
|
|
8795
8795
|
} else O === -1 && (this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${T} video samples`), g = !1);
|
|
8796
8796
|
if (this.ISGenerated) {
|
|
8797
8797
|
if (x && A) {
|
|
8798
8798
|
const V = this.getVideoStartPts(t.samples), M = (Ae(e.samples[0].pts, V) - V) / t.inputTimeScale;
|
|
8799
|
-
|
|
8799
|
+
p += Math.max(0, M), E += Math.max(0, -M);
|
|
8800
8800
|
}
|
|
8801
8801
|
if (x) {
|
|
8802
|
-
if (e.samplerate || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"), u = this.generateIS(e, t, r, n)), h = this.remuxAudio(e,
|
|
8802
|
+
if (e.samplerate || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"), u = this.generateIS(e, t, r, n)), h = this.remuxAudio(e, p, this.isAudioContiguous, n, S || A || c === N.AUDIO ? E : void 0), A) {
|
|
8803
8803
|
const V = h ? h.endPTS - h.startPTS : 0;
|
|
8804
|
-
t.inputTimeScale || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"), u = this.generateIS(e, t, r, n)), l = this.remuxVideo(t,
|
|
8804
|
+
t.inputTimeScale || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"), u = this.generateIS(e, t, r, n)), l = this.remuxVideo(t, E, P, V);
|
|
8805
8805
|
}
|
|
8806
|
-
} else A && (l = this.remuxVideo(t,
|
|
8806
|
+
} else A && (l = this.remuxVideo(t, E, P, 0));
|
|
8807
8807
|
l && (l.firstKeyFrame = O, l.independent = O !== -1, l.firstKeyFramePTS = X);
|
|
8808
8808
|
}
|
|
8809
8809
|
}
|
|
@@ -8850,8 +8850,8 @@ class qt {
|
|
|
8850
8850
|
}
|
|
8851
8851
|
}, h)
|
|
8852
8852
|
if (g = t.inputTimeScale, !l || g !== l.timescale) {
|
|
8853
|
-
const
|
|
8854
|
-
f = Math.min(f, Ae(n[0].dts,
|
|
8853
|
+
const p = this.getVideoStartPts(n), E = Math.round(g * s);
|
|
8854
|
+
f = Math.min(f, Ae(n[0].dts, p) - E), d = Math.min(d, p - E);
|
|
8855
8855
|
} else
|
|
8856
8856
|
h = !1;
|
|
8857
8857
|
this.videoTrackConfig = {
|
|
@@ -8875,10 +8875,10 @@ class qt {
|
|
|
8875
8875
|
}
|
|
8876
8876
|
remuxVideo(e, t, s, i) {
|
|
8877
8877
|
const r = e.inputTimeScale, n = e.samples, o = [], c = n.length, l = this._initPTS;
|
|
8878
|
-
let h = this.nextAvcDts, u = 8, d = this.videoSampleDuration, f, g,
|
|
8878
|
+
let h = this.nextAvcDts, u = 8, d = this.videoSampleDuration, f, g, p = Number.POSITIVE_INFINITY, E = Number.NEGATIVE_INFINITY, y = !1;
|
|
8879
8879
|
if (!s || h === null) {
|
|
8880
8880
|
const k = t * r, w = n[0].pts - Ae(n[0].dts, n[0].pts);
|
|
8881
|
-
|
|
8881
|
+
at && h !== null && Math.abs(k - w - h) < 15e3 ? s = !0 : h = k - w;
|
|
8882
8882
|
}
|
|
8883
8883
|
const S = l.baseTime * r / l.timescale;
|
|
8884
8884
|
for (let k = 0; k < c; k++) {
|
|
@@ -8892,7 +8892,7 @@ class qt {
|
|
|
8892
8892
|
const T = g - f, x = T ? Math.round(T / (c - 1)) : d || e.inputTimeScale / 30;
|
|
8893
8893
|
if (s) {
|
|
8894
8894
|
const k = f - h, w = k > x, Y = k < -1;
|
|
8895
|
-
if ((w || Y) && (w ? this.logger.warn(`${(e.segmentCodec || "").toUpperCase()}: ${pt(k, !0)} ms (${k}dts) hole between fragments detected at ${t.toFixed(3)}`) : this.logger.warn(`${(e.segmentCodec || "").toUpperCase()}: ${pt(-k, !0)} ms (${k}dts) overlapping between fragments detected at ${t.toFixed(3)}`), !Y || h >= n[0].pts ||
|
|
8895
|
+
if ((w || Y) && (w ? this.logger.warn(`${(e.segmentCodec || "").toUpperCase()}: ${pt(k, !0)} ms (${k}dts) hole between fragments detected at ${t.toFixed(3)}`) : this.logger.warn(`${(e.segmentCodec || "").toUpperCase()}: ${pt(-k, !0)} ms (${k}dts) overlapping between fragments detected at ${t.toFixed(3)}`), !Y || h >= n[0].pts || at)) {
|
|
8896
8896
|
f = h;
|
|
8897
8897
|
const H = n[0].pts - k;
|
|
8898
8898
|
if (w)
|
|
@@ -8902,8 +8902,8 @@ class qt {
|
|
|
8902
8902
|
for (let Z = 0; Z < n.length && !(n[Z].dts > H && j); Z++) {
|
|
8903
8903
|
const ee = n[Z].pts;
|
|
8904
8904
|
if (n[Z].dts -= k, n[Z].pts -= k, Z < n.length - 1) {
|
|
8905
|
-
const ne = n[Z + 1].pts, ge = n[Z].pts,
|
|
8906
|
-
j =
|
|
8905
|
+
const ne = n[Z + 1].pts, ge = n[Z].pts, pe = ne <= ge, Ke = ne <= ee;
|
|
8906
|
+
j = pe == Ke;
|
|
8907
8907
|
}
|
|
8908
8908
|
}
|
|
8909
8909
|
}
|
|
@@ -8917,33 +8917,33 @@ class qt {
|
|
|
8917
8917
|
let j = 0;
|
|
8918
8918
|
for (let Z = 0; Z < H; Z++)
|
|
8919
8919
|
j += Y[Z].data.length;
|
|
8920
|
-
_ += j, A += H, w.length = j, w.dts < v ? (w.dts = v, v += x / 4 | 0 || 1) : v = w.dts,
|
|
8920
|
+
_ += j, A += H, w.length = j, w.dts < v ? (w.dts = v, v += x / 4 | 0 || 1) : v = w.dts, p = Math.min(w.pts, p), E = Math.max(w.pts, E);
|
|
8921
8921
|
}
|
|
8922
8922
|
g = n[c - 1].dts;
|
|
8923
|
-
const
|
|
8923
|
+
const R = _ + 4 * A + 8;
|
|
8924
8924
|
let D;
|
|
8925
8925
|
try {
|
|
8926
|
-
D = new Uint8Array(
|
|
8926
|
+
D = new Uint8Array(R);
|
|
8927
8927
|
} catch (k) {
|
|
8928
8928
|
this.observer.emit(m.ERROR, m.ERROR, {
|
|
8929
8929
|
type: U.MUX_ERROR,
|
|
8930
|
-
details:
|
|
8930
|
+
details: b.REMUX_ALLOC_ERROR,
|
|
8931
8931
|
fatal: !1,
|
|
8932
8932
|
error: k,
|
|
8933
|
-
bytes:
|
|
8934
|
-
reason: `fail allocating video mdat ${
|
|
8933
|
+
bytes: R,
|
|
8934
|
+
reason: `fail allocating video mdat ${R}`
|
|
8935
8935
|
});
|
|
8936
8936
|
return;
|
|
8937
8937
|
}
|
|
8938
8938
|
const L = new DataView(D.buffer);
|
|
8939
|
-
L.setUint32(0,
|
|
8939
|
+
L.setUint32(0, R), D.set(I.types.mdat, 4);
|
|
8940
8940
|
let P = !1, O = Number.POSITIVE_INFINITY, X = Number.POSITIVE_INFINITY, V = Number.NEGATIVE_INFINITY, $ = Number.NEGATIVE_INFINITY;
|
|
8941
8941
|
for (let k = 0; k < c; k++) {
|
|
8942
8942
|
const w = n[k], Y = w.units;
|
|
8943
8943
|
let H = 0;
|
|
8944
8944
|
for (let ee = 0, ne = Y.length; ee < ne; ee++) {
|
|
8945
|
-
const ge = Y[ee],
|
|
8946
|
-
L.setUint32(u, Ke), u += 4, D.set(
|
|
8945
|
+
const ge = Y[ee], pe = ge.data, Ke = ge.data.byteLength;
|
|
8946
|
+
L.setUint32(u, Ke), u += 4, D.set(pe, u), u += Ke, H += 4 + Ke;
|
|
8947
8947
|
}
|
|
8948
8948
|
let j;
|
|
8949
8949
|
if (k < c - 1)
|
|
@@ -8951,8 +8951,8 @@ class qt {
|
|
|
8951
8951
|
else {
|
|
8952
8952
|
const ee = this.config, ne = k > 0 ? w.dts - n[k - 1].dts : x;
|
|
8953
8953
|
if (j = k > 0 ? w.pts - n[k - 1].pts : x, ee.stretchShortVideoTrack && this.nextAudioPts !== null) {
|
|
8954
|
-
const ge = Math.floor(ee.maxBufferHole * r),
|
|
8955
|
-
|
|
8954
|
+
const ge = Math.floor(ee.maxBufferHole * r), pe = (i ? p + i * r : this.nextAudioPts) - w.pts;
|
|
8955
|
+
pe > ge ? (d = pe - ne, d < 0 ? d = ne : P = !0, this.logger.log(`[mp4-remuxer]: It is approximately ${pe / 90} ms to the next segment; using duration ${d / 90} ms for the last video frame.`)) : d = ne;
|
|
8956
8956
|
} else
|
|
8957
8957
|
d = ne;
|
|
8958
8958
|
}
|
|
@@ -8960,8 +8960,8 @@ class qt {
|
|
|
8960
8960
|
O = Math.min(O, d), V = Math.max(V, d), X = Math.min(X, j), $ = Math.max($, j), o.push(Sr(w.key, d, H, Z));
|
|
8961
8961
|
}
|
|
8962
8962
|
if (o.length) {
|
|
8963
|
-
if (
|
|
8964
|
-
if (
|
|
8963
|
+
if (at) {
|
|
8964
|
+
if (at < 70) {
|
|
8965
8965
|
const k = o[0].flags;
|
|
8966
8966
|
k.dependsOn = 2, k.isNonSync = 0;
|
|
8967
8967
|
}
|
|
@@ -8985,8 +8985,8 @@ class qt {
|
|
|
8985
8985
|
samples: o
|
|
8986
8986
|
})),
|
|
8987
8987
|
data2: D,
|
|
8988
|
-
startPTS:
|
|
8989
|
-
endPTS: (
|
|
8988
|
+
startPTS: p / r,
|
|
8989
|
+
endPTS: (E + d) / r,
|
|
8990
8990
|
startDTS: f / r,
|
|
8991
8991
|
endDTS: h / r,
|
|
8992
8992
|
type: "video",
|
|
@@ -9009,19 +9009,19 @@ class qt {
|
|
|
9009
9009
|
}
|
|
9010
9010
|
remuxAudio(e, t, s, i, r) {
|
|
9011
9011
|
const n = e.inputTimeScale, o = e.samplerate ? e.samplerate : n, c = n / o, l = this.getSamplesPerFrame(e), h = l * c, u = this._initPTS, d = e.segmentCodec === "mp3" && this.typeSupported.mpeg, f = [], g = r !== void 0;
|
|
9012
|
-
let
|
|
9012
|
+
let p = e.samples, E = d ? 0 : 8, y = this.nextAudioPts || -1;
|
|
9013
9013
|
const S = t * n, T = u.baseTime * n / u.timescale;
|
|
9014
|
-
if (this.isAudioContiguous = s = s ||
|
|
9014
|
+
if (this.isAudioContiguous = s = s || p.length && y > 0 && (i && Math.abs(S - y) < 9e3 || Math.abs(Ae(p[0].pts - T, S) - y) < 20 * h), p.forEach(function(M) {
|
|
9015
9015
|
M.pts = Ae(M.pts - T, S);
|
|
9016
9016
|
}), !s || y < 0) {
|
|
9017
|
-
if (
|
|
9017
|
+
if (p = p.filter((M) => M.pts >= 0), !p.length)
|
|
9018
9018
|
return;
|
|
9019
|
-
r === 0 ? y = 0 : i && !g ? y = Math.max(0, S) : y =
|
|
9019
|
+
r === 0 ? y = 0 : i && !g ? y = Math.max(0, S) : y = p[0].pts;
|
|
9020
9020
|
}
|
|
9021
9021
|
if (e.segmentCodec === "aac") {
|
|
9022
9022
|
const M = this.config.maxAudioFramesDrift;
|
|
9023
|
-
for (let G = 0, B = y; G <
|
|
9024
|
-
const k =
|
|
9023
|
+
for (let G = 0, B = y; G < p.length; G++) {
|
|
9024
|
+
const k = p[G], w = k.pts, Y = w - B, H = Math.abs(1e3 * Y / n);
|
|
9025
9025
|
if (Y <= -M * h && g)
|
|
9026
9026
|
G === 0 && (this.logger.warn(`Audio frame @ ${(w / n).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3 * Y / n)} ms.`), this.nextAudioPts = y = B = w);
|
|
9027
9027
|
else if (Y >= M * h && H < ic && g) {
|
|
@@ -9030,7 +9030,7 @@ class qt {
|
|
|
9030
9030
|
for (let Z = 0; Z < j; Z++) {
|
|
9031
9031
|
const ee = Math.max(B, 0);
|
|
9032
9032
|
let ne = ec.getSilentFrame(e.parsedCodec || e.manifestCodec || e.codec, e.channelCount);
|
|
9033
|
-
ne || (this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."), ne = k.unit.subarray()),
|
|
9033
|
+
ne || (this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."), ne = k.unit.subarray()), p.splice(G, 0, {
|
|
9034
9034
|
unit: ne,
|
|
9035
9035
|
pts: ee
|
|
9036
9036
|
}), B += h, G++;
|
|
@@ -9039,23 +9039,23 @@ class qt {
|
|
|
9039
9039
|
k.pts = B, B += h;
|
|
9040
9040
|
}
|
|
9041
9041
|
}
|
|
9042
|
-
let x = null, A = null, _, v = 0,
|
|
9043
|
-
for (;
|
|
9044
|
-
v +=
|
|
9045
|
-
for (let M = 0, G =
|
|
9046
|
-
const B =
|
|
9042
|
+
let x = null, A = null, _, v = 0, R = p.length;
|
|
9043
|
+
for (; R--; )
|
|
9044
|
+
v += p[R].unit.byteLength;
|
|
9045
|
+
for (let M = 0, G = p.length; M < G; M++) {
|
|
9046
|
+
const B = p[M], k = B.unit;
|
|
9047
9047
|
let w = B.pts;
|
|
9048
9048
|
if (A !== null) {
|
|
9049
9049
|
const H = f[M - 1];
|
|
9050
9050
|
H.duration = Math.round((w - A) / c);
|
|
9051
9051
|
} else if (s && e.segmentCodec === "aac" && (w = y), x = w, v > 0) {
|
|
9052
|
-
v +=
|
|
9052
|
+
v += E;
|
|
9053
9053
|
try {
|
|
9054
9054
|
_ = new Uint8Array(v);
|
|
9055
9055
|
} catch (H) {
|
|
9056
9056
|
this.observer.emit(m.ERROR, m.ERROR, {
|
|
9057
9057
|
type: U.MUX_ERROR,
|
|
9058
|
-
details:
|
|
9058
|
+
details: b.REMUX_ALLOC_ERROR,
|
|
9059
9059
|
fatal: !1,
|
|
9060
9060
|
error: H,
|
|
9061
9061
|
bytes: v,
|
|
@@ -9066,9 +9066,9 @@ class qt {
|
|
|
9066
9066
|
d || (new DataView(_.buffer).setUint32(0, v), _.set(I.types.mdat, 4));
|
|
9067
9067
|
} else
|
|
9068
9068
|
return;
|
|
9069
|
-
_.set(k,
|
|
9069
|
+
_.set(k, E);
|
|
9070
9070
|
const Y = k.byteLength;
|
|
9071
|
-
|
|
9071
|
+
E += Y, f.push(Sr(!0, l, Y, 0)), A = w;
|
|
9072
9072
|
}
|
|
9073
9073
|
const D = f.length;
|
|
9074
9074
|
if (!D)
|
|
@@ -9208,13 +9208,13 @@ class lc {
|
|
|
9208
9208
|
if ((o = g) != null && o.length || (this.generateInitSegment(d), g = this.initData), !((c = g) != null && c.length))
|
|
9209
9209
|
return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."), u;
|
|
9210
9210
|
this.emitInitSegment && (f.tracks = this.initTracks, this.emitInitSegment = !1);
|
|
9211
|
-
const
|
|
9212
|
-
(n || !l) && (cc(l, y, r,
|
|
9211
|
+
const p = Qa(d, g), E = za(g, d), y = E === null ? r : E;
|
|
9212
|
+
(n || !l) && (cc(l, y, r, p) || f.timescale !== l.timescale) && (f.initPTS = y - r, l && l.timescale === 1 && this.logger.warn(`Adjusting initPTS @${r} from ${l.baseTime / l.timescale} to ${f.initPTS}`), this.initPTS = l = {
|
|
9213
9213
|
baseTime: f.initPTS,
|
|
9214
9214
|
timescale: 1
|
|
9215
9215
|
});
|
|
9216
|
-
const S = e ? y - l.baseTime / l.timescale : h, T = S +
|
|
9217
|
-
Ja(g, d, l.baseTime / l.timescale),
|
|
9216
|
+
const S = e ? y - l.baseTime / l.timescale : h, T = S + p;
|
|
9217
|
+
Ja(g, d, l.baseTime / l.timescale), p > 0 ? this.lastEndTime = T : (this.logger.warn("Duration parsed from mp4 should be greater than zero"), this.resetNextTimestamp());
|
|
9218
9218
|
const x = !!g.audio, A = !!g.video;
|
|
9219
9219
|
let _ = "";
|
|
9220
9220
|
x && (_ += "audio"), A && (_ += "video");
|
|
@@ -9290,42 +9290,42 @@ class xr {
|
|
|
9290
9290
|
timeOffset: f,
|
|
9291
9291
|
initSegmentChange: g
|
|
9292
9292
|
} = i || o, {
|
|
9293
|
-
audioCodec:
|
|
9294
|
-
videoCodec:
|
|
9293
|
+
audioCodec: p,
|
|
9294
|
+
videoCodec: E,
|
|
9295
9295
|
defaultInitPts: y,
|
|
9296
9296
|
duration: S,
|
|
9297
9297
|
initSegmentData: T
|
|
9298
9298
|
} = c, x = hc(n, t);
|
|
9299
9299
|
if (x && lt(x.method)) {
|
|
9300
|
-
const
|
|
9301
|
-
if (
|
|
9302
|
-
let L =
|
|
9300
|
+
const R = this.getDecrypter(), D = hi(x.method);
|
|
9301
|
+
if (R.isSync()) {
|
|
9302
|
+
let L = R.softwareDecrypt(n, x.key.buffer, x.iv.buffer, D);
|
|
9303
9303
|
if (s.part > -1) {
|
|
9304
|
-
const O =
|
|
9304
|
+
const O = R.flush();
|
|
9305
9305
|
L = O && O.buffer;
|
|
9306
9306
|
}
|
|
9307
9307
|
if (!L)
|
|
9308
9308
|
return r.executeEnd = Ue(), Ds(s);
|
|
9309
9309
|
n = new Uint8Array(L);
|
|
9310
9310
|
} else
|
|
9311
|
-
return this.asyncResult = !0, this.decryptionPromise =
|
|
9311
|
+
return this.asyncResult = !0, this.decryptionPromise = R.webCryptoDecrypt(n, x.key.buffer, x.iv.buffer, D).then((L) => {
|
|
9312
9312
|
const P = this.push(L, null, s);
|
|
9313
9313
|
return this.decryptionPromise = null, P;
|
|
9314
9314
|
}), this.decryptionPromise;
|
|
9315
9315
|
}
|
|
9316
9316
|
const A = this.needsProbing(h, u);
|
|
9317
9317
|
if (A) {
|
|
9318
|
-
const
|
|
9319
|
-
if (
|
|
9320
|
-
return this.logger.warn(`[transmuxer] ${
|
|
9318
|
+
const R = this.configureTransmuxer(n);
|
|
9319
|
+
if (R)
|
|
9320
|
+
return this.logger.warn(`[transmuxer] ${R.message}`), this.observer.emit(m.ERROR, m.ERROR, {
|
|
9321
9321
|
type: U.MEDIA_ERROR,
|
|
9322
|
-
details:
|
|
9322
|
+
details: b.FRAG_PARSING_ERROR,
|
|
9323
9323
|
fatal: !1,
|
|
9324
|
-
error:
|
|
9325
|
-
reason:
|
|
9324
|
+
error: R,
|
|
9325
|
+
reason: R.message
|
|
9326
9326
|
}), r.executeEnd = Ue(), Ds(s);
|
|
9327
9327
|
}
|
|
9328
|
-
(h || u || g || A) && this.resetInitSegment(T,
|
|
9328
|
+
(h || u || g || A) && this.resetInitSegment(T, p, E, S, t), (h || g || A) && this.resetInitialTimestamp(y), l || this.resetContiguity();
|
|
9329
9329
|
const _ = this.transmux(n, x, f, d, s);
|
|
9330
9330
|
this.asyncResult = bt(_);
|
|
9331
9331
|
const v = this.currentTransmuxState;
|
|
@@ -9508,7 +9508,7 @@ class Wn {
|
|
|
9508
9508
|
const l = new Error(`${c.message} (${c.filename}:${c.lineno})`);
|
|
9509
9509
|
this.hls.config.enableWorker = !1, this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`), this.hls.trigger(m.ERROR, {
|
|
9510
9510
|
type: U.OTHER_ERROR,
|
|
9511
|
-
details:
|
|
9511
|
+
details: b.INTERNAL_EXCEPTION,
|
|
9512
9512
|
fatal: !1,
|
|
9513
9513
|
event: "demuxerWorker",
|
|
9514
9514
|
error: l
|
|
@@ -9583,16 +9583,16 @@ class Wn {
|
|
|
9583
9583
|
const {
|
|
9584
9584
|
instanceNo: f,
|
|
9585
9585
|
transmuxer: g
|
|
9586
|
-
} = this,
|
|
9587
|
-
(T || x || r.stats.parsing.start === 0) && (r.stats.parsing.start =
|
|
9588
|
-
const D = !(y && ((u = r.initSegment) == null ? void 0 : u.url) === ((d = y.initSegment) == null ? void 0 : d.url)), L = new dc(S, v, c, T,
|
|
9586
|
+
} = this, p = n ? n.start : r.start, E = r.decryptdata, y = this.frag, S = !(y && r.cc === y.cc), T = !(y && l.level === y.level), x = y ? l.sn - y.sn : -1, A = this.part ? l.part - this.part.index : -1, _ = x === 0 && l.id > 1 && l.id === (y == null ? void 0 : y.stats.chunkCount), v = !T && (x === 1 || x === 0 && (A === 1 || _ && A <= 0)), R = self.performance.now();
|
|
9587
|
+
(T || x || r.stats.parsing.start === 0) && (r.stats.parsing.start = R), n && (A || !v) && (n.stats.parsing.start = R);
|
|
9588
|
+
const D = !(y && ((u = r.initSegment) == null ? void 0 : u.url) === ((d = y.initSegment) == null ? void 0 : d.url)), L = new dc(S, v, c, T, p, D);
|
|
9589
9589
|
if (!v || S || D) {
|
|
9590
9590
|
this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part > -1 ? " part: " + l.part : ""} ${this.id === N.MAIN ? "level" : "track"}: ${l.level} id: ${l.id}
|
|
9591
9591
|
discontinuity: ${S}
|
|
9592
9592
|
trackSwitch: ${T}
|
|
9593
9593
|
contiguous: ${v}
|
|
9594
9594
|
accurateTimeOffset: ${c}
|
|
9595
|
-
timeOffset: ${
|
|
9595
|
+
timeOffset: ${p}
|
|
9596
9596
|
initSegmentChange: ${D}`);
|
|
9597
9597
|
const P = new uc(s, i, t, o, h);
|
|
9598
9598
|
this.configureTransmuxer(P);
|
|
@@ -9602,12 +9602,12 @@ class Wn {
|
|
|
9602
9602
|
instanceNo: f,
|
|
9603
9603
|
cmd: "demux",
|
|
9604
9604
|
data: e,
|
|
9605
|
-
decryptdata:
|
|
9605
|
+
decryptdata: E,
|
|
9606
9606
|
chunkMeta: l,
|
|
9607
9607
|
state: L
|
|
9608
9608
|
}, e instanceof ArrayBuffer ? [e] : []);
|
|
9609
9609
|
else if (g) {
|
|
9610
|
-
const P = g.push(e,
|
|
9610
|
+
const P = g.push(e, E, l, L);
|
|
9611
9611
|
bt(P) ? P.then((O) => {
|
|
9612
9612
|
this.handleTransmuxComplete(O);
|
|
9613
9613
|
}).catch((O) => {
|
|
@@ -9639,7 +9639,7 @@ class Wn {
|
|
|
9639
9639
|
transmuxerError(e, t, s) {
|
|
9640
9640
|
this.hls && (this.error = e, this.hls.trigger(m.ERROR, {
|
|
9641
9641
|
type: U.MEDIA_ERROR,
|
|
9642
|
-
details:
|
|
9642
|
+
details: b.FRAG_PARSING_ERROR,
|
|
9643
9643
|
chunkMeta: t,
|
|
9644
9644
|
frag: this.frag || void 0,
|
|
9645
9645
|
part: this.part || void 0,
|
|
@@ -9816,22 +9816,22 @@ class fc extends di {
|
|
|
9816
9816
|
}), this.state = C.ENDED;
|
|
9817
9817
|
return;
|
|
9818
9818
|
}
|
|
9819
|
-
const u = h.len, d = t.maxBufferLength, f = c.fragments, g = f[0].start,
|
|
9819
|
+
const u = h.len, d = t.maxBufferLength, f = c.fragments, g = f[0].start, p = this.getLoadPosition(), E = this.flushing ? p : h.end;
|
|
9820
9820
|
if (this.switchingTrack && i) {
|
|
9821
|
-
const T =
|
|
9821
|
+
const T = p;
|
|
9822
9822
|
c.PTSKnown && T < g && (h.end > g || h.nextStart) && (this.log("Alt audio track ahead of main track, seek to start of alt audio track"), i.currentTime = g + 0.05);
|
|
9823
9823
|
}
|
|
9824
|
-
if (u >= d && !this.switchingTrack &&
|
|
9824
|
+
if (u >= d && !this.switchingTrack && E < f[f.length - 1].start)
|
|
9825
9825
|
return;
|
|
9826
|
-
let y = this.getNextFragment(
|
|
9827
|
-
if (y && this.isLoopLoading(y,
|
|
9826
|
+
let y = this.getNextFragment(E, c);
|
|
9827
|
+
if (y && this.isLoopLoading(y, E) && (y = this.getNextFragmentLoopLoading(y, c, h, N.MAIN, d)), !y) {
|
|
9828
9828
|
this.bufferFlushed = !0;
|
|
9829
9829
|
return;
|
|
9830
9830
|
}
|
|
9831
9831
|
let S = ((e = this.mainFragLoading) == null ? void 0 : e.frag) || null;
|
|
9832
|
-
if (!this.audioOnly && this.startFragRequested && S && ue(y) && !y.endList && (!c.live || !this.loadingParts &&
|
|
9832
|
+
if (!this.audioOnly && this.startFragRequested && S && ue(y) && !y.endList && (!c.live || !this.loadingParts && E < this.hls.liveSyncPosition) && (this.fragmentTracker.getState(S) === ce.OK && (this.mainFragLoading = S = null), S && ue(S))) {
|
|
9833
9833
|
if (y.start > S.end) {
|
|
9834
|
-
const x = this.fragmentTracker.getFragAtPos(
|
|
9834
|
+
const x = this.fragmentTracker.getFragAtPos(E, N.MAIN);
|
|
9835
9835
|
x && x.end > S.end && (S = x, this.mainFragLoading = {
|
|
9836
9836
|
frag: x,
|
|
9837
9837
|
targetBufferTime: null
|
|
@@ -9840,7 +9840,7 @@ class fc extends di {
|
|
|
9840
9840
|
if (y.start > S.end)
|
|
9841
9841
|
return;
|
|
9842
9842
|
}
|
|
9843
|
-
this.loadFragment(y, o,
|
|
9843
|
+
this.loadFragment(y, o, E);
|
|
9844
9844
|
}
|
|
9845
9845
|
onMediaDetaching(e, t) {
|
|
9846
9846
|
this.bufferFlushed = this.flushing = !1, super.onMediaDetaching(e, t);
|
|
@@ -9932,19 +9932,19 @@ class fc extends di {
|
|
|
9932
9932
|
d || (d = this.transmuxer = new Wn(this.hls, N.AUDIO, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)));
|
|
9933
9933
|
const f = this.initPTS[s.cc], g = (t = s.initSegment) == null ? void 0 : t.data;
|
|
9934
9934
|
if (f !== void 0) {
|
|
9935
|
-
const
|
|
9935
|
+
const E = i ? i.index : -1, y = E !== -1, S = new ci(s.level, s.sn, s.stats.chunkCount, r.byteLength, E, y);
|
|
9936
9936
|
d.push(r, g, u, "", s, i, h.totalduration, !1, S, f);
|
|
9937
9937
|
} else {
|
|
9938
9938
|
this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);
|
|
9939
9939
|
const {
|
|
9940
|
-
cache:
|
|
9940
|
+
cache: p
|
|
9941
9941
|
} = this.waitingData = this.waitingData || {
|
|
9942
9942
|
frag: s,
|
|
9943
9943
|
part: i,
|
|
9944
9944
|
cache: new Rn(),
|
|
9945
9945
|
complete: !1
|
|
9946
9946
|
};
|
|
9947
|
-
|
|
9947
|
+
p.push(new Uint8Array(r)), this.state !== C.STOPPED && (this.state = C.WAITING_INIT_PTS);
|
|
9948
9948
|
}
|
|
9949
9949
|
}
|
|
9950
9950
|
_handleFragmentLoadComplete(e) {
|
|
@@ -9992,32 +9992,32 @@ class fc extends di {
|
|
|
9992
9992
|
return;
|
|
9993
9993
|
}
|
|
9994
9994
|
switch (t.details) {
|
|
9995
|
-
case
|
|
9996
|
-
case
|
|
9997
|
-
case
|
|
9998
|
-
case
|
|
9999
|
-
case
|
|
10000
|
-
case
|
|
10001
|
-
case
|
|
9995
|
+
case b.FRAG_GAP:
|
|
9996
|
+
case b.FRAG_PARSING_ERROR:
|
|
9997
|
+
case b.FRAG_DECRYPT_ERROR:
|
|
9998
|
+
case b.FRAG_LOAD_ERROR:
|
|
9999
|
+
case b.FRAG_LOAD_TIMEOUT:
|
|
10000
|
+
case b.KEY_LOAD_ERROR:
|
|
10001
|
+
case b.KEY_LOAD_TIMEOUT:
|
|
10002
10002
|
this.onFragmentOrKeyLoadError(N.AUDIO, t);
|
|
10003
10003
|
break;
|
|
10004
|
-
case
|
|
10005
|
-
case
|
|
10006
|
-
case
|
|
10004
|
+
case b.AUDIO_TRACK_LOAD_ERROR:
|
|
10005
|
+
case b.AUDIO_TRACK_LOAD_TIMEOUT:
|
|
10006
|
+
case b.LEVEL_PARSING_ERROR:
|
|
10007
10007
|
!t.levelRetry && this.state === C.WAITING_TRACK && ((s = t.context) == null ? void 0 : s.type) === z.AUDIO_TRACK && (this.state = C.IDLE);
|
|
10008
10008
|
break;
|
|
10009
|
-
case
|
|
10010
|
-
case
|
|
10009
|
+
case b.BUFFER_ADD_CODEC_ERROR:
|
|
10010
|
+
case b.BUFFER_APPEND_ERROR:
|
|
10011
10011
|
if (t.parent !== "audio")
|
|
10012
10012
|
return;
|
|
10013
10013
|
this.resetLoadingState();
|
|
10014
10014
|
break;
|
|
10015
|
-
case
|
|
10015
|
+
case b.BUFFER_FULL_ERROR:
|
|
10016
10016
|
if (t.parent !== "audio")
|
|
10017
10017
|
return;
|
|
10018
10018
|
this.reduceLengthAndFlushBuffer(t) && (this.bufferedTrack = null, super.flushMainBuffer(0, Number.POSITIVE_INFINITY, "audio"));
|
|
10019
10019
|
break;
|
|
10020
|
-
case
|
|
10020
|
+
case b.INTERNAL_EXCEPTION:
|
|
10021
10021
|
this.recoverWorkerError(t);
|
|
10022
10022
|
break;
|
|
10023
10023
|
}
|
|
@@ -10058,49 +10058,49 @@ class fc extends di {
|
|
|
10058
10058
|
audio: d,
|
|
10059
10059
|
text: f,
|
|
10060
10060
|
id3: g,
|
|
10061
|
-
initSegment:
|
|
10061
|
+
initSegment: p
|
|
10062
10062
|
} = r;
|
|
10063
10063
|
if (this.fragContextChanged(c) || !u) {
|
|
10064
10064
|
this.fragmentTracker.removeFragment(c);
|
|
10065
10065
|
return;
|
|
10066
10066
|
}
|
|
10067
|
-
if (this.state = C.PARSING, this.switchingTrack && d && this.completeAudioSwitch(this.switchingTrack),
|
|
10068
|
-
const
|
|
10069
|
-
this._bufferInitSegment(h,
|
|
10070
|
-
frag:
|
|
10067
|
+
if (this.state = C.PARSING, this.switchingTrack && d && this.completeAudioSwitch(this.switchingTrack), p != null && p.tracks) {
|
|
10068
|
+
const E = c.initSegment || c;
|
|
10069
|
+
this._bufferInitSegment(h, p.tracks, E, n), i.trigger(m.FRAG_PARSING_INIT_SEGMENT, {
|
|
10070
|
+
frag: E,
|
|
10071
10071
|
id: s,
|
|
10072
|
-
tracks:
|
|
10072
|
+
tracks: p.tracks
|
|
10073
10073
|
});
|
|
10074
10074
|
}
|
|
10075
10075
|
if (d) {
|
|
10076
10076
|
const {
|
|
10077
|
-
startPTS:
|
|
10077
|
+
startPTS: E,
|
|
10078
10078
|
endPTS: y,
|
|
10079
10079
|
startDTS: S,
|
|
10080
10080
|
endDTS: T
|
|
10081
10081
|
} = d;
|
|
10082
10082
|
l && (l.elementaryStreams[ie.AUDIO] = {
|
|
10083
|
-
startPTS:
|
|
10083
|
+
startPTS: E,
|
|
10084
10084
|
endPTS: y,
|
|
10085
10085
|
startDTS: S,
|
|
10086
10086
|
endDTS: T
|
|
10087
|
-
}), c.setElementaryStreamInfo(ie.AUDIO,
|
|
10087
|
+
}), c.setElementaryStreamInfo(ie.AUDIO, E, y, S, T), this.bufferFragmentData(d, c, l, n);
|
|
10088
10088
|
}
|
|
10089
10089
|
if (g != null && (t = g.samples) != null && t.length) {
|
|
10090
|
-
const
|
|
10090
|
+
const E = re({
|
|
10091
10091
|
id: s,
|
|
10092
10092
|
frag: c,
|
|
10093
10093
|
details: u
|
|
10094
10094
|
}, g);
|
|
10095
|
-
i.trigger(m.FRAG_PARSING_METADATA,
|
|
10095
|
+
i.trigger(m.FRAG_PARSING_METADATA, E);
|
|
10096
10096
|
}
|
|
10097
10097
|
if (f) {
|
|
10098
|
-
const
|
|
10098
|
+
const E = re({
|
|
10099
10099
|
id: s,
|
|
10100
10100
|
frag: c,
|
|
10101
10101
|
details: u
|
|
10102
10102
|
}, f);
|
|
10103
|
-
i.trigger(m.FRAG_PARSING_USERDATA,
|
|
10103
|
+
i.trigger(m.FRAG_PARSING_USERDATA, E);
|
|
10104
10104
|
}
|
|
10105
10105
|
}
|
|
10106
10106
|
_bufferInitSegment(e, t, s, i) {
|
|
@@ -10149,14 +10149,14 @@ class fc extends di {
|
|
|
10149
10149
|
audioCodec: n,
|
|
10150
10150
|
channels: o
|
|
10151
10151
|
} = this.bufferedTrack;
|
|
10152
|
-
|
|
10152
|
+
et({
|
|
10153
10153
|
name: t,
|
|
10154
10154
|
lang: s,
|
|
10155
10155
|
assocLang: i,
|
|
10156
10156
|
characteristics: r,
|
|
10157
10157
|
audioCodec: n,
|
|
10158
10158
|
channels: o
|
|
10159
|
-
}, e,
|
|
10159
|
+
}, e, Je) || (ss(e.url, this.hls) ? (this.log("Switching audio track : flushing all audio"), super.flushMainBuffer(0, Number.POSITIVE_INFINITY, "audio"), this.bufferedTrack = null) : this.bufferedTrack = e);
|
|
10160
10160
|
}
|
|
10161
10161
|
}
|
|
10162
10162
|
completeAudioSwitch(e) {
|
|
@@ -10257,7 +10257,7 @@ class Si extends Ge {
|
|
|
10257
10257
|
} = t;
|
|
10258
10258
|
T.trigger(m.ERROR, {
|
|
10259
10259
|
type: U.NETWORK_ERROR,
|
|
10260
|
-
details:
|
|
10260
|
+
details: b.LEVEL_PARSING_ERROR,
|
|
10261
10261
|
fatal: !1,
|
|
10262
10262
|
url: i.url,
|
|
10263
10263
|
error: S,
|
|
@@ -10276,33 +10276,33 @@ class Si extends Ge {
|
|
|
10276
10276
|
const u = this.hls.mainForwardBufferInfo, d = u ? u.end - u.len : 0, f = (i.edge - d) * 1e3, g = Sn(i, f);
|
|
10277
10277
|
if (i.requestScheduled + g < n ? i.requestScheduled = n : i.requestScheduled += g, this.log(`live playlist ${e} ${i.advanced ? "REFRESHED " + i.lastPartSn + "-" + i.lastPartIndex : i.updated ? "UPDATED" : "MISSED"}`), !this.canLoad || !i.live)
|
|
10278
10278
|
return;
|
|
10279
|
-
let
|
|
10279
|
+
let p, E, y;
|
|
10280
10280
|
if (i.canBlockReload && i.endSN && i.advanced) {
|
|
10281
10281
|
const S = this.hls.config.lowLatencyMode, T = i.lastPartSn, x = i.endSN, A = i.lastPartIndex, _ = A !== -1, v = T === x;
|
|
10282
|
-
_ ? v ? (
|
|
10283
|
-
const
|
|
10282
|
+
_ ? v ? (E = x + 1, y = S ? 0 : A) : (E = T, y = S ? A + 1 : i.maxPartIndex) : E = x + 1;
|
|
10283
|
+
const R = i.age, D = R + i.ageHeader;
|
|
10284
10284
|
let L = Math.min(D - i.partTarget, i.targetduration * 1.5);
|
|
10285
10285
|
if (L > 0) {
|
|
10286
10286
|
if (D > i.targetduration * 3)
|
|
10287
|
-
this.log(`Playlist last advanced ${
|
|
10287
|
+
this.log(`Playlist last advanced ${R.toFixed(2)}s ago. Omitting segment and part directives.`), E = void 0, y = void 0;
|
|
10288
10288
|
else if (s != null && s.tuneInGoal && D - i.partTarget > s.tuneInGoal)
|
|
10289
10289
|
this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${L} with playlist age: ${i.age}`), L = 0;
|
|
10290
10290
|
else {
|
|
10291
10291
|
const P = Math.floor(L / i.targetduration);
|
|
10292
|
-
if (
|
|
10292
|
+
if (E += P, y !== void 0) {
|
|
10293
10293
|
const O = Math.round(L % i.targetduration / i.partTarget);
|
|
10294
10294
|
y += O;
|
|
10295
10295
|
}
|
|
10296
|
-
this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${
|
|
10296
|
+
this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${L} skip sn ${P} to part ${y}`);
|
|
10297
10297
|
}
|
|
10298
10298
|
i.tuneInGoal = L;
|
|
10299
10299
|
}
|
|
10300
|
-
if (
|
|
10301
|
-
i.requestScheduled = n, this.loadingPlaylist(h,
|
|
10300
|
+
if (p = this.getDeliveryDirectives(i, t.deliveryDirectives, E, y), S || !v) {
|
|
10301
|
+
i.requestScheduled = n, this.loadingPlaylist(h, p);
|
|
10302
10302
|
return;
|
|
10303
10303
|
}
|
|
10304
|
-
} else (i.canBlockReload || i.canSkipUntil) && (
|
|
10305
|
-
|
|
10304
|
+
} else (i.canBlockReload || i.canSkipUntil) && (p = this.getDeliveryDirectives(i, t.deliveryDirectives, E, y));
|
|
10305
|
+
p && E !== void 0 && i.canBlockReload && (i.requestScheduled = r.loading.first + Math.max(g - o * 2, g / 2)), this.scheduleLoading(h, p, i);
|
|
10306
10306
|
} else
|
|
10307
10307
|
this.clearTimer();
|
|
10308
10308
|
}
|
|
@@ -10422,7 +10422,7 @@ class gc extends Si {
|
|
|
10422
10422
|
this.tracksInGroup = o;
|
|
10423
10423
|
const c = this.hls.config.audioPreference;
|
|
10424
10424
|
if (!r && c) {
|
|
10425
|
-
const d = ke(c, o,
|
|
10425
|
+
const d = ke(c, o, Je);
|
|
10426
10426
|
if (d > -1)
|
|
10427
10427
|
r = o[d];
|
|
10428
10428
|
else {
|
|
@@ -10444,7 +10444,7 @@ class gc extends Si {
|
|
|
10444
10444
|
const d = new Error(`No audio track selected for current audio group-ID(s): ${(n = this.groupIds) == null ? void 0 : n.join(",")} track count: ${o.length}`);
|
|
10445
10445
|
this.warn(d.message), this.hls.trigger(m.ERROR, {
|
|
10446
10446
|
type: U.MEDIA_ERROR,
|
|
10447
|
-
details:
|
|
10447
|
+
details: b.AUDIO_TRACK_LOAD_ERROR,
|
|
10448
10448
|
fatal: !0,
|
|
10449
10449
|
error: d
|
|
10450
10450
|
});
|
|
@@ -10472,16 +10472,16 @@ class gc extends Si {
|
|
|
10472
10472
|
const s = this.allAudioTracks;
|
|
10473
10473
|
if (this.selectDefaultTrack = !1, s.length) {
|
|
10474
10474
|
const i = this.currentTrack;
|
|
10475
|
-
if (i &&
|
|
10475
|
+
if (i && et(e, i, Je))
|
|
10476
10476
|
return i;
|
|
10477
|
-
const r = ke(e, this.tracksInGroup,
|
|
10477
|
+
const r = ke(e, this.tracksInGroup, Je);
|
|
10478
10478
|
if (r > -1) {
|
|
10479
10479
|
const n = this.tracksInGroup[r];
|
|
10480
10480
|
return this.setAudioTrack(r), n;
|
|
10481
10481
|
} else if (i) {
|
|
10482
10482
|
let n = t.loadLevel;
|
|
10483
10483
|
n === -1 && (n = t.firstAutoLevel);
|
|
10484
|
-
const o = Lo(e, t.levels, s, n,
|
|
10484
|
+
const o = Lo(e, t.levels, s, n, Je);
|
|
10485
10485
|
if (o === -1)
|
|
10486
10486
|
return null;
|
|
10487
10487
|
t.nextLoadLevel = o;
|
|
@@ -10512,7 +10512,7 @@ class gc extends Si {
|
|
|
10512
10512
|
const t = this.tracksInGroup;
|
|
10513
10513
|
for (let s = 0; s < t.length; s++) {
|
|
10514
10514
|
const i = t[s];
|
|
10515
|
-
if (!(this.selectDefaultTrack && !i.default) && (!e ||
|
|
10515
|
+
if (!(this.selectDefaultTrack && !i.default) && (!e || et(e, i, Je)))
|
|
10516
10516
|
return s;
|
|
10517
10517
|
}
|
|
10518
10518
|
if (e) {
|
|
@@ -10526,14 +10526,14 @@ class gc extends Si {
|
|
|
10526
10526
|
} = e;
|
|
10527
10527
|
for (let l = 0; l < t.length; l++) {
|
|
10528
10528
|
const h = t[l];
|
|
10529
|
-
if (
|
|
10529
|
+
if (et({
|
|
10530
10530
|
name: s,
|
|
10531
10531
|
lang: i,
|
|
10532
10532
|
assocLang: r,
|
|
10533
10533
|
characteristics: n,
|
|
10534
10534
|
audioCodec: o,
|
|
10535
10535
|
channels: c
|
|
10536
|
-
}, h,
|
|
10536
|
+
}, h, Je))
|
|
10537
10537
|
return l;
|
|
10538
10538
|
}
|
|
10539
10539
|
for (let l = 0; l < t.length; l++) {
|
|
@@ -10826,11 +10826,11 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
10826
10826
|
if (u) {
|
|
10827
10827
|
const d = this.fragmentTracker, f = h.id;
|
|
10828
10828
|
if (d.hasFragments(f) || d.hasParts(f)) {
|
|
10829
|
-
const
|
|
10830
|
-
d.detectEvictedFragments(l,
|
|
10829
|
+
const E = q.getBuffered(u);
|
|
10830
|
+
d.detectEvictedFragments(l, E, f, null, !0);
|
|
10831
10831
|
}
|
|
10832
|
-
const g = Cs(l),
|
|
10833
|
-
this.sourceBuffers[g] =
|
|
10832
|
+
const g = Cs(l), p = [l, u];
|
|
10833
|
+
this.sourceBuffers[g] = p, u.updating && this.operationQueue && this.operationQueue.prependBlocker(l), this.trackSourceBuffer(l, h);
|
|
10834
10834
|
}
|
|
10835
10835
|
}
|
|
10836
10836
|
}), o(), this.bufferCreated();
|
|
@@ -10912,8 +10912,8 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
10912
10912
|
id: d,
|
|
10913
10913
|
codec: f,
|
|
10914
10914
|
levelCodec: g,
|
|
10915
|
-
container:
|
|
10916
|
-
metadata:
|
|
10915
|
+
container: p,
|
|
10916
|
+
metadata: E,
|
|
10917
10917
|
supplemental: y
|
|
10918
10918
|
} = u;
|
|
10919
10919
|
let S = s[o];
|
|
@@ -10923,15 +10923,15 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
10923
10923
|
listeners: [],
|
|
10924
10924
|
codec: f,
|
|
10925
10925
|
supplemental: y,
|
|
10926
|
-
container:
|
|
10926
|
+
container: p,
|
|
10927
10927
|
levelCodec: g,
|
|
10928
|
-
metadata:
|
|
10928
|
+
metadata: E,
|
|
10929
10929
|
id: d
|
|
10930
10930
|
});
|
|
10931
|
-
const v = Yt(A, _),
|
|
10931
|
+
const v = Yt(A, _), R = v == null ? void 0 : v.replace(Ir, "$1");
|
|
10932
10932
|
let D = Yt(f, g);
|
|
10933
10933
|
const L = (h = D) == null ? void 0 : h.replace(Ir, "$1");
|
|
10934
|
-
D && v &&
|
|
10934
|
+
D && v && R !== L && (o.slice(0, 5) === "audio" && (D = es(D, this.appendSource)), this.log(`switching codec ${A} to ${D}`), D !== (S.pendingCodec || S.codec) && (S.pendingCodec = D), S.container = p, this.appendChangeType(o, p, D));
|
|
10935
10935
|
}), (this.tracksReady || this.sourceBufferCount) && (t.tracks = this.sourceBufferTracks), !this.sourceBufferCount && this.mediaSourceOpenOrEnded && this.checkPendingTracks();
|
|
10936
10936
|
}
|
|
10937
10937
|
get sourceBufferTracks() {
|
|
@@ -11012,20 +11012,20 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11012
11012
|
h.start = d;
|
|
11013
11013
|
const f = o.stats.buffering, g = c ? c.stats.buffering : null;
|
|
11014
11014
|
f.start === 0 && (f.start = d), g && g.start === 0 && (g.start = d);
|
|
11015
|
-
const
|
|
11016
|
-
let
|
|
11017
|
-
r === "audio" && (
|
|
11015
|
+
const p = s.audio;
|
|
11016
|
+
let E = !1;
|
|
11017
|
+
r === "audio" && (p == null ? void 0 : p.container) === "audio/mpeg" && (E = !this.lastMpegAudioChunk || l.id === 1 || this.lastMpegAudioChunk.sn !== l.sn, this.lastMpegAudioChunk = l);
|
|
11018
11018
|
const y = this.tracks.video, S = y == null ? void 0 : y.buffer;
|
|
11019
11019
|
if (S && u !== "initSegment") {
|
|
11020
11020
|
const A = c || o, _ = this.blockedAudioAppend;
|
|
11021
11021
|
if (r === "audio" && n !== "main" && !this.blockedAudioAppend) {
|
|
11022
|
-
const
|
|
11023
|
-
!D.length && !L ? this.blockAudio(A) : !L && !q.isBuffered(S,
|
|
11022
|
+
const R = A.start + A.duration * 0.05, D = S.buffered, L = this.currentOp("video");
|
|
11023
|
+
!D.length && !L ? this.blockAudio(A) : !L && !q.isBuffered(S, R) && this.lastVideoAppendEnd < R && this.blockAudio(A);
|
|
11024
11024
|
} else if (r === "video") {
|
|
11025
11025
|
const v = A.end;
|
|
11026
11026
|
if (_) {
|
|
11027
|
-
const
|
|
11028
|
-
(v >
|
|
11027
|
+
const R = _.frag.start;
|
|
11028
|
+
(v > R || v < this.lastVideoAppendEnd || q.isBuffered(S, R)) && this.unblockAudio();
|
|
11029
11029
|
}
|
|
11030
11030
|
this.lastVideoAppendEnd = v;
|
|
11031
11031
|
}
|
|
@@ -11033,7 +11033,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11033
11033
|
const T = (c || o).start, x = {
|
|
11034
11034
|
label: `append-${r}`,
|
|
11035
11035
|
execute: () => {
|
|
11036
|
-
if (h.executeStart = self.performance.now(),
|
|
11036
|
+
if (h.executeStart = self.performance.now(), E) {
|
|
11037
11037
|
const A = this.tracks[r];
|
|
11038
11038
|
if (A) {
|
|
11039
11039
|
const _ = A.buffer;
|
|
@@ -11051,8 +11051,8 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11051
11051
|
const A = self.performance.now();
|
|
11052
11052
|
h.executeEnd = h.end = A, f.first === 0 && (f.first = A), g && g.first === 0 && (g.first = A);
|
|
11053
11053
|
const _ = {};
|
|
11054
|
-
this.sourceBuffers.forEach(([v,
|
|
11055
|
-
v && (_[v] = q.getBuffered(
|
|
11054
|
+
this.sourceBuffers.forEach(([v, R]) => {
|
|
11055
|
+
v && (_[v] = q.getBuffered(R));
|
|
11056
11056
|
}), this.appendErrors[r] = 0, r === "audio" || r === "video" ? this.appendErrors.audiovideo = 0 : (this.appendErrors.audio = 0, this.appendErrors.video = 0), this.hls.trigger(m.BUFFER_APPENDED, {
|
|
11057
11057
|
type: r,
|
|
11058
11058
|
frag: o,
|
|
@@ -11067,7 +11067,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11067
11067
|
const v = {
|
|
11068
11068
|
type: U.MEDIA_ERROR,
|
|
11069
11069
|
parent: o.type,
|
|
11070
|
-
details:
|
|
11070
|
+
details: b.BUFFER_APPEND_ERROR,
|
|
11071
11071
|
sourceBufferName: r,
|
|
11072
11072
|
frag: o,
|
|
11073
11073
|
part: c,
|
|
@@ -11075,16 +11075,16 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11075
11075
|
error: A,
|
|
11076
11076
|
err: A,
|
|
11077
11077
|
fatal: !1
|
|
11078
|
-
},
|
|
11078
|
+
}, R = (_ = this.media) == null ? void 0 : _.error;
|
|
11079
11079
|
if (A.code === DOMException.QUOTA_EXCEEDED_ERR)
|
|
11080
|
-
v.details =
|
|
11081
|
-
else if (A.code === DOMException.INVALID_STATE_ERR && this.mediaSourceOpenOrEnded && !
|
|
11080
|
+
v.details = b.BUFFER_FULL_ERROR;
|
|
11081
|
+
else if (A.code === DOMException.INVALID_STATE_ERR && this.mediaSourceOpenOrEnded && !R)
|
|
11082
11082
|
v.errorAction = At(!0);
|
|
11083
11083
|
else if (A.name === jn && this.sourceBufferCount === 0)
|
|
11084
11084
|
v.errorAction = At(!0);
|
|
11085
11085
|
else {
|
|
11086
11086
|
const D = ++this.appendErrors[r];
|
|
11087
|
-
this.warn(`Failed ${D}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${
|
|
11087
|
+
this.warn(`Failed ${D}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${R || "no media error"})`), (D >= this.hls.config.appendErrorMaxRetry || R) && (v.fatal = !0);
|
|
11088
11088
|
}
|
|
11089
11089
|
this.hls.trigger(m.ERROR, v);
|
|
11090
11090
|
}
|
|
@@ -11193,7 +11193,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11193
11193
|
e && this.blockUntilOpen(() => this.updateMediaSource(e));
|
|
11194
11194
|
}
|
|
11195
11195
|
onError(e, t) {
|
|
11196
|
-
if (t.details ===
|
|
11196
|
+
if (t.details === b.BUFFER_APPEND_ERROR && t.frag) {
|
|
11197
11197
|
var s;
|
|
11198
11198
|
const i = (s = t.errorAction) == null ? void 0 : s.nextAutoLevel;
|
|
11199
11199
|
F(i) && i !== t.frag.level && this.resetAppendErrors();
|
|
@@ -11354,7 +11354,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11354
11354
|
const e = new Error("could not create source buffer for media codec(s)");
|
|
11355
11355
|
this.hls.trigger(m.ERROR, {
|
|
11356
11356
|
type: U.MEDIA_ERROR,
|
|
11357
|
-
details:
|
|
11357
|
+
details: b.BUFFER_INCOMPATIBLE_CODECS_ERROR,
|
|
11358
11358
|
fatal: !0,
|
|
11359
11359
|
error: e,
|
|
11360
11360
|
reason: e.message
|
|
@@ -11381,7 +11381,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11381
11381
|
var i;
|
|
11382
11382
|
this.error(`error while trying to add sourceBuffer: ${h.message}`), this.shiftAndExecuteNext(n), (i = this.operationQueue) == null || i.removeBlockers(), delete this.tracks[n], this.hls.trigger(m.ERROR, {
|
|
11383
11383
|
type: U.MEDIA_ERROR,
|
|
11384
|
-
details:
|
|
11384
|
+
details: b.BUFFER_ADD_CODEC_ERROR,
|
|
11385
11385
|
fatal: !1,
|
|
11386
11386
|
error: h,
|
|
11387
11387
|
sourceBufferName: n,
|
|
@@ -11446,7 +11446,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !qr(i,
|
|
|
11446
11446
|
const i = new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s = this.mediaSource) == null ? void 0 : s.readyState}`);
|
|
11447
11447
|
this.error(`${i}`, t), this.hls.trigger(m.ERROR, {
|
|
11448
11448
|
type: U.MEDIA_ERROR,
|
|
11449
|
-
details:
|
|
11449
|
+
details: b.BUFFER_APPENDING_ERROR,
|
|
11450
11450
|
sourceBufferName: e,
|
|
11451
11451
|
error: i,
|
|
11452
11452
|
fatal: !1
|
|
@@ -11737,7 +11737,7 @@ const Tc = {
|
|
|
11737
11737
|
* other
|
|
11738
11738
|
*/
|
|
11739
11739
|
OTHER: "o"
|
|
11740
|
-
},
|
|
11740
|
+
}, Ee = Tc, Sc = {
|
|
11741
11741
|
/**
|
|
11742
11742
|
* HTTP Live Streaming (HLS)
|
|
11743
11743
|
*/
|
|
@@ -11986,7 +11986,7 @@ class rh {
|
|
|
11986
11986
|
}, this.applyPlaylistData = (i) => {
|
|
11987
11987
|
try {
|
|
11988
11988
|
this.apply(i, {
|
|
11989
|
-
ot:
|
|
11989
|
+
ot: Ee.MANIFEST,
|
|
11990
11990
|
su: !this.initialized
|
|
11991
11991
|
});
|
|
11992
11992
|
} catch (r) {
|
|
@@ -12001,7 +12001,7 @@ class rh {
|
|
|
12001
12001
|
d: (n || r).duration * 1e3,
|
|
12002
12002
|
ot: c
|
|
12003
12003
|
};
|
|
12004
|
-
(c ===
|
|
12004
|
+
(c === Ee.VIDEO || c === Ee.AUDIO || c == Ee.MUXED) && (l.br = o.bitrate / 1e3, l.tb = this.getTopBandwidth(c) / 1e3, l.bl = this.getBufferLength(c));
|
|
12005
12005
|
const h = n ? this.getNextPart(n) : this.getNextFrag(r);
|
|
12006
12006
|
h != null && h.url && h.url !== r.url && (l.nor = h.url), this.apply(i, l);
|
|
12007
12007
|
} catch (r) {
|
|
@@ -12053,7 +12053,7 @@ class rh {
|
|
|
12053
12053
|
*/
|
|
12054
12054
|
apply(e, t = {}) {
|
|
12055
12055
|
re(t, this.createData());
|
|
12056
|
-
const s = t.ot ===
|
|
12056
|
+
const s = t.ot === Ee.INIT || t.ot === Ee.VIDEO || t.ot === Ee.MUXED;
|
|
12057
12057
|
this.starved && s && (t.bs = !0, t.su = !0, this.starved = !1), t.su == null && (t.su = this.buffering);
|
|
12058
12058
|
const {
|
|
12059
12059
|
includeKeys: i
|
|
@@ -12097,13 +12097,13 @@ class rh {
|
|
|
12097
12097
|
type: t
|
|
12098
12098
|
} = e;
|
|
12099
12099
|
if (t === "subtitle")
|
|
12100
|
-
return
|
|
12100
|
+
return Ee.TIMED_TEXT;
|
|
12101
12101
|
if (e.sn === "initSegment")
|
|
12102
|
-
return
|
|
12102
|
+
return Ee.INIT;
|
|
12103
12103
|
if (t === "audio")
|
|
12104
|
-
return
|
|
12104
|
+
return Ee.AUDIO;
|
|
12105
12105
|
if (t === "main")
|
|
12106
|
-
return this.hls.audioTracks.length ?
|
|
12106
|
+
return this.hls.audioTracks.length ? Ee.VIDEO : Ee.MUXED;
|
|
12107
12107
|
}
|
|
12108
12108
|
/**
|
|
12109
12109
|
* Get the highest bitrate.
|
|
@@ -12111,7 +12111,7 @@ class rh {
|
|
|
12111
12111
|
getTopBandwidth(e) {
|
|
12112
12112
|
let t = 0, s;
|
|
12113
12113
|
const i = this.hls;
|
|
12114
|
-
if (e ===
|
|
12114
|
+
if (e === Ee.AUDIO)
|
|
12115
12115
|
s = i.audioTracks;
|
|
12116
12116
|
else {
|
|
12117
12117
|
const r = i.maxAutoLevel, n = r > -1 ? r + 1 : i.levels.length;
|
|
@@ -12125,7 +12125,7 @@ class rh {
|
|
|
12125
12125
|
* Get the buffer length for a media type in milliseconds
|
|
12126
12126
|
*/
|
|
12127
12127
|
getBufferLength(e) {
|
|
12128
|
-
const t = this.media, s = e ===
|
|
12128
|
+
const t = this.media, s = e === Ee.AUDIO ? this.audioBuffer : this.videoBuffer;
|
|
12129
12129
|
return !s || !t ? NaN : q.bufferInfo(s, t.currentTime, this.config.maxBufferHole).len * 1e3;
|
|
12130
12130
|
}
|
|
12131
12131
|
/**
|
|
@@ -12323,7 +12323,7 @@ class ah extends Ge {
|
|
|
12323
12323
|
u["PATHWAY-ID"] = n;
|
|
12324
12324
|
const d = u.AUDIO && `${u.AUDIO}_clone_${n}`, f = u.SUBTITLES && `${u.SUBTITLES}_clone_${n}`;
|
|
12325
12325
|
d && (s[u.AUDIO] = d, u.AUDIO = d), f && (i[u.SUBTITLES] = f, u.SUBTITLES = f);
|
|
12326
|
-
const g = Jn(h.uri, u["STABLE-VARIANT-ID"], "PER-VARIANT-URIS", c),
|
|
12326
|
+
const g = Jn(h.uri, u["STABLE-VARIANT-ID"], "PER-VARIANT-URIS", c), p = new xt({
|
|
12327
12327
|
attrs: u,
|
|
12328
12328
|
audioCodec: h.audioCodec,
|
|
12329
12329
|
bitrate: h.bitrate,
|
|
@@ -12334,12 +12334,12 @@ class ah extends Ge {
|
|
|
12334
12334
|
width: h.width
|
|
12335
12335
|
});
|
|
12336
12336
|
if (h.audioGroups)
|
|
12337
|
-
for (let
|
|
12338
|
-
|
|
12337
|
+
for (let E = 1; E < h.audioGroups.length; E++)
|
|
12338
|
+
p.addGroupId("audio", `${h.audioGroups[E]}_clone_${n}`);
|
|
12339
12339
|
if (h.subtitleGroups)
|
|
12340
|
-
for (let
|
|
12341
|
-
|
|
12342
|
-
return
|
|
12340
|
+
for (let E = 1; E < h.subtitleGroups.length; E++)
|
|
12341
|
+
p.addGroupId("text", `${h.subtitleGroups[E]}_clone_${n}`);
|
|
12342
|
+
return p;
|
|
12343
12343
|
});
|
|
12344
12344
|
t.push(...l), Cr(this.audioTracks, s, c, n), Cr(this.subtitleTracks, i, c, n);
|
|
12345
12345
|
});
|
|
@@ -12377,18 +12377,18 @@ class ah extends Ge {
|
|
|
12377
12377
|
}
|
|
12378
12378
|
this.updated = performance.now(), this.timeToLoad = g.TTL;
|
|
12379
12379
|
const {
|
|
12380
|
-
"RELOAD-URI":
|
|
12381
|
-
"PATHWAY-CLONES":
|
|
12380
|
+
"RELOAD-URI": p,
|
|
12381
|
+
"PATHWAY-CLONES": E,
|
|
12382
12382
|
"PATHWAY-PRIORITY": y
|
|
12383
12383
|
} = g;
|
|
12384
|
-
if (
|
|
12384
|
+
if (p)
|
|
12385
12385
|
try {
|
|
12386
|
-
this.uri = new self.URL(
|
|
12386
|
+
this.uri = new self.URL(p, i).href;
|
|
12387
12387
|
} catch {
|
|
12388
|
-
this.enabled = !1, this.log(`Failed to parse Steering Manifest RELOAD-URI: ${
|
|
12388
|
+
this.enabled = !1, this.log(`Failed to parse Steering Manifest RELOAD-URI: ${p}`);
|
|
12389
12389
|
return;
|
|
12390
12390
|
}
|
|
12391
|
-
this.scheduleRefresh(this.uri || d.url),
|
|
12391
|
+
this.scheduleRefresh(this.uri || d.url), E && this.clonePathways(E);
|
|
12392
12392
|
const S = {
|
|
12393
12393
|
steeringManifest: g,
|
|
12394
12394
|
url: i.toString()
|
|
@@ -12402,10 +12402,10 @@ class ah extends Ge {
|
|
|
12402
12402
|
}
|
|
12403
12403
|
let g = this.timeToLoad * 1e3;
|
|
12404
12404
|
if (h.code === 429) {
|
|
12405
|
-
const
|
|
12406
|
-
if (typeof (
|
|
12407
|
-
const
|
|
12408
|
-
|
|
12405
|
+
const p = this.loader;
|
|
12406
|
+
if (typeof (p == null ? void 0 : p.getResponseHeader) == "function") {
|
|
12407
|
+
const E = p.getResponseHeader("Retry-After");
|
|
12408
|
+
E && (g = parseFloat(E) * 1e3);
|
|
12409
12409
|
}
|
|
12410
12410
|
this.log(`Steering manifest ${u.url} rate limited`);
|
|
12411
12411
|
return;
|
|
@@ -12476,12 +12476,12 @@ class ct extends Ge {
|
|
|
12476
12476
|
}
|
|
12477
12477
|
const g = le(new Uint8Array(i));
|
|
12478
12478
|
try {
|
|
12479
|
-
const
|
|
12480
|
-
if (!
|
|
12479
|
+
const p = ui(JSON.parse(g).sinf), E = en(p);
|
|
12480
|
+
if (!E)
|
|
12481
12481
|
throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");
|
|
12482
|
-
c = new Uint8Array(
|
|
12483
|
-
} catch (
|
|
12484
|
-
this.warn(`${r} Failed to parse sinf: ${
|
|
12482
|
+
c = new Uint8Array(E.subarray(8, 24)), l = se.FAIRPLAY;
|
|
12483
|
+
} catch (p) {
|
|
12484
|
+
this.warn(`${r} Failed to parse sinf: ${p}`);
|
|
12485
12485
|
return;
|
|
12486
12486
|
}
|
|
12487
12487
|
} else {
|
|
@@ -12489,18 +12489,18 @@ class ct extends Ge {
|
|
|
12489
12489
|
this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${s}" for selected key-system ${o}`);
|
|
12490
12490
|
return;
|
|
12491
12491
|
}
|
|
12492
|
-
const g = no(i),
|
|
12493
|
-
|
|
12494
|
-
const
|
|
12495
|
-
if (!
|
|
12492
|
+
const g = no(i), p = g.filter((y) => !!y.systemId && vs(y.systemId) === o);
|
|
12493
|
+
p.length > 1 && this.warn(`${r} Using first of ${p.length} pssh found for selected key-system ${o}`);
|
|
12494
|
+
const E = p[0];
|
|
12495
|
+
if (!E) {
|
|
12496
12496
|
g.length === 0 || g.some((y) => !y.systemId) ? this.warn(`${r} contains incomplete or invalid pssh data`) : this.log(`ignoring ${r} for ${g.map((y) => vs(y.systemId)).join(",")} pssh data in favor of playlist keys`);
|
|
12497
12497
|
return;
|
|
12498
12498
|
}
|
|
12499
|
-
if (l = vs(
|
|
12499
|
+
if (l = vs(E.systemId), E.version === 0 && E.data)
|
|
12500
12500
|
if (l === se.WIDEVINE) {
|
|
12501
|
-
const y =
|
|
12502
|
-
c = new Uint8Array(
|
|
12503
|
-
} else l === se.PLAYREADY && (c = pn(
|
|
12501
|
+
const y = E.data.length - 22;
|
|
12502
|
+
c = new Uint8Array(E.data.subarray(y, y + 16));
|
|
12503
|
+
} else l === se.PLAYREADY && (c = pn(E.data));
|
|
12504
12504
|
}
|
|
12505
12505
|
if (!l || !c)
|
|
12506
12506
|
return;
|
|
@@ -12510,14 +12510,14 @@ class ct extends Ge {
|
|
|
12510
12510
|
} = this;
|
|
12511
12511
|
let f = u[h];
|
|
12512
12512
|
for (let g = 0; g < d.length; g++) {
|
|
12513
|
-
const
|
|
12514
|
-
if (!
|
|
12513
|
+
const p = d[g], E = p.decryptdata;
|
|
12514
|
+
if (!E.keyId)
|
|
12515
12515
|
continue;
|
|
12516
|
-
const y = Ce.hexDump(
|
|
12517
|
-
if (h === y ||
|
|
12518
|
-
if (f = u[y],
|
|
12516
|
+
const y = Ce.hexDump(E.keyId);
|
|
12517
|
+
if (h === y || E.uri.replace(/-/g, "").indexOf(h) !== -1) {
|
|
12518
|
+
if (f = u[y], E.pssh)
|
|
12519
12519
|
break;
|
|
12520
|
-
delete u[y],
|
|
12520
|
+
delete u[y], E.pssh = new Uint8Array(i), E.keyId = c, f = u[h] = f.then(() => this.generateRequestWithPreferredKeySession(p, s, i, "encrypted-event-key-match")), f.catch((S) => this.handleError(S));
|
|
12521
12521
|
break;
|
|
12522
12522
|
}
|
|
12523
12523
|
}
|
|
@@ -12528,17 +12528,17 @@ class ct extends Ge {
|
|
|
12528
12528
|
}
|
|
12529
12529
|
f = u[h] = this.getKeySystemSelectionPromise([l]).then(({
|
|
12530
12530
|
keySystem: g,
|
|
12531
|
-
mediaKeys:
|
|
12531
|
+
mediaKeys: p
|
|
12532
12532
|
}) => {
|
|
12533
|
-
var
|
|
12533
|
+
var E;
|
|
12534
12534
|
this.throwIfDestroyed();
|
|
12535
|
-
const y = new Lt("ISO-23001-7", h, (
|
|
12536
|
-
return y.pssh = new Uint8Array(i), y.keyId = c, this.attemptSetMediaKeys(g,
|
|
12535
|
+
const y = new Lt("ISO-23001-7", h, (E = xs(g)) != null ? E : "");
|
|
12536
|
+
return y.pssh = new Uint8Array(i), y.keyId = c, this.attemptSetMediaKeys(g, p).then(() => {
|
|
12537
12537
|
this.throwIfDestroyed();
|
|
12538
12538
|
const S = this.createMediaKeySessionContext({
|
|
12539
12539
|
decryptdata: y,
|
|
12540
12540
|
keySystem: g,
|
|
12541
|
-
mediaKeys:
|
|
12541
|
+
mediaKeys: p
|
|
12542
12542
|
});
|
|
12543
12543
|
return this.generateRequestWithPreferredKeySession(S, s, i, "encrypted-event-no-match");
|
|
12544
12544
|
});
|
|
@@ -12597,7 +12597,7 @@ class ct extends Ge {
|
|
|
12597
12597
|
})).catch((u) => {
|
|
12598
12598
|
l.length ? c(l) : u instanceof xe ? o(u) : o(new xe({
|
|
12599
12599
|
type: U.KEY_SYSTEM_ERROR,
|
|
12600
|
-
details:
|
|
12600
|
+
details: b.KEY_SYSTEM_NO_ACCESS,
|
|
12601
12601
|
error: u,
|
|
12602
12602
|
fatal: !0
|
|
12603
12603
|
}, u.message));
|
|
@@ -12711,7 +12711,7 @@ class ct extends Ge {
|
|
|
12711
12711
|
handleError(e) {
|
|
12712
12712
|
this.hls && (this.error(e.message), e instanceof xe ? this.hls.trigger(m.ERROR, e.data) : this.hls.trigger(m.ERROR, {
|
|
12713
12713
|
type: U.KEY_SYSTEM_ERROR,
|
|
12714
|
-
details:
|
|
12714
|
+
details: b.KEY_SYSTEM_NO_KEYS,
|
|
12715
12715
|
error: e,
|
|
12716
12716
|
fatal: !0
|
|
12717
12717
|
}));
|
|
@@ -12728,7 +12728,7 @@ class ct extends Ge {
|
|
|
12728
12728
|
if (e.length || (e = Mt(this.config)), e.length === 0)
|
|
12729
12729
|
throw new xe({
|
|
12730
12730
|
type: U.KEY_SYSTEM_ERROR,
|
|
12731
|
-
details:
|
|
12731
|
+
details: b.KEY_SYSTEM_NO_CONFIGURED_LICENSE,
|
|
12732
12732
|
fatal: !0
|
|
12733
12733
|
}, `Missing key-system license configuration options ${ae({
|
|
12734
12734
|
drmSystems: this.config.drmSystems
|
|
@@ -12766,39 +12766,39 @@ class ct extends Ge {
|
|
|
12766
12766
|
const l = this.getKeyIdString(e.decryptdata);
|
|
12767
12767
|
this.log(`Generating key-session request for "${i}": ${l} (init data type: ${t} length: ${s ? s.byteLength : null})`);
|
|
12768
12768
|
const h = new fi(), u = e._onmessage = (g) => {
|
|
12769
|
-
const
|
|
12770
|
-
if (!
|
|
12769
|
+
const p = e.mediaKeysSession;
|
|
12770
|
+
if (!p) {
|
|
12771
12771
|
h.emit("error", new Error("invalid state"));
|
|
12772
12772
|
return;
|
|
12773
12773
|
}
|
|
12774
12774
|
const {
|
|
12775
|
-
messageType:
|
|
12775
|
+
messageType: E,
|
|
12776
12776
|
message: y
|
|
12777
12777
|
} = g;
|
|
12778
|
-
this.log(`"${
|
|
12778
|
+
this.log(`"${E}" message event for session "${p.sessionId}" message size: ${y.byteLength}`), E === "license-request" || E === "license-renewal" ? this.renewLicense(e, y).catch((S) => {
|
|
12779
12779
|
h.eventNames().length ? h.emit("error", S) : this.handleError(S);
|
|
12780
|
-
}) :
|
|
12780
|
+
}) : E === "license-release" ? e.keySystem === se.FAIRPLAY && (this.updateKeySession(e, Hs("acknowledged")), this.removeSession(e)) : this.warn(`unhandled media key message type "${E}"`);
|
|
12781
12781
|
}, d = e._onkeystatuseschange = (g) => {
|
|
12782
12782
|
if (!e.mediaKeysSession) {
|
|
12783
12783
|
h.emit("error", new Error("invalid state"));
|
|
12784
12784
|
return;
|
|
12785
12785
|
}
|
|
12786
12786
|
this.onKeyStatusChange(e);
|
|
12787
|
-
const
|
|
12788
|
-
h.emit("keyStatus",
|
|
12787
|
+
const E = e.keyStatus;
|
|
12788
|
+
h.emit("keyStatus", E), E === "expired" && (this.warn(`${e.keySystem} expired for key ${l}`), this.renewKeySession(e));
|
|
12789
12789
|
};
|
|
12790
12790
|
e.mediaKeysSession.addEventListener("message", u), e.mediaKeysSession.addEventListener("keystatuseschange", d);
|
|
12791
|
-
const f = new Promise((g,
|
|
12792
|
-
h.on("error",
|
|
12793
|
-
|
|
12791
|
+
const f = new Promise((g, p) => {
|
|
12792
|
+
h.on("error", p), h.on("keyStatus", (E) => {
|
|
12793
|
+
E.startsWith("usable") ? g() : E === "output-restricted" ? p(new xe({
|
|
12794
12794
|
type: U.KEY_SYSTEM_ERROR,
|
|
12795
|
-
details:
|
|
12795
|
+
details: b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,
|
|
12796
12796
|
fatal: !1
|
|
12797
|
-
}, "HDCP level output restricted")) :
|
|
12797
|
+
}, "HDCP level output restricted")) : E === "internal-error" ? p(new xe({
|
|
12798
12798
|
type: U.KEY_SYSTEM_ERROR,
|
|
12799
|
-
details:
|
|
12799
|
+
details: b.KEY_SYSTEM_STATUS_INTERNAL_ERROR,
|
|
12800
12800
|
fatal: !0
|
|
12801
|
-
}, `key status changed to "${
|
|
12801
|
+
}, `key status changed to "${E}"`)) : E === "expired" ? p(new Error("key expired while generating request")) : this.warn(`unhandled key status change "${E}"`);
|
|
12802
12802
|
});
|
|
12803
12803
|
});
|
|
12804
12804
|
return e.mediaKeysSession.generateRequest(t, s).then(() => {
|
|
@@ -12807,7 +12807,7 @@ class ct extends Ge {
|
|
|
12807
12807
|
}).catch((g) => {
|
|
12808
12808
|
throw new xe({
|
|
12809
12809
|
type: U.KEY_SYSTEM_ERROR,
|
|
12810
|
-
details:
|
|
12810
|
+
details: b.KEY_SYSTEM_NO_SESSION,
|
|
12811
12811
|
error: g,
|
|
12812
12812
|
fatal: !1
|
|
12813
12813
|
}, `Error generating key-session request: ${g}`);
|
|
@@ -12837,13 +12837,13 @@ class ct extends Ge {
|
|
|
12837
12837
|
retryDelay: 0,
|
|
12838
12838
|
maxRetryDelay: 0
|
|
12839
12839
|
}, u = {
|
|
12840
|
-
onSuccess: (d, f, g,
|
|
12840
|
+
onSuccess: (d, f, g, p) => {
|
|
12841
12841
|
n(d.data);
|
|
12842
12842
|
},
|
|
12843
|
-
onError: (d, f, g,
|
|
12843
|
+
onError: (d, f, g, p) => {
|
|
12844
12844
|
o(new xe({
|
|
12845
12845
|
type: U.KEY_SYSTEM_ERROR,
|
|
12846
|
-
details:
|
|
12846
|
+
details: b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,
|
|
12847
12847
|
fatal: !0,
|
|
12848
12848
|
networkDetails: g,
|
|
12849
12849
|
response: te({
|
|
@@ -12855,7 +12855,7 @@ class ct extends Ge {
|
|
|
12855
12855
|
onTimeout: (d, f, g) => {
|
|
12856
12856
|
o(new xe({
|
|
12857
12857
|
type: U.KEY_SYSTEM_ERROR,
|
|
12858
|
-
details:
|
|
12858
|
+
details: b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,
|
|
12859
12859
|
fatal: !0,
|
|
12860
12860
|
networkDetails: g,
|
|
12861
12861
|
response: {
|
|
@@ -12878,7 +12878,7 @@ class ct extends Ge {
|
|
|
12878
12878
|
}).catch((n) => {
|
|
12879
12879
|
r(new xe({
|
|
12880
12880
|
type: U.KEY_SYSTEM_ERROR,
|
|
12881
|
-
details:
|
|
12881
|
+
details: b.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,
|
|
12882
12882
|
error: n,
|
|
12883
12883
|
fatal: !0
|
|
12884
12884
|
}, n.message));
|
|
@@ -12889,7 +12889,7 @@ class ct extends Ge {
|
|
|
12889
12889
|
return this.requestLicense(e, new Uint8Array(t)).then((s) => this.updateKeySession(e, new Uint8Array(s)).catch((i) => {
|
|
12890
12890
|
throw new xe({
|
|
12891
12891
|
type: U.KEY_SYSTEM_ERROR,
|
|
12892
|
-
details:
|
|
12892
|
+
details: b.KEY_SYSTEM_SESSION_UPDATE_FAILED,
|
|
12893
12893
|
error: i,
|
|
12894
12894
|
fatal: !0
|
|
12895
12895
|
}, i.message);
|
|
@@ -12959,7 +12959,7 @@ class ct extends Ge {
|
|
|
12959
12959
|
if (this._requestLicenseFailureCount++, this._requestLicenseFailureCount > l || o.status >= 400 && o.status < 500)
|
|
12960
12960
|
r(new xe({
|
|
12961
12961
|
type: U.KEY_SYSTEM_ERROR,
|
|
12962
|
-
details:
|
|
12962
|
+
details: b.KEY_SYSTEM_LICENSE_REQUEST_FAILED,
|
|
12963
12963
|
fatal: !0,
|
|
12964
12964
|
networkDetails: o,
|
|
12965
12965
|
response: {
|
|
@@ -13001,7 +13001,7 @@ class ct extends Ge {
|
|
|
13001
13001
|
var n;
|
|
13002
13002
|
this.log(`Could not clear media keys: ${r}`), (n = this.hls) == null || n.trigger(m.ERROR, {
|
|
13003
13003
|
type: U.OTHER_ERROR,
|
|
13004
|
-
details:
|
|
13004
|
+
details: b.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,
|
|
13005
13005
|
fatal: !1,
|
|
13006
13006
|
error: new Error(`Could not clear media keys: ${r}`)
|
|
13007
13007
|
});
|
|
@@ -13011,7 +13011,7 @@ class ct extends Ge {
|
|
|
13011
13011
|
var n;
|
|
13012
13012
|
this.log(`Could not close sessions and clear media keys: ${r}`), (n = this.hls) == null || n.trigger(m.ERROR, {
|
|
13013
13013
|
type: U.OTHER_ERROR,
|
|
13014
|
-
details:
|
|
13014
|
+
details: b.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
|
|
13015
13015
|
fatal: !1,
|
|
13016
13016
|
error: new Error(`Could not close sessions and clear media keys: ${r}`)
|
|
13017
13017
|
});
|
|
@@ -13046,7 +13046,7 @@ class ct extends Ge {
|
|
|
13046
13046
|
var c;
|
|
13047
13047
|
this.log(`Could not remove session: ${o}`), (c = this.hls) == null || c.trigger(m.ERROR, {
|
|
13048
13048
|
type: U.OTHER_ERROR,
|
|
13049
|
-
details:
|
|
13049
|
+
details: b.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,
|
|
13050
13050
|
fatal: !1,
|
|
13051
13051
|
error: new Error(`Could not remove session: ${o}`)
|
|
13052
13052
|
});
|
|
@@ -13054,7 +13054,7 @@ class ct extends Ge {
|
|
|
13054
13054
|
var c;
|
|
13055
13055
|
this.log(`Could not close session: ${o}`), (c = this.hls) == null || c.trigger(m.ERROR, {
|
|
13056
13056
|
type: U.OTHER_ERROR,
|
|
13057
|
-
details:
|
|
13057
|
+
details: b.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
|
|
13058
13058
|
fatal: !1,
|
|
13059
13059
|
error: new Error(`Could not close session: ${o}`)
|
|
13060
13060
|
});
|
|
@@ -13324,7 +13324,7 @@ class hh extends Si {
|
|
|
13324
13324
|
const t = this.tracksInGroup, s = this.selectDefaultTrack;
|
|
13325
13325
|
for (let i = 0; i < t.length; i++) {
|
|
13326
13326
|
const r = t[i];
|
|
13327
|
-
if (!(s && !r.default || !s && !e) && (!e ||
|
|
13327
|
+
if (!(s && !r.default || !s && !e) && (!e || et(r, e)))
|
|
13328
13328
|
return i;
|
|
13329
13329
|
}
|
|
13330
13330
|
if (e) {
|
|
@@ -13376,7 +13376,7 @@ class hh extends Si {
|
|
|
13376
13376
|
const t = this.allSubtitleTracks;
|
|
13377
13377
|
if (this.selectDefaultTrack = !1, t.length) {
|
|
13378
13378
|
const s = this.currentTrack;
|
|
13379
|
-
if (s &&
|
|
13379
|
+
if (s && et(e, s))
|
|
13380
13380
|
return s;
|
|
13381
13381
|
const i = ke(e, this.tracksInGroup);
|
|
13382
13382
|
if (i > -1) {
|
|
@@ -13864,9 +13864,9 @@ class mh extends Ge {
|
|
|
13864
13864
|
if (g && !d)
|
|
13865
13865
|
return -1;
|
|
13866
13866
|
if (!u && !f && !d && !g) {
|
|
13867
|
-
const
|
|
13868
|
-
if (
|
|
13869
|
-
return
|
|
13867
|
+
const p = l.startTime, E = h.startTime;
|
|
13868
|
+
if (p !== E)
|
|
13869
|
+
return p - E;
|
|
13870
13870
|
}
|
|
13871
13871
|
return l.dateRange.tagOrder - h.dateRange.tagOrder;
|
|
13872
13872
|
}), this.events = n, c.forEach((l) => {
|
|
@@ -13898,10 +13898,10 @@ class mh extends Ge {
|
|
|
13898
13898
|
this.resolveOffsets(e, t);
|
|
13899
13899
|
let c = 0, l = 0;
|
|
13900
13900
|
if (e.forEach((h, u) => {
|
|
13901
|
-
const d = h.cue.pre, f = h.cue.post, g = e[u - 1] || null,
|
|
13902
|
-
let _ =
|
|
13903
|
-
if (d || !f &&
|
|
13904
|
-
const
|
|
13901
|
+
const d = h.cue.pre, f = h.cue.post, g = e[u - 1] || null, p = h.appendInPlace, E = f ? r : h.startOffset, y = h.duration, S = h.timelineOccupancy === ls.Range ? y : 0, T = h.resumptionOffset, x = (g == null ? void 0 : g.startTime) === E, A = E + h.cumulativeDuration;
|
|
13902
|
+
let _ = p ? A + y : E + T;
|
|
13903
|
+
if (d || !f && E <= 0) {
|
|
13904
|
+
const R = l;
|
|
13905
13905
|
l += S, h.timelineStart = A;
|
|
13906
13906
|
const D = n;
|
|
13907
13907
|
n += y, s.push({
|
|
@@ -13913,13 +13913,13 @@ class mh extends Ge {
|
|
|
13913
13913
|
end: n
|
|
13914
13914
|
},
|
|
13915
13915
|
integrated: {
|
|
13916
|
-
start:
|
|
13916
|
+
start: R,
|
|
13917
13917
|
end: l
|
|
13918
13918
|
}
|
|
13919
13919
|
});
|
|
13920
|
-
} else if (
|
|
13920
|
+
} else if (E <= r) {
|
|
13921
13921
|
if (!x) {
|
|
13922
|
-
const L =
|
|
13922
|
+
const L = E - c;
|
|
13923
13923
|
if (L > Pr) {
|
|
13924
13924
|
const P = c, O = l;
|
|
13925
13925
|
l += L;
|
|
@@ -13940,10 +13940,10 @@ class mh extends Ge {
|
|
|
13940
13940
|
}
|
|
13941
13941
|
};
|
|
13942
13942
|
s.push(V);
|
|
13943
|
-
} else L > 0 && g && (g.cumulativeDuration += L, s[s.length - 1].end =
|
|
13943
|
+
} else L > 0 && g && (g.cumulativeDuration += L, s[s.length - 1].end = E);
|
|
13944
13944
|
}
|
|
13945
13945
|
f && (_ = A), h.timelineStart = A;
|
|
13946
|
-
const
|
|
13946
|
+
const R = l;
|
|
13947
13947
|
l += S;
|
|
13948
13948
|
const D = n;
|
|
13949
13949
|
n += y, s.push({
|
|
@@ -13955,7 +13955,7 @@ class mh extends Ge {
|
|
|
13955
13955
|
end: n
|
|
13956
13956
|
},
|
|
13957
13957
|
integrated: {
|
|
13958
|
-
start:
|
|
13958
|
+
start: R,
|
|
13959
13959
|
end: l
|
|
13960
13960
|
}
|
|
13961
13961
|
});
|
|
@@ -14013,7 +14013,7 @@ class mh extends Ge {
|
|
|
14013
14013
|
let r = 0, n = -1;
|
|
14014
14014
|
e.forEach((o, c) => {
|
|
14015
14015
|
const l = o.cue.pre, h = o.cue.post, u = l ? 0 : h ? i : o.startTime;
|
|
14016
|
-
this.updateAssetDurations(o), n === u ? o.cumulativeDuration = r : (r = 0, n = u), !h && o.snapOptions.in && (o.resumeAnchor =
|
|
14016
|
+
this.updateAssetDurations(o), n === u ? o.cumulativeDuration = r : (r = 0, n = u), !h && o.snapOptions.in && (o.resumeAnchor = tt(null, s.fragments, o.startOffset + o.resumptionOffset, 0, 0) || void 0), o.appendInPlace && !o.appendInPlaceStarted && (this.primaryCanResumeInPlaceAt(o, t) || (o.appendInPlace = !1)), !o.appendInPlace && c + 1 < e.length && e[c + 1].startTime - e[c].resumeTime < Pr && (e[c + 1].appendInPlace = !1, e[c + 1].appendInPlace && this.warn(`Could not change append strategy for abutting event ${o}`));
|
|
14017
14017
|
const f = F(o.resumeOffset) ? o.resumeOffset : o.duration;
|
|
14018
14018
|
r += f;
|
|
14019
14019
|
});
|
|
@@ -14024,7 +14024,7 @@ class mh extends Ge {
|
|
|
14024
14024
|
const o = t[n].details, c = o.edge;
|
|
14025
14025
|
if (s >= c)
|
|
14026
14026
|
return this.log(`"${e.identifier}" resumption ${s} past ${n} playlist end ${c}`), !1;
|
|
14027
|
-
const l =
|
|
14027
|
+
const l = tt(null, o.fragments, s);
|
|
14028
14028
|
if (!l)
|
|
14029
14029
|
return this.log(`"${e.identifier}" resumption ${s} does not align with any fragments in ${n} playlist (${o.fragStart}-${o.fragmentEnd})`), !0;
|
|
14030
14030
|
const h = n === "audio" ? 0.175 : 0;
|
|
@@ -14063,7 +14063,7 @@ class ph {
|
|
|
14063
14063
|
try {
|
|
14064
14064
|
i = sa(s, this.hls.sessionId, e.baseUrl);
|
|
14065
14065
|
} catch (d) {
|
|
14066
|
-
const f = this.assignAssetListError(e,
|
|
14066
|
+
const f = this.assignAssetListError(e, b.ASSET_LIST_LOAD_ERROR, d, s);
|
|
14067
14067
|
this.hls.trigger(m.ERROR, f);
|
|
14068
14068
|
return;
|
|
14069
14069
|
}
|
|
@@ -14078,26 +14078,26 @@ class ph {
|
|
|
14078
14078
|
retryDelay: 0,
|
|
14079
14079
|
maxRetryDelay: 0
|
|
14080
14080
|
}, u = {
|
|
14081
|
-
onSuccess: (d, f, g,
|
|
14082
|
-
const
|
|
14081
|
+
onSuccess: (d, f, g, p) => {
|
|
14082
|
+
const E = d.data, y = E == null ? void 0 : E.ASSETS;
|
|
14083
14083
|
if (!Array.isArray(y)) {
|
|
14084
|
-
const S = this.assignAssetListError(e,
|
|
14084
|
+
const S = this.assignAssetListError(e, b.ASSET_LIST_PARSING_ERROR, new Error("Invalid interstitial asset list"), g.url, f, p);
|
|
14085
14085
|
this.hls.trigger(m.ERROR, S);
|
|
14086
14086
|
return;
|
|
14087
14087
|
}
|
|
14088
|
-
e.assetListResponse =
|
|
14088
|
+
e.assetListResponse = E, this.hls.trigger(m.ASSET_LIST_LOADED, {
|
|
14089
14089
|
event: e,
|
|
14090
|
-
assetListResponse:
|
|
14091
|
-
networkDetails:
|
|
14090
|
+
assetListResponse: E,
|
|
14091
|
+
networkDetails: p
|
|
14092
14092
|
});
|
|
14093
14093
|
},
|
|
14094
|
-
onError: (d, f, g,
|
|
14095
|
-
const
|
|
14096
|
-
this.hls.trigger(m.ERROR,
|
|
14094
|
+
onError: (d, f, g, p) => {
|
|
14095
|
+
const E = this.assignAssetListError(e, b.ASSET_LIST_LOAD_ERROR, new Error(`Error loading X-ASSET-LIST: HTTP status ${d.code} ${d.text} (${f.url})`), f.url, p, g);
|
|
14096
|
+
this.hls.trigger(m.ERROR, E);
|
|
14097
14097
|
},
|
|
14098
14098
|
onTimeout: (d, f, g) => {
|
|
14099
|
-
const
|
|
14100
|
-
this.hls.trigger(m.ERROR,
|
|
14099
|
+
const p = this.assignAssetListError(e, b.ASSET_LIST_LOAD_TIMEOUT, new Error(`Timeout loading X-ASSET-LIST (${f.url})`), f.url, d, g);
|
|
14100
|
+
this.hls.trigger(m.ERROR, p);
|
|
14101
14101
|
}
|
|
14102
14102
|
};
|
|
14103
14103
|
return o.load(c, h, u), this.hls.trigger(m.ASSET_LIST_LOADING, {
|
|
@@ -14199,12 +14199,12 @@ class Eh extends Ge {
|
|
|
14199
14199
|
if (u && this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
14200
14200
|
Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`), this.playerQueue.forEach((f) => {
|
|
14201
14201
|
if (f.interstitial.appendInPlace) {
|
|
14202
|
-
const g = f.assetItem.timelineStart,
|
|
14203
|
-
if (
|
|
14202
|
+
const g = f.assetItem.timelineStart, p = f.timelineOffset - g;
|
|
14203
|
+
if (p)
|
|
14204
14204
|
try {
|
|
14205
14205
|
f.timelineOffset = g;
|
|
14206
|
-
} catch (
|
|
14207
|
-
Math.abs(
|
|
14206
|
+
} catch (E) {
|
|
14207
|
+
Math.abs(p) > ht && this.warn(`${E} ("${f.assetId}" ${f.timelineOffset}->${g})`);
|
|
14208
14208
|
}
|
|
14209
14209
|
}
|
|
14210
14210
|
}), n) {
|
|
@@ -14295,29 +14295,29 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14295
14295
|
if (!this.manager) {
|
|
14296
14296
|
if (!this.hls)
|
|
14297
14297
|
return null;
|
|
14298
|
-
const e = this, t = () => e.bufferingItem || e.waitingItem, s = (u) => u && e.getAssetPlayer(u.identifier), i = (u, d, f, g,
|
|
14298
|
+
const e = this, t = () => e.bufferingItem || e.waitingItem, s = (u) => u && e.getAssetPlayer(u.identifier), i = (u, d, f, g, p) => {
|
|
14299
14299
|
if (u) {
|
|
14300
|
-
let
|
|
14300
|
+
let E = u[d].start;
|
|
14301
14301
|
const y = u.event;
|
|
14302
14302
|
if (y) {
|
|
14303
14303
|
if (d === "playout" || y.timelineOccupancy !== ls.Point) {
|
|
14304
14304
|
const S = s(f);
|
|
14305
|
-
(S == null ? void 0 : S.interstitial) === y && (
|
|
14305
|
+
(S == null ? void 0 : S.interstitial) === y && (E += S.assetItem.startOffset + S[p]);
|
|
14306
14306
|
}
|
|
14307
14307
|
} else {
|
|
14308
14308
|
const S = g === "bufferedPos" ? n() : e[g];
|
|
14309
|
-
|
|
14309
|
+
E += S - u.start;
|
|
14310
14310
|
}
|
|
14311
|
-
return
|
|
14311
|
+
return E;
|
|
14312
14312
|
}
|
|
14313
14313
|
return 0;
|
|
14314
14314
|
}, r = (u, d) => {
|
|
14315
14315
|
if (u !== 0 && d !== "primary" && e.schedule.length) {
|
|
14316
14316
|
var f;
|
|
14317
|
-
const g = e.schedule.findItemIndexAtTime(u),
|
|
14318
|
-
if (
|
|
14319
|
-
const
|
|
14320
|
-
return u +
|
|
14317
|
+
const g = e.schedule.findItemIndexAtTime(u), p = (f = e.schedule.items) == null ? void 0 : f[g];
|
|
14318
|
+
if (p) {
|
|
14319
|
+
const E = p[d].start - p.start;
|
|
14320
|
+
return u + E;
|
|
14321
14321
|
}
|
|
14322
14322
|
}
|
|
14323
14323
|
return u;
|
|
@@ -14329,33 +14329,33 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14329
14329
|
return (d = e.primaryDetails) != null && d.live ? e.primaryDetails.edge : e.schedule.durations[u];
|
|
14330
14330
|
}, c = (u, d) => {
|
|
14331
14331
|
var f, g;
|
|
14332
|
-
const
|
|
14333
|
-
if (
|
|
14332
|
+
const p = e.effectivePlayingItem;
|
|
14333
|
+
if (p != null && (f = p.event) != null && f.restrictions.skip)
|
|
14334
14334
|
return;
|
|
14335
14335
|
e.log(`seek to ${u} "${d}"`);
|
|
14336
|
-
const
|
|
14337
|
-
if (
|
|
14338
|
-
const
|
|
14336
|
+
const E = e.effectivePlayingItem, y = e.schedule.findItemIndexAtTime(u, d), S = (g = e.schedule.items) == null ? void 0 : g[y], T = e.getBufferingPlayer(), x = T == null ? void 0 : T.interstitial, A = x == null ? void 0 : x.appendInPlace, _ = E && e.itemsMatch(E, S);
|
|
14337
|
+
if (E && (A || _)) {
|
|
14338
|
+
const R = s(e.playingAsset), D = (R == null ? void 0 : R.media) || e.primaryMedia;
|
|
14339
14339
|
if (D) {
|
|
14340
|
-
const L = d === "primary" ? D.currentTime : i(
|
|
14341
|
-
if (O >= 0 && (!
|
|
14340
|
+
const L = d === "primary" ? D.currentTime : i(E, d, e.playingAsset, "timelinePos", "currentTime"), P = u - L, O = (A ? L : D.currentTime) + P;
|
|
14341
|
+
if (O >= 0 && (!R || A || O <= R.duration)) {
|
|
14342
14342
|
D.currentTime = O;
|
|
14343
14343
|
return;
|
|
14344
14344
|
}
|
|
14345
14345
|
}
|
|
14346
14346
|
}
|
|
14347
14347
|
if (S) {
|
|
14348
|
-
let
|
|
14348
|
+
let R = u;
|
|
14349
14349
|
if (d !== "primary") {
|
|
14350
14350
|
const L = S[d].start, P = u - L;
|
|
14351
|
-
|
|
14351
|
+
R = S.start + P;
|
|
14352
14352
|
}
|
|
14353
14353
|
const D = !e.isInterstitial(S);
|
|
14354
|
-
if ((!e.isInterstitial(
|
|
14354
|
+
if ((!e.isInterstitial(E) || E.event.appendInPlace) && (D || S.event.appendInPlace)) {
|
|
14355
14355
|
const L = e.media || (A ? T == null ? void 0 : T.media : null);
|
|
14356
|
-
L && (L.currentTime =
|
|
14357
|
-
} else if (
|
|
14358
|
-
const L = e.findItemIndex(
|
|
14356
|
+
L && (L.currentTime = R);
|
|
14357
|
+
} else if (E) {
|
|
14358
|
+
const L = e.findItemIndex(E);
|
|
14359
14359
|
if (y > L) {
|
|
14360
14360
|
const O = e.schedule.findJumpRestrictedIndex(L + 1, y);
|
|
14361
14361
|
if (O > L) {
|
|
@@ -14365,7 +14365,7 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14365
14365
|
}
|
|
14366
14366
|
let P = 0;
|
|
14367
14367
|
if (D)
|
|
14368
|
-
e.timelinePos =
|
|
14368
|
+
e.timelinePos = R, e.checkBuffer();
|
|
14369
14369
|
else {
|
|
14370
14370
|
var v;
|
|
14371
14371
|
const O = S == null || (v = S.event) == null ? void 0 : v.assetList;
|
|
@@ -14577,8 +14577,8 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14577
14577
|
const f = this.playerQueue;
|
|
14578
14578
|
f.length > 1 && f.forEach((g) => {
|
|
14579
14579
|
if (o && g.interstitial.appendInPlace !== c) {
|
|
14580
|
-
const
|
|
14581
|
-
this.clearInterstitial(g.interstitial, null),
|
|
14580
|
+
const p = g.interstitial;
|
|
14581
|
+
this.clearInterstitial(g.interstitial, null), p.appendInPlace = !1, p.appendInPlace && this.warn(`Could not change append strategy for queued assets ${p}`);
|
|
14582
14582
|
}
|
|
14583
14583
|
}), this.hls.detachMedia(), this.detachedData = {
|
|
14584
14584
|
media: t
|
|
@@ -15080,12 +15080,12 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15080
15080
|
})), this.getAssetPlayer(u) && this.warn(`Duplicate date range identifier ${e} and asset ${u}`);
|
|
15081
15081
|
const g = new gh(this.HlsPlayerClass, d, e, t);
|
|
15082
15082
|
this.playerQueue.push(g), e.assetList[s] = t;
|
|
15083
|
-
const
|
|
15083
|
+
const p = (T) => {
|
|
15084
15084
|
if (T.live) {
|
|
15085
15085
|
const _ = new Error(`Interstitials MUST be VOD assets ${e}`), v = {
|
|
15086
15086
|
fatal: !0,
|
|
15087
15087
|
type: U.OTHER_ERROR,
|
|
15088
|
-
details:
|
|
15088
|
+
details: b.INTERSTITIAL_ASSET_ITEM_ERROR,
|
|
15089
15089
|
error: _
|
|
15090
15090
|
};
|
|
15091
15091
|
this.handleAssetItemError(v, e, this.schedule.findEventIndex(e.identifier), s, _.message);
|
|
@@ -15096,27 +15096,27 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15096
15096
|
};
|
|
15097
15097
|
g.on(m.LEVEL_UPDATED, (T, {
|
|
15098
15098
|
details: x
|
|
15099
|
-
}) =>
|
|
15099
|
+
}) => p(x)), g.on(m.LEVEL_PTS_UPDATED, (T, {
|
|
15100
15100
|
details: x
|
|
15101
|
-
}) =>
|
|
15102
|
-
const
|
|
15101
|
+
}) => p(x));
|
|
15102
|
+
const E = (T, x) => {
|
|
15103
15103
|
const A = this.getAssetPlayer(u);
|
|
15104
15104
|
if (A && x.tracks) {
|
|
15105
|
-
A.off(m.BUFFER_CODECS,
|
|
15105
|
+
A.off(m.BUFFER_CODECS, E), A.tracks = x.tracks;
|
|
15106
15106
|
const _ = this.primaryMedia;
|
|
15107
15107
|
this.bufferingAsset === A.assetItem && _ && !A.media && this.bufferAssetPlayer(A, _);
|
|
15108
15108
|
}
|
|
15109
15109
|
};
|
|
15110
|
-
g.on(m.BUFFER_CODECS,
|
|
15110
|
+
g.on(m.BUFFER_CODECS, E);
|
|
15111
15111
|
const y = () => {
|
|
15112
15112
|
var T;
|
|
15113
15113
|
const x = this.getAssetPlayer(u);
|
|
15114
15114
|
if (this.log(`buffered to end of asset ${x}`), !x)
|
|
15115
15115
|
return;
|
|
15116
|
-
const A = this.schedule.findEventIndex(e.identifier), _ = e.findAssetIndex(t), v = _ + 1,
|
|
15117
|
-
if (this.isInterstitial(
|
|
15116
|
+
const A = this.schedule.findEventIndex(e.identifier), _ = e.findAssetIndex(t), v = _ + 1, R = (T = this.schedule.items) == null ? void 0 : T[A];
|
|
15117
|
+
if (this.isInterstitial(R))
|
|
15118
15118
|
if (_ !== -1 && !e.isAssetPastPlayoutLimit(v) && !e.assetList[v].error)
|
|
15119
|
-
this.bufferedToItem(
|
|
15119
|
+
this.bufferedToItem(R, v);
|
|
15120
15120
|
else {
|
|
15121
15121
|
var D;
|
|
15122
15122
|
const L = (D = this.schedule.items) == null ? void 0 : D[A + 1];
|
|
@@ -15133,7 +15133,7 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15133
15133
|
};
|
|
15134
15134
|
return g.once(m.MEDIA_ENDED, S(s)), g.once(m.PLAYOUT_LIMIT_REACHED, S(1 / 0)), g.on(m.ERROR, (T, x) => {
|
|
15135
15135
|
const A = this.getAssetPlayer(u);
|
|
15136
|
-
if (x.details ===
|
|
15136
|
+
if (x.details === b.BUFFER_STALLED_ERROR) {
|
|
15137
15137
|
if (A != null && A.media) {
|
|
15138
15138
|
const _ = A.currentTime, v = A.duration - _;
|
|
15139
15139
|
_ && e.appendInPlace && v / A.media.playbackRate < 0.5 ? (this.log(`Advancing buffer past end of asset ${u} ${e} at ${A.media.currentTime}`), y()) : (this.warn(`Stalled at ${_} of ${_ + v} in asset ${u} ${e}`), this.onTimeupdate(), this.checkBuffer(!0));
|
|
@@ -15147,7 +15147,7 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15147
15147
|
const x = new Error(`Asset player destroyed unexpectedly ${u}`), A = {
|
|
15148
15148
|
fatal: !0,
|
|
15149
15149
|
type: U.OTHER_ERROR,
|
|
15150
|
-
details:
|
|
15150
|
+
details: b.INTERSTITIAL_ASSET_ITEM_ERROR,
|
|
15151
15151
|
error: x
|
|
15152
15152
|
};
|
|
15153
15153
|
this.handleAssetItemError(A, e, this.schedule.findEventIndex(e.identifier), s, x.message);
|
|
@@ -15216,17 +15216,17 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15216
15216
|
const f = new Error(`Asset "${o}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(d)}')`), g = {
|
|
15217
15217
|
fatal: !0,
|
|
15218
15218
|
type: U.OTHER_ERROR,
|
|
15219
|
-
details:
|
|
15219
|
+
details: b.INTERSTITIAL_ASSET_ITEM_ERROR,
|
|
15220
15220
|
error: f
|
|
15221
|
-
},
|
|
15222
|
-
this.handleAssetItemError(g, r, c,
|
|
15221
|
+
}, p = r.findAssetIndex(n);
|
|
15222
|
+
this.handleAssetItemError(g, r, c, p, f.message);
|
|
15223
15223
|
return;
|
|
15224
15224
|
}
|
|
15225
15225
|
}
|
|
15226
15226
|
this.transferMediaTo(e, t);
|
|
15227
15227
|
}
|
|
15228
15228
|
handleAssetItemError(e, t, s, i, r) {
|
|
15229
|
-
if (e.details ===
|
|
15229
|
+
if (e.details === b.BUFFER_STALLED_ERROR)
|
|
15230
15230
|
return;
|
|
15231
15231
|
const n = t.assetList[i] || null;
|
|
15232
15232
|
let o = null;
|
|
@@ -15273,39 +15273,39 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15273
15273
|
return;
|
|
15274
15274
|
const o = i.timelineStart, c = i.duration;
|
|
15275
15275
|
let l = 0;
|
|
15276
|
-
n.forEach((g,
|
|
15277
|
-
const
|
|
15278
|
-
this.createAsset(i,
|
|
15276
|
+
n.forEach((g, p) => {
|
|
15277
|
+
const E = parseFloat(g.DURATION);
|
|
15278
|
+
this.createAsset(i, p, l, o + l, E, g.URI), l += E;
|
|
15279
15279
|
}), i.duration = l, this.log(`Loaded asset-list with duration: ${l} (was: ${c}) ${i}`);
|
|
15280
15280
|
const h = this.waitingItem, u = (h == null ? void 0 : h.event.identifier) === r;
|
|
15281
15281
|
this.updateSchedule();
|
|
15282
15282
|
const d = (s = this.bufferingItem) == null ? void 0 : s.event;
|
|
15283
15283
|
if (u) {
|
|
15284
15284
|
var f;
|
|
15285
|
-
const g = this.schedule.findEventIndex(r),
|
|
15286
|
-
if (
|
|
15287
|
-
if (!this.playingItem && this.timelinePos >
|
|
15285
|
+
const g = this.schedule.findEventIndex(r), p = (f = this.schedule.items) == null ? void 0 : f[g];
|
|
15286
|
+
if (p) {
|
|
15287
|
+
if (!this.playingItem && this.timelinePos > p.end && this.schedule.findItemIndexAtTime(this.timelinePos) !== g) {
|
|
15288
15288
|
i.error = new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`), this.primaryFallback(i);
|
|
15289
15289
|
return;
|
|
15290
15290
|
}
|
|
15291
|
-
this.setBufferingItem(
|
|
15291
|
+
this.setBufferingItem(p);
|
|
15292
15292
|
}
|
|
15293
15293
|
this.setSchedulePosition(g);
|
|
15294
15294
|
} else if ((d == null ? void 0 : d.identifier) === r && d.appendInPlace) {
|
|
15295
|
-
const g = i.assetList[0],
|
|
15296
|
-
g &&
|
|
15295
|
+
const g = i.assetList[0], p = this.getAssetPlayer(g.identifier), E = this.primaryMedia;
|
|
15296
|
+
g && p && E && this.bufferAssetPlayer(p, E);
|
|
15297
15297
|
}
|
|
15298
15298
|
}
|
|
15299
15299
|
onError(e, t) {
|
|
15300
15300
|
switch (t.details) {
|
|
15301
|
-
case
|
|
15302
|
-
case
|
|
15303
|
-
case
|
|
15301
|
+
case b.ASSET_LIST_PARSING_ERROR:
|
|
15302
|
+
case b.ASSET_LIST_LOAD_ERROR:
|
|
15303
|
+
case b.ASSET_LIST_LOAD_TIMEOUT: {
|
|
15304
15304
|
const s = t.interstitial;
|
|
15305
15305
|
s && this.primaryFallback(s);
|
|
15306
15306
|
break;
|
|
15307
15307
|
}
|
|
15308
|
-
case
|
|
15308
|
+
case b.BUFFER_STALLED_ERROR: {
|
|
15309
15309
|
this.onTimeupdate(), this.checkBuffer(!0);
|
|
15310
15310
|
break;
|
|
15311
15311
|
}
|
|
@@ -15395,7 +15395,7 @@ class yh extends di {
|
|
|
15395
15395
|
// If something goes wrong, proceed to next frag, if we were processing one.
|
|
15396
15396
|
onError(e, t) {
|
|
15397
15397
|
const s = t.frag;
|
|
15398
|
-
(s == null ? void 0 : s.type) === N.SUBTITLE && (t.details ===
|
|
15398
|
+
(s == null ? void 0 : s.type) === N.SUBTITLE && (t.details === b.FRAG_GAP && this.fragmentTracker.fragBuffered(s, !0), this.fragCurrent && this.fragCurrent.abortRequests(), this.state !== C.STOPPED && (this.state = C.IDLE));
|
|
15399
15399
|
}
|
|
15400
15400
|
// Got all new subtitle levels.
|
|
15401
15401
|
onSubtitleTracksUpdated(e, {
|
|
@@ -15454,7 +15454,7 @@ class yh extends di {
|
|
|
15454
15454
|
details: n,
|
|
15455
15455
|
id: o,
|
|
15456
15456
|
groupId: t.groupId
|
|
15457
|
-
}), this.tick(), n.live && !this.fragCurrent && this.media && this.state === C.IDLE && (
|
|
15457
|
+
}), this.tick(), n.live && !this.fragCurrent && this.media && this.state === C.IDLE && (tt(null, n.fragments, this.media.currentTime, 0) || (this.warn("Subtitle playlist not aligned with playback"), c.details = void 0)));
|
|
15458
15458
|
}
|
|
15459
15459
|
_handleFragmentLoadComplete(e) {
|
|
15460
15460
|
const {
|
|
@@ -15466,7 +15466,7 @@ class yh extends di {
|
|
|
15466
15466
|
this.decrypter.decrypt(new Uint8Array(s), i.key.buffer, i.iv.buffer, hi(i.method)).catch((o) => {
|
|
15467
15467
|
throw r.trigger(m.ERROR, {
|
|
15468
15468
|
type: U.MEDIA_ERROR,
|
|
15469
|
-
details:
|
|
15469
|
+
details: b.FRAG_DECRYPT_ERROR,
|
|
15470
15470
|
fatal: !1,
|
|
15471
15471
|
error: o,
|
|
15472
15472
|
reason: o.message,
|
|
@@ -15509,15 +15509,15 @@ class yh extends di {
|
|
|
15509
15509
|
return;
|
|
15510
15510
|
const u = l.fragments, d = u.length, f = l.edge;
|
|
15511
15511
|
let g = null;
|
|
15512
|
-
const
|
|
15512
|
+
const p = this.fragPrevious;
|
|
15513
15513
|
if (o < f) {
|
|
15514
15514
|
const S = i.maxFragLookUpTolerance, T = o > f - S ? 0 : S;
|
|
15515
|
-
g =
|
|
15515
|
+
g = tt(p, u, Math.max(u[0].start, o), T), !g && p && p.start < u[0].start && (g = u[0]);
|
|
15516
15516
|
} else
|
|
15517
15517
|
g = u[d - 1];
|
|
15518
15518
|
if (g = this.filterReplacedPrimary(g, s.details), !g)
|
|
15519
15519
|
return;
|
|
15520
|
-
const
|
|
15520
|
+
const E = g.sn - l.startSN, y = u[E - 1];
|
|
15521
15521
|
if (y && y.cc === g.cc && this.fragmentTracker.getState(y) === ce.NOT_LOADED && (g = y), this.fragmentTracker.getState(g) === ce.NOT_LOADED) {
|
|
15522
15522
|
const S = this.mapToInitFragWhenRequired(g);
|
|
15523
15523
|
S && this.loadFragment(S, s, o);
|
|
@@ -16320,7 +16320,7 @@ var Ai = function() {
|
|
|
16320
16320
|
enumerable: !0
|
|
16321
16321
|
};
|
|
16322
16322
|
h.hasBeenReset = !1;
|
|
16323
|
-
let d = "", f = !1, g = o,
|
|
16323
|
+
let d = "", f = !1, g = o, p = c, E = l, y = null, S = "", T = !0, x = "auto", A = "start", _ = 50, v = "middle", R = 50, D = "middle";
|
|
16324
16324
|
Object.defineProperty(h, "id", r({}, u, {
|
|
16325
16325
|
get: function() {
|
|
16326
16326
|
return d;
|
|
@@ -16346,19 +16346,19 @@ var Ai = function() {
|
|
|
16346
16346
|
}
|
|
16347
16347
|
})), Object.defineProperty(h, "endTime", r({}, u, {
|
|
16348
16348
|
get: function() {
|
|
16349
|
-
return
|
|
16349
|
+
return p;
|
|
16350
16350
|
},
|
|
16351
16351
|
set: function(L) {
|
|
16352
16352
|
if (typeof L != "number")
|
|
16353
16353
|
throw new TypeError("End time must be set to a number.");
|
|
16354
|
-
|
|
16354
|
+
p = L, this.hasBeenReset = !0;
|
|
16355
16355
|
}
|
|
16356
16356
|
})), Object.defineProperty(h, "text", r({}, u, {
|
|
16357
16357
|
get: function() {
|
|
16358
|
-
return
|
|
16358
|
+
return E;
|
|
16359
16359
|
},
|
|
16360
16360
|
set: function(L) {
|
|
16361
|
-
|
|
16361
|
+
E = "" + L, this.hasBeenReset = !0;
|
|
16362
16362
|
}
|
|
16363
16363
|
})), Object.defineProperty(h, "region", r({}, u, {
|
|
16364
16364
|
get: function() {
|
|
@@ -16424,12 +16424,12 @@ var Ai = function() {
|
|
|
16424
16424
|
}
|
|
16425
16425
|
})), Object.defineProperty(h, "size", r({}, u, {
|
|
16426
16426
|
get: function() {
|
|
16427
|
-
return
|
|
16427
|
+
return R;
|
|
16428
16428
|
},
|
|
16429
16429
|
set: function(L) {
|
|
16430
16430
|
if (L < 0 || L > 100)
|
|
16431
16431
|
throw new Error("Size must be between 0 and 100.");
|
|
16432
|
-
|
|
16432
|
+
R = L, this.hasBeenReset = !0;
|
|
16433
16433
|
}
|
|
16434
16434
|
})), Object.defineProperty(h, "align", r({}, u, {
|
|
16435
16435
|
get: function() {
|
|
@@ -16532,9 +16532,9 @@ function wh(a, e, t) {
|
|
|
16532
16532
|
let g;
|
|
16533
16533
|
switch (d) {
|
|
16534
16534
|
case "region":
|
|
16535
|
-
for (let
|
|
16536
|
-
if (t[
|
|
16537
|
-
l.set(d, t[
|
|
16535
|
+
for (let p = t.length - 1; p >= 0; p--)
|
|
16536
|
+
if (t[p].id === f) {
|
|
16537
|
+
l.set(d, t[p].region);
|
|
16538
16538
|
break;
|
|
16539
16539
|
}
|
|
16540
16540
|
break;
|
|
@@ -16702,8 +16702,8 @@ function Bh(a, e, t, s, i, r, n) {
|
|
|
16702
16702
|
const o = new Oh(), c = Se(new Uint8Array(a)).trim().replace(Fh, `
|
|
16703
16703
|
`).split(`
|
|
16704
16704
|
`), l = [], h = e ? sc(e.baseTime, e.timescale) : 0;
|
|
16705
|
-
let u = "00:00.000", d = 0, f = 0, g,
|
|
16706
|
-
o.oncue = function(
|
|
16705
|
+
let u = "00:00.000", d = 0, f = 0, g, p = !0;
|
|
16706
|
+
o.oncue = function(E) {
|
|
16707
16707
|
const y = t[s];
|
|
16708
16708
|
let S = t.ccOffset;
|
|
16709
16709
|
const T = (d - h) / 9e4;
|
|
@@ -16714,22 +16714,22 @@ function Bh(a, e, t, s, i, r, n) {
|
|
|
16714
16714
|
}
|
|
16715
16715
|
S = T - t.presentationOffset;
|
|
16716
16716
|
}
|
|
16717
|
-
const x =
|
|
16718
|
-
|
|
16719
|
-
const _ =
|
|
16720
|
-
|
|
16721
|
-
}, o.onparsingerror = function(
|
|
16722
|
-
g =
|
|
16717
|
+
const x = E.endTime - E.startTime, A = Ae((E.startTime + S - f) * 9e4, i * 9e4) / 9e4;
|
|
16718
|
+
E.startTime = Math.max(A, 0), E.endTime = Math.max(A + x, 0);
|
|
16719
|
+
const _ = E.text.trim();
|
|
16720
|
+
E.text = decodeURIComponent(encodeURIComponent(_)), E.id || (E.id = Li(E.startTime, E.endTime, _)), E.endTime > 0 && l.push(E);
|
|
16721
|
+
}, o.onparsingerror = function(E) {
|
|
16722
|
+
g = E;
|
|
16723
16723
|
}, o.onflush = function() {
|
|
16724
16724
|
if (g) {
|
|
16725
16725
|
n(g);
|
|
16726
16726
|
return;
|
|
16727
16727
|
}
|
|
16728
16728
|
r(l);
|
|
16729
|
-
}, c.forEach((
|
|
16730
|
-
if (
|
|
16731
|
-
if (ws(
|
|
16732
|
-
|
|
16729
|
+
}, c.forEach((E) => {
|
|
16730
|
+
if (p)
|
|
16731
|
+
if (ws(E, "X-TIMESTAMP-MAP=")) {
|
|
16732
|
+
p = !1, E.slice(16).split(",").forEach((y) => {
|
|
16733
16733
|
ws(y, "LOCAL:") ? u = y.slice(6) : ws(y, "MPEGTS:") && (d = parseInt(y.slice(7)));
|
|
16734
16734
|
});
|
|
16735
16735
|
try {
|
|
@@ -16738,8 +16738,8 @@ function Bh(a, e, t, s, i, r, n) {
|
|
|
16738
16738
|
g = y;
|
|
16739
16739
|
}
|
|
16740
16740
|
return;
|
|
16741
|
-
} else
|
|
16742
|
-
o.parse(
|
|
16741
|
+
} else E === "" && (p = !1);
|
|
16742
|
+
o.parse(E + `
|
|
16743
16743
|
`);
|
|
16744
16744
|
}), o.flush();
|
|
16745
16745
|
}
|
|
@@ -16778,24 +16778,24 @@ function $h(a, e) {
|
|
|
16778
16778
|
if (!d || !u.hasAttribute("begin"))
|
|
16779
16779
|
return null;
|
|
16780
16780
|
const f = Ns(u.getAttribute("begin"), n), g = Ns(u.getAttribute("dur"), n);
|
|
16781
|
-
let
|
|
16781
|
+
let p = Ns(u.getAttribute("end"), n);
|
|
16782
16782
|
if (f === null)
|
|
16783
16783
|
throw Br(u);
|
|
16784
|
-
if (
|
|
16784
|
+
if (p === null) {
|
|
16785
16785
|
if (g === null)
|
|
16786
16786
|
throw Br(u);
|
|
16787
|
-
|
|
16787
|
+
p = f + g;
|
|
16788
16788
|
}
|
|
16789
|
-
const
|
|
16790
|
-
|
|
16789
|
+
const E = new Ai(f - e, p - e, d);
|
|
16790
|
+
E.id = Li(E.startTime, E.endTime, E.text);
|
|
16791
16791
|
const y = l[u.getAttribute("region")], S = c[u.getAttribute("style")], T = Gh(y, S, c), {
|
|
16792
16792
|
textAlign: x
|
|
16793
16793
|
} = T;
|
|
16794
16794
|
if (x) {
|
|
16795
16795
|
const A = Uh[x];
|
|
16796
|
-
A && (
|
|
16796
|
+
A && (E.lineAlign = A), E.align = x;
|
|
16797
16797
|
}
|
|
16798
|
-
return re(
|
|
16798
|
+
return re(E, T), E;
|
|
16799
16799
|
}).filter((u) => u !== null);
|
|
16800
16800
|
}
|
|
16801
16801
|
function Fs(a, e, t) {
|
|
@@ -17294,8 +17294,8 @@ const Wh = /\s/, qh = {
|
|
|
17294
17294
|
for (let d = 0; d < s.rows.length; d++)
|
|
17295
17295
|
if (r = s.rows[d], o = !0, c = 0, l = "", !r.isEmpty()) {
|
|
17296
17296
|
var u;
|
|
17297
|
-
for (let
|
|
17298
|
-
Wh.test(r.chars[
|
|
17297
|
+
for (let p = 0; p < r.chars.length; p++)
|
|
17298
|
+
Wh.test(r.chars[p].uchar) && o ? c++ : (l += r.chars[p].uchar, o = !1);
|
|
17299
17299
|
r.cueStartTime = e, e === t && (t += 1e-4), c >= 16 ? c-- : c++;
|
|
17300
17300
|
const f = oa(l.trim()), g = Li(e, t, f);
|
|
17301
17301
|
a != null && (u = a.cues) != null && u.getCueById(g) || (n = new h(e, t, f), n.id = g, n.line = d + 1, n.align = "left", n.position = 10 + Math.min(80, Math.floor(c * 8 / 32) * 10), i.push(n));
|
|
@@ -17348,10 +17348,10 @@ class Gr {
|
|
|
17348
17348
|
this.callbacks && (this.abortInternal(), this.callbacks.onTimeout(i, e, this.response));
|
|
17349
17349
|
}, l - (f - i.loading.start)), !u.ok) {
|
|
17350
17350
|
const {
|
|
17351
|
-
status:
|
|
17352
|
-
statusText:
|
|
17351
|
+
status: p,
|
|
17352
|
+
statusText: E
|
|
17353
17353
|
} = u;
|
|
17354
|
-
throw new eu(
|
|
17354
|
+
throw new eu(E || "fetch, bad network response", p, u);
|
|
17355
17355
|
}
|
|
17356
17356
|
i.loading.first = f, i.total = Zh(u.headers) || i.total;
|
|
17357
17357
|
const g = (d = this.callbacks) == null ? void 0 : d.onProgress;
|
|
@@ -17362,14 +17362,14 @@ class Gr {
|
|
|
17362
17362
|
if (!g)
|
|
17363
17363
|
throw new Error("loader destroyed");
|
|
17364
17364
|
self.clearTimeout(this.requestTimeout), i.loading.end = Math.max(self.performance.now(), i.loading.first);
|
|
17365
|
-
const
|
|
17366
|
-
|
|
17367
|
-
const
|
|
17365
|
+
const p = u[o];
|
|
17366
|
+
p && (i.loaded = i.total = p);
|
|
17367
|
+
const E = {
|
|
17368
17368
|
url: g.url,
|
|
17369
17369
|
data: u,
|
|
17370
17370
|
code: g.status
|
|
17371
17371
|
}, y = (d = this.callbacks) == null ? void 0 : d.onProgress;
|
|
17372
|
-
y && !F(t.highWaterMark) && y(i, e, u, g), (f = this.callbacks) == null || f.onSuccess(
|
|
17372
|
+
y && !F(t.highWaterMark) && y(i, e, u, g), (f = this.callbacks) == null || f.onSuccess(E, i, e, g);
|
|
17373
17373
|
}).catch((u) => {
|
|
17374
17374
|
var d;
|
|
17375
17375
|
if (self.clearTimeout(this.requestTimeout), i.aborted)
|
|
@@ -17511,10 +17511,10 @@ class da {
|
|
|
17511
17511
|
if (g != null) {
|
|
17512
17512
|
var n, o;
|
|
17513
17513
|
s.loading.end = Math.max(self.performance.now(), s.loading.first);
|
|
17514
|
-
const
|
|
17515
|
-
s.loaded = s.total =
|
|
17516
|
-
const
|
|
17517
|
-
|
|
17514
|
+
const p = t.responseType === "arraybuffer" ? g.byteLength : g.length;
|
|
17515
|
+
s.loaded = s.total = p, s.bwEstimate = s.total * 8e3 / (s.loading.end - s.loading.first);
|
|
17516
|
+
const E = (n = this.callbacks) == null ? void 0 : n.onProgress;
|
|
17517
|
+
E && E(s, e, g, t);
|
|
17518
17518
|
const y = {
|
|
17519
17519
|
url: t.responseURL,
|
|
17520
17520
|
data: g,
|
|
@@ -18022,30 +18022,30 @@ class hu extends dn {
|
|
|
18022
18022
|
}
|
|
18023
18023
|
const d = q.bufferInfo(n, e, 0), f = d.nextStart || 0, g = this.fragmentTracker;
|
|
18024
18024
|
if (c && g && this.hls) {
|
|
18025
|
-
const _ = Kr(this.hls.inFlightFragments, e), v = d.len > Qt,
|
|
18026
|
-
if (v ||
|
|
18025
|
+
const _ = Kr(this.hls.inFlightFragments, e), v = d.len > Qt, R = !f || _ || f - e > Qt && !g.getPartialFragment(e);
|
|
18026
|
+
if (v || R)
|
|
18027
18027
|
return;
|
|
18028
18028
|
this.moved = !1;
|
|
18029
18029
|
}
|
|
18030
|
-
const
|
|
18030
|
+
const p = (i = this.hls) == null ? void 0 : i.latestLevelDetails;
|
|
18031
18031
|
if (!this.moved && this.stalled !== null && g) {
|
|
18032
18032
|
if (!(d.len > 0) && !f)
|
|
18033
18033
|
return;
|
|
18034
|
-
const v = Math.max(f, d.start || 0) - e, D = !!(
|
|
18034
|
+
const v = Math.max(f, d.start || 0) - e, D = !!(p != null && p.live) ? p.targetduration * 2 : Qt, L = g.getPartialFragment(e);
|
|
18035
18035
|
if (v > 0 && (v <= D || L)) {
|
|
18036
18036
|
n.paused || this._trySkipBufferHole(L);
|
|
18037
18037
|
return;
|
|
18038
18038
|
}
|
|
18039
18039
|
}
|
|
18040
|
-
const
|
|
18040
|
+
const E = r.detectStallWithCurrentTimeMs, y = self.performance.now(), S = this.waiting;
|
|
18041
18041
|
if (o === null) {
|
|
18042
|
-
S > 0 && y - S <
|
|
18042
|
+
S > 0 && y - S < E ? this.stalled = S : this.stalled = y;
|
|
18043
18043
|
return;
|
|
18044
18044
|
}
|
|
18045
18045
|
const T = y - o;
|
|
18046
|
-
if (!c && (T >=
|
|
18046
|
+
if (!c && (T >= E || S) && this.hls) {
|
|
18047
18047
|
var x;
|
|
18048
|
-
if (((x = this.mediaSource) == null ? void 0 : x.readyState) === "ended" && !(
|
|
18048
|
+
if (((x = this.mediaSource) == null ? void 0 : x.readyState) === "ended" && !(p != null && p.live) && Math.abs(e - ((p == null ? void 0 : p.edge) || 0)) < 1) {
|
|
18049
18049
|
if (this.ended)
|
|
18050
18050
|
return;
|
|
18051
18051
|
this.ended = e || 1, this.hls.trigger(m.MEDIA_ENDED, {
|
|
@@ -18082,7 +18082,7 @@ class hu extends dn {
|
|
|
18082
18082
|
const d = this.fragmentTracker.getPartialFragment(e) || void 0, f = q.bufferInfo(this.media, e, 0);
|
|
18083
18083
|
this.hls.trigger(m.ERROR, {
|
|
18084
18084
|
type: U.MEDIA_ERROR,
|
|
18085
|
-
details:
|
|
18085
|
+
details: b.BUFFER_SEEK_OVER_HOLE,
|
|
18086
18086
|
fatal: !1,
|
|
18087
18087
|
error: u,
|
|
18088
18088
|
reason: u.message,
|
|
@@ -18132,7 +18132,7 @@ class hu extends dn {
|
|
|
18132
18132
|
const n = new Error(`Playback stalling at @${s.currentTime} due to low buffer (${ae(e)})`);
|
|
18133
18133
|
this.warn(n.message), t.trigger(m.ERROR, {
|
|
18134
18134
|
type: U.MEDIA_ERROR,
|
|
18135
|
-
details:
|
|
18135
|
+
details: b.BUFFER_STALLED_ERROR,
|
|
18136
18136
|
fatal: !1,
|
|
18137
18137
|
error: n,
|
|
18138
18138
|
buffer: e.len,
|
|
@@ -18163,16 +18163,16 @@ class hu extends dn {
|
|
|
18163
18163
|
if (d > r.maxBufferHole) {
|
|
18164
18164
|
let g = !1;
|
|
18165
18165
|
if (n === 0) {
|
|
18166
|
-
const
|
|
18167
|
-
|
|
18166
|
+
const p = s.getAppendedFrag(0, N.MAIN);
|
|
18167
|
+
p && c < p.end && (g = !0);
|
|
18168
18168
|
}
|
|
18169
18169
|
if (!g) {
|
|
18170
|
-
const
|
|
18171
|
-
if (
|
|
18170
|
+
const p = e || s.getAppendedFrag(n, N.MAIN);
|
|
18171
|
+
if (p) {
|
|
18172
18172
|
var l;
|
|
18173
18173
|
if (!((l = this.hls.loadLevelObj) != null && l.details) || Kr(this.hls.inFlightFragments, c))
|
|
18174
18174
|
return 0;
|
|
18175
|
-
let y = !1, S =
|
|
18175
|
+
let y = !1, S = p.end;
|
|
18176
18176
|
for (; S < c; ) {
|
|
18177
18177
|
const T = s.getPartialFragment(S);
|
|
18178
18178
|
if (T)
|
|
@@ -18192,7 +18192,7 @@ class hu extends dn {
|
|
|
18192
18192
|
const g = new Error(`fragment loaded with buffer holes, seeking from ${n} to ${f}`);
|
|
18193
18193
|
this.hls.trigger(m.ERROR, {
|
|
18194
18194
|
type: U.MEDIA_ERROR,
|
|
18195
|
-
details:
|
|
18195
|
+
details: b.BUFFER_SEEK_OVER_HOLE,
|
|
18196
18196
|
fatal: !1,
|
|
18197
18197
|
error: g,
|
|
18198
18198
|
reason: g.message,
|
|
@@ -18223,7 +18223,7 @@ class hu extends dn {
|
|
|
18223
18223
|
const o = n + (i + 1) * r.nudgeOffset, c = new Error(`Nudging 'currentTime' from ${n} to ${o}`);
|
|
18224
18224
|
this.warn(c.message), s.currentTime = o, t.trigger(m.ERROR, {
|
|
18225
18225
|
type: U.MEDIA_ERROR,
|
|
18226
|
-
details:
|
|
18226
|
+
details: b.BUFFER_NUDGE_ON_STALL,
|
|
18227
18227
|
error: c,
|
|
18228
18228
|
fatal: !1,
|
|
18229
18229
|
buffer: e.len,
|
|
@@ -18233,7 +18233,7 @@ class hu extends dn {
|
|
|
18233
18233
|
const o = new Error(`Playhead still not moving while enough data buffered @${n} after ${r.nudgeMaxRetry} nudges`);
|
|
18234
18234
|
this.error(o.message), t.trigger(m.ERROR, {
|
|
18235
18235
|
type: U.MEDIA_ERROR,
|
|
18236
|
-
details:
|
|
18236
|
+
details: b.BUFFER_STALLED_ERROR,
|
|
18237
18237
|
error: o,
|
|
18238
18238
|
fatal: !0,
|
|
18239
18239
|
buffer: e.len,
|
|
@@ -18371,8 +18371,8 @@ class fu {
|
|
|
18371
18371
|
const g = l[f];
|
|
18372
18372
|
if (!Fn(g)) {
|
|
18373
18373
|
this.updateId3CueEnds(h, c);
|
|
18374
|
-
const
|
|
18375
|
-
|
|
18374
|
+
const p = Hr(n, h, u, g, c);
|
|
18375
|
+
p && this.id3Track.addCue(p);
|
|
18376
18376
|
}
|
|
18377
18377
|
}
|
|
18378
18378
|
}
|
|
@@ -18434,8 +18434,8 @@ class fu {
|
|
|
18434
18434
|
const d = h[u], f = n[d].cues;
|
|
18435
18435
|
delete n[d], Object.keys(f).forEach((g) => {
|
|
18436
18436
|
try {
|
|
18437
|
-
const
|
|
18438
|
-
|
|
18437
|
+
const p = f[g];
|
|
18438
|
+
p.removeEventListener("enter", this.onEventCueEnter), s.removeCue(p);
|
|
18439
18439
|
} catch {
|
|
18440
18440
|
}
|
|
18441
18441
|
});
|
|
@@ -18449,47 +18449,47 @@ class fu {
|
|
|
18449
18449
|
this.id3Track || (this.id3Track = this.createTrack(this.media));
|
|
18450
18450
|
const l = si();
|
|
18451
18451
|
for (let h = 0; h < r.length; h++) {
|
|
18452
|
-
const u = r[h], d = i[u], f = d.startTime, g = n[u],
|
|
18453
|
-
let
|
|
18452
|
+
const u = r[h], d = i[u], f = d.startTime, g = n[u], p = (g == null ? void 0 : g.cues) || {};
|
|
18453
|
+
let E = (g == null ? void 0 : g.durationKnown) || !1, y = Ht;
|
|
18454
18454
|
const {
|
|
18455
18455
|
duration: S,
|
|
18456
18456
|
endDate: T
|
|
18457
18457
|
} = d;
|
|
18458
18458
|
if (T && S !== null)
|
|
18459
|
-
y = f + S,
|
|
18460
|
-
else if (d.endOnNext && !
|
|
18459
|
+
y = f + S, E = !0;
|
|
18460
|
+
else if (d.endOnNext && !E) {
|
|
18461
18461
|
const A = r.reduce((_, v) => {
|
|
18462
18462
|
if (v !== d.id) {
|
|
18463
|
-
const
|
|
18464
|
-
if (
|
|
18465
|
-
return
|
|
18463
|
+
const R = i[v];
|
|
18464
|
+
if (R.class === d.class && R.startDate > d.startDate && (!_ || d.startDate < _.startDate))
|
|
18465
|
+
return R;
|
|
18466
18466
|
}
|
|
18467
18467
|
return _;
|
|
18468
18468
|
}, null);
|
|
18469
|
-
A && (y = A.startTime,
|
|
18469
|
+
A && (y = A.startTime, E = !0);
|
|
18470
18470
|
}
|
|
18471
18471
|
const x = Object.keys(d.attr);
|
|
18472
18472
|
for (let A = 0; A < x.length; A++) {
|
|
18473
18473
|
const _ = x[A];
|
|
18474
18474
|
if (!Ho(_))
|
|
18475
18475
|
continue;
|
|
18476
|
-
const v =
|
|
18476
|
+
const v = p[_];
|
|
18477
18477
|
if (v)
|
|
18478
|
-
|
|
18478
|
+
E && !g.durationKnown ? v.endTime = y : Math.abs(v.startTime - f) > 0.01 && (v.startTime = f, v.endTime = y);
|
|
18479
18479
|
else if (l) {
|
|
18480
|
-
let
|
|
18481
|
-
Yo(_) && (
|
|
18480
|
+
let R = d.attr[_];
|
|
18481
|
+
Yo(_) && (R = du(R));
|
|
18482
18482
|
const L = Hr(l, f, y, {
|
|
18483
18483
|
key: _,
|
|
18484
|
-
data:
|
|
18484
|
+
data: R
|
|
18485
18485
|
}, Te.dateRange);
|
|
18486
|
-
L && (L.id = u, this.id3Track.addCue(L),
|
|
18486
|
+
L && (L.id = u, this.id3Track.addCue(L), p[_] = L, this.hls.config.interstitialsController && (_ === "X-ASSET-LIST" || _ === "X-ASSET-URL") && L.addEventListener("enter", this.onEventCueEnter));
|
|
18487
18487
|
}
|
|
18488
18488
|
}
|
|
18489
18489
|
n[u] = {
|
|
18490
|
-
cues:
|
|
18490
|
+
cues: p,
|
|
18491
18491
|
dateRange: d,
|
|
18492
|
-
durationKnown:
|
|
18492
|
+
durationKnown: E
|
|
18493
18493
|
};
|
|
18494
18494
|
}
|
|
18495
18495
|
}
|
|
@@ -18621,7 +18621,7 @@ class gu {
|
|
|
18621
18621
|
}
|
|
18622
18622
|
onError(e, t) {
|
|
18623
18623
|
var s;
|
|
18624
|
-
t.details ===
|
|
18624
|
+
t.details === b.BUFFER_STALLED_ERROR && (this.stallCount++, this.hls && (s = this.levelDetails) != null && s.live && this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"));
|
|
18625
18625
|
}
|
|
18626
18626
|
changeMediaPlaybackRate(e, t) {
|
|
18627
18627
|
var s, i;
|
|
@@ -18678,8 +18678,8 @@ class mu extends Si {
|
|
|
18678
18678
|
} = h;
|
|
18679
18679
|
f && (h.audioCodec = f = es(f, s) || void 0), ((u = g) == null ? void 0 : u.indexOf("avc1")) === 0 && (g = h.videoCodec = ho(g));
|
|
18680
18680
|
const {
|
|
18681
|
-
width:
|
|
18682
|
-
height:
|
|
18681
|
+
width: p,
|
|
18682
|
+
height: E,
|
|
18683
18683
|
unknownCodecs: y
|
|
18684
18684
|
} = h;
|
|
18685
18685
|
let S = y ? y.length : 0;
|
|
@@ -18688,7 +18688,7 @@ class mu extends Si {
|
|
|
18688
18688
|
const O = y[P];
|
|
18689
18689
|
this.isAudioSupported(O) ? (h.audioCodec = f = f ? `${f},${O}` : O, S--, ut.audio[f.substring(0, 4)] = 2) : this.isVideoSupported(O) && (h.videoCodec = g = g ? `${g},${O}` : O, S--, ut.video[g.substring(0, 4)] = 2);
|
|
18690
18690
|
}
|
|
18691
|
-
if (o || (o = !!(
|
|
18691
|
+
if (o || (o = !!(p && E)), c || (c = !!g), l || (l = !!f), S || f && !this.isAudioSupported(f) || g && !this.isVideoSupported(g)) {
|
|
18692
18692
|
this.log(`Some or all CODECS not supported "${d.CODECS}"`);
|
|
18693
18693
|
return;
|
|
18694
18694
|
}
|
|
@@ -18698,8 +18698,8 @@ class mu extends Si {
|
|
|
18698
18698
|
"HDCP-LEVEL": A,
|
|
18699
18699
|
"PATHWAY-ID": _,
|
|
18700
18700
|
RESOLUTION: v,
|
|
18701
|
-
"VIDEO-RANGE":
|
|
18702
|
-
} = d, L = `${`${_ || "."}-`}${h.bitrate}-${v}-${x}-${T}-${
|
|
18701
|
+
"VIDEO-RANGE": R
|
|
18702
|
+
} = d, L = `${`${_ || "."}-`}${h.bitrate}-${v}-${x}-${T}-${R}-${A}`;
|
|
18703
18703
|
if (r[L])
|
|
18704
18704
|
if (r[L].uri !== h.url && !h.attrs["PATHWAY-ID"]) {
|
|
18705
18705
|
const P = n[L] += 1;
|
|
@@ -18731,19 +18731,19 @@ class mu extends Si {
|
|
|
18731
18731
|
filterAndSortMediaOptions(e, t, s, i, r) {
|
|
18732
18732
|
let n = [], o = [], c = e;
|
|
18733
18733
|
if ((s || i) && r && (c = c.filter(({
|
|
18734
|
-
videoCodec:
|
|
18734
|
+
videoCodec: E,
|
|
18735
18735
|
videoRange: y,
|
|
18736
18736
|
width: S,
|
|
18737
18737
|
height: T
|
|
18738
|
-
}) => (!!
|
|
18738
|
+
}) => (!!E || !!(S && T)) && po(y))), c.length === 0) {
|
|
18739
18739
|
Promise.resolve().then(() => {
|
|
18740
18740
|
if (this.hls) {
|
|
18741
|
-
let
|
|
18742
|
-
t.levels.length && (y = `one or more CODECS in variant not supported: ${ae(t.levels.map((T) => T.attrs.CODECS).filter((T, x, A) => A.indexOf(T) === x))}`, this.warn(y),
|
|
18743
|
-
const S = new Error(
|
|
18741
|
+
let E = "no level with compatible codecs found in manifest", y = E;
|
|
18742
|
+
t.levels.length && (y = `one or more CODECS in variant not supported: ${ae(t.levels.map((T) => T.attrs.CODECS).filter((T, x, A) => A.indexOf(T) === x))}`, this.warn(y), E += ` (${y})`);
|
|
18743
|
+
const S = new Error(E);
|
|
18744
18744
|
this.hls.trigger(m.ERROR, {
|
|
18745
18745
|
type: U.MEDIA_ERROR,
|
|
18746
|
-
details:
|
|
18746
|
+
details: b.MANIFEST_INCOMPATIBLE_CODECS_ERROR,
|
|
18747
18747
|
fatal: !0,
|
|
18748
18748
|
url: t.url,
|
|
18749
18749
|
error: S,
|
|
@@ -18753,42 +18753,42 @@ class mu extends Si {
|
|
|
18753
18753
|
});
|
|
18754
18754
|
return;
|
|
18755
18755
|
}
|
|
18756
|
-
t.audioTracks && (n = t.audioTracks.filter((
|
|
18756
|
+
t.audioTracks && (n = t.audioTracks.filter((E) => !E.audioCodec || this.isAudioSupported(E.audioCodec)), Yr(n)), t.subtitles && (o = t.subtitles, Yr(o));
|
|
18757
18757
|
const l = c.slice(0);
|
|
18758
|
-
c.sort((
|
|
18759
|
-
if (
|
|
18760
|
-
return (
|
|
18761
|
-
if (s &&
|
|
18762
|
-
return
|
|
18763
|
-
if (
|
|
18764
|
-
return
|
|
18765
|
-
if (
|
|
18766
|
-
return ts.indexOf(
|
|
18767
|
-
if (
|
|
18768
|
-
const S = Bi(
|
|
18758
|
+
c.sort((E, y) => {
|
|
18759
|
+
if (E.attrs["HDCP-LEVEL"] !== y.attrs["HDCP-LEVEL"])
|
|
18760
|
+
return (E.attrs["HDCP-LEVEL"] || "") > (y.attrs["HDCP-LEVEL"] || "") ? 1 : -1;
|
|
18761
|
+
if (s && E.height !== y.height)
|
|
18762
|
+
return E.height - y.height;
|
|
18763
|
+
if (E.frameRate !== y.frameRate)
|
|
18764
|
+
return E.frameRate - y.frameRate;
|
|
18765
|
+
if (E.videoRange !== y.videoRange)
|
|
18766
|
+
return ts.indexOf(E.videoRange) - ts.indexOf(y.videoRange);
|
|
18767
|
+
if (E.videoCodec !== y.videoCodec) {
|
|
18768
|
+
const S = Bi(E.videoCodec), T = Bi(y.videoCodec);
|
|
18769
18769
|
if (S !== T)
|
|
18770
18770
|
return T - S;
|
|
18771
18771
|
}
|
|
18772
|
-
if (
|
|
18773
|
-
const S = Jt(
|
|
18772
|
+
if (E.uri === y.uri && E.codecSet !== y.codecSet) {
|
|
18773
|
+
const S = Jt(E.codecSet), T = Jt(y.codecSet);
|
|
18774
18774
|
if (S !== T)
|
|
18775
18775
|
return T - S;
|
|
18776
18776
|
}
|
|
18777
|
-
return
|
|
18777
|
+
return E.averageBitrate !== y.averageBitrate ? E.averageBitrate - y.averageBitrate : 0;
|
|
18778
18778
|
});
|
|
18779
18779
|
let h = l[0];
|
|
18780
18780
|
if (this.steering && (c = this.steering.filterParsedLevels(c), c.length !== l.length)) {
|
|
18781
|
-
for (let
|
|
18782
|
-
if (l[
|
|
18783
|
-
h = l[
|
|
18781
|
+
for (let E = 0; E < l.length; E++)
|
|
18782
|
+
if (l[E].pathwayId === c[0].pathwayId) {
|
|
18783
|
+
h = l[E];
|
|
18784
18784
|
break;
|
|
18785
18785
|
}
|
|
18786
18786
|
}
|
|
18787
18787
|
this._levels = c;
|
|
18788
|
-
for (let
|
|
18789
|
-
if (c[
|
|
18788
|
+
for (let E = 0; E < c.length; E++)
|
|
18789
|
+
if (c[E] === h) {
|
|
18790
18790
|
var u;
|
|
18791
|
-
this._firstLevel =
|
|
18791
|
+
this._firstLevel = E;
|
|
18792
18792
|
const y = h.bitrate, S = this.hls.bandwidthEstimate;
|
|
18793
18793
|
if (this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${y}`), ((u = this.hls.userConfig) == null ? void 0 : u.abrEwmaDefaultEstimate) === void 0) {
|
|
18794
18794
|
const T = Math.min(y, this.hls.config.abrEwmaDefaultEstimateMax);
|
|
@@ -18796,7 +18796,7 @@ class mu extends Si {
|
|
|
18796
18796
|
}
|
|
18797
18797
|
break;
|
|
18798
18798
|
}
|
|
18799
|
-
const d = r && !i, f = this.hls.config, g = !!(f.audioStreamController && f.audioTrackController),
|
|
18799
|
+
const d = r && !i, f = this.hls.config, g = !!(f.audioStreamController && f.audioTrackController), p = {
|
|
18800
18800
|
levels: c,
|
|
18801
18801
|
audioTracks: n,
|
|
18802
18802
|
subtitleTracks: o,
|
|
@@ -18806,9 +18806,9 @@ class mu extends Si {
|
|
|
18806
18806
|
stats: t.stats,
|
|
18807
18807
|
audio: r,
|
|
18808
18808
|
video: i,
|
|
18809
|
-
altAudio: g && !d && n.some((
|
|
18809
|
+
altAudio: g && !d && n.some((E) => !!E.url)
|
|
18810
18810
|
};
|
|
18811
|
-
this.hls.trigger(m.MANIFEST_PARSED,
|
|
18811
|
+
this.hls.trigger(m.MANIFEST_PARSED, p);
|
|
18812
18812
|
}
|
|
18813
18813
|
get levels() {
|
|
18814
18814
|
return this._levels.length === 0 ? null : this._levels;
|
|
@@ -18827,7 +18827,7 @@ class mu extends Si {
|
|
|
18827
18827
|
const h = new Error("invalid level idx"), u = e < 0;
|
|
18828
18828
|
if (this.hls.trigger(m.ERROR, {
|
|
18829
18829
|
type: U.OTHER_ERROR,
|
|
18830
|
-
details:
|
|
18830
|
+
details: b.LEVEL_SWITCH_ERROR,
|
|
18831
18831
|
level: e,
|
|
18832
18832
|
fatal: u,
|
|
18833
18833
|
error: h,
|
|
@@ -19129,8 +19129,8 @@ class Tu extends di {
|
|
|
19129
19129
|
return;
|
|
19130
19130
|
const c = this.getLevelDetails();
|
|
19131
19131
|
if (c && this._streamEnded(o, c)) {
|
|
19132
|
-
const
|
|
19133
|
-
this.altAudio === 2 && (
|
|
19132
|
+
const p = {};
|
|
19133
|
+
this.altAudio === 2 && (p.type = "video"), this.hls.trigger(m.BUFFER_EOS, p), this.state = C.ENDED;
|
|
19134
19134
|
return;
|
|
19135
19135
|
}
|
|
19136
19136
|
if (!this.buffering)
|
|
@@ -19149,13 +19149,13 @@ class Tu extends di {
|
|
|
19149
19149
|
let f = this.getNextFragment(d, l);
|
|
19150
19150
|
if (this.couldBacktrack && !this.fragPrevious && f && ue(f) && this.fragmentTracker.getState(f) !== ce.OK) {
|
|
19151
19151
|
var g;
|
|
19152
|
-
const
|
|
19152
|
+
const E = ((g = this.backtrackFragment) != null ? g : f).sn - l.startSN, y = l.fragments[E - 1];
|
|
19153
19153
|
y && f.cc === y.cc && (f = y, this.fragmentTracker.removeFragment(y));
|
|
19154
19154
|
} else this.backtrackFragment && o.len && (this.backtrackFragment = null);
|
|
19155
19155
|
if (f && this.isLoopLoading(f, d)) {
|
|
19156
19156
|
if (!f.gap) {
|
|
19157
|
-
const
|
|
19158
|
-
y && this.afterBufferFlushed(y,
|
|
19157
|
+
const E = this.audioOnly && !this.altAudio ? ie.AUDIO : ie.VIDEO, y = (E === ie.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media;
|
|
19158
|
+
y && this.afterBufferFlushed(y, E, N.MAIN);
|
|
19159
19159
|
}
|
|
19160
19160
|
f = this.getNextFragmentLoopLoading(f, l, o, N.MAIN, u);
|
|
19161
19161
|
}
|
|
@@ -19328,8 +19328,8 @@ class Tu extends di {
|
|
|
19328
19328
|
this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`), this.fragmentTracker.removeFragment(s);
|
|
19329
19329
|
return;
|
|
19330
19330
|
}
|
|
19331
|
-
const l = o.videoCodec, h = c.PTSKnown || !c.live, u = (t = s.initSegment) == null ? void 0 : t.data, d = this._getAudioCodec(o), f = this.transmuxer = this.transmuxer || new Wn(this.hls, N.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)), g = i ? i.index : -1,
|
|
19332
|
-
f.push(r, u, d, l, s, i, c.totalduration, h,
|
|
19331
|
+
const l = o.videoCodec, h = c.PTSKnown || !c.live, u = (t = s.initSegment) == null ? void 0 : t.data, d = this._getAudioCodec(o), f = this.transmuxer = this.transmuxer || new Wn(this.hls, N.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)), g = i ? i.index : -1, p = g !== -1, E = new ci(s.level, s.sn, s.stats.chunkCount, r.byteLength, g, p), y = this.initPTS[s.cc];
|
|
19332
|
+
f.push(r, u, d, l, s, i, c.totalduration, h, E, y);
|
|
19333
19333
|
}
|
|
19334
19334
|
onAudioTrackSwitching(e, t) {
|
|
19335
19335
|
const s = this.hls, i = this.altAudio === 2;
|
|
@@ -19404,32 +19404,32 @@ class Tu extends di {
|
|
|
19404
19404
|
return;
|
|
19405
19405
|
}
|
|
19406
19406
|
switch (t.details) {
|
|
19407
|
-
case
|
|
19408
|
-
case
|
|
19409
|
-
case
|
|
19410
|
-
case
|
|
19411
|
-
case
|
|
19412
|
-
case
|
|
19413
|
-
case
|
|
19407
|
+
case b.FRAG_GAP:
|
|
19408
|
+
case b.FRAG_PARSING_ERROR:
|
|
19409
|
+
case b.FRAG_DECRYPT_ERROR:
|
|
19410
|
+
case b.FRAG_LOAD_ERROR:
|
|
19411
|
+
case b.FRAG_LOAD_TIMEOUT:
|
|
19412
|
+
case b.KEY_LOAD_ERROR:
|
|
19413
|
+
case b.KEY_LOAD_TIMEOUT:
|
|
19414
19414
|
this.onFragmentOrKeyLoadError(N.MAIN, t);
|
|
19415
19415
|
break;
|
|
19416
|
-
case
|
|
19417
|
-
case
|
|
19418
|
-
case
|
|
19416
|
+
case b.LEVEL_LOAD_ERROR:
|
|
19417
|
+
case b.LEVEL_LOAD_TIMEOUT:
|
|
19418
|
+
case b.LEVEL_PARSING_ERROR:
|
|
19419
19419
|
!t.levelRetry && this.state === C.WAITING_LEVEL && ((s = t.context) == null ? void 0 : s.type) === z.LEVEL && (this.state = C.IDLE);
|
|
19420
19420
|
break;
|
|
19421
|
-
case
|
|
19422
|
-
case
|
|
19421
|
+
case b.BUFFER_ADD_CODEC_ERROR:
|
|
19422
|
+
case b.BUFFER_APPEND_ERROR:
|
|
19423
19423
|
if (t.parent !== "main")
|
|
19424
19424
|
return;
|
|
19425
19425
|
this.resetLoadingState();
|
|
19426
19426
|
break;
|
|
19427
|
-
case
|
|
19427
|
+
case b.BUFFER_FULL_ERROR:
|
|
19428
19428
|
if (t.parent !== "main")
|
|
19429
19429
|
return;
|
|
19430
19430
|
this.reduceLengthAndFlushBuffer(t) && this.flushMainBuffer(0, Number.POSITIVE_INFINITY);
|
|
19431
19431
|
break;
|
|
19432
|
-
case
|
|
19432
|
+
case b.INTERNAL_EXCEPTION:
|
|
19433
19433
|
this.recoverWorkerError(t);
|
|
19434
19434
|
break;
|
|
19435
19435
|
}
|
|
@@ -19511,8 +19511,8 @@ class Tu extends di {
|
|
|
19511
19511
|
id3: f,
|
|
19512
19512
|
initSegment: g
|
|
19513
19513
|
} = r, {
|
|
19514
|
-
details:
|
|
19515
|
-
} = h,
|
|
19514
|
+
details: p
|
|
19515
|
+
} = h, E = this.altAudio ? void 0 : r.audio;
|
|
19516
19516
|
if (this.fragContextChanged(c)) {
|
|
19517
19517
|
this.fragmentTracker.removeFragment(c);
|
|
19518
19518
|
return;
|
|
@@ -19537,9 +19537,9 @@ class Tu extends di {
|
|
|
19537
19537
|
timescale: S
|
|
19538
19538
|
}));
|
|
19539
19539
|
}
|
|
19540
|
-
if (u &&
|
|
19541
|
-
|
|
19542
|
-
const y =
|
|
19540
|
+
if (u && p) {
|
|
19541
|
+
E && u.type === "audiovideo" && this.logMuxedErr(c);
|
|
19542
|
+
const y = p.fragments[c.sn - 1 - p.startSN], S = c.sn === p.startSN, T = !y || c.cc > y.cc;
|
|
19543
19543
|
if (r.independent !== !1) {
|
|
19544
19544
|
const {
|
|
19545
19545
|
startPTS: x,
|
|
@@ -19555,13 +19555,13 @@ class Tu extends di {
|
|
|
19555
19555
|
endDTS: v
|
|
19556
19556
|
};
|
|
19557
19557
|
else if (u.firstKeyFrame && u.independent && n.id === 1 && !T && (this.couldBacktrack = !0), u.dropped && u.independent) {
|
|
19558
|
-
const
|
|
19558
|
+
const R = this.getMainFwdBufferInfo(), D = (R ? R.end : this.getLoadPosition()) + this.config.maxBufferHole, L = u.firstKeyFramePTS ? u.firstKeyFramePTS : x;
|
|
19559
19559
|
if (!S && D < L - this.config.maxBufferHole && !T) {
|
|
19560
19560
|
this.backtrack(c);
|
|
19561
19561
|
return;
|
|
19562
19562
|
} else T && (c.gap = !0);
|
|
19563
19563
|
c.setElementaryStreamInfo(u.type, c.start, A, c.start, v, !0);
|
|
19564
|
-
} else S && x - (
|
|
19564
|
+
} else S && x - (p.appliedTimelineOffset || 0) > Qt && (c.gap = !0);
|
|
19565
19565
|
c.setElementaryStreamInfo(u.type, x, A, _, v), this.backtrackFragment && (this.backtrackFragment = c), this.bufferFragmentData(u, c, l, n, S || T);
|
|
19566
19566
|
} else if (S || T)
|
|
19567
19567
|
c.gap = !0;
|
|
@@ -19570,34 +19570,34 @@ class Tu extends di {
|
|
|
19570
19570
|
return;
|
|
19571
19571
|
}
|
|
19572
19572
|
}
|
|
19573
|
-
if (
|
|
19573
|
+
if (E) {
|
|
19574
19574
|
const {
|
|
19575
19575
|
startPTS: y,
|
|
19576
19576
|
endPTS: S,
|
|
19577
19577
|
startDTS: T,
|
|
19578
19578
|
endDTS: x
|
|
19579
|
-
} =
|
|
19579
|
+
} = E;
|
|
19580
19580
|
l && (l.elementaryStreams[ie.AUDIO] = {
|
|
19581
19581
|
startPTS: y,
|
|
19582
19582
|
endPTS: S,
|
|
19583
19583
|
startDTS: T,
|
|
19584
19584
|
endDTS: x
|
|
19585
|
-
}), c.setElementaryStreamInfo(ie.AUDIO, y, S, T, x), this.bufferFragmentData(
|
|
19585
|
+
}), c.setElementaryStreamInfo(ie.AUDIO, y, S, T, x), this.bufferFragmentData(E, c, l, n);
|
|
19586
19586
|
}
|
|
19587
|
-
if (
|
|
19587
|
+
if (p && f != null && (t = f.samples) != null && t.length) {
|
|
19588
19588
|
const y = {
|
|
19589
19589
|
id: s,
|
|
19590
19590
|
frag: c,
|
|
19591
|
-
details:
|
|
19591
|
+
details: p,
|
|
19592
19592
|
samples: f.samples
|
|
19593
19593
|
};
|
|
19594
19594
|
i.trigger(m.FRAG_PARSING_METADATA, y);
|
|
19595
19595
|
}
|
|
19596
|
-
if (
|
|
19596
|
+
if (p && d) {
|
|
19597
19597
|
const y = {
|
|
19598
19598
|
id: s,
|
|
19599
19599
|
frag: c,
|
|
19600
|
-
details:
|
|
19600
|
+
details: p,
|
|
19601
19601
|
samples: d.samples
|
|
19602
19602
|
};
|
|
19603
19603
|
i.trigger(m.FRAG_PARSING_USERDATA, y);
|
|
@@ -19708,7 +19708,7 @@ class Tu extends di {
|
|
|
19708
19708
|
var e;
|
|
19709
19709
|
const t = ((e = this.media) == null ? void 0 : e.currentTime) || this.lastCurrentTime;
|
|
19710
19710
|
if (F(t)) {
|
|
19711
|
-
const s = this.getLevelDetails(), i = this.currentFrag || (s ?
|
|
19711
|
+
const s = this.getLevelDetails(), i = this.currentFrag || (s ? tt(null, s.fragments, t) : null);
|
|
19712
19712
|
if (i) {
|
|
19713
19713
|
const r = i.programDateTime;
|
|
19714
19714
|
if (r !== null) {
|
|
@@ -19760,7 +19760,7 @@ class Su {
|
|
|
19760
19760
|
}
|
|
19761
19761
|
this.keyUriToKeyInfo = {};
|
|
19762
19762
|
}
|
|
19763
|
-
createKeyLoadError(e, t =
|
|
19763
|
+
createKeyLoadError(e, t = b.KEY_LOAD_ERROR, s, i, r) {
|
|
19764
19764
|
return new Be({
|
|
19765
19765
|
type: U.NETWORK_ERROR,
|
|
19766
19766
|
details: t,
|
|
@@ -19797,11 +19797,11 @@ class Su {
|
|
|
19797
19797
|
const r = e.decryptdata;
|
|
19798
19798
|
if (!r) {
|
|
19799
19799
|
const l = new Error(t ? `Expected frag.decryptdata to be defined after setting format ${t}` : "Missing decryption data on fragment in onKeyLoading");
|
|
19800
|
-
return Promise.reject(this.createKeyLoadError(e,
|
|
19800
|
+
return Promise.reject(this.createKeyLoadError(e, b.KEY_LOAD_ERROR, l));
|
|
19801
19801
|
}
|
|
19802
19802
|
const n = r.uri;
|
|
19803
19803
|
if (!n)
|
|
19804
|
-
return Promise.reject(this.createKeyLoadError(e,
|
|
19804
|
+
return Promise.reject(this.createKeyLoadError(e, b.KEY_LOAD_ERROR, new Error(`Invalid key URI: "${n}"`)));
|
|
19805
19805
|
let o = this.keyUriToKeyInfo[n];
|
|
19806
19806
|
if ((s = o) != null && s.decryptdata.key)
|
|
19807
19807
|
return r.key = o.decryptdata.key, Promise.resolve({
|
|
@@ -19837,7 +19837,7 @@ class Su {
|
|
|
19837
19837
|
case "AES-256-CTR":
|
|
19838
19838
|
return this.loadKeyHTTP(o, e);
|
|
19839
19839
|
default:
|
|
19840
|
-
return Promise.reject(this.createKeyLoadError(e,
|
|
19840
|
+
return Promise.reject(this.createKeyLoadError(e, b.KEY_LOAD_ERROR, new Error(`Key supplied with unsupported METHOD: "${r.method}"`)));
|
|
19841
19841
|
}
|
|
19842
19842
|
}
|
|
19843
19843
|
loadKeyEME(e, t) {
|
|
@@ -19869,30 +19869,30 @@ class Su {
|
|
|
19869
19869
|
retryDelay: 0,
|
|
19870
19870
|
maxRetryDelay: 0
|
|
19871
19871
|
}, u = {
|
|
19872
|
-
onSuccess: (d, f, g,
|
|
19872
|
+
onSuccess: (d, f, g, p) => {
|
|
19873
19873
|
const {
|
|
19874
|
-
frag:
|
|
19874
|
+
frag: E,
|
|
19875
19875
|
keyInfo: y,
|
|
19876
19876
|
url: S
|
|
19877
19877
|
} = g;
|
|
19878
|
-
if (!
|
|
19879
|
-
return o(this.createKeyLoadError(
|
|
19880
|
-
y.decryptdata.key =
|
|
19881
|
-
frag:
|
|
19878
|
+
if (!E.decryptdata || y !== this.keyUriToKeyInfo[S])
|
|
19879
|
+
return o(this.createKeyLoadError(E, b.KEY_LOAD_ERROR, new Error("after key load, decryptdata unset or changed"), p));
|
|
19880
|
+
y.decryptdata.key = E.decryptdata.key = new Uint8Array(d.data), E.keyLoader = null, y.loader = null, n({
|
|
19881
|
+
frag: E,
|
|
19882
19882
|
keyInfo: y
|
|
19883
19883
|
});
|
|
19884
19884
|
},
|
|
19885
|
-
onError: (d, f, g,
|
|
19886
|
-
this.resetLoader(f), o(this.createKeyLoadError(t,
|
|
19885
|
+
onError: (d, f, g, p) => {
|
|
19886
|
+
this.resetLoader(f), o(this.createKeyLoadError(t, b.KEY_LOAD_ERROR, new Error(`HTTP Error ${d.code} loading key ${d.text}`), g, te({
|
|
19887
19887
|
url: c.url,
|
|
19888
19888
|
data: void 0
|
|
19889
19889
|
}, d)));
|
|
19890
19890
|
},
|
|
19891
19891
|
onTimeout: (d, f, g) => {
|
|
19892
|
-
this.resetLoader(f), o(this.createKeyLoadError(t,
|
|
19892
|
+
this.resetLoader(f), o(this.createKeyLoadError(t, b.KEY_LOAD_TIMEOUT, new Error("key loading timed out"), g));
|
|
19893
19893
|
},
|
|
19894
19894
|
onAbort: (d, f, g) => {
|
|
19895
|
-
this.resetLoader(f), o(this.createKeyLoadError(t,
|
|
19895
|
+
this.resetLoader(f), o(this.createKeyLoadError(t, b.INTERNAL_ABORTED, new Error("key loading aborted"), g));
|
|
19896
19896
|
}
|
|
19897
19897
|
};
|
|
19898
19898
|
r.load(c, h, u);
|
|
@@ -20132,11 +20132,11 @@ class vu {
|
|
|
20132
20132
|
} = c;
|
|
20133
20133
|
this.variableList = g;
|
|
20134
20134
|
const {
|
|
20135
|
-
AUDIO:
|
|
20136
|
-
SUBTITLES:
|
|
20135
|
+
AUDIO: p = [],
|
|
20136
|
+
SUBTITLES: E,
|
|
20137
20137
|
"CLOSED-CAPTIONS": y
|
|
20138
20138
|
} = we.parseMasterPlaylistMedia(n, o, c);
|
|
20139
|
-
|
|
20139
|
+
p.length && !p.some((T) => !T.url) && h[0].audioCodec && !h[0].attrs.AUDIO && (this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"), p.unshift({
|
|
20140
20140
|
type: "main",
|
|
20141
20141
|
name: "main",
|
|
20142
20142
|
groupId: "main",
|
|
@@ -20149,8 +20149,8 @@ class vu {
|
|
|
20149
20149
|
url: ""
|
|
20150
20150
|
})), r.trigger(m.MANIFEST_LOADED, {
|
|
20151
20151
|
levels: h,
|
|
20152
|
-
audioTracks:
|
|
20153
|
-
subtitles:
|
|
20152
|
+
audioTracks: p,
|
|
20153
|
+
subtitles: E,
|
|
20154
20154
|
captions: y,
|
|
20155
20155
|
contentSteering: l,
|
|
20156
20156
|
url: o,
|
|
@@ -20194,7 +20194,7 @@ class vu {
|
|
|
20194
20194
|
handleManifestParsingError(e, t, s, i, r) {
|
|
20195
20195
|
this.hls.trigger(m.ERROR, {
|
|
20196
20196
|
type: U.NETWORK_ERROR,
|
|
20197
|
-
details:
|
|
20197
|
+
details: b.MANIFEST_PARSING_ERROR,
|
|
20198
20198
|
fatal: t.type === z.MANIFEST,
|
|
20199
20199
|
url: e.url,
|
|
20200
20200
|
err: s,
|
|
@@ -20211,20 +20211,20 @@ class vu {
|
|
|
20211
20211
|
e.type === z.LEVEL ? n += `: ${e.level} id: ${e.id}` : (e.type === z.AUDIO_TRACK || e.type === z.SUBTITLE_TRACK) && (n += ` id: ${e.id} group-id: "${e.groupId}"`);
|
|
20212
20212
|
const o = new Error(n);
|
|
20213
20213
|
this.hls.logger.warn(`[playlist-loader]: ${n}`);
|
|
20214
|
-
let c =
|
|
20214
|
+
let c = b.UNKNOWN, l = !1;
|
|
20215
20215
|
const h = this.getInternalLoader(e);
|
|
20216
20216
|
switch (e.type) {
|
|
20217
20217
|
case z.MANIFEST:
|
|
20218
|
-
c = s ?
|
|
20218
|
+
c = s ? b.MANIFEST_LOAD_TIMEOUT : b.MANIFEST_LOAD_ERROR, l = !0;
|
|
20219
20219
|
break;
|
|
20220
20220
|
case z.LEVEL:
|
|
20221
|
-
c = s ?
|
|
20221
|
+
c = s ? b.LEVEL_LOAD_TIMEOUT : b.LEVEL_LOAD_ERROR, l = !1;
|
|
20222
20222
|
break;
|
|
20223
20223
|
case z.AUDIO_TRACK:
|
|
20224
|
-
c = s ?
|
|
20224
|
+
c = s ? b.AUDIO_TRACK_LOAD_TIMEOUT : b.AUDIO_TRACK_LOAD_ERROR, l = !1;
|
|
20225
20225
|
break;
|
|
20226
20226
|
case z.SUBTITLE_TRACK:
|
|
20227
|
-
c = s ?
|
|
20227
|
+
c = s ? b.SUBTITLE_TRACK_LOAD_TIMEOUT : b.SUBTITLE_LOAD_ERROR, l = !1;
|
|
20228
20228
|
break;
|
|
20229
20229
|
}
|
|
20230
20230
|
h && this.resetInternalLoader(e.type);
|
|
@@ -20255,19 +20255,19 @@ class vu {
|
|
|
20255
20255
|
id: h,
|
|
20256
20256
|
groupId: u,
|
|
20257
20257
|
deliveryDirectives: d
|
|
20258
|
-
} = i, f = Bs(t, i), g = Wr(i),
|
|
20258
|
+
} = i, f = Bs(t, i), g = Wr(i), p = typeof i.level == "number" && g === N.MAIN ? l : void 0;
|
|
20259
20259
|
if (!e.fragments.length) {
|
|
20260
20260
|
const y = e.playlistParsingError = new Error("No Segments found in Playlist");
|
|
20261
20261
|
o.trigger(m.ERROR, {
|
|
20262
20262
|
type: U.NETWORK_ERROR,
|
|
20263
|
-
details:
|
|
20263
|
+
details: b.LEVEL_EMPTY_ERROR,
|
|
20264
20264
|
fatal: !1,
|
|
20265
20265
|
url: f,
|
|
20266
20266
|
error: y,
|
|
20267
20267
|
reason: y.message,
|
|
20268
20268
|
response: t,
|
|
20269
20269
|
context: i,
|
|
20270
|
-
level:
|
|
20270
|
+
level: p,
|
|
20271
20271
|
parent: g,
|
|
20272
20272
|
networkDetails: r,
|
|
20273
20273
|
stats: s
|
|
@@ -20275,19 +20275,19 @@ class vu {
|
|
|
20275
20275
|
return;
|
|
20276
20276
|
}
|
|
20277
20277
|
e.targetduration || (e.playlistParsingError = new Error("Missing Target Duration"));
|
|
20278
|
-
const
|
|
20279
|
-
if (
|
|
20280
|
-
if (this.hls.logger.warn(
|
|
20278
|
+
const E = e.playlistParsingError;
|
|
20279
|
+
if (E) {
|
|
20280
|
+
if (this.hls.logger.warn(E), !o.config.ignorePlaylistParsingErrors) {
|
|
20281
20281
|
o.trigger(m.ERROR, {
|
|
20282
20282
|
type: U.NETWORK_ERROR,
|
|
20283
|
-
details:
|
|
20283
|
+
details: b.LEVEL_PARSING_ERROR,
|
|
20284
20284
|
fatal: !1,
|
|
20285
20285
|
url: f,
|
|
20286
|
-
error:
|
|
20287
|
-
reason:
|
|
20286
|
+
error: E,
|
|
20287
|
+
reason: E.message,
|
|
20288
20288
|
response: t,
|
|
20289
20289
|
context: i,
|
|
20290
|
-
level:
|
|
20290
|
+
level: p,
|
|
20291
20291
|
parent: g,
|
|
20292
20292
|
networkDetails: r,
|
|
20293
20293
|
stats: s
|
|
@@ -20302,7 +20302,7 @@ class vu {
|
|
|
20302
20302
|
o.trigger(m.LEVEL_LOADED, {
|
|
20303
20303
|
details: e,
|
|
20304
20304
|
levelInfo: i.levelOrTrack || o.levels[0],
|
|
20305
|
-
level:
|
|
20305
|
+
level: p || 0,
|
|
20306
20306
|
id: h || 0,
|
|
20307
20307
|
stats: s,
|
|
20308
20308
|
networkDetails: r,
|
|
@@ -20335,7 +20335,7 @@ class vu {
|
|
|
20335
20335
|
}
|
|
20336
20336
|
}
|
|
20337
20337
|
}
|
|
20338
|
-
class
|
|
20338
|
+
class me {
|
|
20339
20339
|
/**
|
|
20340
20340
|
* Get the video-dev/hls.js package version.
|
|
20341
20341
|
*/
|
|
@@ -20370,19 +20370,19 @@ class Ee {
|
|
|
20370
20370
|
return U;
|
|
20371
20371
|
}
|
|
20372
20372
|
static get ErrorDetails() {
|
|
20373
|
-
return
|
|
20373
|
+
return b;
|
|
20374
20374
|
}
|
|
20375
20375
|
/**
|
|
20376
20376
|
* Get the default configuration applied to new instances.
|
|
20377
20377
|
*/
|
|
20378
20378
|
static get DefaultConfig() {
|
|
20379
|
-
return
|
|
20379
|
+
return me.defaultConfig ? me.defaultConfig : iu;
|
|
20380
20380
|
}
|
|
20381
20381
|
/**
|
|
20382
20382
|
* Replace the default configuration applied to new instances.
|
|
20383
20383
|
*/
|
|
20384
20384
|
static set DefaultConfig(e) {
|
|
20385
|
-
|
|
20385
|
+
me.defaultConfig = e;
|
|
20386
20386
|
}
|
|
20387
20387
|
/**
|
|
20388
20388
|
* Creates an instance of an HLS client that can attach to exactly one `HTMLMediaElement`.
|
|
@@ -20390,7 +20390,7 @@ class Ee {
|
|
|
20390
20390
|
*/
|
|
20391
20391
|
constructor(e = {}) {
|
|
20392
20392
|
this.config = void 0, this.userConfig = void 0, this.logger = void 0, this.coreComponents = void 0, this.networkControllers = void 0, this._emitter = new fi(), this._autoLevelCapping = -1, this._maxHdcpLevel = null, this.abrController = void 0, this.bufferController = void 0, this.capLevelController = void 0, this.latencyController = void 0, this.levelController = void 0, this.streamController = void 0, this.audioStreamController = void 0, this.subtititleStreamController = void 0, this.audioTrackController = void 0, this.subtitleTrackController = void 0, this.interstitialsController = void 0, this.gapController = void 0, this.emeController = void 0, this.cmcdController = void 0, this._media = null, this._url = null, this._sessionId = void 0, this.triggeringException = void 0, this.started = !1;
|
|
20393
|
-
const t = this.logger = Ua(e.debug || !1, "Hls instance", e.assetPlayerId), s = this.config = nu(
|
|
20393
|
+
const t = this.logger = Ua(e.debug || !1, "Hls instance", e.assetPlayerId), s = this.config = nu(me.DefaultConfig, e, t);
|
|
20394
20394
|
this.userConfig = e, s.progressive && au(s, t);
|
|
20395
20395
|
const {
|
|
20396
20396
|
abrController: i,
|
|
@@ -20398,11 +20398,11 @@ class Ee {
|
|
|
20398
20398
|
capLevelController: n,
|
|
20399
20399
|
errorController: o,
|
|
20400
20400
|
fpsController: c
|
|
20401
|
-
} = s, l = new o(this), h = this.abrController = new i(this), u = new ko(this), d = s.interstitialsController, f = d ? this.interstitialsController = new d(this,
|
|
20402
|
-
|
|
20401
|
+
} = s, l = new o(this), h = this.abrController = new i(this), u = new ko(this), d = s.interstitialsController, f = d ? this.interstitialsController = new d(this, me) : null, g = this.bufferController = new r(this, u), p = this.capLevelController = new n(this), E = new c(this), y = new vu(this), S = s.contentSteeringController, T = S ? new S(this) : null, x = this.levelController = new mu(this, T), A = new fu(this), _ = new Su(this.config), v = this.streamController = new Tu(this, u, _), R = this.gapController = new hu(this, u);
|
|
20402
|
+
p.setStreamController(v), E.setStreamController(v);
|
|
20403
20403
|
const D = [y, x, v];
|
|
20404
20404
|
f && D.splice(1, 0, f), T && D.splice(1, 0, T), this.networkControllers = D;
|
|
20405
|
-
const L = [h, g,
|
|
20405
|
+
const L = [h, g, R, p, E, A, u];
|
|
20406
20406
|
this.audioTrackController = this.createController(s.audioTrackController, D);
|
|
20407
20407
|
const P = s.audioStreamController;
|
|
20408
20408
|
P && D.push(this.audioStreamController = new P(this, u, _)), this.subtitleTrackController = this.createController(s.subtitleTrackController, D);
|
|
@@ -20448,7 +20448,7 @@ class Ee {
|
|
|
20448
20448
|
const i = e === m.ERROR;
|
|
20449
20449
|
this.trigger(m.ERROR, {
|
|
20450
20450
|
type: U.OTHER_ERROR,
|
|
20451
|
-
details:
|
|
20451
|
+
details: b.INTERNAL_EXCEPTION,
|
|
20452
20452
|
fatal: i,
|
|
20453
20453
|
event: e,
|
|
20454
20454
|
error: s
|
|
@@ -20476,7 +20476,7 @@ class Ee {
|
|
|
20476
20476
|
const r = new Error(`attachMedia failed: invalid argument (${e})`);
|
|
20477
20477
|
this.trigger(m.ERROR, {
|
|
20478
20478
|
type: U.OTHER_ERROR,
|
|
20479
|
-
details:
|
|
20479
|
+
details: b.ATTACH_MEDIA_ERROR,
|
|
20480
20480
|
fatal: !0,
|
|
20481
20481
|
error: r
|
|
20482
20482
|
});
|
|
@@ -21041,7 +21041,7 @@ class Ee {
|
|
|
21041
21041
|
return cn(e, s, navigator.mediaCapabilities);
|
|
21042
21042
|
}
|
|
21043
21043
|
}
|
|
21044
|
-
|
|
21044
|
+
me.defaultConfig = void 0;
|
|
21045
21045
|
const xu = { class: "test-video-dialog" }, Au = ["das-loading-text"], Lu = ["objectFit"], Iu = /* @__PURE__ */ ya({
|
|
21046
21046
|
__name: "das-hls-player",
|
|
21047
21047
|
props: {
|
|
@@ -21056,83 +21056,84 @@ const xu = { class: "test-video-dialog" }, Au = ["das-loading-text"], Lu = ["obj
|
|
|
21056
21056
|
},
|
|
21057
21057
|
emits: ["loaded", "errorClick", "error"],
|
|
21058
21058
|
setup(a, { expose: e, emit: t }) {
|
|
21059
|
-
Ta((
|
|
21060
|
-
|
|
21059
|
+
Ta((v) => ({
|
|
21060
|
+
d5293290: v.loadingBackground
|
|
21061
21061
|
}));
|
|
21062
21062
|
const s = a, i = t, {
|
|
21063
21063
|
fit: r,
|
|
21064
21064
|
loadingText: n = ki("加载中"),
|
|
21065
21065
|
loading: o = !1,
|
|
21066
21066
|
errorText: c = ki("das-ui-hls-player-videoLoadFailedRetry")
|
|
21067
|
-
} = Sa(s), l = va(() => s.src || ""), h = Ca(s, "videoError"), u =
|
|
21068
|
-
|
|
21069
|
-
const g =
|
|
21070
|
-
const
|
|
21071
|
-
if (d != null && d.value) return
|
|
21072
|
-
setTimeout(() =>
|
|
21067
|
+
} = Sa(s), l = va(() => s.src || ""), h = Ca(s, "videoError"), u = Ze(!0), d = Ze(null), f = Ze(null);
|
|
21068
|
+
Ze(!1);
|
|
21069
|
+
const g = Ze(""), p = Ze(null), E = () => new Promise((v) => {
|
|
21070
|
+
const R = () => {
|
|
21071
|
+
if (d != null && d.value) return v();
|
|
21072
|
+
setTimeout(() => R(), 50);
|
|
21073
21073
|
};
|
|
21074
|
-
|
|
21075
|
-
}),
|
|
21074
|
+
R();
|
|
21075
|
+
}), y = async () => {
|
|
21076
21076
|
if (!l.value)
|
|
21077
21077
|
return g.value = "视频URL为空";
|
|
21078
|
-
if (await E(),
|
|
21079
|
-
const
|
|
21078
|
+
if (await E(), T(), me.isSupported()) {
|
|
21079
|
+
const v = {
|
|
21080
21080
|
debug: !0,
|
|
21081
21081
|
enableWorker: !0,
|
|
21082
21082
|
lowLatencyMode: !0,
|
|
21083
21083
|
backBufferLength: 90
|
|
21084
21084
|
};
|
|
21085
|
-
f.value = new
|
|
21086
|
-
|
|
21087
|
-
|
|
21088
|
-
|
|
21089
|
-
|
|
21090
|
-
|
|
21085
|
+
f.value = new me(v), f.value.attachMedia(d.value), f.value.on(me.Events.MEDIA_ATTACHED, () => {
|
|
21086
|
+
f.value.loadSource(l.value), f.value.autoLevelCapping = -1, f.value.on(me.Events.MANIFEST_PARSED, () => {
|
|
21087
|
+
p.value && clearTimeout(p.value), p.value = setTimeout(() => {
|
|
21088
|
+
d.value.play().catch(x), i("loaded", d.value);
|
|
21089
|
+
}, 1e3);
|
|
21090
|
+
});
|
|
21091
|
+
}), f.value.on(me.Events.ERROR, (R, D) => {
|
|
21092
|
+
x(D);
|
|
21093
|
+
}), f.value.on(me.Events.BUFFER_CREATED, () => {
|
|
21091
21094
|
});
|
|
21092
|
-
} else d.value.canPlayType("application/vnd.apple.mpegurl") ? (d.value.src = s.src, d.value.play()) :
|
|
21095
|
+
} else d.value.canPlayType("application/vnd.apple.mpegurl") ? (d.value.src = s.src, d.value.play()) : x({ type: "UNSUPPORTED" });
|
|
21093
21096
|
d.value.addEventListener("playing", () => {
|
|
21094
21097
|
u.value = !1, g.value = "";
|
|
21095
21098
|
}), d.value.addEventListener("waiting", () => {
|
|
21096
21099
|
g.value = "视频缓冲中...";
|
|
21097
21100
|
});
|
|
21098
|
-
}, y = () => {
|
|
21099
|
-
var _, v;
|
|
21100
|
-
(_ = d.value) == null || _.removeEventListener("playing", () => {
|
|
21101
|
-
}), (v = d.value) == null || v.removeEventListener("waiting", () => {
|
|
21102
|
-
});
|
|
21103
21101
|
}, S = () => {
|
|
21102
|
+
var v, R;
|
|
21103
|
+
(v = d.value) == null || v.removeEventListener("playing", () => {
|
|
21104
|
+
}), (R = d.value) == null || R.removeEventListener("waiting", () => {
|
|
21105
|
+
});
|
|
21106
|
+
}, T = () => {
|
|
21104
21107
|
f.value && (f.value.destroy(), f.value = null);
|
|
21105
|
-
},
|
|
21106
|
-
g.value = "视频加载失败"
|
|
21107
|
-
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
case Ee.ErrorTypes.NETWORK_ERROR:
|
|
21111
|
-
g.value = "网络错误,正在尝试恢复...", f.value.startLoad(), x();
|
|
21108
|
+
}, x = (v) => {
|
|
21109
|
+
if (g.value = "视频加载失败", v.fatal)
|
|
21110
|
+
switch (v.type) {
|
|
21111
|
+
case me.ErrorTypes.NETWORK_ERROR:
|
|
21112
|
+
g.value = "网络错误,正在尝试恢复...", f.value.startLoad();
|
|
21112
21113
|
break;
|
|
21113
|
-
case
|
|
21114
|
-
g.value = "媒体错误,正在尝试恢复...", f.value.recoverMediaError()
|
|
21114
|
+
case me.ErrorTypes.MEDIA_ERROR:
|
|
21115
|
+
g.value = "媒体错误,正在尝试恢复...", f.value.recoverMediaError();
|
|
21115
21116
|
break;
|
|
21116
21117
|
default:
|
|
21117
|
-
g.value = "播放错误,正在尝试重新初始化...",
|
|
21118
|
+
g.value = "播放错误,正在尝试重新初始化...", A();
|
|
21118
21119
|
break;
|
|
21119
21120
|
}
|
|
21120
21121
|
else
|
|
21121
|
-
g.value = "播放出现异常,正在尝试恢复...",
|
|
21122
|
-
}, x = () => {
|
|
21123
|
-
g.value = "正在重试...", S(), setTimeout(() => {
|
|
21124
|
-
p();
|
|
21125
|
-
}, 2e3);
|
|
21122
|
+
g.value = "播放出现异常,正在尝试恢复...", A();
|
|
21126
21123
|
}, A = () => {
|
|
21127
|
-
|
|
21124
|
+
g.value = "正在重试...", T(), setTimeout(() => {
|
|
21125
|
+
y();
|
|
21126
|
+
}, 1e3);
|
|
21127
|
+
}, _ = () => {
|
|
21128
|
+
y();
|
|
21128
21129
|
};
|
|
21129
|
-
return xa(
|
|
21130
|
-
|
|
21130
|
+
return xa(_), Aa(() => {
|
|
21131
|
+
p.value && clearTimeout(p.value), S(), T();
|
|
21131
21132
|
}), e({
|
|
21132
21133
|
video: d
|
|
21133
|
-
}), (
|
|
21134
|
+
}), (v, R) => (gs(), fs("div", xu, [
|
|
21134
21135
|
Pi("button", {
|
|
21135
|
-
onClick:
|
|
21136
|
+
onClick: _,
|
|
21136
21137
|
style: { "margin-top": "50px" }
|
|
21137
21138
|
}, "点击播放"),
|
|
21138
21139
|
Pi(
|
|
@@ -21173,7 +21174,7 @@ const xu = { class: "test-video-dialog" }, Au = ["das-loading-text"], Lu = ["obj
|
|
|
21173
21174
|
for (const [s, i] of e)
|
|
21174
21175
|
t[s] = i;
|
|
21175
21176
|
return t;
|
|
21176
|
-
}, bu = /* @__PURE__ */ Ru(Iu, [["__scopeId", "data-v-
|
|
21177
|
+
}, bu = /* @__PURE__ */ Ru(Iu, [["__scopeId", "data-v-57987bb2"]]), _u = {
|
|
21177
21178
|
加载中: { "zh-CN": "加载中", en: "Loading", _appCode: "framework" },
|
|
21178
21179
|
"das-ui-hls-player-videoLoadFailedRetry": {
|
|
21179
21180
|
"zh-CN": "视频加载失败,请点击重试",
|
|
@@ -21182,7 +21183,7 @@ const xu = { class: "test-video-dialog" }, Au = ["das-loading-text"], Lu = ["obj
|
|
|
21182
21183
|
}
|
|
21183
21184
|
};
|
|
21184
21185
|
_a(_u);
|
|
21185
|
-
const Nu = ba(bu), Bu = () =>
|
|
21186
|
+
const Nu = ba(bu), Bu = () => Ze(null);
|
|
21186
21187
|
export {
|
|
21187
21188
|
Nu as DasHlsPlayer,
|
|
21188
21189
|
Bu as getDasHlsPlayerRef
|