@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
|
@@ -4958,6 +4958,7 @@ function getOption(opts) {
|
|
|
4958
4958
|
checkStatsErrorDelay: 5e3,
|
|
4959
4959
|
connectionStateChangeTimeout: 5e3,
|
|
4960
4960
|
enableNetworkQuality: false,
|
|
4961
|
+
hackCreateOfferIssue: false,
|
|
4961
4962
|
networkQuality: {
|
|
4962
4963
|
networkQos: {
|
|
4963
4964
|
1: {
|
|
@@ -6909,7 +6910,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
6909
6910
|
value: function() {
|
|
6910
6911
|
var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3(url) {
|
|
6911
6912
|
var _this2 = this;
|
|
6912
|
-
var
|
|
6913
|
+
var encodedTransformSupported, lastPc;
|
|
6913
6914
|
return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
|
|
6914
6915
|
while (1)
|
|
6915
6916
|
switch (_context3.prev = _context3.next) {
|
|
@@ -6917,32 +6918,39 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
6917
6918
|
this._disconnect();
|
|
6918
6919
|
this._url = url;
|
|
6919
6920
|
this._retry = this._opts.retryCount;
|
|
6921
|
+
if (!this._opts.hackCreateOfferIssue) {
|
|
6922
|
+
_context3.next = 6;
|
|
6923
|
+
break;
|
|
6924
|
+
}
|
|
6925
|
+
_context3.next = 6;
|
|
6926
|
+
return this._createEmptyPeer();
|
|
6927
|
+
case 6:
|
|
6928
|
+
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
6929
|
+
_context3.prev = 7;
|
|
6920
6930
|
lastPc = this._pc;
|
|
6921
6931
|
if (lastPc) {
|
|
6922
6932
|
lastPc.close();
|
|
6923
6933
|
}
|
|
6924
|
-
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
6925
|
-
_context3.prev = 6;
|
|
6926
6934
|
this._pc = new RTCPeerConnection({
|
|
6927
6935
|
encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
|
|
6928
6936
|
});
|
|
6929
6937
|
this._bindRTCEvents();
|
|
6930
|
-
_context3.next =
|
|
6938
|
+
_context3.next = 14;
|
|
6931
6939
|
return this._connect(url);
|
|
6932
|
-
case
|
|
6933
|
-
_context3.next =
|
|
6940
|
+
case 14:
|
|
6941
|
+
_context3.next = 19;
|
|
6934
6942
|
break;
|
|
6935
|
-
case
|
|
6936
|
-
_context3.prev =
|
|
6937
|
-
_context3.t0 = _context3["catch"](
|
|
6943
|
+
case 16:
|
|
6944
|
+
_context3.prev = 16;
|
|
6945
|
+
_context3.t0 = _context3["catch"](7);
|
|
6938
6946
|
setTimeout(function() {
|
|
6939
6947
|
return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context3.t0));
|
|
6940
6948
|
});
|
|
6941
|
-
case
|
|
6949
|
+
case 19:
|
|
6942
6950
|
case "end":
|
|
6943
6951
|
return _context3.stop();
|
|
6944
6952
|
}
|
|
6945
|
-
}, _callee3, this, [[
|
|
6953
|
+
}, _callee3, this, [[7, 16]]);
|
|
6946
6954
|
}));
|
|
6947
6955
|
function load(_x) {
|
|
6948
6956
|
return _load.apply(this, arguments);
|
|
@@ -7120,6 +7128,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7120
7128
|
case 13:
|
|
7121
7129
|
offer = _context4.sent;
|
|
7122
7130
|
case 14:
|
|
7131
|
+
if (this._opts.hackCreateOfferIssue) {
|
|
7132
|
+
this._createEmptyPeer();
|
|
7133
|
+
}
|
|
7123
7134
|
logger.log("local offer");
|
|
7124
7135
|
logger.log(offer.sdp);
|
|
7125
7136
|
parsed = lib.parse(offer.sdp);
|
|
@@ -7144,11 +7155,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7144
7155
|
});
|
|
7145
7156
|
offer.sdp = lib.write(parsed);
|
|
7146
7157
|
logger.log("local offer modified:\n", offer.sdp);
|
|
7147
|
-
_context4.next =
|
|
7158
|
+
_context4.next = 23;
|
|
7148
7159
|
return pc.setLocalDescription(offer);
|
|
7149
|
-
case
|
|
7160
|
+
case 23:
|
|
7150
7161
|
finnalUrl = this._url;
|
|
7151
|
-
_context4.prev =
|
|
7162
|
+
_context4.prev = 24;
|
|
7152
7163
|
if (this._opts.preProcessUrl) {
|
|
7153
7164
|
finnalUrl = this._opts.preProcessUrl(finnalUrl).url;
|
|
7154
7165
|
}
|
|
@@ -7161,7 +7172,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7161
7172
|
sessionId
|
|
7162
7173
|
});
|
|
7163
7174
|
reqStart = Date.now();
|
|
7164
|
-
_context4.next =
|
|
7175
|
+
_context4.next = 33;
|
|
7165
7176
|
return this._loader.load(finnalUrl, {
|
|
7166
7177
|
body: JSON.stringify({
|
|
7167
7178
|
sessionId,
|
|
@@ -7169,27 +7180,27 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7169
7180
|
localSdp: offer
|
|
7170
7181
|
})
|
|
7171
7182
|
});
|
|
7172
|
-
case
|
|
7183
|
+
case 33:
|
|
7173
7184
|
res = _context4.sent;
|
|
7174
7185
|
this.emit(EVENT.LOAD_RESPONSE_HEADERS, {
|
|
7175
7186
|
headers: res.response.headers
|
|
7176
7187
|
});
|
|
7177
7188
|
answer = res === null || res === void 0 ? void 0 : res.data;
|
|
7178
7189
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) === 404 || (answer === null || answer === void 0 ? void 0 : answer.code) === 403)) {
|
|
7179
|
-
_context4.next =
|
|
7190
|
+
_context4.next = 41;
|
|
7180
7191
|
break;
|
|
7181
7192
|
}
|
|
7182
7193
|
err = StreamingError.create(answer.code === 404 ? ERR.NETWORK_NOTFOUND : ERR.NETWORK_FORBIDDEN, null, answer);
|
|
7183
7194
|
err.errorType = ERR.NETWORK;
|
|
7184
7195
|
this._emitError(err);
|
|
7185
7196
|
return _context4.abrupt("return");
|
|
7186
|
-
case
|
|
7197
|
+
case 41:
|
|
7187
7198
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) !== 200)) {
|
|
7188
|
-
_context4.next =
|
|
7199
|
+
_context4.next = 43;
|
|
7189
7200
|
break;
|
|
7190
7201
|
}
|
|
7191
7202
|
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));
|
|
7192
|
-
case
|
|
7203
|
+
case 43:
|
|
7193
7204
|
logger.log("answer:");
|
|
7194
7205
|
logger.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
|
|
7195
7206
|
_parsed = lib.parse(answer.remoteSdp.sdp);
|
|
@@ -7218,22 +7229,28 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7218
7229
|
answer.remoteSdp.sdp = lib.write(_parsed);
|
|
7219
7230
|
logger.log("answer modified:\n", answer.remoteSdp.sdp);
|
|
7220
7231
|
this._rctConnectStartTs = Date.now();
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7232
|
+
if (!(pc.signalingState === "closed")) {
|
|
7233
|
+
_context4.next = 53;
|
|
7234
|
+
break;
|
|
7235
|
+
}
|
|
7236
|
+
return _context4.abrupt("return");
|
|
7237
|
+
case 53:
|
|
7238
|
+
_context4.next = 55;
|
|
7239
|
+
return pc.setRemoteDescription(answer.remoteSdp);
|
|
7240
|
+
case 55:
|
|
7224
7241
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
7225
7242
|
this._listenPeerStateTimeout();
|
|
7226
|
-
_context4.next =
|
|
7243
|
+
_context4.next = 62;
|
|
7227
7244
|
break;
|
|
7228
|
-
case 56:
|
|
7229
|
-
_context4.prev = 56;
|
|
7230
|
-
_context4.t0 = _context4["catch"](23);
|
|
7231
|
-
this._emitError(StreamingError.network(_context4.t0));
|
|
7232
7245
|
case 59:
|
|
7246
|
+
_context4.prev = 59;
|
|
7247
|
+
_context4.t0 = _context4["catch"](24);
|
|
7248
|
+
this._emitError(StreamingError.network(_context4.t0));
|
|
7249
|
+
case 62:
|
|
7233
7250
|
case "end":
|
|
7234
7251
|
return _context4.stop();
|
|
7235
7252
|
}
|
|
7236
|
-
}, _callee4, this, [[
|
|
7253
|
+
}, _callee4, this, [[24, 59]]);
|
|
7237
7254
|
}));
|
|
7238
7255
|
function _connect() {
|
|
7239
7256
|
return _connect2.apply(this, arguments);
|
|
@@ -7416,6 +7433,32 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7416
7433
|
this._pc.close();
|
|
7417
7434
|
}
|
|
7418
7435
|
}
|
|
7436
|
+
}, {
|
|
7437
|
+
key: "_createEmptyPeer",
|
|
7438
|
+
value: function() {
|
|
7439
|
+
var _createEmptyPeer2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee6() {
|
|
7440
|
+
var pc;
|
|
7441
|
+
return _regeneratorRuntime$1().wrap(function _callee6$(_context6) {
|
|
7442
|
+
while (1)
|
|
7443
|
+
switch (_context6.prev = _context6.next) {
|
|
7444
|
+
case 0:
|
|
7445
|
+
pc = new RTCPeerConnection();
|
|
7446
|
+
_context6.next = 3;
|
|
7447
|
+
return pc.createOffer();
|
|
7448
|
+
case 3:
|
|
7449
|
+
pc.close();
|
|
7450
|
+
pc = null;
|
|
7451
|
+
case 5:
|
|
7452
|
+
case "end":
|
|
7453
|
+
return _context6.stop();
|
|
7454
|
+
}
|
|
7455
|
+
}, _callee6);
|
|
7456
|
+
}));
|
|
7457
|
+
function _createEmptyPeer() {
|
|
7458
|
+
return _createEmptyPeer2.apply(this, arguments);
|
|
7459
|
+
}
|
|
7460
|
+
return _createEmptyPeer;
|
|
7461
|
+
}()
|
|
7419
7462
|
}, {
|
|
7420
7463
|
key: "destroy",
|
|
7421
7464
|
value: function destroy(keepClearMediaStream) {
|
|
@@ -7556,7 +7599,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
7556
7599
|
}, {
|
|
7557
7600
|
key: "version",
|
|
7558
7601
|
get: function get() {
|
|
7559
|
-
return "0.2.1-alpha.
|
|
7602
|
+
return "0.2.1-alpha.37";
|
|
7560
7603
|
}
|
|
7561
7604
|
}, {
|
|
7562
7605
|
key: "beforePlayerInit",
|