@byteplus/veplayer-plugin 2.4.2-rc.1 → 2.4.2-rc.2
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/esm/index.development.js +895 -321
- package/esm/index.production.js +4 -4
- package/esm/veplayer.plugin.rtm.development.js +751 -177
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.rtm.development.js +751 -177
- package/umd/veplayer.plugin.rtm.production.js +1 -1
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
function _iterableToArrayLimit(arr, i) {
|
|
2
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3
|
+
if (null != _i) {
|
|
4
|
+
var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
|
|
5
|
+
try {
|
|
6
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
7
|
+
if (Object(_i) !== _i)
|
|
8
|
+
return;
|
|
9
|
+
_n = false;
|
|
10
|
+
} else
|
|
11
|
+
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
|
|
12
|
+
;
|
|
13
|
+
} catch (err) {
|
|
14
|
+
_d = true, _e = err;
|
|
15
|
+
} finally {
|
|
16
|
+
try {
|
|
17
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
|
|
18
|
+
return;
|
|
19
|
+
} finally {
|
|
20
|
+
if (_d)
|
|
21
|
+
throw _e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return _arr;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
1
27
|
function ownKeys$2(object, enumerableOnly) {
|
|
2
28
|
var keys = Object.keys(object);
|
|
3
29
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -335,14 +361,6 @@ function _regeneratorRuntime$1() {
|
|
|
335
361
|
}
|
|
336
362
|
}, exports;
|
|
337
363
|
}
|
|
338
|
-
function _typeof$2(obj) {
|
|
339
|
-
"@babel/helpers - typeof";
|
|
340
|
-
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
341
|
-
return typeof obj2;
|
|
342
|
-
} : function(obj2) {
|
|
343
|
-
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
344
|
-
}, _typeof$2(obj);
|
|
345
|
-
}
|
|
346
364
|
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
347
365
|
try {
|
|
348
366
|
var info = gen[key](arg);
|
|
@@ -483,6 +501,104 @@ function _createSuper$1(Derived) {
|
|
|
483
501
|
return _possibleConstructorReturn$1(this, result);
|
|
484
502
|
};
|
|
485
503
|
}
|
|
504
|
+
function _slicedToArray(arr, i) {
|
|
505
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest();
|
|
506
|
+
}
|
|
507
|
+
function _toConsumableArray$1(arr) {
|
|
508
|
+
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$1();
|
|
509
|
+
}
|
|
510
|
+
function _arrayWithoutHoles$1(arr) {
|
|
511
|
+
if (Array.isArray(arr))
|
|
512
|
+
return _arrayLikeToArray$2(arr);
|
|
513
|
+
}
|
|
514
|
+
function _arrayWithHoles(arr) {
|
|
515
|
+
if (Array.isArray(arr))
|
|
516
|
+
return arr;
|
|
517
|
+
}
|
|
518
|
+
function _iterableToArray$1(iter) {
|
|
519
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
520
|
+
return Array.from(iter);
|
|
521
|
+
}
|
|
522
|
+
function _unsupportedIterableToArray$2(o, minLen) {
|
|
523
|
+
if (!o)
|
|
524
|
+
return;
|
|
525
|
+
if (typeof o === "string")
|
|
526
|
+
return _arrayLikeToArray$2(o, minLen);
|
|
527
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
528
|
+
if (n === "Object" && o.constructor)
|
|
529
|
+
n = o.constructor.name;
|
|
530
|
+
if (n === "Map" || n === "Set")
|
|
531
|
+
return Array.from(o);
|
|
532
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
533
|
+
return _arrayLikeToArray$2(o, minLen);
|
|
534
|
+
}
|
|
535
|
+
function _arrayLikeToArray$2(arr, len) {
|
|
536
|
+
if (len == null || len > arr.length)
|
|
537
|
+
len = arr.length;
|
|
538
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
539
|
+
arr2[i] = arr[i];
|
|
540
|
+
return arr2;
|
|
541
|
+
}
|
|
542
|
+
function _nonIterableSpread$1() {
|
|
543
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
544
|
+
}
|
|
545
|
+
function _nonIterableRest() {
|
|
546
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
547
|
+
}
|
|
548
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) {
|
|
549
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
550
|
+
if (!it) {
|
|
551
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
552
|
+
if (it)
|
|
553
|
+
o = it;
|
|
554
|
+
var i = 0;
|
|
555
|
+
var F = function() {
|
|
556
|
+
};
|
|
557
|
+
return {
|
|
558
|
+
s: F,
|
|
559
|
+
n: function() {
|
|
560
|
+
if (i >= o.length)
|
|
561
|
+
return {
|
|
562
|
+
done: true
|
|
563
|
+
};
|
|
564
|
+
return {
|
|
565
|
+
done: false,
|
|
566
|
+
value: o[i++]
|
|
567
|
+
};
|
|
568
|
+
},
|
|
569
|
+
e: function(e) {
|
|
570
|
+
throw e;
|
|
571
|
+
},
|
|
572
|
+
f: F
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
576
|
+
}
|
|
577
|
+
var normalCompletion = true, didErr = false, err;
|
|
578
|
+
return {
|
|
579
|
+
s: function() {
|
|
580
|
+
it = it.call(o);
|
|
581
|
+
},
|
|
582
|
+
n: function() {
|
|
583
|
+
var step = it.next();
|
|
584
|
+
normalCompletion = step.done;
|
|
585
|
+
return step;
|
|
586
|
+
},
|
|
587
|
+
e: function(e) {
|
|
588
|
+
didErr = true;
|
|
589
|
+
err = e;
|
|
590
|
+
},
|
|
591
|
+
f: function() {
|
|
592
|
+
try {
|
|
593
|
+
if (!normalCompletion && it.return != null)
|
|
594
|
+
it.return();
|
|
595
|
+
} finally {
|
|
596
|
+
if (didErr)
|
|
597
|
+
throw err;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
}
|
|
486
602
|
function _toPrimitive$2(input, hint) {
|
|
487
603
|
if (typeof input !== "object" || input === null)
|
|
488
604
|
return input;
|
|
@@ -5069,6 +5185,519 @@ var NetworkEvaluate = /* @__PURE__ */ function() {
|
|
|
5069
5185
|
}]);
|
|
5070
5186
|
return NetworkEvaluate2;
|
|
5071
5187
|
}();
|
|
5188
|
+
var RTC_SEI_TYPE = /* @__PURE__ */ function(RTC_SEI_TYPE2) {
|
|
5189
|
+
RTC_SEI_TYPE2[RTC_SEI_TYPE2["internal"] = 0] = "internal";
|
|
5190
|
+
RTC_SEI_TYPE2[RTC_SEI_TYPE2["external"] = 1] = "external";
|
|
5191
|
+
RTC_SEI_TYPE2[RTC_SEI_TYPE2["bypass"] = 2] = "bypass";
|
|
5192
|
+
return RTC_SEI_TYPE2;
|
|
5193
|
+
}(RTC_SEI_TYPE || {});
|
|
5194
|
+
var UUID_INTERNAL = new Uint8Array([109, 167, 53, 190, 103, 90, 72, 1, 170, 89, 63, 164, 194, 199, 19, 85]);
|
|
5195
|
+
var UUID_EXTERNAL = new Uint8Array([109, 167, 53, 190, 103, 90, 72, 1, 170, 89, 63, 164, 194, 199, 19, 84]);
|
|
5196
|
+
var rbsp2ebsp = function rbsp2ebsp2(src) {
|
|
5197
|
+
var result = [];
|
|
5198
|
+
for (var i = 0; i < src.length; i++) {
|
|
5199
|
+
if (src[i] <= 3 && src[i - 1] === 0 && src[i - 2] === 0) {
|
|
5200
|
+
result.push(3);
|
|
5201
|
+
}
|
|
5202
|
+
result.push(src[i]);
|
|
5203
|
+
}
|
|
5204
|
+
return new Uint8Array(result);
|
|
5205
|
+
};
|
|
5206
|
+
var ebsp2rbsp = function ebsp2rbsp2(src) {
|
|
5207
|
+
var result = [];
|
|
5208
|
+
for (var i = 0; i < src.length; i++) {
|
|
5209
|
+
if (src[i] <= 3 && src[i - 1] === 0 && src[i - 2] === 0) {
|
|
5210
|
+
continue;
|
|
5211
|
+
}
|
|
5212
|
+
result.push(src[i]);
|
|
5213
|
+
}
|
|
5214
|
+
return new Uint8Array(result);
|
|
5215
|
+
};
|
|
5216
|
+
function serializeData(num) {
|
|
5217
|
+
var result = [];
|
|
5218
|
+
while (num >= 255) {
|
|
5219
|
+
num -= 255;
|
|
5220
|
+
result.push(255);
|
|
5221
|
+
}
|
|
5222
|
+
result.push(num);
|
|
5223
|
+
return new Uint8Array(result);
|
|
5224
|
+
}
|
|
5225
|
+
function deserializeData(data) {
|
|
5226
|
+
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
5227
|
+
var result = 0;
|
|
5228
|
+
while (data[offset] === 255 && offset < data.byteLength) {
|
|
5229
|
+
offset++;
|
|
5230
|
+
result += 255;
|
|
5231
|
+
}
|
|
5232
|
+
if (offset < data.byteLength) {
|
|
5233
|
+
result += data[offset++];
|
|
5234
|
+
}
|
|
5235
|
+
return [result, offset];
|
|
5236
|
+
}
|
|
5237
|
+
var SEIHelper = /* @__PURE__ */ function() {
|
|
5238
|
+
function SEIHelper2() {
|
|
5239
|
+
_classCallCheck$2(this, SEIHelper2);
|
|
5240
|
+
}
|
|
5241
|
+
_createClass$2(SEIHelper2, null, [{
|
|
5242
|
+
key: "generateSEI",
|
|
5243
|
+
value: function generateSEI(src) {
|
|
5244
|
+
var internal = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
5245
|
+
var annexbHeader = new Uint8Array([0, 0, 0, 1]);
|
|
5246
|
+
var nalType = new Uint8Array([6]);
|
|
5247
|
+
var seiType = new Uint8Array([5]);
|
|
5248
|
+
var uuid = internal ? UUID_INTERNAL : UUID_EXTERNAL;
|
|
5249
|
+
var serializedPayloadSize = serializeData(src.byteLength + uuid.byteLength);
|
|
5250
|
+
var payloadEbsp = rbsp2ebsp(src);
|
|
5251
|
+
return new Uint8Array([].concat(_toConsumableArray$1(annexbHeader), _toConsumableArray$1(nalType), _toConsumableArray$1(seiType), _toConsumableArray$1(serializedPayloadSize), _toConsumableArray$1(uuid), _toConsumableArray$1(payloadEbsp), [128]));
|
|
5252
|
+
}
|
|
5253
|
+
}, {
|
|
5254
|
+
key: "decodeSeiBody",
|
|
5255
|
+
value: function decodeSeiBody(src) {
|
|
5256
|
+
src = src.slice(0, src.length - 1);
|
|
5257
|
+
var rbsp = ebsp2rbsp(src);
|
|
5258
|
+
if (rbsp.byteLength < 2) {
|
|
5259
|
+
return;
|
|
5260
|
+
}
|
|
5261
|
+
var offset = 0;
|
|
5262
|
+
if (!(rbsp[1] === 5 || rbsp[1] === 100)) {
|
|
5263
|
+
return;
|
|
5264
|
+
}
|
|
5265
|
+
offset += 2;
|
|
5266
|
+
var _deserializeData = deserializeData(rbsp, offset), _deserializeData2 = _slicedToArray(_deserializeData, 2), payloadLength = _deserializeData2[0], newOffset = _deserializeData2[1];
|
|
5267
|
+
offset = newOffset;
|
|
5268
|
+
var rtcSeiType = 2;
|
|
5269
|
+
var end = offset + payloadLength;
|
|
5270
|
+
if (rbsp.byteLength >= UUID_EXTERNAL.byteLength && payloadLength >= UUID_EXTERNAL.byteLength && rbsp.slice(offset, offset + UUID_EXTERNAL.byteLength).toString() === UUID_EXTERNAL.toString()) {
|
|
5271
|
+
offset += UUID_EXTERNAL.byteLength;
|
|
5272
|
+
rtcSeiType = 1;
|
|
5273
|
+
} else if (rbsp.byteLength >= UUID_EXTERNAL.byteLength && payloadLength >= UUID_EXTERNAL.byteLength && rbsp.slice(offset, offset + UUID_INTERNAL.byteLength).toString() === UUID_INTERNAL.toString()) {
|
|
5274
|
+
offset += UUID_INTERNAL.byteLength;
|
|
5275
|
+
rtcSeiType = 0;
|
|
5276
|
+
}
|
|
5277
|
+
var seiPayload = rbsp.slice(offset, end);
|
|
5278
|
+
return {
|
|
5279
|
+
type: rtcSeiType,
|
|
5280
|
+
payload: seiPayload
|
|
5281
|
+
};
|
|
5282
|
+
}
|
|
5283
|
+
}, {
|
|
5284
|
+
key: "parseInternalSEI",
|
|
5285
|
+
value: function parseInternalSEI(decodedSEI) {
|
|
5286
|
+
var result = /* @__PURE__ */ new Map();
|
|
5287
|
+
var offset = 0;
|
|
5288
|
+
if (decodedSEI.type === 0) {
|
|
5289
|
+
while (decodedSEI.payload.byteLength - offset >= 2) {
|
|
5290
|
+
var _deserializeData3 = deserializeData(decodedSEI.payload, offset), _deserializeData4 = _slicedToArray(_deserializeData3, 2), internalSeiType = _deserializeData4[0], newOffset = _deserializeData4[1];
|
|
5291
|
+
offset = newOffset;
|
|
5292
|
+
var _deserializeData5 = deserializeData(decodedSEI.payload, offset), _deserializeData6 = _slicedToArray(_deserializeData5, 2), internalSeiLength = _deserializeData6[0], newOff = _deserializeData6[1];
|
|
5293
|
+
offset = newOff;
|
|
5294
|
+
if (!result.get(internalSeiType) && internalSeiLength <= decodedSEI.payload.byteLength - offset) {
|
|
5295
|
+
result.set(internalSeiType, decodedSEI.payload.slice(offset, offset + internalSeiLength));
|
|
5296
|
+
offset += internalSeiLength;
|
|
5297
|
+
} else {
|
|
5298
|
+
break;
|
|
5299
|
+
}
|
|
5300
|
+
}
|
|
5301
|
+
return result;
|
|
5302
|
+
}
|
|
5303
|
+
}
|
|
5304
|
+
}, {
|
|
5305
|
+
key: "makeInternalSei",
|
|
5306
|
+
value: function makeInternalSei(map) {
|
|
5307
|
+
var resultSeiList = [];
|
|
5308
|
+
var _iterator = _createForOfIteratorHelper$1(map), _step;
|
|
5309
|
+
try {
|
|
5310
|
+
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
5311
|
+
var _step$value = _slicedToArray(_step.value, 2), type = _step$value[0], payload = _step$value[1];
|
|
5312
|
+
var serializedType = serializeData(type);
|
|
5313
|
+
var size = serializeData(payload.byteLength);
|
|
5314
|
+
resultSeiList.push(serializedType, size, payload);
|
|
5315
|
+
}
|
|
5316
|
+
} catch (err) {
|
|
5317
|
+
_iterator.e(err);
|
|
5318
|
+
} finally {
|
|
5319
|
+
_iterator.f();
|
|
5320
|
+
}
|
|
5321
|
+
var resultLength = resultSeiList.reduce(function(pre, cur) {
|
|
5322
|
+
return pre + cur.byteLength;
|
|
5323
|
+
}, 0);
|
|
5324
|
+
var result = new Uint8Array(resultLength);
|
|
5325
|
+
resultSeiList.reduce(function(pre, cur) {
|
|
5326
|
+
result.set(cur, pre);
|
|
5327
|
+
return pre + cur.byteLength;
|
|
5328
|
+
}, 0);
|
|
5329
|
+
return result;
|
|
5330
|
+
}
|
|
5331
|
+
}]);
|
|
5332
|
+
return SEIHelper2;
|
|
5333
|
+
}();
|
|
5334
|
+
var Nalunit = /* @__PURE__ */ function() {
|
|
5335
|
+
function Nalunit2() {
|
|
5336
|
+
_classCallCheck$2(this, Nalunit2);
|
|
5337
|
+
}
|
|
5338
|
+
_createClass$2(Nalunit2, null, [{
|
|
5339
|
+
key: "getNalunits",
|
|
5340
|
+
value: function getNalunits(buffer) {
|
|
5341
|
+
if (buffer.length - buffer.position < 4) {
|
|
5342
|
+
return [];
|
|
5343
|
+
}
|
|
5344
|
+
var position = buffer.position;
|
|
5345
|
+
if (buffer.getInt32(position) === 1 || buffer.getInt16(position) === 0 && buffer.getInt8(position + 2) === 1) {
|
|
5346
|
+
return Nalunit2.getAnnexbNals(buffer);
|
|
5347
|
+
} else {
|
|
5348
|
+
return Nalunit2.getAvccNals(buffer);
|
|
5349
|
+
}
|
|
5350
|
+
}
|
|
5351
|
+
}, {
|
|
5352
|
+
key: "getAnnexbNals",
|
|
5353
|
+
value: function getAnnexbNals(buffer) {
|
|
5354
|
+
var nals = [];
|
|
5355
|
+
var position = Nalunit2.getHeaderPositionAnnexB(buffer);
|
|
5356
|
+
var start = position.pos;
|
|
5357
|
+
var end = start;
|
|
5358
|
+
while (start < buffer.length - 4) {
|
|
5359
|
+
var header = new Uint8Array(buffer.buffer.slice(start, start + position.headerLength));
|
|
5360
|
+
if (position.pos === buffer.position) {
|
|
5361
|
+
buffer.skip(position.headerLength);
|
|
5362
|
+
}
|
|
5363
|
+
position = Nalunit2.getHeaderPositionAnnexB(buffer);
|
|
5364
|
+
end = position.pos;
|
|
5365
|
+
var body = new Uint8Array(buffer.buffer.slice(start + header.byteLength, end));
|
|
5366
|
+
var unit = {
|
|
5367
|
+
header,
|
|
5368
|
+
body,
|
|
5369
|
+
type: -1
|
|
5370
|
+
};
|
|
5371
|
+
Nalunit2.analyseNal(unit);
|
|
5372
|
+
if (unit.type <= 9 && unit.type !== 0) {
|
|
5373
|
+
nals.push(unit);
|
|
5374
|
+
}
|
|
5375
|
+
buffer.skip(end - buffer.position);
|
|
5376
|
+
start = end;
|
|
5377
|
+
}
|
|
5378
|
+
return nals;
|
|
5379
|
+
}
|
|
5380
|
+
}, {
|
|
5381
|
+
key: "getAvccNals",
|
|
5382
|
+
value: function getAvccNals(buffer) {
|
|
5383
|
+
var nals = [];
|
|
5384
|
+
while (buffer.position < buffer.length - 4) {
|
|
5385
|
+
var length = buffer.getInt32(buffer.position);
|
|
5386
|
+
if (buffer.length - buffer.position >= length) {
|
|
5387
|
+
var header = new Uint8Array(buffer.buffer.slice(buffer.position, buffer.position + 4));
|
|
5388
|
+
buffer.skip(4);
|
|
5389
|
+
var body = new Uint8Array(buffer.buffer.slice(buffer.position, buffer.position + length));
|
|
5390
|
+
buffer.skip(length);
|
|
5391
|
+
var unit = {
|
|
5392
|
+
header,
|
|
5393
|
+
body,
|
|
5394
|
+
type: -1
|
|
5395
|
+
};
|
|
5396
|
+
Nalunit2.analyseNal(unit);
|
|
5397
|
+
if (unit.type <= 9 && unit.type !== 0) {
|
|
5398
|
+
nals.push(unit);
|
|
5399
|
+
}
|
|
5400
|
+
} else {
|
|
5401
|
+
break;
|
|
5402
|
+
}
|
|
5403
|
+
}
|
|
5404
|
+
return nals;
|
|
5405
|
+
}
|
|
5406
|
+
}, {
|
|
5407
|
+
key: "analyseNal",
|
|
5408
|
+
value: function analyseNal(unit) {
|
|
5409
|
+
var type = unit.body[0] & 31;
|
|
5410
|
+
unit.type = type;
|
|
5411
|
+
switch (type) {
|
|
5412
|
+
case 1:
|
|
5413
|
+
unit.ndr = true;
|
|
5414
|
+
break;
|
|
5415
|
+
case 5:
|
|
5416
|
+
unit.idr = true;
|
|
5417
|
+
break;
|
|
5418
|
+
case 6:
|
|
5419
|
+
unit.sei = true;
|
|
5420
|
+
break;
|
|
5421
|
+
case 7:
|
|
5422
|
+
unit.sps = true;
|
|
5423
|
+
break;
|
|
5424
|
+
case 8:
|
|
5425
|
+
unit.pps = true;
|
|
5426
|
+
break;
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5429
|
+
}, {
|
|
5430
|
+
key: "getHeaderPositionAnnexB",
|
|
5431
|
+
value: function getHeaderPositionAnnexB(buffer) {
|
|
5432
|
+
var pos = buffer.position;
|
|
5433
|
+
var headerLength = 0;
|
|
5434
|
+
var bufferLen = buffer.length;
|
|
5435
|
+
while (headerLength !== 3 && headerLength !== 4 && pos < bufferLen - 4) {
|
|
5436
|
+
if (buffer.getInt16(pos) === 0) {
|
|
5437
|
+
if (buffer.getInt16(pos + 2) === 1) {
|
|
5438
|
+
headerLength = 4;
|
|
5439
|
+
} else if (buffer.getInt8(pos + 2) === 1) {
|
|
5440
|
+
headerLength = 3;
|
|
5441
|
+
} else {
|
|
5442
|
+
pos++;
|
|
5443
|
+
}
|
|
5444
|
+
} else {
|
|
5445
|
+
pos++;
|
|
5446
|
+
}
|
|
5447
|
+
}
|
|
5448
|
+
if (pos === bufferLen - 4) {
|
|
5449
|
+
if (buffer.getInt16(pos) === 0) {
|
|
5450
|
+
if (buffer.getInt16(pos + 2) === 1) {
|
|
5451
|
+
headerLength = 4;
|
|
5452
|
+
} else {
|
|
5453
|
+
pos = bufferLen;
|
|
5454
|
+
}
|
|
5455
|
+
} else {
|
|
5456
|
+
pos++;
|
|
5457
|
+
if (buffer.getInt16(pos) === 0 && buffer.getInt8(pos) === 1) {
|
|
5458
|
+
headerLength = 3;
|
|
5459
|
+
} else {
|
|
5460
|
+
pos = bufferLen;
|
|
5461
|
+
}
|
|
5462
|
+
}
|
|
5463
|
+
}
|
|
5464
|
+
return {
|
|
5465
|
+
pos,
|
|
5466
|
+
headerLength
|
|
5467
|
+
};
|
|
5468
|
+
}
|
|
5469
|
+
}]);
|
|
5470
|
+
return Nalunit2;
|
|
5471
|
+
}();
|
|
5472
|
+
var RTCDataView = /* @__PURE__ */ function() {
|
|
5473
|
+
function RTCDataView2(buffer) {
|
|
5474
|
+
_classCallCheck$2(this, RTCDataView2);
|
|
5475
|
+
this._position = 0;
|
|
5476
|
+
this._dataview = new DataView(buffer);
|
|
5477
|
+
}
|
|
5478
|
+
_createClass$2(RTCDataView2, [{
|
|
5479
|
+
key: "length",
|
|
5480
|
+
get: function get() {
|
|
5481
|
+
return this.buffer.byteLength;
|
|
5482
|
+
}
|
|
5483
|
+
}, {
|
|
5484
|
+
key: "buffer",
|
|
5485
|
+
get: function get() {
|
|
5486
|
+
return this._dataview.buffer;
|
|
5487
|
+
}
|
|
5488
|
+
}, {
|
|
5489
|
+
key: "position",
|
|
5490
|
+
get: function get() {
|
|
5491
|
+
return this._position;
|
|
5492
|
+
},
|
|
5493
|
+
set: function set(value) {
|
|
5494
|
+
this._position = value;
|
|
5495
|
+
}
|
|
5496
|
+
}, {
|
|
5497
|
+
key: "back",
|
|
5498
|
+
value: function back(count) {
|
|
5499
|
+
this.position -= count;
|
|
5500
|
+
}
|
|
5501
|
+
}, {
|
|
5502
|
+
key: "getUint8",
|
|
5503
|
+
value: function getUint8(offset) {
|
|
5504
|
+
return this._dataview.getUint8(offset);
|
|
5505
|
+
}
|
|
5506
|
+
}, {
|
|
5507
|
+
key: "getInt8",
|
|
5508
|
+
value: function getInt8(offset) {
|
|
5509
|
+
return this._dataview.getInt8(offset);
|
|
5510
|
+
}
|
|
5511
|
+
}, {
|
|
5512
|
+
key: "getInt16",
|
|
5513
|
+
value: function getInt16(offset) {
|
|
5514
|
+
return this._dataview.getInt16(offset);
|
|
5515
|
+
}
|
|
5516
|
+
}, {
|
|
5517
|
+
key: "getUint16",
|
|
5518
|
+
value: function getUint16(offset) {
|
|
5519
|
+
return this._dataview.getUint16(offset);
|
|
5520
|
+
}
|
|
5521
|
+
}, {
|
|
5522
|
+
key: "getUint32",
|
|
5523
|
+
value: function getUint32(offset) {
|
|
5524
|
+
return this._dataview.getUint32(offset);
|
|
5525
|
+
}
|
|
5526
|
+
}, {
|
|
5527
|
+
key: "getInt32",
|
|
5528
|
+
value: function getInt32(offset) {
|
|
5529
|
+
return this._dataview.getInt32(offset);
|
|
5530
|
+
}
|
|
5531
|
+
}, {
|
|
5532
|
+
key: "skip",
|
|
5533
|
+
value: function skip(count) {
|
|
5534
|
+
var loop = Math.floor(count / 4);
|
|
5535
|
+
var last = count % 4;
|
|
5536
|
+
for (var i = 0; i < loop; i++) {
|
|
5537
|
+
RTCDataView2.readByte(this, 4);
|
|
5538
|
+
}
|
|
5539
|
+
if (last > 0) {
|
|
5540
|
+
RTCDataView2.readByte(this, last);
|
|
5541
|
+
}
|
|
5542
|
+
}
|
|
5543
|
+
}, {
|
|
5544
|
+
key: "readUint8",
|
|
5545
|
+
value: function readUint8() {
|
|
5546
|
+
return RTCDataView2.readByte(this, 1);
|
|
5547
|
+
}
|
|
5548
|
+
}, {
|
|
5549
|
+
key: "readUint16",
|
|
5550
|
+
value: function readUint16() {
|
|
5551
|
+
return RTCDataView2.readByte(this, 2);
|
|
5552
|
+
}
|
|
5553
|
+
}, {
|
|
5554
|
+
key: "readUint24",
|
|
5555
|
+
value: function readUint24() {
|
|
5556
|
+
return RTCDataView2.readByte(this, 3);
|
|
5557
|
+
}
|
|
5558
|
+
}, {
|
|
5559
|
+
key: "readUint32",
|
|
5560
|
+
value: function readUint32() {
|
|
5561
|
+
return RTCDataView2.readByte(this, 4);
|
|
5562
|
+
}
|
|
5563
|
+
}, {
|
|
5564
|
+
key: "readUint64",
|
|
5565
|
+
value: function readUint64() {
|
|
5566
|
+
return RTCDataView2.readByte(this, 8);
|
|
5567
|
+
}
|
|
5568
|
+
}, {
|
|
5569
|
+
key: "readInt8",
|
|
5570
|
+
value: function readInt8() {
|
|
5571
|
+
return RTCDataView2.readByte(this, 1, true);
|
|
5572
|
+
}
|
|
5573
|
+
}, {
|
|
5574
|
+
key: "readInt16",
|
|
5575
|
+
value: function readInt16() {
|
|
5576
|
+
return RTCDataView2.readByte(this, 2, true);
|
|
5577
|
+
}
|
|
5578
|
+
}, {
|
|
5579
|
+
key: "readInt32",
|
|
5580
|
+
value: function readInt32() {
|
|
5581
|
+
return RTCDataView2.readByte(this, 4, true);
|
|
5582
|
+
}
|
|
5583
|
+
}, {
|
|
5584
|
+
key: "writeUint32",
|
|
5585
|
+
value: function writeUint32(value) {
|
|
5586
|
+
return new Uint8Array([value >>> 24 & 255, value >>> 16 & 255, value >>> 8 & 255, value & 255]);
|
|
5587
|
+
}
|
|
5588
|
+
}], [{
|
|
5589
|
+
key: "readByte",
|
|
5590
|
+
value: function readByte(buffer, size, sign) {
|
|
5591
|
+
var res;
|
|
5592
|
+
switch (size) {
|
|
5593
|
+
case 1:
|
|
5594
|
+
if (sign) {
|
|
5595
|
+
res = buffer.getInt8(buffer.position);
|
|
5596
|
+
} else {
|
|
5597
|
+
res = buffer.getUint8(buffer.position);
|
|
5598
|
+
}
|
|
5599
|
+
break;
|
|
5600
|
+
case 2:
|
|
5601
|
+
if (sign) {
|
|
5602
|
+
res = buffer.getInt16(buffer.position);
|
|
5603
|
+
} else {
|
|
5604
|
+
res = buffer.getUint16(buffer.position);
|
|
5605
|
+
}
|
|
5606
|
+
break;
|
|
5607
|
+
case 3:
|
|
5608
|
+
if (sign) {
|
|
5609
|
+
throw new Error("not supported for readByte 3");
|
|
5610
|
+
} else {
|
|
5611
|
+
res = buffer.getUint8(buffer.position) << 16;
|
|
5612
|
+
res |= buffer.getUint8(buffer.position + 1) << 8;
|
|
5613
|
+
res |= buffer.getUint8(buffer.position + 2);
|
|
5614
|
+
}
|
|
5615
|
+
break;
|
|
5616
|
+
case 4:
|
|
5617
|
+
if (sign) {
|
|
5618
|
+
res = buffer.getInt32(buffer.position);
|
|
5619
|
+
} else {
|
|
5620
|
+
res = buffer.getUint32(buffer.position);
|
|
5621
|
+
}
|
|
5622
|
+
break;
|
|
5623
|
+
case 8:
|
|
5624
|
+
if (sign) {
|
|
5625
|
+
throw new Error("not supported for readBody 8");
|
|
5626
|
+
} else {
|
|
5627
|
+
res = buffer.getUint32(buffer.position) << 32;
|
|
5628
|
+
res |= buffer.getUint32(buffer.position + 4);
|
|
5629
|
+
}
|
|
5630
|
+
break;
|
|
5631
|
+
default:
|
|
5632
|
+
res = "";
|
|
5633
|
+
}
|
|
5634
|
+
buffer.position += size;
|
|
5635
|
+
return res;
|
|
5636
|
+
}
|
|
5637
|
+
}]);
|
|
5638
|
+
return RTCDataView2;
|
|
5639
|
+
}();
|
|
5640
|
+
function isSupported() {
|
|
5641
|
+
if (!window.RTCPeerConnection || !window.RTCPeerConnection.prototype.addTransceiver) {
|
|
5642
|
+
return false;
|
|
5643
|
+
}
|
|
5644
|
+
return true;
|
|
5645
|
+
}
|
|
5646
|
+
function getCapacity() {
|
|
5647
|
+
if (!isSupported())
|
|
5648
|
+
return Promise.reject("RTCPeerConnection no support");
|
|
5649
|
+
var pc;
|
|
5650
|
+
try {
|
|
5651
|
+
pc = new RTCPeerConnection();
|
|
5652
|
+
pc.addTransceiver("video", {
|
|
5653
|
+
direction: "recvonly"
|
|
5654
|
+
});
|
|
5655
|
+
pc.addTransceiver("audio", {
|
|
5656
|
+
direction: "recvonly"
|
|
5657
|
+
});
|
|
5658
|
+
} catch (e) {
|
|
5659
|
+
return Promise.reject(e === null || e === void 0 ? void 0 : e.message);
|
|
5660
|
+
}
|
|
5661
|
+
return pc.createOffer().then(function(offer) {
|
|
5662
|
+
var _sdpJson$media, _sdpJson$media2, _vMedia$rtp, _aMedia$rtp;
|
|
5663
|
+
logger.log(offer.sdp);
|
|
5664
|
+
var sdpJson = lib.parse(offer.sdp);
|
|
5665
|
+
var vMedia = (_sdpJson$media = sdpJson.media) === null || _sdpJson$media === void 0 ? void 0 : _sdpJson$media.filter(function(x) {
|
|
5666
|
+
return x.type === "video";
|
|
5667
|
+
})[0];
|
|
5668
|
+
var aMedia = (_sdpJson$media2 = sdpJson.media) === null || _sdpJson$media2 === void 0 ? void 0 : _sdpJson$media2.filter(function(x) {
|
|
5669
|
+
return x.type === "audio";
|
|
5670
|
+
})[0];
|
|
5671
|
+
var vCodecs = vMedia === null || vMedia === void 0 ? void 0 : (_vMedia$rtp = vMedia.rtp) === null || _vMedia$rtp === void 0 ? void 0 : _vMedia$rtp.filter(function(x) {
|
|
5672
|
+
return x.codec === "VP8" || x.codec === "VP9" || x.codec === "H264";
|
|
5673
|
+
});
|
|
5674
|
+
var aCodecs = aMedia === null || aMedia === void 0 ? void 0 : (_aMedia$rtp = aMedia.rtp) === null || _aMedia$rtp === void 0 ? void 0 : _aMedia$rtp.filter(function(x) {
|
|
5675
|
+
return x.codec === "opus";
|
|
5676
|
+
});
|
|
5677
|
+
var vFmtp = vMedia === null || vMedia === void 0 ? void 0 : vMedia.fmtp;
|
|
5678
|
+
var aFmtp = aMedia === null || aMedia === void 0 ? void 0 : aMedia.fmtp;
|
|
5679
|
+
vFmtp && vCodecs.map(function(codec) {
|
|
5680
|
+
var _vFmtp$filter$;
|
|
5681
|
+
codec.config = (_vFmtp$filter$ = vFmtp.filter(function(x) {
|
|
5682
|
+
return x.payload === codec.payload;
|
|
5683
|
+
})[0]) === null || _vFmtp$filter$ === void 0 ? void 0 : _vFmtp$filter$.config;
|
|
5684
|
+
});
|
|
5685
|
+
aFmtp && aCodecs.map(function(codec) {
|
|
5686
|
+
var _aFmtp$filter$;
|
|
5687
|
+
codec.config = (_aFmtp$filter$ = aFmtp.filter(function(x) {
|
|
5688
|
+
return x.payload === codec.payload;
|
|
5689
|
+
})[0]) === null || _aFmtp$filter$ === void 0 ? void 0 : _aFmtp$filter$.config;
|
|
5690
|
+
});
|
|
5691
|
+
pc.close();
|
|
5692
|
+
return {
|
|
5693
|
+
video: vCodecs,
|
|
5694
|
+
audio: aCodecs
|
|
5695
|
+
};
|
|
5696
|
+
});
|
|
5697
|
+
}
|
|
5698
|
+
var isEncodedTransformSupported = function isEncodedTransformSupported2() {
|
|
5699
|
+
return typeof TransformStream !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpReceiver.prototype.createEncodedStreams !== "undefined";
|
|
5700
|
+
};
|
|
5072
5701
|
var logger = new Logger("rts");
|
|
5073
5702
|
var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
5074
5703
|
_inherits$1(Rts2, _EventEmitter);
|
|
@@ -5082,7 +5711,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5082
5711
|
_defineProperty$2(_assertThisInitialized$1(_this), "_audioTransceicer", null);
|
|
5083
5712
|
_defineProperty$2(_assertThisInitialized$1(_this), "_videoTransceicer", null);
|
|
5084
5713
|
_defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
|
|
5085
|
-
_defineProperty$2(_assertThisInitialized$1(_this), "_lastMediaStream", null);
|
|
5086
5714
|
_defineProperty$2(_assertThisInitialized$1(_this), "_media", null);
|
|
5087
5715
|
_defineProperty$2(_assertThisInitialized$1(_this), "_opts", null);
|
|
5088
5716
|
_defineProperty$2(_assertThisInitialized$1(_this), "_loader", null);
|
|
@@ -5090,7 +5718,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5090
5718
|
_defineProperty$2(_assertThisInitialized$1(_this), "_retry", 0);
|
|
5091
5719
|
_defineProperty$2(_assertThisInitialized$1(_this), "_waitingTimer", 0);
|
|
5092
5720
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rctConnectStartTs", 0);
|
|
5093
|
-
_defineProperty$2(_assertThisInitialized$1(_this), "_isReplacing", false);
|
|
5094
5721
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onTrack", function(e) {
|
|
5095
5722
|
logger.log("addTrack: ", e.track, e.streams);
|
|
5096
5723
|
_this["_".concat(e.track.kind)] = e.track;
|
|
@@ -5141,9 +5768,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5141
5768
|
}));
|
|
5142
5769
|
_this._retry = _this._opts.retryCount;
|
|
5143
5770
|
_this._bindMediaEvent();
|
|
5144
|
-
if (_this._opts.mediaStream && _this._opts.seamlesslyReload) {
|
|
5145
|
-
_this._lastMediaStream = _this._opts.mediaStream;
|
|
5146
|
-
}
|
|
5147
5771
|
return _this;
|
|
5148
5772
|
}
|
|
5149
5773
|
_createClass$2(Rts2, [{
|
|
@@ -5187,9 +5811,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5187
5811
|
}, {
|
|
5188
5812
|
key: "load",
|
|
5189
5813
|
value: function() {
|
|
5190
|
-
var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee(url
|
|
5814
|
+
var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee(url) {
|
|
5191
5815
|
var _this2 = this;
|
|
5192
|
-
var
|
|
5816
|
+
var lastPc;
|
|
5193
5817
|
return _regeneratorRuntime$1().wrap(function _callee$(_context) {
|
|
5194
5818
|
while (1)
|
|
5195
5819
|
switch (_context.prev = _context.next) {
|
|
@@ -5197,43 +5821,39 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5197
5821
|
this._disconnect();
|
|
5198
5822
|
this._url = url;
|
|
5199
5823
|
this._retry = this._opts.retryCount;
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
(_this$_pc3 = this._pc) === null || _this$_pc3 === void 0 ? void 0 : _this$_pc3.close();
|
|
5824
|
+
lastPc = this._pc;
|
|
5825
|
+
if (lastPc) {
|
|
5826
|
+
lastPc.close();
|
|
5204
5827
|
}
|
|
5205
|
-
_context.prev =
|
|
5828
|
+
_context.prev = 5;
|
|
5206
5829
|
this._pc = new RTCPeerConnection();
|
|
5207
5830
|
this._bindRTCEvents();
|
|
5208
|
-
_context.next =
|
|
5831
|
+
_context.next = 10;
|
|
5209
5832
|
return this._connect(url);
|
|
5210
|
-
case
|
|
5211
|
-
_context.next =
|
|
5833
|
+
case 10:
|
|
5834
|
+
_context.next = 15;
|
|
5212
5835
|
break;
|
|
5213
|
-
case
|
|
5214
|
-
_context.prev =
|
|
5215
|
-
_context.t0 = _context["catch"](
|
|
5836
|
+
case 12:
|
|
5837
|
+
_context.prev = 12;
|
|
5838
|
+
_context.t0 = _context["catch"](5);
|
|
5216
5839
|
setTimeout(function() {
|
|
5217
5840
|
return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context.t0));
|
|
5218
5841
|
});
|
|
5219
|
-
case
|
|
5842
|
+
case 15:
|
|
5220
5843
|
case "end":
|
|
5221
5844
|
return _context.stop();
|
|
5222
5845
|
}
|
|
5223
|
-
}, _callee, this, [[
|
|
5846
|
+
}, _callee, this, [[5, 12]]);
|
|
5224
5847
|
}));
|
|
5225
|
-
function load(_x
|
|
5848
|
+
function load(_x) {
|
|
5226
5849
|
return _load.apply(this, arguments);
|
|
5227
5850
|
}
|
|
5228
5851
|
return load;
|
|
5229
5852
|
}()
|
|
5230
5853
|
}, {
|
|
5231
5854
|
key: "switchURL",
|
|
5232
|
-
value: function switchURL(url
|
|
5233
|
-
|
|
5234
|
-
this._lastMediaStream = this._mediaStream;
|
|
5235
|
-
}
|
|
5236
|
-
this.load(url || this._url, seamless);
|
|
5855
|
+
value: function switchURL(url) {
|
|
5856
|
+
this.load(url || this._url);
|
|
5237
5857
|
}
|
|
5238
5858
|
}, {
|
|
5239
5859
|
key: "_bindRTCEvents",
|
|
@@ -5259,7 +5879,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5259
5879
|
_this3.load(_this3._url);
|
|
5260
5880
|
}
|
|
5261
5881
|
if (pc.connectionState === "connected") {
|
|
5262
|
-
_this3._closeLastPc();
|
|
5263
5882
|
_this3._handleMediaStream();
|
|
5264
5883
|
_this3.emit(EVENT.TTFB, {
|
|
5265
5884
|
url: _this3._url,
|
|
@@ -5272,29 +5891,18 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5272
5891
|
}, {
|
|
5273
5892
|
key: "_handleMediaStream",
|
|
5274
5893
|
value: function _handleMediaStream() {
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
var
|
|
5278
|
-
var videoTrack = this._lastMediaStream.getVideoTracks()[0];
|
|
5279
|
-
var audioTrack = this._lastMediaStream.getAudioTracks()[0];
|
|
5894
|
+
if (this._opts.mediaStream && this._opts.seamlesslyReload) {
|
|
5895
|
+
var videoTrack = this._opts.mediaStream.getVideoTracks()[0];
|
|
5896
|
+
var audioTrack = this._opts.mediaStream.getAudioTracks()[0];
|
|
5280
5897
|
if (videoTrack) {
|
|
5281
|
-
this.
|
|
5898
|
+
this._opts.mediaStream.removeTrack(videoTrack);
|
|
5282
5899
|
}
|
|
5283
5900
|
if (audioTrack) {
|
|
5284
|
-
this.
|
|
5901
|
+
this._opts.mediaStream.removeTrack(audioTrack);
|
|
5285
5902
|
}
|
|
5286
|
-
this._mediaStream = this.
|
|
5287
|
-
this._mediaStream.addTrack(this._audio);
|
|
5288
|
-
this._mediaStream.addTrack(this._video);
|
|
5289
|
-
this._isReplacing = true;
|
|
5290
|
-
this._media.pause();
|
|
5291
|
-
(_this$_media$play = this._media.play()) === null || _this$_media$play === void 0 ? void 0 : _this$_media$play.finally(function() {
|
|
5292
|
-
_this4._isReplacing = false;
|
|
5293
|
-
});
|
|
5903
|
+
this._mediaStream = this._opts.mediaStream;
|
|
5294
5904
|
} else {
|
|
5295
5905
|
this._mediaStream = new MediaStream();
|
|
5296
|
-
this._mediaStream.addTrack(this._audio);
|
|
5297
|
-
this._mediaStream.addTrack(this._video);
|
|
5298
5906
|
this._media.srcObject = this._mediaStream;
|
|
5299
5907
|
var req = this._media.play();
|
|
5300
5908
|
if (req && req.catch) {
|
|
@@ -5302,6 +5910,39 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5302
5910
|
});
|
|
5303
5911
|
}
|
|
5304
5912
|
}
|
|
5913
|
+
this._mediaStream.addTrack(this._audio);
|
|
5914
|
+
this._mediaStream.addTrack(this._video);
|
|
5915
|
+
}
|
|
5916
|
+
}, {
|
|
5917
|
+
key: "initVideoEncodedTransform",
|
|
5918
|
+
value: function initVideoEncodedTransform() {
|
|
5919
|
+
var _this4 = this;
|
|
5920
|
+
if (!this._videoTransceicer || !this._videoTransceicer.receiver) {
|
|
5921
|
+
console.log("no receiver found when trying to bind encodedTransform");
|
|
5922
|
+
return;
|
|
5923
|
+
}
|
|
5924
|
+
var receiver = this._videoTransceicer.receiver;
|
|
5925
|
+
if (isEncodedTransformSupported()) {
|
|
5926
|
+
var _receiver$createEncod = receiver.createEncodedStreams(), readable = _receiver$createEncod.readable, writable = _receiver$createEncod.writable;
|
|
5927
|
+
readable.pipeThrough(new TransformStream({
|
|
5928
|
+
transform: function transform(chunk, controller) {
|
|
5929
|
+
var nals = Nalunit.getNalunits(new RTCDataView(chunk.data));
|
|
5930
|
+
nals.forEach(function(nalUnit) {
|
|
5931
|
+
if (nalUnit.sei) {
|
|
5932
|
+
var decodedSei = SEIHelper.decodeSeiBody(nalUnit.body);
|
|
5933
|
+
if (decodedSei && decodedSei.type !== RTC_SEI_TYPE.internal) {
|
|
5934
|
+
_this4.emit(EVENT.SEI, {
|
|
5935
|
+
sei: {
|
|
5936
|
+
content: decodedSei.payload
|
|
5937
|
+
}
|
|
5938
|
+
});
|
|
5939
|
+
}
|
|
5940
|
+
}
|
|
5941
|
+
});
|
|
5942
|
+
controller.enqueue(chunk);
|
|
5943
|
+
}
|
|
5944
|
+
})).pipeTo(writable);
|
|
5945
|
+
}
|
|
5305
5946
|
}
|
|
5306
5947
|
}, {
|
|
5307
5948
|
key: "_bindMediaEvent",
|
|
@@ -5320,7 +5961,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5320
5961
|
case 0:
|
|
5321
5962
|
pc = this._pc;
|
|
5322
5963
|
if (!pc.addTransceiver) {
|
|
5323
|
-
_context2.next =
|
|
5964
|
+
_context2.next = 12;
|
|
5324
5965
|
break;
|
|
5325
5966
|
}
|
|
5326
5967
|
this._audioTransceicer = pc.addTransceiver("audio", {
|
|
@@ -5329,6 +5970,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5329
5970
|
this._videoTransceicer = pc.addTransceiver("video", {
|
|
5330
5971
|
direction: "recvonly"
|
|
5331
5972
|
});
|
|
5973
|
+
this.initVideoEncodedTransform();
|
|
5332
5974
|
delayHint = this._opts.delayHint;
|
|
5333
5975
|
if (delayHint) {
|
|
5334
5976
|
this._audioTransceicer.receiver.playoutDelayHint = delayHint;
|
|
@@ -5336,22 +5978,22 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5336
5978
|
this._videoTransceicer.receiver.playoutDelayHint = delayHint;
|
|
5337
5979
|
this._videoTransceicer.receiver.jitterBufferDelayHint = delayHint;
|
|
5338
5980
|
}
|
|
5339
|
-
_context2.next =
|
|
5981
|
+
_context2.next = 9;
|
|
5340
5982
|
return pc.createOffer();
|
|
5341
|
-
case
|
|
5983
|
+
case 9:
|
|
5342
5984
|
offer = _context2.sent;
|
|
5343
|
-
_context2.next =
|
|
5985
|
+
_context2.next = 15;
|
|
5344
5986
|
break;
|
|
5345
|
-
case
|
|
5346
|
-
_context2.next =
|
|
5987
|
+
case 12:
|
|
5988
|
+
_context2.next = 14;
|
|
5347
5989
|
return pc.createOffer({
|
|
5348
5990
|
iceRestart: true,
|
|
5349
5991
|
offerToReceiveAudio: true,
|
|
5350
5992
|
offerToReceiveVideo: true
|
|
5351
5993
|
});
|
|
5352
|
-
case 13:
|
|
5353
|
-
offer = _context2.sent;
|
|
5354
5994
|
case 14:
|
|
5995
|
+
offer = _context2.sent;
|
|
5996
|
+
case 15:
|
|
5355
5997
|
logger.log("local offer");
|
|
5356
5998
|
logger.log(offer.sdp);
|
|
5357
5999
|
parsed = lib.parse(offer.sdp);
|
|
@@ -5376,11 +6018,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5376
6018
|
});
|
|
5377
6019
|
offer.sdp = lib.write(parsed);
|
|
5378
6020
|
logger.log("local offer modified:\n", offer.sdp);
|
|
5379
|
-
_context2.next =
|
|
6021
|
+
_context2.next = 23;
|
|
5380
6022
|
return pc.setLocalDescription(offer);
|
|
5381
|
-
case
|
|
6023
|
+
case 23:
|
|
5382
6024
|
finnalUrl = this._url;
|
|
5383
|
-
_context2.prev =
|
|
6025
|
+
_context2.prev = 24;
|
|
5384
6026
|
if (this._opts.preProcessUrl) {
|
|
5385
6027
|
finnalUrl = this._opts.preProcessUrl(finnalUrl).url;
|
|
5386
6028
|
}
|
|
@@ -5393,7 +6035,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5393
6035
|
sessionId
|
|
5394
6036
|
});
|
|
5395
6037
|
reqStart = Date.now();
|
|
5396
|
-
_context2.next =
|
|
6038
|
+
_context2.next = 33;
|
|
5397
6039
|
return this._loader.load(finnalUrl, {
|
|
5398
6040
|
body: JSON.stringify({
|
|
5399
6041
|
sessionId,
|
|
@@ -5401,27 +6043,27 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5401
6043
|
localSdp: offer
|
|
5402
6044
|
})
|
|
5403
6045
|
});
|
|
5404
|
-
case
|
|
6046
|
+
case 33:
|
|
5405
6047
|
res = _context2.sent;
|
|
5406
6048
|
this.emit(EVENT.LOAD_RESPONSE_HEADERS, {
|
|
5407
6049
|
headers: res.response.headers
|
|
5408
6050
|
});
|
|
5409
6051
|
answer = res === null || res === void 0 ? void 0 : res.data;
|
|
5410
6052
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) === 404 || (answer === null || answer === void 0 ? void 0 : answer.code) === 403)) {
|
|
5411
|
-
_context2.next =
|
|
6053
|
+
_context2.next = 41;
|
|
5412
6054
|
break;
|
|
5413
6055
|
}
|
|
5414
6056
|
err = StreamingError.create(answer.code === 404 ? ERR.NETWORK_NOTFOUND : ERR.NETWORK_FORBIDDEN, null, answer);
|
|
5415
6057
|
err.errorType = ERR.NETWORK;
|
|
5416
6058
|
this._emitError(err);
|
|
5417
6059
|
return _context2.abrupt("return");
|
|
5418
|
-
case
|
|
6060
|
+
case 41:
|
|
5419
6061
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) !== 200)) {
|
|
5420
|
-
_context2.next =
|
|
6062
|
+
_context2.next = 43;
|
|
5421
6063
|
break;
|
|
5422
6064
|
}
|
|
5423
6065
|
throw new Error("code: ".concat(answer === null || answer === void 0 ? void 0 : answer.code, ", message:").concat(answer === null || answer === void 0 ? void 0 : answer.message));
|
|
5424
|
-
case
|
|
6066
|
+
case 43:
|
|
5425
6067
|
logger.log("answer:");
|
|
5426
6068
|
logger.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
|
|
5427
6069
|
this.emit(EVENT.LOAD_COMPLETE, {
|
|
@@ -5436,41 +6078,35 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5436
6078
|
answer.remoteSdp.sdp = lib.write(_parsed);
|
|
5437
6079
|
logger.log("answer modified:\n", answer.remoteSdp.sdp);
|
|
5438
6080
|
this._rctConnectStartTs = Date.now();
|
|
5439
|
-
_context2.next =
|
|
6081
|
+
_context2.next = 53;
|
|
5440
6082
|
return this._pc.setRemoteDescription(answer.remoteSdp);
|
|
5441
|
-
case
|
|
6083
|
+
case 53:
|
|
5442
6084
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
5443
|
-
_context2.next =
|
|
6085
|
+
_context2.next = 59;
|
|
5444
6086
|
break;
|
|
5445
|
-
case
|
|
5446
|
-
_context2.prev =
|
|
5447
|
-
_context2.t0 = _context2["catch"](
|
|
6087
|
+
case 56:
|
|
6088
|
+
_context2.prev = 56;
|
|
6089
|
+
_context2.t0 = _context2["catch"](24);
|
|
5448
6090
|
this._emitError(StreamingError.network(_context2.t0));
|
|
5449
|
-
case
|
|
6091
|
+
case 59:
|
|
5450
6092
|
case "end":
|
|
5451
6093
|
return _context2.stop();
|
|
5452
6094
|
}
|
|
5453
|
-
}, _callee2, this, [[
|
|
6095
|
+
}, _callee2, this, [[24, 56]]);
|
|
5454
6096
|
}));
|
|
5455
6097
|
function _connect() {
|
|
5456
6098
|
return _connect2.apply(this, arguments);
|
|
5457
6099
|
}
|
|
5458
6100
|
return _connect;
|
|
5459
6101
|
}()
|
|
5460
|
-
}, {
|
|
5461
|
-
key: "_closeLastPc",
|
|
5462
|
-
value: function _closeLastPc() {
|
|
5463
|
-
if (this._lastPc) {
|
|
5464
|
-
this._lastPc.close();
|
|
5465
|
-
this._lastPc = null;
|
|
5466
|
-
}
|
|
5467
|
-
}
|
|
5468
6102
|
}, {
|
|
5469
6103
|
key: "_disconnect",
|
|
5470
6104
|
value: function _disconnect() {
|
|
5471
|
-
var _this$_loader, _this$_networkEvaluat2;
|
|
6105
|
+
var _this$_loader, _this$_networkEvaluat2, _this$_videoTransceic, _this$_audioTransceic;
|
|
5472
6106
|
(_this$_loader = this._loader) === null || _this$_loader === void 0 ? void 0 : _this$_loader.cancel();
|
|
5473
6107
|
(_this$_networkEvaluat2 = this._networkEvaluate) === null || _this$_networkEvaluat2 === void 0 ? void 0 : _this$_networkEvaluat2.destroy();
|
|
6108
|
+
(_this$_videoTransceic = this._videoTransceicer) === null || _this$_videoTransceic === void 0 ? void 0 : _this$_videoTransceic.stop();
|
|
6109
|
+
(_this$_audioTransceic = this._audioTransceicer) === null || _this$_audioTransceic === void 0 ? void 0 : _this$_audioTransceic.stop();
|
|
5474
6110
|
this._audioTransceicer = null;
|
|
5475
6111
|
this._videoTransceicer = null;
|
|
5476
6112
|
this._mediaStream = null;
|
|
@@ -5479,7 +6115,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5479
6115
|
}, {
|
|
5480
6116
|
key: "_emitError",
|
|
5481
6117
|
value: function _emitError(error) {
|
|
5482
|
-
this._closeLastPc();
|
|
5483
6118
|
this.emit(EVENT.ERROR, error);
|
|
5484
6119
|
}
|
|
5485
6120
|
}, {
|
|
@@ -5491,7 +6126,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5491
6126
|
if (this._media && !((_this$_opts = this._opts) !== null && _this$_opts !== void 0 && _this$_opts.seamlesslyReload)) {
|
|
5492
6127
|
this._media.srcObject = null;
|
|
5493
6128
|
}
|
|
5494
|
-
this._closeLastPc();
|
|
5495
6129
|
if (this._pc) {
|
|
5496
6130
|
this._pc.close();
|
|
5497
6131
|
}
|
|
@@ -5520,64 +6154,6 @@ try {
|
|
|
5520
6154
|
}
|
|
5521
6155
|
} catch (error) {
|
|
5522
6156
|
}
|
|
5523
|
-
function isSupported() {
|
|
5524
|
-
if (!window.RTCPeerConnection || !window.RTCPeerConnection.prototype.addTransceiver) {
|
|
5525
|
-
return false;
|
|
5526
|
-
}
|
|
5527
|
-
return true;
|
|
5528
|
-
}
|
|
5529
|
-
function getCapacity() {
|
|
5530
|
-
if (!isSupported())
|
|
5531
|
-
return Promise.reject("RTCPeerConnection no support");
|
|
5532
|
-
var pc;
|
|
5533
|
-
try {
|
|
5534
|
-
pc = new RTCPeerConnection();
|
|
5535
|
-
pc.addTransceiver("video", {
|
|
5536
|
-
direction: "recvonly"
|
|
5537
|
-
});
|
|
5538
|
-
pc.addTransceiver("audio", {
|
|
5539
|
-
direction: "recvonly"
|
|
5540
|
-
});
|
|
5541
|
-
} catch (e) {
|
|
5542
|
-
return Promise.reject(e === null || e === void 0 ? void 0 : e.message);
|
|
5543
|
-
}
|
|
5544
|
-
return pc.createOffer().then(function(offer) {
|
|
5545
|
-
var _sdpJson$media, _sdpJson$media2, _vMedia$rtp, _aMedia$rtp;
|
|
5546
|
-
logger.log(offer.sdp);
|
|
5547
|
-
var sdpJson = lib.parse(offer.sdp);
|
|
5548
|
-
var vMedia = (_sdpJson$media = sdpJson.media) === null || _sdpJson$media === void 0 ? void 0 : _sdpJson$media.filter(function(x) {
|
|
5549
|
-
return x.type === "video";
|
|
5550
|
-
})[0];
|
|
5551
|
-
var aMedia = (_sdpJson$media2 = sdpJson.media) === null || _sdpJson$media2 === void 0 ? void 0 : _sdpJson$media2.filter(function(x) {
|
|
5552
|
-
return x.type === "audio";
|
|
5553
|
-
})[0];
|
|
5554
|
-
var vCodecs = vMedia === null || vMedia === void 0 ? void 0 : (_vMedia$rtp = vMedia.rtp) === null || _vMedia$rtp === void 0 ? void 0 : _vMedia$rtp.filter(function(x) {
|
|
5555
|
-
return x.codec === "VP8" || x.codec === "VP9" || x.codec === "H264";
|
|
5556
|
-
});
|
|
5557
|
-
var aCodecs = aMedia === null || aMedia === void 0 ? void 0 : (_aMedia$rtp = aMedia.rtp) === null || _aMedia$rtp === void 0 ? void 0 : _aMedia$rtp.filter(function(x) {
|
|
5558
|
-
return x.codec === "opus";
|
|
5559
|
-
});
|
|
5560
|
-
var vFmtp = vMedia === null || vMedia === void 0 ? void 0 : vMedia.fmtp;
|
|
5561
|
-
var aFmtp = aMedia === null || aMedia === void 0 ? void 0 : aMedia.fmtp;
|
|
5562
|
-
vFmtp && vCodecs.map(function(codec) {
|
|
5563
|
-
var _vFmtp$filter$;
|
|
5564
|
-
codec.config = (_vFmtp$filter$ = vFmtp.filter(function(x) {
|
|
5565
|
-
return x.payload === codec.payload;
|
|
5566
|
-
})[0]) === null || _vFmtp$filter$ === void 0 ? void 0 : _vFmtp$filter$.config;
|
|
5567
|
-
});
|
|
5568
|
-
aFmtp && aCodecs.map(function(codec) {
|
|
5569
|
-
var _aFmtp$filter$;
|
|
5570
|
-
codec.config = (_aFmtp$filter$ = aFmtp.filter(function(x) {
|
|
5571
|
-
return x.payload === codec.payload;
|
|
5572
|
-
})[0]) === null || _aFmtp$filter$ === void 0 ? void 0 : _aFmtp$filter$.config;
|
|
5573
|
-
});
|
|
5574
|
-
pc.close();
|
|
5575
|
-
return {
|
|
5576
|
-
video: vCodecs,
|
|
5577
|
-
audio: aCodecs
|
|
5578
|
-
};
|
|
5579
|
-
});
|
|
5580
|
-
}
|
|
5581
6157
|
var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
5582
6158
|
_inherits$1(RtsPlugin2, _BasePlugin);
|
|
5583
6159
|
var _super = _createSuper$1(RtsPlugin2);
|
|
@@ -5592,26 +6168,26 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5592
6168
|
_defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
|
|
5593
6169
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rtsOpts", null);
|
|
5594
6170
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onPause", function() {
|
|
5595
|
-
var _this$_rts, _this$
|
|
5596
|
-
if (!((_this$_rts = _this._rts) !== null && _this$_rts !== void 0 && _this$_rts._pc)
|
|
6171
|
+
var _this$_rts, _this$config, _this$_rts3;
|
|
6172
|
+
if (!((_this$_rts = _this._rts) !== null && _this$_rts !== void 0 && _this$_rts._pc)) {
|
|
5597
6173
|
return;
|
|
5598
6174
|
}
|
|
5599
6175
|
if ((_this$config = _this.config) !== null && _this$config !== void 0 && _this$config.seamlesslyReload) {
|
|
5600
|
-
var _this$
|
|
5601
|
-
_this._mediaStream = (_this$
|
|
6176
|
+
var _this$_rts2;
|
|
6177
|
+
_this._mediaStream = (_this$_rts2 = _this._rts) === null || _this$_rts2 === void 0 ? void 0 : _this$_rts2._mediaStream;
|
|
5602
6178
|
}
|
|
5603
|
-
(_this$
|
|
6179
|
+
(_this$_rts3 = _this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3.destroy();
|
|
5604
6180
|
});
|
|
5605
6181
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onPlay", function() {
|
|
5606
|
-
var _this$
|
|
5607
|
-
if ((_this$
|
|
6182
|
+
var _this$_rts4;
|
|
6183
|
+
if ((_this$_rts4 = _this._rts) !== null && _this$_rts4 !== void 0 && _this$_rts4._pc) {
|
|
5608
6184
|
return;
|
|
5609
6185
|
}
|
|
5610
6186
|
_this._init();
|
|
5611
6187
|
});
|
|
5612
6188
|
_defineProperty$2(_assertThisInitialized$1(_this), "_init", function() {
|
|
5613
|
-
var _this$
|
|
5614
|
-
(_this$
|
|
6189
|
+
var _this$_rts5;
|
|
6190
|
+
(_this$_rts5 = _this._rts) === null || _this$_rts5 === void 0 ? void 0 : _this$_rts5.destroy();
|
|
5615
6191
|
var config = _this.player.config;
|
|
5616
6192
|
var rtsOpts = config.rts || {};
|
|
5617
6193
|
_this._rtsOpts = rtsOpts;
|
|
@@ -5628,39 +6204,36 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5628
6204
|
}, rtsOpts));
|
|
5629
6205
|
_this._rts.load(config.url);
|
|
5630
6206
|
});
|
|
5631
|
-
_defineProperty$2(_assertThisInitialized$1(_this), "_onSwitchURL", function(url
|
|
6207
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_onSwitchURL", function(url) {
|
|
5632
6208
|
if (_this._rts) {
|
|
5633
|
-
if (_typeof$2(seamless) === "object") {
|
|
5634
|
-
seamless = seamless.seamless;
|
|
5635
|
-
}
|
|
5636
6209
|
_this.player.config.url = url;
|
|
5637
|
-
_this._rts.switchURL(url
|
|
6210
|
+
_this._rts.switchURL(url);
|
|
5638
6211
|
}
|
|
5639
6212
|
});
|
|
5640
6213
|
_defineProperty$2(_assertThisInitialized$1(_this), "destroy", function() {
|
|
5641
|
-
var _this$
|
|
6214
|
+
var _this$_rts6;
|
|
5642
6215
|
_this.player.switchURL = _this._originSwitchFn;
|
|
5643
|
-
(_this$
|
|
6216
|
+
(_this$_rts6 = _this._rts) === null || _this$_rts6 === void 0 ? void 0 : _this$_rts6.destroy();
|
|
5644
6217
|
});
|
|
5645
6218
|
return _this;
|
|
5646
6219
|
}
|
|
5647
6220
|
_createClass$2(RtsPlugin2, [{
|
|
5648
6221
|
key: "pc",
|
|
5649
6222
|
get: function get() {
|
|
5650
|
-
var _this$
|
|
5651
|
-
return (_this$
|
|
6223
|
+
var _this$_rts7;
|
|
6224
|
+
return (_this$_rts7 = this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.pc;
|
|
5652
6225
|
}
|
|
5653
6226
|
}, {
|
|
5654
6227
|
key: "videoTrack",
|
|
5655
6228
|
get: function get() {
|
|
5656
|
-
var _this$
|
|
5657
|
-
return (_this$
|
|
6229
|
+
var _this$_rts8;
|
|
6230
|
+
return (_this$_rts8 = this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.videoTack;
|
|
5658
6231
|
}
|
|
5659
6232
|
}, {
|
|
5660
6233
|
key: "audioTrack",
|
|
5661
6234
|
get: function get() {
|
|
5662
|
-
var _this$
|
|
5663
|
-
return (_this$
|
|
6235
|
+
var _this$_rts9;
|
|
6236
|
+
return (_this$_rts9 = this._rts) === null || _this$_rts9 === void 0 ? void 0 : _this$_rts9.audioTrack;
|
|
5664
6237
|
}
|
|
5665
6238
|
}, {
|
|
5666
6239
|
key: "core",
|
|
@@ -5670,13 +6243,13 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5670
6243
|
}, {
|
|
5671
6244
|
key: "loader",
|
|
5672
6245
|
get: function get() {
|
|
5673
|
-
var _this$
|
|
5674
|
-
return (_this$
|
|
6246
|
+
var _this$_rts10;
|
|
6247
|
+
return (_this$_rts10 = this._rts) === null || _this$_rts10 === void 0 ? void 0 : _this$_rts10.loader;
|
|
5675
6248
|
}
|
|
5676
6249
|
}, {
|
|
5677
6250
|
key: "version",
|
|
5678
6251
|
get: function get() {
|
|
5679
|
-
return "0.2.1-alpha.
|
|
6252
|
+
return "0.2.1-alpha.5";
|
|
5680
6253
|
}
|
|
5681
6254
|
}, {
|
|
5682
6255
|
key: "beforePlayerInit",
|
|
@@ -5704,6 +6277,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5704
6277
|
this._transCoreEvent(EVENT.LOAD_RESPONSE_HEADERS);
|
|
5705
6278
|
this._transCoreEvent(EVENT.LOAD_RETRY);
|
|
5706
6279
|
this._transCoreEvent(EVENT.METADATA_PARSED);
|
|
6280
|
+
this._transCoreEvent(EVENT.SEI);
|
|
5707
6281
|
this._transCoreEvent(EXTEND_EVENTS.RTC_STATE_CHANGE);
|
|
5708
6282
|
try {
|
|
5709
6283
|
BasePlugin.defineGetterOrSetter(this.player, {
|
|
@@ -5726,20 +6300,20 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5726
6300
|
}, {
|
|
5727
6301
|
key: "getStats",
|
|
5728
6302
|
value: function getStats2() {
|
|
5729
|
-
var _this$
|
|
5730
|
-
return (_this$
|
|
6303
|
+
var _this$_rts11;
|
|
6304
|
+
return (_this$_rts11 = this._rts) === null || _this$_rts11 === void 0 ? void 0 : _this$_rts11.getStats();
|
|
5731
6305
|
}
|
|
5732
6306
|
}, {
|
|
5733
6307
|
key: "getStatsSnapshoot",
|
|
5734
6308
|
value: function getStatsSnapshoot2() {
|
|
5735
|
-
var _this$
|
|
5736
|
-
return (_this$
|
|
6309
|
+
var _this$_rts12;
|
|
6310
|
+
return (_this$_rts12 = this._rts) === null || _this$_rts12 === void 0 ? void 0 : _this$_rts12.getStatsSnapshoot();
|
|
5737
6311
|
}
|
|
5738
6312
|
}, {
|
|
5739
6313
|
key: "getNetWorkInfo",
|
|
5740
6314
|
value: function getNetWorkInfo() {
|
|
5741
|
-
var _this$
|
|
5742
|
-
return (_this$
|
|
6315
|
+
var _this$_rts13;
|
|
6316
|
+
return (_this$_rts13 = this._rts) === null || _this$_rts13 === void 0 ? void 0 : _this$_rts13.networkStats;
|
|
5743
6317
|
}
|
|
5744
6318
|
}, {
|
|
5745
6319
|
key: "_transErrorEvent",
|