@volcengine/veplayer-plugin 2.4.0-rc.2 → 2.4.0-rc.3

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.
@@ -5213,6 +5213,8 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
5213
5213
  _defineProperty$f(this, "_chunkSpeed", 0);
5214
5214
  _defineProperty$f(this, "_chunkCache", []);
5215
5215
  _defineProperty$f(this, "_speeds", []);
5216
+ _defineProperty$f(this, "_totalSize", 0);
5217
+ _defineProperty$f(this, "_totalCost", 0);
5216
5218
  this._opts = opts || {};
5217
5219
  }
5218
5220
  _createClass$h(BandwidthService2, [{
@@ -5229,6 +5231,8 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
5229
5231
  var _this$_opts, _this$_opts2;
5230
5232
  if (!totalByte || !ms || totalByte < (((_this$_opts = this._opts) === null || _this$_opts === void 0 ? void 0 : _this$_opts.skipChunkSize) || SKIP_SMALL_CHUNK))
5231
5233
  return;
5234
+ this._totalSize += totalByte;
5235
+ this._totalCost += ms;
5232
5236
  this._chunkSpeed = 8e3 * totalByte / ms;
5233
5237
  this._chunkCache.push({
5234
5238
  size: totalByte,
@@ -5278,11 +5282,23 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
5278
5282
  }
5279
5283
  return this._chunkSpeed;
5280
5284
  }
5285
+ }, {
5286
+ key: "getTotalSize",
5287
+ value: function getTotalSize() {
5288
+ return this._totalSize;
5289
+ }
5290
+ }, {
5291
+ key: "getTotalCost",
5292
+ value: function getTotalCost() {
5293
+ return this._totalCost;
5294
+ }
5281
5295
  }, {
5282
5296
  key: "reset",
5283
5297
  value: function reset() {
5284
5298
  this._chunkCache = [];
5285
5299
  this._speeds = [];
5300
+ this._totalSize = 0;
5301
+ this._totalCost = 0;
5286
5302
  }
5287
5303
  }]);
5288
5304
  return BandwidthService2;
@@ -5411,13 +5427,15 @@ var MediaStatsService$1 = /* @__PURE__ */ function() {
5411
5427
  _createClass$h(MediaStatsService2, [{
5412
5428
  key: "getStats",
5413
5429
  value: function getStats2() {
5414
- var _this$_core, _this$_core2, _this$_core2$speedInf, _this$_core3, _this$_core3$speedInf, _this$_core4, _this$_core4$bufferIn;
5430
+ var _this$_core, _this$_core2, _this$_core2$speedInf, _this$_core3, _this$_core3$speedInf, _this$_core4, _this$_core4$speedInf, _this$_core5, _this$_core5$speedInf, _this$_core6, _this$_core6$bufferIn;
5415
5431
  var _ref2 = ((_this$_core = this._core) === null || _this$_core === void 0 ? void 0 : _this$_core.media) || {}, _ref2$currentTime = _ref2.currentTime, currentTime = _ref2$currentTime === void 0 ? 0 : _ref2$currentTime, _ref2$decodeFps = _ref2.decodeFps, decodeFps = _ref2$decodeFps === void 0 ? 0 : _ref2$decodeFps;
5416
5432
  return _objectSpread2$8(_objectSpread2$8({}, this._stats.getStats()), {}, {
5417
5433
  downloadSpeed: ((_this$_core2 = this._core) === null || _this$_core2 === void 0 ? void 0 : (_this$_core2$speedInf = _this$_core2.speedInfo) === null || _this$_core2$speedInf === void 0 ? void 0 : _this$_core2$speedInf.call(_this$_core2).speed) || 0,
5418
5434
  avgSpeed: ((_this$_core3 = this._core) === null || _this$_core3 === void 0 ? void 0 : (_this$_core3$speedInf = _this$_core3.speedInfo) === null || _this$_core3$speedInf === void 0 ? void 0 : _this$_core3$speedInf.call(_this$_core3).avgSpeed) || 0,
5435
+ totalReceivedByte: ((_this$_core4 = this._core) === null || _this$_core4 === void 0 ? void 0 : (_this$_core4$speedInf = _this$_core4.speedInfo) === null || _this$_core4$speedInf === void 0 ? void 0 : _this$_core4$speedInf.call(_this$_core4).totalSize) || 0,
5436
+ totalReceivedCost: ((_this$_core5 = this._core) === null || _this$_core5 === void 0 ? void 0 : (_this$_core5$speedInf = _this$_core5.speedInfo) === null || _this$_core5$speedInf === void 0 ? void 0 : _this$_core5$speedInf.call(_this$_core5).totalCost) || 0,
5419
5437
  currentTime,
5420
- bufferEnd: ((_this$_core4 = this._core) === null || _this$_core4 === void 0 ? void 0 : (_this$_core4$bufferIn = _this$_core4.bufferInfo()) === null || _this$_core4$bufferIn === void 0 ? void 0 : _this$_core4$bufferIn.remaining) || 0,
5438
+ bufferEnd: ((_this$_core6 = this._core) === null || _this$_core6 === void 0 ? void 0 : (_this$_core6$bufferIn = _this$_core6.bufferInfo()) === null || _this$_core6$bufferIn === void 0 ? void 0 : _this$_core6$bufferIn.remaining) || 0,
5421
5439
  decodeFps
5422
5440
  });
5423
5441
  }
@@ -12278,7 +12296,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
12278
12296
  _createClass$j(Flv2, [{
12279
12297
  key: "version",
12280
12298
  get: function get3() {
12281
- return "3.0.18-alpha.3";
12299
+ return "3.0.18-alpha.5";
12282
12300
  }
12283
12301
  }, {
12284
12302
  key: "isLive",
@@ -12312,7 +12330,9 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
12312
12330
  value: function speedInfo() {
12313
12331
  return {
12314
12332
  speed: this._bandwidthService.getLatestSpeed(),
12315
- avgSpeed: this._bandwidthService.getAvgSpeed()
12333
+ avgSpeed: this._bandwidthService.getAvgSpeed(),
12334
+ totalSize: this._bandwidthService.getTotalSize(),
12335
+ totalCost: this._bandwidthService.getTotalCost()
12316
12336
  };
12317
12337
  }
12318
12338
  }, {
@@ -12602,7 +12622,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
12602
12622
  _context9.prev = 17;
12603
12623
  _context9.t0 = _context9["catch"](12);
12604
12624
  this._loading = false;
12605
- return _context9.abrupt("return", this._emitError(StreamingError$3.network(_context9.t0)));
12625
+ return _context9.abrupt("return", this._emitError(StreamingError$3.network(_context9.t0), false));
12606
12626
  case 21:
12607
12627
  case "end":
12608
12628
  return _context9.stop();