@volcengine/veplayer-plugin 2.2.0-rc.0 → 2.3.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.development.js +75169 -69866
- package/esm/index.production.js +4 -5
- package/esm/veplayer.plugin.drm.development.js +1577 -0
- package/esm/veplayer.plugin.drm.production.js +2 -0
- package/esm/veplayer.plugin.flv.development.js +45 -23
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +80 -58
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.mp4.development.js +10674 -5866
- package/esm/veplayer.plugin.mp4.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +19 -17
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.time.shift.development.js +3 -3
- package/esm/veplayer.plugin.time.shift.production.js +1 -1
- package/esm/veplayer.plugin.xgvideo.development.js +228 -226
- package/esm/veplayer.plugin.xgvideo.production.js +1 -1
- package/package.json +8 -3
- package/umd/index.d.ts +2 -0
- package/umd/index.development.js +74071 -68723
- package/umd/index.production.js +1 -1
- package/umd/veplayer.plugin.drm.development.js +1579 -0
- package/umd/veplayer.plugin.drm.production.js +1 -0
- package/umd/veplayer.plugin.flv.development.js +28 -5
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +42 -21
- package/umd/veplayer.plugin.hls.production.js +1 -1
- package/umd/veplayer.plugin.mp4.development.js +10218 -5410
- package/umd/veplayer.plugin.mp4.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +3 -2
- package/umd/veplayer.plugin.rtm.production.js +1 -1
- package/umd/veplayer.plugin.time.shift.development.js +3 -3
- package/umd/veplayer.plugin.time.shift.production.js +1 -1
- package/umd/veplayer.plugin.xgvideo.development.js +2 -1
- package/umd/veplayer.plugin.xgvideo.production.js +1 -1
|
@@ -913,13 +913,13 @@ var XgplayerTimeRange = /* @__PURE__ */ function() {
|
|
|
913
913
|
}
|
|
914
914
|
_createClass$2(XgplayerTimeRange2, [{
|
|
915
915
|
key: "start",
|
|
916
|
-
value: function start(
|
|
917
|
-
return this.bufferedList[
|
|
916
|
+
value: function start(index) {
|
|
917
|
+
return this.bufferedList[index].start;
|
|
918
918
|
}
|
|
919
919
|
}, {
|
|
920
920
|
key: "end",
|
|
921
|
-
value: function end(
|
|
922
|
-
return this.bufferedList[
|
|
921
|
+
value: function end(index) {
|
|
922
|
+
return this.bufferedList[index].end;
|
|
923
923
|
}
|
|
924
924
|
}, {
|
|
925
925
|
key: "length",
|
|
@@ -1563,10 +1563,10 @@ util.getIndexByTime = function(time, segments) {
|
|
|
1563
1563
|
return _index;
|
|
1564
1564
|
};
|
|
1565
1565
|
util.getOffsetCurrentTime = function(currentTime, segments) {
|
|
1566
|
-
var
|
|
1566
|
+
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
|
|
1567
1567
|
var _index = -1;
|
|
1568
|
-
if (
|
|
1569
|
-
_index =
|
|
1568
|
+
if (index >= 0 && index < segments.length) {
|
|
1569
|
+
_index = index;
|
|
1570
1570
|
} else {
|
|
1571
1571
|
_index = util.getIndexByTime(currentTime, segments);
|
|
1572
1572
|
}
|
|
@@ -1605,7 +1605,7 @@ util.getCurrentTimeByOffset = function(offsetTime, segments) {
|
|
|
1605
1605
|
}
|
|
1606
1606
|
return offsetTime;
|
|
1607
1607
|
};
|
|
1608
|
-
var version = "3.0.
|
|
1608
|
+
var version = "3.0.12";
|
|
1609
1609
|
var ERROR_MAP = {
|
|
1610
1610
|
1: 5101,
|
|
1611
1611
|
2: 5102,
|
|
@@ -2815,7 +2815,7 @@ var Buffer$1 = /* @__PURE__ */ function() {
|
|
|
2815
2815
|
};
|
|
2816
2816
|
var start = 0;
|
|
2817
2817
|
var end = 0;
|
|
2818
|
-
var
|
|
2818
|
+
var index = 0;
|
|
2819
2819
|
var nextStart = 0;
|
|
2820
2820
|
var nextEnd = 0;
|
|
2821
2821
|
var prevStart = 0;
|
|
@@ -2826,7 +2826,7 @@ var Buffer$1 = /* @__PURE__ */ function() {
|
|
|
2826
2826
|
if (pos + maxHole >= item[0] && pos <= item[1]) {
|
|
2827
2827
|
start = item[0];
|
|
2828
2828
|
end = item[1];
|
|
2829
|
-
|
|
2829
|
+
index = i;
|
|
2830
2830
|
} else if (pos + maxHole < item[0]) {
|
|
2831
2831
|
nextStart = item[0];
|
|
2832
2832
|
nextEnd = item[1];
|
|
@@ -2839,7 +2839,7 @@ var Buffer$1 = /* @__PURE__ */ function() {
|
|
|
2839
2839
|
return {
|
|
2840
2840
|
start,
|
|
2841
2841
|
end,
|
|
2842
|
-
index
|
|
2842
|
+
index,
|
|
2843
2843
|
buffers,
|
|
2844
2844
|
nextStart,
|
|
2845
2845
|
nextEnd,
|
|
@@ -3830,7 +3830,7 @@ function setUrlParams(url, params) {
|
|
|
3830
3830
|
}
|
|
3831
3831
|
return url;
|
|
3832
3832
|
}
|
|
3833
|
-
function createResponse(data, done, response, contentLength, age, startTime, firstByteTime,
|
|
3833
|
+
function createResponse(data, done, response, contentLength, age, startTime, firstByteTime, index, range, vid, priOptions) {
|
|
3834
3834
|
age = age !== null && age !== void 0 ? parseFloat(age) : null;
|
|
3835
3835
|
contentLength = parseInt(contentLength || "0", 10);
|
|
3836
3836
|
if (Number.isNaN(contentLength))
|
|
@@ -3838,7 +3838,7 @@ function createResponse(data, done, response, contentLength, age, startTime, fir
|
|
|
3838
3838
|
var options = {
|
|
3839
3839
|
range,
|
|
3840
3840
|
vid,
|
|
3841
|
-
index
|
|
3841
|
+
index,
|
|
3842
3842
|
contentLength,
|
|
3843
3843
|
age,
|
|
3844
3844
|
startTime,
|
|
@@ -3916,14 +3916,14 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
3916
3916
|
key: "load",
|
|
3917
3917
|
value: function load(_ref) {
|
|
3918
3918
|
var _this$_abortControlle, _this2 = this;
|
|
3919
|
-
var url = _ref.url, vid = _ref.vid, timeout = _ref.timeout, responseType = _ref.responseType, onProgress = _ref.onProgress,
|
|
3919
|
+
var url = _ref.url, vid = _ref.vid, timeout = _ref.timeout, responseType = _ref.responseType, onProgress = _ref.onProgress, index = _ref.index, onTimeout = _ref.onTimeout, onCancel = _ref.onCancel, range = _ref.range, transformResponse = _ref.transformResponse, request = _ref.request, params = _ref.params, logger2 = _ref.logger, method = _ref.method, headers = _ref.headers, body = _ref.body, mode = _ref.mode, credentials = _ref.credentials, cache = _ref.cache, redirect = _ref.redirect, referrer = _ref.referrer, referrerPolicy = _ref.referrerPolicy, onProcessMinLen = _ref.onProcessMinLen, priOptions = _ref.priOptions;
|
|
3920
3920
|
this._logger = logger2;
|
|
3921
3921
|
this._aborted = false;
|
|
3922
3922
|
this._onProcessMinLen = onProcessMinLen;
|
|
3923
3923
|
this._onCancel = onCancel;
|
|
3924
3924
|
this._abortController = typeof AbortController !== "undefined" && new AbortController();
|
|
3925
3925
|
this._running = true;
|
|
3926
|
-
this._index =
|
|
3926
|
+
this._index = index;
|
|
3927
3927
|
this._range = range || [0, 0];
|
|
3928
3928
|
this._vid = vid || url;
|
|
3929
3929
|
this._priOptions = priOptions || {};
|
|
@@ -3972,7 +3972,7 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
3972
3972
|
}, timeout);
|
|
3973
3973
|
}
|
|
3974
3974
|
var startTime = Date.now();
|
|
3975
|
-
this._logger.debug("[fetch load start], index,",
|
|
3975
|
+
this._logger.debug("[fetch load start], index,", index, ",range,", range);
|
|
3976
3976
|
return new Promise(function(resolve, reject) {
|
|
3977
3977
|
fetch(request || url, request ? void 0 : init).then(/* @__PURE__ */ function() {
|
|
3978
3978
|
var _ref2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(response) {
|
|
@@ -4050,8 +4050,8 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
4050
4050
|
priOptions: _this2._priOptions
|
|
4051
4051
|
});
|
|
4052
4052
|
case 37:
|
|
4053
|
-
_this2._logger.debug("[fetch load end], index,",
|
|
4054
|
-
resolve(createResponse(data, true, response, response.headers.get("Content-Length"), response.headers.get("age"), startTime, firstByteTime,
|
|
4053
|
+
_this2._logger.debug("[fetch load end], index,", index, ",range,", range);
|
|
4054
|
+
resolve(createResponse(data, true, response, response.headers.get("Content-Length"), response.headers.get("age"), startTime, firstByteTime, index, range, _this2._vid, _this2._priOptions));
|
|
4055
4055
|
case 39:
|
|
4056
4056
|
case "end":
|
|
4057
4057
|
return _context.stop();
|
|
@@ -4666,7 +4666,7 @@ var Task = /* @__PURE__ */ function() {
|
|
|
4666
4666
|
this.alive = !!config.onProgress;
|
|
4667
4667
|
!config.logger && (config.logger = new Logger$2("Loader"));
|
|
4668
4668
|
this._loaderType = type;
|
|
4669
|
-
this._loader = type === LoaderType.FETCH &&
|
|
4669
|
+
this._loader = type === LoaderType.FETCH && typeof fetch !== "undefined" ? new FetchLoader() : new XhrLoader();
|
|
4670
4670
|
this._config = config;
|
|
4671
4671
|
this._retryCount = 0;
|
|
4672
4672
|
this._retryTimer = null;
|
|
@@ -6064,7 +6064,7 @@ var NALu = /* @__PURE__ */ function() {
|
|
|
6064
6064
|
}
|
|
6065
6065
|
}
|
|
6066
6066
|
return {
|
|
6067
|
-
payload: unit.subarray(i),
|
|
6067
|
+
payload: unit.subarray(i, i + size),
|
|
6068
6068
|
type,
|
|
6069
6069
|
size,
|
|
6070
6070
|
uuid
|
|
@@ -6115,6 +6115,11 @@ var ExpGolomb = /* @__PURE__ */ function() {
|
|
|
6115
6115
|
this._loadWord();
|
|
6116
6116
|
}
|
|
6117
6117
|
_createClass(ExpGolomb2, [{
|
|
6118
|
+
key: "bitsAvailable",
|
|
6119
|
+
get: function get() {
|
|
6120
|
+
return this._bitsAvailable;
|
|
6121
|
+
}
|
|
6122
|
+
}, {
|
|
6118
6123
|
key: "_loadWord",
|
|
6119
6124
|
value: function _loadWord() {
|
|
6120
6125
|
var position = this._data.byteLength - this._bytesAvailable;
|
|
@@ -6580,6 +6585,9 @@ var HEVC = /* @__PURE__ */ function() {
|
|
|
6580
6585
|
}
|
|
6581
6586
|
var subLayerProfilePresentFlag = [];
|
|
6582
6587
|
var subLayerLevelPresentFlag = [];
|
|
6588
|
+
if (maxSubLayersMinus1 > eg.bitsAvailable) {
|
|
6589
|
+
throw new Error("maxSubLayersMinus inavlid size ".concat(maxSubLayersMinus1));
|
|
6590
|
+
}
|
|
6583
6591
|
for (var j = 0; j < maxSubLayersMinus1; j++) {
|
|
6584
6592
|
subLayerProfilePresentFlag[j] = eg.readBits(1);
|
|
6585
6593
|
subLayerLevelPresentFlag[j] = eg.readBits(1);
|
|
@@ -6722,6 +6730,16 @@ var TsFixer = /* @__PURE__ */ function() {
|
|
|
6722
6730
|
x.dts += vDelta;
|
|
6723
6731
|
x.pts += vDelta;
|
|
6724
6732
|
});
|
|
6733
|
+
} else {
|
|
6734
|
+
for (var i = 1; i < len - 1; i++) {
|
|
6735
|
+
var _samples$i;
|
|
6736
|
+
var dts = (_samples$i = samples[i]) === null || _samples$i === void 0 ? void 0 : _samples$i.dts;
|
|
6737
|
+
var prevDts = samples[i - 1].dts;
|
|
6738
|
+
if (dts && dts - prevDts < 0) {
|
|
6739
|
+
samples[i].dts += vDelta;
|
|
6740
|
+
samples[i].pts += vDelta;
|
|
6741
|
+
}
|
|
6742
|
+
}
|
|
6725
6743
|
}
|
|
6726
6744
|
}
|
|
6727
6745
|
var refSampleDurationInt;
|
|
@@ -6732,13 +6750,13 @@ var TsFixer = /* @__PURE__ */ function() {
|
|
|
6732
6750
|
var second = videoTrack.samples[1];
|
|
6733
6751
|
refSampleDurationInt = len === 1 ? 9e3 : Math.floor(second.dts - first.dts);
|
|
6734
6752
|
}
|
|
6735
|
-
for (var
|
|
6736
|
-
var
|
|
6737
|
-
var _nextSample = samples[
|
|
6738
|
-
if (
|
|
6739
|
-
sampleDuration = _nextSample.dts -
|
|
6740
|
-
} else if (samples[
|
|
6741
|
-
sampleDuration = Math.min(
|
|
6753
|
+
for (var _i = 0; _i < len; _i++) {
|
|
6754
|
+
var _dts = samples[_i].dts;
|
|
6755
|
+
var _nextSample = samples[_i + 1];
|
|
6756
|
+
if (_i < len - 1) {
|
|
6757
|
+
sampleDuration = _nextSample.dts - _dts;
|
|
6758
|
+
} else if (samples[_i - 1]) {
|
|
6759
|
+
sampleDuration = Math.min(_dts - samples[_i - 1].dts, refSampleDurationInt);
|
|
6742
6760
|
} else {
|
|
6743
6761
|
sampleDuration = refSampleDurationInt;
|
|
6744
6762
|
}
|
|
@@ -6751,15 +6769,15 @@ var TsFixer = /* @__PURE__ */ function() {
|
|
|
6751
6769
|
}
|
|
6752
6770
|
videoTrack.warnings.push({
|
|
6753
6771
|
type: WarningType.LARGE_VIDEO_GAP,
|
|
6754
|
-
time:
|
|
6755
|
-
dts,
|
|
6756
|
-
originDts: samples[
|
|
6772
|
+
time: _dts / videoTrack.timescale,
|
|
6773
|
+
dts: _dts,
|
|
6774
|
+
originDts: samples[_i].originDts,
|
|
6757
6775
|
nextDts: this._videoNextDts,
|
|
6758
6776
|
sampleDuration,
|
|
6759
6777
|
refSampleDuration: refSampleDurationInt
|
|
6760
6778
|
});
|
|
6761
6779
|
}
|
|
6762
|
-
samples[
|
|
6780
|
+
samples[_i].duration = sampleDuration;
|
|
6763
6781
|
this._videoNextDts += sampleDuration;
|
|
6764
6782
|
}
|
|
6765
6783
|
}
|
|
@@ -8224,7 +8242,7 @@ var MP4Parser = /* @__PURE__ */ function() {
|
|
|
8224
8242
|
offset += defaultSize;
|
|
8225
8243
|
}
|
|
8226
8244
|
} else {
|
|
8227
|
-
ret[tfhd.trackId] = trun.samples.map(function(s,
|
|
8245
|
+
ret[tfhd.trackId] = trun.samples.map(function(s, index) {
|
|
8228
8246
|
s = {
|
|
8229
8247
|
offset,
|
|
8230
8248
|
dts,
|
|
@@ -8232,7 +8250,7 @@ var MP4Parser = /* @__PURE__ */ function() {
|
|
|
8232
8250
|
duration: s.duration || defaultDuration,
|
|
8233
8251
|
size: s.size || defaultSize,
|
|
8234
8252
|
gopId,
|
|
8235
|
-
keyframe:
|
|
8253
|
+
keyframe: index === 0 || s.flags !== null && s.flags !== void 0 && (s.flags & 65536) >>> 0 !== 65536
|
|
8236
8254
|
};
|
|
8237
8255
|
if (s.keyframe) {
|
|
8238
8256
|
gopId++;
|
|
@@ -11274,8 +11292,9 @@ var BufferService = /* @__PURE__ */ function() {
|
|
|
11274
11292
|
}, {
|
|
11275
11293
|
key: "isFull",
|
|
11276
11294
|
value: function isFull() {
|
|
11295
|
+
var _this$_mse3;
|
|
11277
11296
|
var mediaType = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : MSE.VIDEO;
|
|
11278
|
-
return this._mse.isFull(mediaType);
|
|
11297
|
+
return (_this$_mse3 = this._mse) === null || _this$_mse3 === void 0 ? void 0 : _this$_mse3.isFull(mediaType);
|
|
11279
11298
|
}
|
|
11280
11299
|
}]);
|
|
11281
11300
|
return BufferService2;
|
|
@@ -11288,6 +11307,7 @@ function getConfig(cfg) {
|
|
|
11288
11307
|
retryDelay: 1e3,
|
|
11289
11308
|
pollRetryCount: 2,
|
|
11290
11309
|
loadTimeout: 1e4,
|
|
11310
|
+
manifestLoadTimeout: 1e4,
|
|
11291
11311
|
preloadTime: 30,
|
|
11292
11312
|
softDecode: false,
|
|
11293
11313
|
bufferBehind: 10,
|
|
@@ -11536,11 +11556,11 @@ function getCodecs(type, codecs) {
|
|
|
11536
11556
|
}
|
|
11537
11557
|
function parseMasterPlaylist(lines, parentUrl) {
|
|
11538
11558
|
var master = new MasterPlaylist();
|
|
11539
|
-
var
|
|
11559
|
+
var index = 0;
|
|
11540
11560
|
var line;
|
|
11541
11561
|
var audioStreams = [];
|
|
11542
11562
|
var subtitleStreams = [];
|
|
11543
|
-
while (line = lines[
|
|
11563
|
+
while (line = lines[index++]) {
|
|
11544
11564
|
var tag = parseTag(line);
|
|
11545
11565
|
if (!tag)
|
|
11546
11566
|
continue;
|
|
@@ -11582,7 +11602,7 @@ function parseMasterPlaylist(lines, parentUrl) {
|
|
|
11582
11602
|
var _attr = parseAttr(data);
|
|
11583
11603
|
_stream.bitrate = parseInt(_attr["AVERAGE-BANDWIDTH"] || _attr.BANDWIDTH);
|
|
11584
11604
|
_stream.name = _attr.NAME;
|
|
11585
|
-
_stream.url = getAbsoluteUrl(lines[
|
|
11605
|
+
_stream.url = getAbsoluteUrl(lines[index++], parentUrl);
|
|
11586
11606
|
if (_attr.RESOLUTION) {
|
|
11587
11607
|
var _attr$RESOLUTION$spli = _attr.RESOLUTION.split("x"), _attr$RESOLUTION$spli2 = _slicedToArray$1(_attr$RESOLUTION$spli, 2), w = _attr$RESOLUTION$spli2[0], h = _attr$RESOLUTION$spli2[1];
|
|
11588
11608
|
_stream.width = parseInt(w);
|
|
@@ -11637,11 +11657,11 @@ function parseMediaPlaylist(lines, parentUrl, useLowLatency) {
|
|
|
11637
11657
|
var totalDuration = 0;
|
|
11638
11658
|
var curSN = 0;
|
|
11639
11659
|
var curCC = 0;
|
|
11640
|
-
var
|
|
11660
|
+
var index = 0;
|
|
11641
11661
|
var line;
|
|
11642
11662
|
var endOfList = false;
|
|
11643
11663
|
var partSegmentIndex = 0;
|
|
11644
|
-
while (line = lines[
|
|
11664
|
+
while (line = lines[index++]) {
|
|
11645
11665
|
if (endOfList) {
|
|
11646
11666
|
break;
|
|
11647
11667
|
}
|
|
@@ -11874,26 +11894,26 @@ var ManifestLoader = /* @__PURE__ */ function() {
|
|
|
11874
11894
|
this.hls = hls;
|
|
11875
11895
|
this._timer = null;
|
|
11876
11896
|
this._useLowLatency = hls.config.useLowLatency;
|
|
11877
|
-
var _this$hls$config = this.hls.config, retryCount = _this$hls$config.retryCount, retryDelay = _this$hls$config.retryDelay,
|
|
11897
|
+
var _this$hls$config = this.hls.config, retryCount = _this$hls$config.retryCount, retryDelay = _this$hls$config.retryDelay, manifestLoadTimeout = _this$hls$config.manifestLoadTimeout, fetchOptions = _this$hls$config.fetchOptions;
|
|
11878
11898
|
this._loader = new NetLoader(_objectSpread2$2(_objectSpread2$2({}, fetchOptions), {}, {
|
|
11879
11899
|
responseType: "text",
|
|
11880
11900
|
retry: retryCount,
|
|
11881
11901
|
retryDelay,
|
|
11882
|
-
timeout:
|
|
11902
|
+
timeout: manifestLoadTimeout,
|
|
11883
11903
|
onRetryError: this._onLoaderRetry
|
|
11884
11904
|
}));
|
|
11885
11905
|
this._audioLoader = new NetLoader(_objectSpread2$2(_objectSpread2$2({}, fetchOptions), {}, {
|
|
11886
11906
|
responseType: "text",
|
|
11887
11907
|
retry: retryCount,
|
|
11888
11908
|
retryDelay,
|
|
11889
|
-
timeout:
|
|
11909
|
+
timeout: manifestLoadTimeout,
|
|
11890
11910
|
onRetryError: this._onLoaderRetry
|
|
11891
11911
|
}));
|
|
11892
11912
|
this._subtitleLoader = new NetLoader(_objectSpread2$2(_objectSpread2$2({}, fetchOptions), {}, {
|
|
11893
11913
|
responseType: "text",
|
|
11894
11914
|
retry: retryCount,
|
|
11895
11915
|
retryDelay,
|
|
11896
|
-
timeout:
|
|
11916
|
+
timeout: manifestLoadTimeout,
|
|
11897
11917
|
onRetryError: this._onLoaderRetry
|
|
11898
11918
|
}));
|
|
11899
11919
|
}
|
|
@@ -12284,13 +12304,13 @@ var Stream = /* @__PURE__ */ function() {
|
|
|
12284
12304
|
return playlist;
|
|
12285
12305
|
var maxStartPoint = playlist.totalDuration - playlist.partHoldBack;
|
|
12286
12306
|
var segs = playlist.segments;
|
|
12287
|
-
var
|
|
12307
|
+
var index = 0;
|
|
12288
12308
|
for (var i = 0, l = segs.length; i < l; i++) {
|
|
12289
12309
|
if (segs[i].start <= maxStartPoint && segs[i].independent) {
|
|
12290
|
-
|
|
12310
|
+
index = i;
|
|
12291
12311
|
}
|
|
12292
12312
|
}
|
|
12293
|
-
var usefulSegs = segs.slice(
|
|
12313
|
+
var usefulSegs = segs.slice(index);
|
|
12294
12314
|
var endTime = 0;
|
|
12295
12315
|
usefulSegs.forEach(function(s) {
|
|
12296
12316
|
s.start = endTime;
|
|
@@ -12340,10 +12360,10 @@ var Stream = /* @__PURE__ */ function() {
|
|
|
12340
12360
|
}
|
|
12341
12361
|
if (hasNew) {
|
|
12342
12362
|
logger$1.log("update segments: endSN:".concat(endSN, ", partIndex:").concat(endPartIndex, " --> endSN:").concat(playlist.endSN, ", partIndex:").concat(playlist.endPartIndex));
|
|
12343
|
-
var
|
|
12363
|
+
var index = playlist.segments.findIndex(function(x) {
|
|
12344
12364
|
return x.sn === endSN && x.partIndex === endPartIndex;
|
|
12345
12365
|
});
|
|
12346
|
-
var toAppend =
|
|
12366
|
+
var toAppend = index < 0 ? playlist.segments : playlist.segments.slice(index + 1);
|
|
12347
12367
|
if (segments.length && toAppend.length) {
|
|
12348
12368
|
var endTime = endSeg.end;
|
|
12349
12369
|
var endTimeBeforeAppend = endTime;
|
|
@@ -12488,15 +12508,15 @@ var Playlist = /* @__PURE__ */ function() {
|
|
|
12488
12508
|
}
|
|
12489
12509
|
}, {
|
|
12490
12510
|
key: "getSegmentByIndex",
|
|
12491
|
-
value: function getSegmentByIndex(
|
|
12511
|
+
value: function getSegmentByIndex(index) {
|
|
12492
12512
|
var _this$currentSegments6;
|
|
12493
|
-
return (_this$currentSegments6 = this.currentSegments) === null || _this$currentSegments6 === void 0 ? void 0 : _this$currentSegments6[
|
|
12513
|
+
return (_this$currentSegments6 = this.currentSegments) === null || _this$currentSegments6 === void 0 ? void 0 : _this$currentSegments6[index];
|
|
12494
12514
|
}
|
|
12495
12515
|
}, {
|
|
12496
12516
|
key: "setNextSegmentByIndex",
|
|
12497
12517
|
value: function setNextSegmentByIndex() {
|
|
12498
|
-
var
|
|
12499
|
-
this._segmentPointer =
|
|
12518
|
+
var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
12519
|
+
this._segmentPointer = index - 1;
|
|
12500
12520
|
}
|
|
12501
12521
|
}, {
|
|
12502
12522
|
key: "findSegmentIndexByTime",
|
|
@@ -12581,8 +12601,8 @@ var Playlist = /* @__PURE__ */ function() {
|
|
|
12581
12601
|
}, {
|
|
12582
12602
|
key: "checkSegmentTrackChange",
|
|
12583
12603
|
value: function checkSegmentTrackChange(cTime, nbSb) {
|
|
12584
|
-
var
|
|
12585
|
-
var seg = this.getSegmentByIndex(
|
|
12604
|
+
var index = this.findSegmentIndexByTime(cTime);
|
|
12605
|
+
var seg = this.getSegmentByIndex(index);
|
|
12586
12606
|
if (!seg)
|
|
12587
12607
|
return;
|
|
12588
12608
|
if (!seg.hasAudio && !seg.hasVideo)
|
|
@@ -12591,7 +12611,7 @@ var Playlist = /* @__PURE__ */ function() {
|
|
|
12591
12611
|
return seg;
|
|
12592
12612
|
if (seg.end - cTime > 0.3)
|
|
12593
12613
|
return;
|
|
12594
|
-
var next = this.getSegmentByIndex(
|
|
12614
|
+
var next = this.getSegmentByIndex(index + 1);
|
|
12595
12615
|
if (!next)
|
|
12596
12616
|
return;
|
|
12597
12617
|
if (!next.hasAudio && !next.hasVideo)
|
|
@@ -14111,7 +14131,7 @@ var Hls = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
14111
14131
|
}]);
|
|
14112
14132
|
return Hls2;
|
|
14113
14133
|
}(EventEmitter);
|
|
14114
|
-
_defineProperty$3(Hls, "version", "3.0.
|
|
14134
|
+
_defineProperty$3(Hls, "version", "3.0.12");
|
|
14115
14135
|
try {
|
|
14116
14136
|
if (localStorage.getItem("xgd")) {
|
|
14117
14137
|
Hls.enableLogger();
|
|
@@ -14433,7 +14453,9 @@ var HlsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
14433
14453
|
}(BasePlugin);
|
|
14434
14454
|
_defineProperty$3(HlsPlugin, "Hls", Hls);
|
|
14435
14455
|
_defineProperty$3(HlsPlugin, "EVENT", Event$1);
|
|
14436
|
-
|
|
14456
|
+
const DynamicModule = window["VePlayer"].DynamicModule;
|
|
14457
|
+
const __PLUGIN_NAME__ = DynamicModule.PluginHls;
|
|
14437
14458
|
export {
|
|
14438
|
-
|
|
14459
|
+
HlsPlugin,
|
|
14460
|
+
__PLUGIN_NAME__
|
|
14439
14461
|
};
|