@volcengine/veplayer-plugin 2.6.0-rc.5 → 2.6.1-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.
Files changed (31) hide show
  1. package/esm/index.development.js +192 -164
  2. package/esm/index.production.js +2 -2
  3. package/esm/veplayer.plugin.abr.development.js +2 -1
  4. package/esm/veplayer.plugin.abr.production.js +1 -1
  5. package/esm/veplayer.plugin.drm.development.js +2 -1
  6. package/esm/veplayer.plugin.drm.production.js +1 -1
  7. package/esm/veplayer.plugin.flv.development.js +3 -2
  8. package/esm/veplayer.plugin.flv.production.js +1 -1
  9. package/esm/veplayer.plugin.hls.development.js +53 -15
  10. package/esm/veplayer.plugin.hls.production.js +1 -1
  11. package/esm/veplayer.plugin.mp4.development.js +115 -124
  12. package/esm/veplayer.plugin.mp4.production.js +1 -1
  13. package/esm/veplayer.plugin.rtm.development.js +3 -2
  14. package/esm/veplayer.plugin.rtm.production.js +1 -1
  15. package/esm/veplayer.plugin.shaka.development.js +2 -1
  16. package/esm/veplayer.plugin.shaka.production.js +1 -1
  17. package/package.json +1 -1
  18. package/umd/veplayer.plugin.abr.development.js +2 -1
  19. package/umd/veplayer.plugin.abr.production.js +1 -1
  20. package/umd/veplayer.plugin.drm.development.js +2 -1
  21. package/umd/veplayer.plugin.drm.production.js +1 -1
  22. package/umd/veplayer.plugin.flv.development.js +3 -2
  23. package/umd/veplayer.plugin.flv.production.js +1 -1
  24. package/umd/veplayer.plugin.hls.development.js +53 -15
  25. package/umd/veplayer.plugin.hls.production.js +1 -1
  26. package/umd/veplayer.plugin.mp4.development.js +115 -124
  27. package/umd/veplayer.plugin.mp4.production.js +1 -1
  28. package/umd/veplayer.plugin.rtm.development.js +3 -2
  29. package/umd/veplayer.plugin.rtm.production.js +1 -1
  30. package/umd/veplayer.plugin.shaka.development.js +2 -1
  31. package/umd/veplayer.plugin.shaka.production.js +1 -1
@@ -1640,7 +1640,7 @@ util.getCurrentTimeByOffset = function(offsetTime, segments) {
1640
1640
  }
1641
1641
  return offsetTime;
1642
1642
  };
1643
- var version = "3.0.21-rc.5";
1643
+ var version = "3.0.21-alpha.13";
1644
1644
  var ERROR_MAP = {
1645
1645
  1: 5101,
1646
1646
  2: 5102,
@@ -1815,8 +1815,9 @@ function removeHooks(hookName, handler) {
1815
1815
  if (index !== -1) {
1816
1816
  hooks.splice(index, 1);
1817
1817
  }
1818
+ } else if (__hooks[hookName]) {
1819
+ __hooks[hookName] = null;
1818
1820
  }
1819
- delete __hooks[hookName];
1820
1821
  }
1821
1822
  function hooksDescriptor(instance) {
1822
1823
  var presetHooks = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
@@ -3881,15 +3882,17 @@ var MSE = /* @__PURE__ */ function() {
3881
3882
  op.exec();
3882
3883
  } catch (error) {
3883
3884
  if (error && error.message && error.message.indexOf("SourceBuffer is full") >= 0) {
3885
+ var _op$promise;
3884
3886
  this._mseFullFlag[type] = true;
3885
3887
  if (op.context && _typeof(op.context) === "object") {
3886
3888
  op.context.isFull = true;
3887
3889
  }
3888
3890
  this._logger.error("[MSE error], context,", op.context, " ,name,", op.opName, ",err,SourceBuffer is full");
3889
- op.promise.reject(new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_FULL, error));
3891
+ op === null || op === void 0 ? void 0 : (_op$promise = op.promise) === null || _op$promise === void 0 ? void 0 : _op$promise.reject(new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_FULL, error));
3890
3892
  } else {
3893
+ var _op$promise2;
3891
3894
  this._logger.error(error);
3892
- op.promise.reject(error.constructor === StreamingError ? error : new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_OTHER, error));
3895
+ op === null || op === void 0 ? void 0 : (_op$promise2 = op.promise) === null || _op$promise2 === void 0 ? void 0 : _op$promise2.reject(error.constructor === StreamingError ? error : new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_OTHER, error));
3893
3896
  queue.shift();
3894
3897
  this._startQueue(type);
3895
3898
  }
