@byteplus/veplayer-plugin 2.8.0-rc.7 → 2.8.0-rc.8
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 +62 -25
- package/esm/index.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +62 -25
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.rtm.development.js +62 -25
- package/umd/veplayer.plugin.rtm.production.js +1 -1
package/package.json
CHANGED
|
@@ -4962,6 +4962,7 @@
|
|
|
4962
4962
|
checkStatsErrorDelay: 5e3,
|
|
4963
4963
|
connectionStateChangeTimeout: 5e3,
|
|
4964
4964
|
enableNetworkQuality: false,
|
|
4965
|
+
hackCreateOfferIssue: false,
|
|
4965
4966
|
networkQuality: {
|
|
4966
4967
|
networkQos: {
|
|
4967
4968
|
1: {
|
|
@@ -6927,26 +6928,33 @@
|
|
|
6927
6928
|
}
|
|
6928
6929
|
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
6929
6930
|
_context3.prev = 6;
|
|
6931
|
+
if (!this._opts.hackCreateOfferIssue) {
|
|
6932
|
+
_context3.next = 10;
|
|
6933
|
+
break;
|
|
6934
|
+
}
|
|
6935
|
+
_context3.next = 10;
|
|
6936
|
+
return this._createEmptyPeer();
|
|
6937
|
+
case 10:
|
|
6930
6938
|
this._pc = new RTCPeerConnection({
|
|
6931
6939
|
encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
|
|
6932
6940
|
});
|
|
6933
6941
|
this._bindRTCEvents();
|
|
6934
|
-
_context3.next =
|
|
6942
|
+
_context3.next = 14;
|
|
6935
6943
|
return this._connect(url);
|
|
6936
|
-
case
|
|
6937
|
-
_context3.next =
|
|
6944
|
+
case 14:
|
|
6945
|
+
_context3.next = 19;
|
|
6938
6946
|
break;
|
|
6939
|
-
case
|
|
6940
|
-
_context3.prev =
|
|
6947
|
+
case 16:
|
|
6948
|
+
_context3.prev = 16;
|
|
6941
6949
|
_context3.t0 = _context3["catch"](6);
|
|
6942
6950
|
setTimeout(function() {
|
|
6943
6951
|
return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context3.t0));
|
|
6944
6952
|
});
|
|
6945
|
-
case
|
|
6953
|
+
case 19:
|
|
6946
6954
|
case "end":
|
|
6947
6955
|
return _context3.stop();
|
|
6948
6956
|
}
|
|
6949
|
-
}, _callee3, this, [[6,
|
|
6957
|
+
}, _callee3, this, [[6, 16]]);
|
|
6950
6958
|
}));
|
|
6951
6959
|
function load(_x) {
|
|
6952
6960
|
return _load.apply(this, arguments);
|
|
@@ -7124,6 +7132,9 @@
|
|
|
7124
7132
|
case 13:
|
|
7125
7133
|
offer = _context4.sent;
|
|
7126
7134
|
case 14:
|
|
7135
|
+
if (this._opts.hackCreateOfferIssue) {
|
|
7136
|
+
this._createEmptyPeer();
|
|
7137
|
+
}
|
|
7127
7138
|
logger.log("local offer");
|
|
7128
7139
|
logger.log(offer.sdp);
|
|
7129
7140
|
parsed = lib.parse(offer.sdp);
|
|
@@ -7148,11 +7159,11 @@
|
|
|
7148
7159
|
});
|
|
7149
7160
|
offer.sdp = lib.write(parsed);
|
|
7150
7161
|
logger.log("local offer modified:\n", offer.sdp);
|
|
7151
|
-
_context4.next =
|
|
7162
|
+
_context4.next = 23;
|
|
7152
7163
|
return pc.setLocalDescription(offer);
|
|
7153
|
-
case
|
|
7164
|
+
case 23:
|
|
7154
7165
|
finnalUrl = this._url;
|
|
7155
|
-
_context4.prev =
|
|
7166
|
+
_context4.prev = 24;
|
|
7156
7167
|
if (this._opts.preProcessUrl) {
|
|
7157
7168
|
finnalUrl = this._opts.preProcessUrl(finnalUrl).url;
|
|
7158
7169
|
}
|
|
@@ -7165,7 +7176,7 @@
|
|
|
7165
7176
|
sessionId
|
|
7166
7177
|
});
|
|
7167
7178
|
reqStart = Date.now();
|
|
7168
|
-
_context4.next =
|
|
7179
|
+
_context4.next = 33;
|
|
7169
7180
|
return this._loader.load(finnalUrl, {
|
|
7170
7181
|
body: JSON.stringify({
|
|
7171
7182
|
sessionId,
|
|
@@ -7173,27 +7184,27 @@
|
|
|
7173
7184
|
localSdp: offer
|
|
7174
7185
|
})
|
|
7175
7186
|
});
|
|
7176
|
-
case
|
|
7187
|
+
case 33:
|
|
7177
7188
|
res = _context4.sent;
|
|
7178
7189
|
this.emit(EVENT.LOAD_RESPONSE_HEADERS, {
|
|
7179
7190
|
headers: res.response.headers
|
|
7180
7191
|
});
|
|
7181
7192
|
answer = res === null || res === void 0 ? void 0 : res.data;
|
|
7182
7193
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) === 404 || (answer === null || answer === void 0 ? void 0 : answer.code) === 403)) {
|
|
7183
|
-
_context4.next =
|
|
7194
|
+
_context4.next = 41;
|
|
7184
7195
|
break;
|
|
7185
7196
|
}
|
|
7186
7197
|
err = StreamingError.create(answer.code === 404 ? ERR.NETWORK_NOTFOUND : ERR.NETWORK_FORBIDDEN, null, answer);
|
|
7187
7198
|
err.errorType = ERR.NETWORK;
|
|
7188
7199
|
this._emitError(err);
|
|
7189
7200
|
return _context4.abrupt("return");
|
|
7190
|
-
case
|
|
7201
|
+
case 41:
|
|
7191
7202
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) !== 200)) {
|
|
7192
|
-
_context4.next =
|
|
7203
|
+
_context4.next = 43;
|
|
7193
7204
|
break;
|
|
7194
7205
|
}
|
|
7195
7206
|
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));
|
|
7196
|
-
case
|
|
7207
|
+
case 43:
|
|
7197
7208
|
logger.log("answer:");
|
|
7198
7209
|
logger.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
|
|
7199
7210
|
_parsed = lib.parse(answer.remoteSdp.sdp);
|
|
@@ -7222,22 +7233,22 @@
|
|
|
7222
7233
|
answer.remoteSdp.sdp = lib.write(_parsed);
|
|
7223
7234
|
logger.log("answer modified:\n", answer.remoteSdp.sdp);
|
|
7224
7235
|
this._rctConnectStartTs = Date.now();
|
|
7225
|
-
_context4.next =
|
|
7236
|
+
_context4.next = 53;
|
|
7226
7237
|
return this._pc.setRemoteDescription(answer.remoteSdp);
|
|
7227
|
-
case
|
|
7238
|
+
case 53:
|
|
7228
7239
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
7229
7240
|
this._listenPeerStateTimeout();
|
|
7230
|
-
_context4.next =
|
|
7241
|
+
_context4.next = 60;
|
|
7231
7242
|
break;
|
|
7232
|
-
case
|
|
7233
|
-
_context4.prev =
|
|
7234
|
-
_context4.t0 = _context4["catch"](
|
|
7243
|
+
case 57:
|
|
7244
|
+
_context4.prev = 57;
|
|
7245
|
+
_context4.t0 = _context4["catch"](24);
|
|
7235
7246
|
this._emitError(StreamingError.network(_context4.t0));
|
|
7236
|
-
case
|
|
7247
|
+
case 60:
|
|
7237
7248
|
case "end":
|
|
7238
7249
|
return _context4.stop();
|
|
7239
7250
|
}
|
|
7240
|
-
}, _callee4, this, [[
|
|
7251
|
+
}, _callee4, this, [[24, 57]]);
|
|
7241
7252
|
}));
|
|
7242
7253
|
function _connect() {
|
|
7243
7254
|
return _connect2.apply(this, arguments);
|
|
@@ -7420,6 +7431,32 @@
|
|
|
7420
7431
|
this._pc.close();
|
|
7421
7432
|
}
|
|
7422
7433
|
}
|
|
7434
|
+
}, {
|
|
7435
|
+
key: "_createEmptyPeer",
|
|
7436
|
+
value: function() {
|
|
7437
|
+
var _createEmptyPeer2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee6() {
|
|
7438
|
+
var pc;
|
|
7439
|
+
return _regeneratorRuntime$1().wrap(function _callee6$(_context6) {
|
|
7440
|
+
while (1)
|
|
7441
|
+
switch (_context6.prev = _context6.next) {
|
|
7442
|
+
case 0:
|
|
7443
|
+
pc = new RTCPeerConnection();
|
|
7444
|
+
_context6.next = 3;
|
|
7445
|
+
return pc.createOffer();
|
|
7446
|
+
case 3:
|
|
7447
|
+
pc.close();
|
|
7448
|
+
pc = null;
|
|
7449
|
+
case 5:
|
|
7450
|
+
case "end":
|
|
7451
|
+
return _context6.stop();
|
|
7452
|
+
}
|
|
7453
|
+
}, _callee6);
|
|
7454
|
+
}));
|
|
7455
|
+
function _createEmptyPeer() {
|
|
7456
|
+
return _createEmptyPeer2.apply(this, arguments);
|
|
7457
|
+
}
|
|
7458
|
+
return _createEmptyPeer;
|
|
7459
|
+
}()
|
|
7423
7460
|
}, {
|
|
7424
7461
|
key: "destroy",
|
|
7425
7462
|
value: function destroy(keepClearMediaStream) {
|
|
@@ -7560,7 +7597,7 @@
|
|
|
7560
7597
|
}, {
|
|
7561
7598
|
key: "version",
|
|
7562
7599
|
get: function get() {
|
|
7563
|
-
return "0.2.1-alpha.
|
|
7600
|
+
return "0.2.1-alpha.35";
|
|
7564
7601
|
}
|
|
7565
7602
|
}, {
|
|
7566
7603
|
key: "beforePlayerInit",
|