@volcengine/veplayer-plugin 2.4.0-rc.5 → 2.4.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.
@@ -2923,6 +2923,21 @@ var Buffer$6 = /* @__PURE__ */ function() {
2923
2923
  length: Buffer22.totalLength && Buffer22.totalLength(buffers)
2924
2924
  };
2925
2925
  }
2926
+ }, {
2927
+ key: "isBuffered",
2928
+ value: function isBuffered(media, pos) {
2929
+ if (media) {
2930
+ var buffered = Buffer22.get(media);
2931
+ if (buffered !== null && buffered !== void 0 && buffered.length) {
2932
+ for (var i = 0; i < buffered.length; i++) {
2933
+ if (pos >= buffered.start(i) && pos <= buffered.end(i)) {
2934
+ return true;
2935
+ }
2936
+ }
2937
+ }
2938
+ }
2939
+ return false;
2940
+ }
2926
2941
  }]);
2927
2942
  return Buffer22;
2928
2943
  }();
@@ -6052,7 +6067,7 @@ var AAC$2 = /* @__PURE__ */ function() {
6052
6067
  continue;
6053
6068
  }
6054
6069
  frameLength = (data2[i + 3] & 3) << 11 | data2[i + 4] << 3 | (data2[i + 5] & 224) >> 5;
6055
- if (len - i < frameLength)
6070
+ if (!frameLength || len - i < frameLength)
6056
6071
  break;
6057
6072
  protectionSkipBytes = (~data2[i + 1] & 1) * 2;
6058
6073
  frames.push({
@@ -12138,7 +12153,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
12138
12153
  }
12139
12154
  return;
12140
12155
  }
12141
- if (opts.isLive && media.readyState === 4 && bufferEnd > opts.disconnectTime) {
12156
+ if (opts.isLive && media.readyState === 4 && bufferEnd - media.currentTime > opts.disconnectTime) {
12142
12157
  _this.disconnect();
12143
12158
  }
12144
12159
  }
@@ -12310,7 +12325,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
12310
12325
  _createClass$j(Flv2, [{
12311
12326
  key: "version",
12312
12327
  get: function get3() {
12313
- return "3.0.19-rc.0";
12328
+ return "3.0.19-rc.10";
12314
12329
  }
12315
12330
  }, {
12316
12331
  key: "isLive",
@@ -30962,7 +30977,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
30962
30977
  }, {
30963
30978
  key: "version",
30964
30979
  get: function get3() {
30965
- return "0.2.1-alpha.0";
30980
+ return "0.2.1-alpha.1";
30966
30981
  }
30967
30982
  }, {
30968
30983
  key: "beforePlayerInit",
@@ -31058,8 +31073,14 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
31058
31073
  }
31059
31074
  player.config.url = backupURL;
31060
31075
  if (backupConstruct) {
31061
- var newPlugin = player.registerPlugin(backupConstruct);
31062
- newPlugin.beforePlayerInit();
31076
+ if (!Array.isArray(backupConstruct)) {
31077
+ backupConstruct = [backupConstruct];
31078
+ }
31079
+ backupConstruct.forEach(function(construct3) {
31080
+ var _newPlugin$beforePlay;
31081
+ var newPlugin = player.registerPlugin(construct3);
31082
+ (_newPlugin$beforePlay = newPlugin.beforePlayerInit) === null || _newPlugin$beforePlay === void 0 ? void 0 : _newPlugin$beforePlay.call(newPlugin);
31083
+ });
31063
31084
  } else {
31064
31085
  player.video.src = backupURL;
31065
31086
  }