@@ -6338,6 +6341,19 @@ var NALu = /* @__PURE__ */ function() {
6338
6341
  _createClass(NALu2, null, [{
6339
6342
  key: "parseAnnexB",
6340
6343
  value: function parseAnnexB(data) {
6344
+ var j = data.byteLength - 1;
6345
+ var dropZerosLength = 0;
6346
+ do {
6347
+ if (data[j] === 0) {
6348
+ dropZerosLength++;
6349
+ } else {
6350
+ break;
6351
+ }
6352
+ j--;
6353
+ } while (j > 0);
6354
+ if (dropZerosLength >= 3) {
6355
+ data = data.subarray(0, j + 1);
6356
+ }
6341
6357
  var len = data.length;
6342
6358
  var start = 2;
6343
6359
  var end = 0;
@@ -6358,6 +6374,9 @@ var NALu = /* @__PURE__ */ function() {
6358
6374
  } else if (data[end - 2] !== 0) {
6359
6375
  end++;
6360
6376
  break;
6377
+ } else if (end < len - 1 && data[end + 1] !== 1) {
6378
+ end++;
6379
+ break;
6361
6380
  }
6362
6381
  if (start !== end - 2)
6363
6382
  units.push(data.subarray(start, end - 2));
@@ -7175,9 +7194,26 @@ var TsFixer = /* @__PURE__ */ function() {
7175
7194
  var samples = audioTrack.samples;
7176
7195
  if (!samples.length)
7177
7196
  return;
7178
- samples.forEach(function(x) {
7179
- x.pts -= _this3._needForceFixLargeGap ? _this3._baseAudioDts : _this3._baseDts;
7180
- x.dts = x.pts;
7197
+ if (audioTrack.codecType === AudioCodecType.MP3) {
7198
+ if (this.lastAudioSample) {
7199
+ samples.unshift(this.lastAudioSample);
7200
+ }
7201
+ for (var index = 0; index < samples.length; index++) {
7202
+ var x = samples[index];
7203
+ if (samples[index + 1]) {
7204
+ x.duration = samples[index + 1].pts - x.pts;
7205
+ } else {
7206
+ break;
7207
+ }
7208
+ x.pts -= this._baseDts;
7209
+ x.dts = x.pts;
7210
+ }
7211
+ this.lastAudioSample = samples.pop();
7212
+ return;
7213
+ }
7214
+ samples.forEach(function(x2) {
7215
+ x2.pts -= _this3._needForceFixLargeGap ? _this3._baseAudioDts : _this3._baseDts;
7216
+ x2.dts = x2.pts;
7181
7217
  });
7182
7218
  this._doFixAudioInternal(audioTrack, samples, 9e4);
7183
7219
  }
@@ -12143,7 +12179,7 @@ var BufferService = /* @__PURE__ */ function() {
12143
12179
  value: function() {
12144
12180
  var _appendBuffer = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2(segment, audioSegment, videoChunk, audioChunk, discontinuity, contiguous, startTime) {
12145
12181
  var _this2 = this;
12146
- var afterAppend, p, needInit, _this$_transmuxer$tra, _this$_transmuxer$tra2, video, audio, isFirstAppend, mse, _p, videoData, videoRest, audioData, audioRest;
12182
+ var afterAppend, p, needInit, _this$_transmuxer$tra, _this$_transmuxer$tra2, video, audio, isFirstAppend, mse, _p, videoData, videoRest, audioData, audioRest, ret;
12147
12183
  return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
12148
12184
  while (1)
12149
12185
  switch (_context2.prev = _context2.next) {
@@ -12196,11 +12232,11 @@ var BufferService = /* @__PURE__ */ function() {
12196
12232
  this._softVideo.appendBuffer(video, audio);
12197
12233
  this._needInitSegment = false;
12198
12234
  afterAppend();
12199
- _context2.next = 30;
12235
+ _context2.next = 32;
12200
12236
  break;
12201
12237
  case 20:
12202
12238
  if (!this._mse) {
12203
- _context2.next = 30;
12239
+ _context2.next = 32;
12204
12240
  break;
12205
12241
  }
12206
12242
  isFirstAppend = !this._sourceCreated;
@@ -12223,8 +12259,10 @@ var BufferService = /* @__PURE__ */ function() {
12223
12259
  audioData = audio.data, audioRest = _objectWithoutProperties$1(audio, _excluded2);
12224
12260
  _p.push(mse.append(MSE.AUDIO, audioData, audioRest));
12225
12261
  }
12226
- return _context2.abrupt("return", Promise.all(_p).then(afterAppend));
12227
- case 30:
12262
+ ret = Promise.all(_p);
12263
+ ret.then(afterAppend);
12264
+ return _context2.abrupt("return", ret);
12265
+ case 32:
12228
12266
  case "end":
12229
12267
  return _context2.stop();
12230
12268
  }
@@ -15714,7 +15752,7 @@ var Hls = /* @__PURE__ */ function(_EventEmitter) {
15714
15752
  }]);
15715
15753
  return Hls2;
15716
15754
  }(EventEmitter);
15717
- _defineProperty$3(Hls, "version", "3.0.21-rc.5");
15755
+ _defineProperty$3(Hls, "version", "3.0.21-rc.20");
15718
15756
  try {
15719
15757
  if (localStorage.getItem("xgd")) {
15720
15758
  Hls.enableLogger();
@@ -15875,7 +15913,7 @@ var HlsPlugin = /* @__PURE__ */ function(_BasePlugin) {
15875
15913
  get: function get() {
15876
15914
  var _this$player, _this$player$config;
15877
15915
  var mediaType = (_this$player = this.player) === null || _this$player === void 0 ? void 0 : (_this$player$config = _this$player.config) === null || _this$player$config === void 0 ? void 0 : _this$player$config.mediaType;
15878
- return !!mediaType && mediaType !== "video" && mediaType !== "audio";
15916
+ return !!mediaType && mediaType !== "video" && mediaType !== "audio" && mediaType !== "offscreen-video";
15879
15917
  }
15880
15918
  }, {
15881
15919
  key: "beforePlayerInit",
@@ -15884,7 +15922,7 @@ var HlsPlugin = /* @__PURE__ */ function(_BasePlugin) {
15884
15922
  var config = this.player.config;
15885
15923
  var mediaElem = this.player.media || this.player.video;
15886
15924
  var hlsOpts = config.hls || {};
15887
- if (!config.url && !config.__allowHlsEmptyUrl__ || !hlsOpts.preferMMS && MSE.isMMSOnly()) {
15925
+ if (!config.url && !config.__allowHlsEmptyUrl__ || !this.softDecode && !hlsOpts.preferMMS && MSE.isMMSOnly()) {
15888
15926
  return;
15889
15927
  }
15890
15928
  if (this.hls)