@volcengine/veplayer-plugin 2.0.0-rc.0 → 2.2.0-rc.0
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/README.md +21 -0
- package/esm/index.development.js +45768 -41842
- package/esm/index.production.js +5 -4
- package/esm/veplayer.plugin.flv.development.js +1988 -8535
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +3548 -10507
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.mp4.development.js +87 -4
- package/esm/veplayer.plugin.mp4.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +159 -43
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.shaka.development.js +86 -3
- package/esm/veplayer.plugin.shaka.production.js +1 -1
- package/esm/veplayer.plugin.xgvideo.development.js +226 -225
- package/esm/veplayer.plugin.xgvideo.production.js +1 -1
- package/package.json +2 -1
- package/umd/index.development.js +35422 -31496
- package/umd/index.production.js +1 -1
- package/umd/veplayer.plugin.flv.development.js +2034 -8580
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +3654 -10614
- package/umd/veplayer.plugin.hls.production.js +1 -1
- package/umd/veplayer.plugin.mp4.development.js +87 -4
- package/umd/veplayer.plugin.mp4.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +180 -65
- package/umd/veplayer.plugin.rtm.production.js +1 -1
- package/umd/veplayer.plugin.shaka.development.js +86 -3
- package/umd/veplayer.plugin.shaka.production.js +1 -1
- package/umd/veplayer.plugin.xgvideo.development.js +26 -26
- package/umd/veplayer.plugin.xgvideo.production.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ?
|
|
3
|
-
})(this, function() {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.__VEPLAYER_PLUGIN_RTM__ = {}));
|
|
3
|
+
})(this, function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
5
|
function ownKeys$2(object, enumerableOnly) {
|
|
6
6
|
var keys = Object.keys(object);
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
}
|
|
26
26
|
function _regeneratorRuntime$1() {
|
|
27
27
|
_regeneratorRuntime$1 = function() {
|
|
28
|
-
return
|
|
28
|
+
return exports3;
|
|
29
29
|
};
|
|
30
|
-
var
|
|
30
|
+
var exports3 = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function(obj, key, desc) {
|
|
31
31
|
obj[key] = desc.value;
|
|
32
32
|
}, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
33
33
|
function define2(obj, key, value) {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
exports3.wrap = wrap;
|
|
68
68
|
var ContinueSentinel = {};
|
|
69
69
|
function Generator() {
|
|
70
70
|
}
|
|
@@ -215,28 +215,28 @@
|
|
|
215
215
|
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
216
216
|
value: GeneratorFunction,
|
|
217
217
|
configurable: true
|
|
218
|
-
}), GeneratorFunction.displayName = define2(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"),
|
|
218
|
+
}), GeneratorFunction.displayName = define2(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports3.isGeneratorFunction = function(genFun) {
|
|
219
219
|
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
220
220
|
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
221
|
-
},
|
|
221
|
+
}, exports3.mark = function(genFun) {
|
|
222
222
|
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define2(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
223
|
-
},
|
|
223
|
+
}, exports3.awrap = function(arg) {
|
|
224
224
|
return {
|
|
225
225
|
__await: arg
|
|
226
226
|
};
|
|
227
227
|
}, defineIteratorMethods(AsyncIterator.prototype), define2(AsyncIterator.prototype, asyncIteratorSymbol, function() {
|
|
228
228
|
return this;
|
|
229
|
-
}),
|
|
229
|
+
}), exports3.AsyncIterator = AsyncIterator, exports3.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
|
|
230
230
|
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
231
231
|
var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
|
|
232
|
-
return
|
|
232
|
+
return exports3.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
|
|
233
233
|
return result.done ? result.value : iter.next();
|
|
234
234
|
});
|
|
235
235
|
}, defineIteratorMethods(Gp), define2(Gp, toStringTagSymbol, "Generator"), define2(Gp, iteratorSymbol, function() {
|
|
236
236
|
return this;
|
|
237
237
|
}), define2(Gp, "toString", function() {
|
|
238
238
|
return "[object Generator]";
|
|
239
|
-
}),
|
|
239
|
+
}), exports3.keys = function(val) {
|
|
240
240
|
var object = Object(val), keys = [];
|
|
241
241
|
for (var key in object)
|
|
242
242
|
keys.push(key);
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
}
|
|
249
249
|
return next.done = true, next;
|
|
250
250
|
};
|
|
251
|
-
},
|
|
251
|
+
}, exports3.values = values, Context.prototype = {
|
|
252
252
|
constructor: Context,
|
|
253
253
|
reset: function(skipTempReset) {
|
|
254
254
|
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
nextLoc
|
|
338
338
|
}, "next" === this.method && (this.arg = void 0), ContinueSentinel;
|
|
339
339
|
}
|
|
340
|
-
},
|
|
340
|
+
}, exports3;
|
|
341
341
|
}
|
|
342
342
|
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
343
343
|
try {
|
|
@@ -1388,6 +1388,9 @@
|
|
|
1388
1388
|
}
|
|
1389
1389
|
return /^blob/.test(video.currentSrc) || /^blob/.test(video.src);
|
|
1390
1390
|
};
|
|
1391
|
+
util.isBlob = function(url) {
|
|
1392
|
+
return typeof url === "string" && /^blob/.test(url);
|
|
1393
|
+
};
|
|
1391
1394
|
util.generateSessionId = function() {
|
|
1392
1395
|
var did = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
1393
1396
|
var d = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -1440,7 +1443,24 @@
|
|
|
1440
1443
|
scale: 1,
|
|
1441
1444
|
rotate: 0
|
|
1442
1445
|
};
|
|
1443
|
-
|
|
1446
|
+
var transformValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1447
|
+
var styles = {
|
|
1448
|
+
scale: "".concat(pos.scale || 1),
|
|
1449
|
+
translate: "".concat(pos.x || 0, "%, ").concat(pos.y || 0, "%"),
|
|
1450
|
+
rotate: "".concat(pos.rotate || 0, "deg")
|
|
1451
|
+
};
|
|
1452
|
+
var stylesKeys = Object.keys(styles);
|
|
1453
|
+
stylesKeys.forEach(function(key) {
|
|
1454
|
+
var reg = new RegExp("".concat(key, "\\([^\\(]+\\)"), "g");
|
|
1455
|
+
var fn = "".concat(key, "(").concat(styles[key], ")");
|
|
1456
|
+
if (reg.test(transformValue)) {
|
|
1457
|
+
reg.lastIndex = -1;
|
|
1458
|
+
transformValue = transformValue.replace(reg, fn);
|
|
1459
|
+
} else {
|
|
1460
|
+
transformValue += "".concat(fn, " ");
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
return transformValue;
|
|
1444
1464
|
};
|
|
1445
1465
|
util.convertDeg = function(val) {
|
|
1446
1466
|
if (Math.abs(val) <= 1) {
|
|
@@ -1448,7 +1468,70 @@
|
|
|
1448
1468
|
}
|
|
1449
1469
|
return val % 360;
|
|
1450
1470
|
};
|
|
1451
|
-
|
|
1471
|
+
util.getIndexByTime = function(time, segments) {
|
|
1472
|
+
var _len = segments.length;
|
|
1473
|
+
var _index = -1;
|
|
1474
|
+
if (_len < 1) {
|
|
1475
|
+
return _index;
|
|
1476
|
+
}
|
|
1477
|
+
if (time <= segments[0].end || _len < 2) {
|
|
1478
|
+
_index = 0;
|
|
1479
|
+
} else if (time > segments[_len - 1].end) {
|
|
1480
|
+
_index = _len - 1;
|
|
1481
|
+
} else {
|
|
1482
|
+
for (var i = 1; i < _len; i++) {
|
|
1483
|
+
if (time > segments[i - 1].end && time <= segments[i].end) {
|
|
1484
|
+
_index = i;
|
|
1485
|
+
break;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
return _index;
|
|
1490
|
+
};
|
|
1491
|
+
util.getOffsetCurrentTime = function(currentTime, segments) {
|
|
1492
|
+
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
|
|
1493
|
+
var _index = -1;
|
|
1494
|
+
if (index >= 0 && index < segments.length) {
|
|
1495
|
+
_index = index;
|
|
1496
|
+
} else {
|
|
1497
|
+
_index = util.getIndexByTime(currentTime, segments);
|
|
1498
|
+
}
|
|
1499
|
+
if (_index < 0) {
|
|
1500
|
+
return -1;
|
|
1501
|
+
}
|
|
1502
|
+
var _len = segments.length;
|
|
1503
|
+
var _segments$_index = segments[_index], start = _segments$_index.start, end = _segments$_index.end, cTime = _segments$_index.cTime, offset = _segments$_index.offset;
|
|
1504
|
+
if (currentTime < start) {
|
|
1505
|
+
return cTime;
|
|
1506
|
+
} else if (currentTime >= start && currentTime <= end) {
|
|
1507
|
+
return currentTime - offset;
|
|
1508
|
+
} else if (currentTime > end && _index >= _len - 1) {
|
|
1509
|
+
return end;
|
|
1510
|
+
}
|
|
1511
|
+
return -1;
|
|
1512
|
+
};
|
|
1513
|
+
util.getCurrentTimeByOffset = function(offsetTime, segments) {
|
|
1514
|
+
var _index = -1;
|
|
1515
|
+
if (!segments || segments.length < 0) {
|
|
1516
|
+
return offsetTime;
|
|
1517
|
+
}
|
|
1518
|
+
for (var i = 0; i < segments.length; i++) {
|
|
1519
|
+
if (offsetTime <= segments[i].duration) {
|
|
1520
|
+
_index = i;
|
|
1521
|
+
break;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
if (_index !== -1) {
|
|
1525
|
+
var start = segments[_index].start;
|
|
1526
|
+
if (_index - 1 < 0) {
|
|
1527
|
+
return start + offsetTime;
|
|
1528
|
+
} else {
|
|
1529
|
+
return start + (offsetTime - segments[_index - 1].duration);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
return offsetTime;
|
|
1533
|
+
};
|
|
1534
|
+
var version = "3.0.11-alpha.2";
|
|
1452
1535
|
var ERROR_MAP = {
|
|
1453
1536
|
1: 5101,
|
|
1454
1537
|
2: 5102,
|
|
@@ -1895,9 +1978,9 @@
|
|
|
1895
1978
|
}
|
|
1896
1979
|
function _regeneratorRuntime() {
|
|
1897
1980
|
_regeneratorRuntime = function() {
|
|
1898
|
-
return
|
|
1981
|
+
return exports3;
|
|
1899
1982
|
};
|
|
1900
|
-
var
|
|
1983
|
+
var exports3 = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function(obj, key, desc) {
|
|
1901
1984
|
obj[key] = desc.value;
|
|
1902
1985
|
}, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1903
1986
|
function define2(obj, key, value) {
|
|
@@ -1934,7 +2017,7 @@
|
|
|
1934
2017
|
};
|
|
1935
2018
|
}
|
|
1936
2019
|
}
|
|
1937
|
-
|
|
2020
|
+
exports3.wrap = wrap;
|
|
1938
2021
|
var ContinueSentinel = {};
|
|
1939
2022
|
function Generator() {
|
|
1940
2023
|
}
|
|
@@ -2085,28 +2168,28 @@
|
|
|
2085
2168
|
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
2086
2169
|
value: GeneratorFunction,
|
|
2087
2170
|
configurable: true
|
|
2088
|
-
}), GeneratorFunction.displayName = define2(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"),
|
|
2171
|
+
}), GeneratorFunction.displayName = define2(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports3.isGeneratorFunction = function(genFun) {
|
|
2089
2172
|
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
2090
2173
|
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
2091
|
-
},
|
|
2174
|
+
}, exports3.mark = function(genFun) {
|
|
2092
2175
|
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define2(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
2093
|
-
},
|
|
2176
|
+
}, exports3.awrap = function(arg) {
|
|
2094
2177
|
return {
|
|
2095
2178
|
__await: arg
|
|
2096
2179
|
};
|
|
2097
2180
|
}, defineIteratorMethods(AsyncIterator.prototype), define2(AsyncIterator.prototype, asyncIteratorSymbol, function() {
|
|
2098
2181
|
return this;
|
|
2099
|
-
}),
|
|
2182
|
+
}), exports3.AsyncIterator = AsyncIterator, exports3.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
|
|
2100
2183
|
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
2101
2184
|
var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
|
|
2102
|
-
return
|
|
2185
|
+
return exports3.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
|
|
2103
2186
|
return result.done ? result.value : iter.next();
|
|
2104
2187
|
});
|
|
2105
2188
|
}, defineIteratorMethods(Gp), define2(Gp, toStringTagSymbol, "Generator"), define2(Gp, iteratorSymbol, function() {
|
|
2106
2189
|
return this;
|
|
2107
2190
|
}), define2(Gp, "toString", function() {
|
|
2108
2191
|
return "[object Generator]";
|
|
2109
|
-
}),
|
|
2192
|
+
}), exports3.keys = function(val) {
|
|
2110
2193
|
var object = Object(val), keys = [];
|
|
2111
2194
|
for (var key in object)
|
|
2112
2195
|
keys.push(key);
|
|
@@ -2118,7 +2201,7 @@
|
|
|
2118
2201
|
}
|
|
2119
2202
|
return next.done = true, next;
|
|
2120
2203
|
};
|
|
2121
|
-
},
|
|
2204
|
+
}, exports3.values = values, Context.prototype = {
|
|
2122
2205
|
constructor: Context,
|
|
2123
2206
|
reset: function(skipTempReset) {
|
|
2124
2207
|
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
|
|
@@ -2207,7 +2290,7 @@
|
|
|
2207
2290
|
nextLoc
|
|
2208
2291
|
}, "next" === this.method && (this.arg = void 0), ContinueSentinel;
|
|
2209
2292
|
}
|
|
2210
|
-
},
|
|
2293
|
+
}, exports3;
|
|
2211
2294
|
}
|
|
2212
2295
|
function _typeof(obj) {
|
|
2213
2296
|
"@babel/helpers - typeof";
|
|
@@ -4506,7 +4589,7 @@
|
|
|
4506
4589
|
});
|
|
4507
4590
|
});
|
|
4508
4591
|
var grammarExports = grammar$2.exports;
|
|
4509
|
-
(function(
|
|
4592
|
+
(function(exports3) {
|
|
4510
4593
|
var toIntIfInt = function(v) {
|
|
4511
4594
|
return String(Number(v)) === v ? Number(v) : v;
|
|
4512
4595
|
};
|
|
@@ -4539,7 +4622,7 @@
|
|
|
4539
4622
|
};
|
|
4540
4623
|
var grammar2 = grammarExports;
|
|
4541
4624
|
var validLine = RegExp.prototype.test.bind(/^([a-z])=(.*)/);
|
|
4542
|
-
|
|
4625
|
+
exports3.parse = function(sdp) {
|
|
4543
4626
|
var session = {}, media = [], location = session;
|
|
4544
4627
|
sdp.split(/(\r\n|\r|\n)/).filter(validLine).forEach(function(l) {
|
|
4545
4628
|
var type = l[0];
|
|
@@ -4567,14 +4650,14 @@
|
|
|
4567
4650
|
}
|
|
4568
4651
|
return acc;
|
|
4569
4652
|
};
|
|
4570
|
-
|
|
4653
|
+
exports3.parseParams = function(str) {
|
|
4571
4654
|
return str.split(/;\s?/).reduce(paramReducer, {});
|
|
4572
4655
|
};
|
|
4573
|
-
|
|
4574
|
-
|
|
4656
|
+
exports3.parseFmtpConfig = exports3.parseParams;
|
|
4657
|
+
exports3.parsePayloads = function(str) {
|
|
4575
4658
|
return str.toString().split(" ").map(Number);
|
|
4576
4659
|
};
|
|
4577
|
-
|
|
4660
|
+
exports3.parseRemoteCandidates = function(str) {
|
|
4578
4661
|
var candidates = [];
|
|
4579
4662
|
var parts = str.split(" ").map(toIntIfInt);
|
|
4580
4663
|
for (var i = 0; i < parts.length; i += 3) {
|
|
@@ -4586,12 +4669,12 @@
|
|
|
4586
4669
|
}
|
|
4587
4670
|
return candidates;
|
|
4588
4671
|
};
|
|
4589
|
-
|
|
4672
|
+
exports3.parseImageAttributes = function(str) {
|
|
4590
4673
|
return str.split(" ").map(function(item) {
|
|
4591
4674
|
return item.substring(1, item.length - 1).split(",").reduce(paramReducer, {});
|
|
4592
4675
|
});
|
|
4593
4676
|
};
|
|
4594
|
-
|
|
4677
|
+
exports3.parseSimulcastStreamList = function(str) {
|
|
4595
4678
|
return str.split(";").map(function(stream) {
|
|
4596
4679
|
return stream.split(",").map(function(format2) {
|
|
4597
4680
|
var scid, paused = false;
|
|
@@ -4895,6 +4978,11 @@
|
|
|
4895
4978
|
get: function get() {
|
|
4896
4979
|
return this._video;
|
|
4897
4980
|
}
|
|
4981
|
+
}, {
|
|
4982
|
+
key: "loader",
|
|
4983
|
+
get: function get() {
|
|
4984
|
+
return this._loader;
|
|
4985
|
+
}
|
|
4898
4986
|
}, {
|
|
4899
4987
|
key: "getStats",
|
|
4900
4988
|
value: function getStats$1() {
|
|
@@ -4996,7 +5084,7 @@
|
|
|
4996
5084
|
key: "_connect",
|
|
4997
5085
|
value: function() {
|
|
4998
5086
|
var _connect2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2() {
|
|
4999
|
-
var pc, offer, delayHint, parsed, _answer$remoteSdp, _answer$remoteSdp2, parseSession, sessionId, reqStart, res, answer, _parsed;
|
|
5087
|
+
var pc, offer, delayHint, parsed, finnalUrl, _answer$remoteSdp, _answer$remoteSdp2, parseSession, sessionId, reqStart, res, answer, err, _parsed;
|
|
5000
5088
|
return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
|
|
5001
5089
|
while (1)
|
|
5002
5090
|
switch (_context2.prev = _context2.next) {
|
|
@@ -5058,39 +5146,53 @@
|
|
|
5058
5146
|
_context2.next = 22;
|
|
5059
5147
|
return pc.setLocalDescription(offer);
|
|
5060
5148
|
case 22:
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5149
|
+
finnalUrl = this._url;
|
|
5150
|
+
_context2.prev = 23;
|
|
5151
|
+
if (this._opts.preProcessUrl) {
|
|
5152
|
+
finnalUrl = this._opts.preProcessUrl(finnalUrl).url;
|
|
5153
|
+
}
|
|
5154
|
+
this._loader.finnalUrl = finnalUrl;
|
|
5155
|
+
parseSession = /_?session_id=([^&$]+)/.exec(finnalUrl);
|
|
5156
|
+
sessionId = parseSession ? parseSession[1] : Date.now() + "666";
|
|
5064
5157
|
this.emit(EVENT.LOAD_START, {
|
|
5065
|
-
url:
|
|
5158
|
+
url: finnalUrl,
|
|
5066
5159
|
offersdp: offer.sdp,
|
|
5067
5160
|
sessionId
|
|
5068
5161
|
});
|
|
5069
5162
|
reqStart = Date.now();
|
|
5070
|
-
_context2.next =
|
|
5071
|
-
return this._loader.load(
|
|
5163
|
+
_context2.next = 32;
|
|
5164
|
+
return this._loader.load(finnalUrl, {
|
|
5072
5165
|
body: JSON.stringify({
|
|
5073
5166
|
sessionId,
|
|
5074
5167
|
version: "1.0-html",
|
|
5075
5168
|
localSdp: offer
|
|
5076
5169
|
})
|
|
5077
5170
|
});
|
|
5078
|
-
case
|
|
5171
|
+
case 32:
|
|
5079
5172
|
res = _context2.sent;
|
|
5080
5173
|
this.emit(EVENT.LOAD_RESPONSE_HEADERS, {
|
|
5081
5174
|
headers: res.response.headers
|
|
5082
5175
|
});
|
|
5083
5176
|
answer = res === null || res === void 0 ? void 0 : res.data;
|
|
5177
|
+
if (!((answer === null || answer === void 0 ? void 0 : answer.code) === 404 || (answer === null || answer === void 0 ? void 0 : answer.code) === 403)) {
|
|
5178
|
+
_context2.next = 40;
|
|
5179
|
+
break;
|
|
5180
|
+
}
|
|
5181
|
+
err = StreamingError.create(answer.code === 404 ? ERR.NETWORK_NOTFOUND : ERR.NETWORK_FORBIDDEN, null, answer);
|
|
5182
|
+
err.errorType = ERR.NETWORK;
|
|
5183
|
+
this._emitError(err);
|
|
5184
|
+
return _context2.abrupt("return");
|
|
5185
|
+
case 40:
|
|
5084
5186
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) !== 200)) {
|
|
5085
|
-
_context2.next =
|
|
5187
|
+
_context2.next = 42;
|
|
5086
5188
|
break;
|
|
5087
5189
|
}
|
|
5088
5190
|
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));
|
|
5089
|
-
case
|
|
5191
|
+
case 42:
|
|
5090
5192
|
logger.log("answer:");
|
|
5091
5193
|
logger.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
|
|
5092
5194
|
this.emit(EVENT.LOAD_COMPLETE, {
|
|
5093
|
-
url:
|
|
5195
|
+
url: finnalUrl,
|
|
5094
5196
|
elapsed: Date.now() - reqStart,
|
|
5095
5197
|
answersdp: (_answer$remoteSdp2 = answer.remoteSdp) === null || _answer$remoteSdp2 === void 0 ? void 0 : _answer$remoteSdp2.sdp
|
|
5096
5198
|
});
|
|
@@ -5101,20 +5203,20 @@
|
|
|
5101
5203
|
answer.remoteSdp.sdp = lib.write(_parsed);
|
|
5102
5204
|
logger.log("answer modified:\n", answer.remoteSdp.sdp);
|
|
5103
5205
|
this._rctConnectStartTs = Date.now();
|
|
5104
|
-
_context2.next =
|
|
5206
|
+
_context2.next = 52;
|
|
5105
5207
|
return this._pc.setRemoteDescription(answer.remoteSdp);
|
|
5106
|
-
case
|
|
5107
|
-
_context2.next =
|
|
5208
|
+
case 52:
|
|
5209
|
+
_context2.next = 57;
|
|
5108
5210
|
break;
|
|
5109
|
-
case
|
|
5110
|
-
_context2.prev =
|
|
5111
|
-
_context2.t0 = _context2["catch"](
|
|
5211
|
+
case 54:
|
|
5212
|
+
_context2.prev = 54;
|
|
5213
|
+
_context2.t0 = _context2["catch"](23);
|
|
5112
5214
|
this._emitError(StreamingError.network(_context2.t0));
|
|
5113
|
-
case
|
|
5215
|
+
case 57:
|
|
5114
5216
|
case "end":
|
|
5115
5217
|
return _context2.stop();
|
|
5116
5218
|
}
|
|
5117
|
-
}, _callee2, this, [[
|
|
5219
|
+
}, _callee2, this, [[23, 54]]);
|
|
5118
5220
|
}));
|
|
5119
5221
|
function _connect() {
|
|
5120
5222
|
return _connect2.apply(this, arguments);
|
|
@@ -5249,7 +5351,14 @@
|
|
|
5249
5351
|
var rtsOpts = config.rts || {};
|
|
5250
5352
|
_this._rtsOpts = rtsOpts;
|
|
5251
5353
|
_this._rts = new Rts(_objectSpread2$2({
|
|
5252
|
-
media: _this.player.video
|
|
5354
|
+
media: _this.player.video,
|
|
5355
|
+
preProcessUrl: function preProcessUrl(url, ext) {
|
|
5356
|
+
var _this$player$preProce, _this$player;
|
|
5357
|
+
return ((_this$player$preProce = (_this$player = _this.player).preProcessUrl) === null || _this$player$preProce === void 0 ? void 0 : _this$player$preProce.call(_this$player, url, ext)) || {
|
|
5358
|
+
url,
|
|
5359
|
+
ext
|
|
5360
|
+
};
|
|
5361
|
+
}
|
|
5253
5362
|
}, rtsOpts));
|
|
5254
5363
|
_this._rts.load(config.url);
|
|
5255
5364
|
});
|
|
@@ -5284,18 +5393,24 @@
|
|
|
5284
5393
|
get: function get() {
|
|
5285
5394
|
return this._rts;
|
|
5286
5395
|
}
|
|
5396
|
+
}, {
|
|
5397
|
+
key: "loader",
|
|
5398
|
+
get: function get() {
|
|
5399
|
+
var _this$_rts5;
|
|
5400
|
+
return (_this$_rts5 = this._rts) === null || _this$_rts5 === void 0 ? void 0 : _this$_rts5.loader;
|
|
5401
|
+
}
|
|
5287
5402
|
}, {
|
|
5288
5403
|
key: "version",
|
|
5289
5404
|
get: function get() {
|
|
5290
|
-
return "0.2.0-alpha.
|
|
5405
|
+
return "0.2.0-alpha.5";
|
|
5291
5406
|
}
|
|
5292
5407
|
}, {
|
|
5293
5408
|
key: "beforePlayerInit",
|
|
5294
5409
|
value: function beforePlayerInit() {
|
|
5295
|
-
var _this$
|
|
5410
|
+
var _this$player2, _this2 = this;
|
|
5296
5411
|
this._init();
|
|
5297
5412
|
this.player.switchURL = this._onSwitchURL;
|
|
5298
|
-
(_this$
|
|
5413
|
+
(_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.useHooks("replay", function() {
|
|
5299
5414
|
var _this2$_rts;
|
|
5300
5415
|
return (_this2$_rts = _this2._rts) === null || _this2$_rts === void 0 ? void 0 : _this2$_rts.switchURL();
|
|
5301
5416
|
});
|
|
@@ -5330,14 +5445,14 @@
|
|
|
5330
5445
|
}, {
|
|
5331
5446
|
key: "getStats",
|
|
5332
5447
|
value: function getStats2() {
|
|
5333
|
-
var _this$
|
|
5334
|
-
return (_this$
|
|
5448
|
+
var _this$_rts6;
|
|
5449
|
+
return (_this$_rts6 = this._rts) === null || _this$_rts6 === void 0 ? void 0 : _this$_rts6.getStats();
|
|
5335
5450
|
}
|
|
5336
5451
|
}, {
|
|
5337
5452
|
key: "getStatsSnapshoot",
|
|
5338
5453
|
value: function getStatsSnapshoot2() {
|
|
5339
|
-
var _this$
|
|
5340
|
-
return (_this$
|
|
5454
|
+
var _this$_rts7;
|
|
5455
|
+
return (_this$_rts7 = this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.getStatsSnapshoot();
|
|
5341
5456
|
}
|
|
5342
5457
|
}, {
|
|
5343
5458
|
key: "_transErrorEvent",
|
|
@@ -5402,8 +5517,8 @@
|
|
|
5402
5517
|
}, {
|
|
5403
5518
|
key: "destroy",
|
|
5404
5519
|
value: function destroy() {
|
|
5405
|
-
var _this$
|
|
5406
|
-
(_this$
|
|
5520
|
+
var _this$_rts8;
|
|
5521
|
+
(_this$_rts8 = this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.destroy();
|
|
5407
5522
|
}
|
|
5408
5523
|
}], [{
|
|
5409
5524
|
key: "pluginName",
|
|
@@ -5468,6 +5583,6 @@
|
|
|
5468
5583
|
}]);
|
|
5469
5584
|
return RtsPlugin2;
|
|
5470
5585
|
}(BasePlugin);
|
|
5471
|
-
VePlayer.register("plugin:rtm", RtsPlugin);
|
|
5472
|
-
|
|
5586
|
+
VePlayer.register("plugin:rtm", { RtmPlugin: RtsPlugin });
|
|
5587
|
+
exports2.RtmPlugin = RtsPlugin;
|
|
5473
5588
|
});
|