@byteplus/veplayer-plugin 2.8.0-rc.7 → 2.8.0-rc.9
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 +73 -30
- package/esm/index.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +73 -30
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.rtm.development.js +73 -30
- package/umd/veplayer.plugin.rtm.production.js +1 -1
package/esm/index.development.js
CHANGED
|
@@ -51262,6 +51262,7 @@ function getOption(opts) {
|
|
|
51262
51262
|
checkStatsErrorDelay: 5e3,
|
|
51263
51263
|
connectionStateChangeTimeout: 5e3,
|
|
51264
51264
|
enableNetworkQuality: false,
|
|
51265
|
+
hackCreateOfferIssue: false,
|
|
51265
51266
|
networkQuality: {
|
|
51266
51267
|
networkQos: {
|
|
51267
51268
|
1: {
|
|
@@ -53213,7 +53214,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53213
53214
|
value: function() {
|
|
53214
53215
|
var _load = _asyncToGenerator$a(/* @__PURE__ */ _regeneratorRuntime$a().mark(function _callee3(url2) {
|
|
53215
53216
|
var _this2 = this;
|
|
53216
|
-
var
|
|
53217
|
+
var encodedTransformSupported, lastPc;
|
|
53217
53218
|
return _regeneratorRuntime$a().wrap(function _callee3$(_context3) {
|
|
53218
53219
|
while (1)
|
|
53219
53220
|
switch (_context3.prev = _context3.next) {
|
|
@@ -53221,32 +53222,39 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53221
53222
|
this._disconnect();
|
|
53222
53223
|
this._url = url2;
|
|
53223
53224
|
this._retry = this._opts.retryCount;
|
|
53225
|
+
if (!this._opts.hackCreateOfferIssue) {
|
|
53226
|
+
_context3.next = 6;
|
|
53227
|
+
break;
|
|
53228
|
+
}
|
|
53229
|
+
_context3.next = 6;
|
|
53230
|
+
return this._createEmptyPeer();
|
|
53231
|
+
case 6:
|
|
53232
|
+
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
53233
|
+
_context3.prev = 7;
|
|
53224
53234
|
lastPc = this._pc;
|
|
53225
53235
|
if (lastPc) {
|
|
53226
53236
|
lastPc.close();
|
|
53227
53237
|
}
|
|
53228
|
-
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
53229
|
-
_context3.prev = 6;
|
|
53230
53238
|
this._pc = new RTCPeerConnection({
|
|
53231
53239
|
encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
|
|
53232
53240
|
});
|
|
53233
53241
|
this._bindRTCEvents();
|
|
53234
|
-
_context3.next =
|
|
53242
|
+
_context3.next = 14;
|
|
53235
53243
|
return this._connect(url2);
|
|
53236
|
-
case
|
|
53237
|
-
_context3.next =
|
|
53244
|
+
case 14:
|
|
53245
|
+
_context3.next = 19;
|
|
53238
53246
|
break;
|
|
53239
|
-
case
|
|
53240
|
-
_context3.prev =
|
|
53241
|
-
_context3.t0 = _context3["catch"](
|
|
53247
|
+
case 16:
|
|
53248
|
+
_context3.prev = 16;
|
|
53249
|
+
_context3.t0 = _context3["catch"](7);
|
|
53242
53250
|
setTimeout(function() {
|
|
53243
53251
|
return _this2._emitError(StreamingError$2.create(ERR$2.OTHER, null, _context3.t0));
|
|
53244
53252
|
});
|
|
53245
|
-
case
|
|
53253
|
+
case 19:
|
|
53246
53254
|
case "end":
|
|
53247
53255
|
return _context3.stop();
|
|
53248
53256
|
}
|
|
53249
|
-
}, _callee3, this, [[
|
|
53257
|
+
}, _callee3, this, [[7, 16]]);
|
|
53250
53258
|
}));
|
|
53251
53259
|
function load(_x) {
|
|
53252
53260
|
return _load.apply(this, arguments);
|
|
@@ -53424,6 +53432,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53424
53432
|
case 13:
|
|
53425
53433
|
offer = _context4.sent;
|
|
53426
53434
|
case 14:
|
|
53435
|
+
if (this._opts.hackCreateOfferIssue) {
|
|
53436
|
+
this._createEmptyPeer();
|
|
53437
|
+
}
|
|
53427
53438
|
logger$a.log("local offer");
|
|
53428
53439
|
logger$a.log(offer.sdp);
|
|
53429
53440
|
parsed = lib$1.parse(offer.sdp);
|
|
@@ -53448,11 +53459,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53448
53459
|
});
|
|
53449
53460
|
offer.sdp = lib$1.write(parsed);
|
|
53450
53461
|
logger$a.log("local offer modified:\n", offer.sdp);
|
|
53451
|
-
_context4.next =
|
|
53462
|
+
_context4.next = 23;
|
|
53452
53463
|
return pc.setLocalDescription(offer);
|
|
53453
|
-
case
|
|
53464
|
+
case 23:
|
|
53454
53465
|
finnalUrl = this._url;
|
|
53455
|
-
_context4.prev =
|
|
53466
|
+
_context4.prev = 24;
|
|
53456
53467
|
if (this._opts.preProcessUrl) {
|
|
53457
53468
|
finnalUrl = this._opts.preProcessUrl(finnalUrl).url;
|
|
53458
53469
|
}
|
|
@@ -53465,7 +53476,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53465
53476
|
sessionId
|
|
53466
53477
|
});
|
|
53467
53478
|
reqStart = Date.now();
|
|
53468
|
-
_context4.next =
|
|
53479
|
+
_context4.next = 33;
|
|
53469
53480
|
return this._loader.load(finnalUrl, {
|
|
53470
53481
|
body: JSON.stringify({
|
|
53471
53482
|
sessionId,
|
|
@@ -53473,27 +53484,27 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53473
53484
|
localSdp: offer
|
|
53474
53485
|
})
|
|
53475
53486
|
});
|
|
53476
|
-
case
|
|
53487
|
+
case 33:
|
|
53477
53488
|
res = _context4.sent;
|
|
53478
53489
|
this.emit(EVENT$2.LOAD_RESPONSE_HEADERS, {
|
|
53479
53490
|
headers: res.response.headers
|
|
53480
53491
|
});
|
|
53481
53492
|
answer = res === null || res === void 0 ? void 0 : res.data;
|
|
53482
53493
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) === 404 || (answer === null || answer === void 0 ? void 0 : answer.code) === 403)) {
|
|
53483
|
-
_context4.next =
|
|
53494
|
+
_context4.next = 41;
|
|
53484
53495
|
break;
|
|
53485
53496
|
}
|
|
53486
53497
|
err = StreamingError$2.create(answer.code === 404 ? ERR$2.NETWORK_NOTFOUND : ERR$2.NETWORK_FORBIDDEN, null, answer);
|
|
53487
53498
|
err.errorType = ERR$2.NETWORK;
|
|
53488
53499
|
this._emitError(err);
|
|
53489
53500
|
return _context4.abrupt("return");
|
|
53490
|
-
case
|
|
53501
|
+
case 41:
|
|
53491
53502
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) !== 200)) {
|
|
53492
|
-
_context4.next =
|
|
53503
|
+
_context4.next = 43;
|
|
53493
53504
|
break;
|
|
53494
53505
|
}
|
|
53495
53506
|
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));
|
|
53496
|
-
case
|
|
53507
|
+
case 43:
|
|
53497
53508
|
logger$a.log("answer:");
|
|
53498
53509
|
logger$a.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
|
|
53499
53510
|
_parsed = lib$1.parse(answer.remoteSdp.sdp);
|
|
@@ -53522,22 +53533,28 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53522
53533
|
answer.remoteSdp.sdp = lib$1.write(_parsed);
|
|
53523
53534
|
logger$a.log("answer modified:\n", answer.remoteSdp.sdp);
|
|
53524
53535
|
this._rctConnectStartTs = Date.now();
|
|
53525
|
-
|
|
53526
|
-
|
|
53527
|
-
|
|
53536
|
+
if (!(pc.signalingState === "closed")) {
|
|
53537
|
+
_context4.next = 53;
|
|
53538
|
+
break;
|
|
53539
|
+
}
|
|
53540
|
+
return _context4.abrupt("return");
|
|
53541
|
+
case 53:
|
|
53542
|
+
_context4.next = 55;
|
|
53543
|
+
return pc.setRemoteDescription(answer.remoteSdp);
|
|
53544
|
+
case 55:
|
|
53528
53545
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
53529
53546
|
this._listenPeerStateTimeout();
|
|
53530
|
-
_context4.next =
|
|
53547
|
+
_context4.next = 62;
|
|
53531
53548
|
break;
|
|
53532
|
-
case 56:
|
|
53533
|
-
_context4.prev = 56;
|
|
53534
|
-
_context4.t0 = _context4["catch"](23);
|
|
53535
|
-
this._emitError(StreamingError$2.network(_context4.t0));
|
|
53536
53549
|
case 59:
|
|
53550
|
+
_context4.prev = 59;
|
|
53551
|
+
_context4.t0 = _context4["catch"](24);
|
|
53552
|
+
this._emitError(StreamingError$2.network(_context4.t0));
|
|
53553
|
+
case 62:
|
|
53537
53554
|
case "end":
|
|
53538
53555
|
return _context4.stop();
|
|
53539
53556
|
}
|
|
53540
|
-
}, _callee4, this, [[
|
|
53557
|
+
}, _callee4, this, [[24, 59]]);
|
|
53541
53558
|
}));
|
|
53542
53559
|
function _connect() {
|
|
53543
53560
|
return _connect2.apply(this, arguments);
|
|
@@ -53720,6 +53737,32 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
53720
53737
|
this._pc.close();
|
|
53721
53738
|
}
|
|
53722
53739
|
}
|
|
53740
|
+
}, {
|
|
53741
|
+
key: "_createEmptyPeer",
|
|
53742
|
+
value: function() {
|
|
53743
|
+
var _createEmptyPeer2 = _asyncToGenerator$a(/* @__PURE__ */ _regeneratorRuntime$a().mark(function _callee6() {
|
|
53744
|
+
var pc;
|
|
53745
|
+
return _regeneratorRuntime$a().wrap(function _callee6$(_context6) {
|
|
53746
|
+
while (1)
|
|
53747
|
+
switch (_context6.prev = _context6.next) {
|
|
53748
|
+
case 0:
|
|
53749
|
+
pc = new RTCPeerConnection();
|
|
53750
|
+
_context6.next = 3;
|
|
53751
|
+
return pc.createOffer();
|
|
53752
|
+
case 3:
|
|
53753
|
+
pc.close();
|
|
53754
|
+
pc = null;
|
|
53755
|
+
case 5:
|
|
53756
|
+
case "end":
|
|
53757
|
+
return _context6.stop();
|
|
53758
|
+
}
|
|
53759
|
+
}, _callee6);
|
|
53760
|
+
}));
|
|
53761
|
+
function _createEmptyPeer() {
|
|
53762
|
+
return _createEmptyPeer2.apply(this, arguments);
|
|
53763
|
+
}
|
|
53764
|
+
return _createEmptyPeer;
|
|
53765
|
+
}()
|
|
53723
53766
|
}, {
|
|
53724
53767
|
key: "destroy",
|
|
53725
53768
|
value: function destroy2(keepClearMediaStream) {
|
|
@@ -53860,7 +53903,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
53860
53903
|
}, {
|
|
53861
53904
|
key: "version",
|
|
53862
53905
|
get: function get4() {
|
|
53863
|
-
return "0.2.1-alpha.
|
|
53906
|
+
return "0.2.1-alpha.37";
|
|
53864
53907
|
}
|
|
53865
53908
|
}, {
|
|
53866
53909
|
key: "beforePlayerInit",
|