@volcengine/veplayer 2.0.0-rc.2 → 2.1.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 +14 -1
- package/esm/index.d.ts +17 -11
- package/esm/veplayer.biz.live.development.js +184 -45
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +53 -28
- package/esm/veplayer.development.css +1 -1
- package/esm/veplayer.development.js +600 -234
- package/esm/veplayer.live.d.ts +53 -28
- package/esm/veplayer.live.development.css +1 -1
- package/esm/veplayer.live.development.js +600 -234
- package/esm/veplayer.live.production.css +1 -1
- package/esm/veplayer.live.production.js +4 -4
- package/esm/veplayer.production.css +1 -1
- package/esm/veplayer.production.js +4 -4
- package/esm/veplayer.vod.d.ts +17 -11
- package/esm/veplayer.vod.development.css +1 -1
- package/esm/veplayer.vod.development.js +402 -173
- package/esm/veplayer.vod.production.css +1 -1
- package/esm/veplayer.vod.production.js +4 -4
- package/package.json +2 -1
- package/umd/index.d.ts +17 -11
- package/umd/veplayer.biz.live.development.js +184 -45
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +53 -28
- package/umd/veplayer.development.css +1 -1
- package/umd/veplayer.development.js +600 -234
- package/umd/veplayer.live.d.ts +53 -28
- package/umd/veplayer.live.development.css +1 -1
- package/umd/veplayer.live.development.js +598 -232
- package/umd/veplayer.live.production.css +1 -1
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.css +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +17 -11
- package/umd/veplayer.vod.development.css +1 -1
- package/umd/veplayer.vod.development.js +402 -173
- package/umd/veplayer.vod.production.css +1 -1
- package/umd/veplayer.vod.production.js +1 -1
|
@@ -1019,6 +1019,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
return /^blob/.test(video.currentSrc) || /^blob/.test(video.src);
|
|
1021
1021
|
};
|
|
1022
|
+
util$1.isBlob = function(url) {
|
|
1023
|
+
return /^blob/.test(url);
|
|
1024
|
+
};
|
|
1022
1025
|
util$1.generateSessionId = function() {
|
|
1023
1026
|
var did = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
1024
1027
|
var d2 = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -1079,6 +1082,69 @@ var __publicField = (obj, key, value) => {
|
|
|
1079
1082
|
}
|
|
1080
1083
|
return val % 360;
|
|
1081
1084
|
};
|
|
1085
|
+
util$1.getIndexByTime = function(time, segments) {
|
|
1086
|
+
var _len = segments.length;
|
|
1087
|
+
var _index = -1;
|
|
1088
|
+
if (_len < 1) {
|
|
1089
|
+
return _index;
|
|
1090
|
+
}
|
|
1091
|
+
if (time <= segments[0].end || _len < 2) {
|
|
1092
|
+
_index = 0;
|
|
1093
|
+
} else if (time > segments[_len - 1].end) {
|
|
1094
|
+
_index = _len - 1;
|
|
1095
|
+
} else {
|
|
1096
|
+
for (var i2 = 1; i2 < _len; i2++) {
|
|
1097
|
+
if (time > segments[i2 - 1].end && time <= segments[i2].end) {
|
|
1098
|
+
_index = i2;
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
return _index;
|
|
1104
|
+
};
|
|
1105
|
+
util$1.getOffsetCurrentTime = function(currentTime, segments) {
|
|
1106
|
+
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
|
|
1107
|
+
var _index = -1;
|
|
1108
|
+
if (index >= 0 && index < segments.length) {
|
|
1109
|
+
_index = index;
|
|
1110
|
+
} else {
|
|
1111
|
+
_index = util$1.getIndexByTime(currentTime, segments);
|
|
1112
|
+
}
|
|
1113
|
+
if (_index < 0) {
|
|
1114
|
+
return -1;
|
|
1115
|
+
}
|
|
1116
|
+
var _len = segments.length;
|
|
1117
|
+
var _segments$_index = segments[_index], start = _segments$_index.start, end = _segments$_index.end, cTime = _segments$_index.cTime, offset = _segments$_index.offset;
|
|
1118
|
+
if (currentTime < start) {
|
|
1119
|
+
return cTime;
|
|
1120
|
+
} else if (currentTime >= start && currentTime <= end) {
|
|
1121
|
+
return currentTime - offset;
|
|
1122
|
+
} else if (currentTime > end && _index >= _len - 1) {
|
|
1123
|
+
return end;
|
|
1124
|
+
}
|
|
1125
|
+
return -1;
|
|
1126
|
+
};
|
|
1127
|
+
util$1.getCurrentTimeByOffset = function(offsetTime, segments) {
|
|
1128
|
+
var _index = -1;
|
|
1129
|
+
if (!segments || segments.length < 0) {
|
|
1130
|
+
return offsetTime;
|
|
1131
|
+
}
|
|
1132
|
+
for (var i2 = 0; i2 < segments.length; i2++) {
|
|
1133
|
+
if (offsetTime <= segments[i2].duration) {
|
|
1134
|
+
_index = i2;
|
|
1135
|
+
break;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
if (_index !== -1) {
|
|
1139
|
+
var start = segments[_index].start;
|
|
1140
|
+
if (_index - 1 < 0) {
|
|
1141
|
+
return start + offsetTime;
|
|
1142
|
+
} else {
|
|
1143
|
+
return start + (offsetTime - segments[_index - 1].duration);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
return offsetTime;
|
|
1147
|
+
};
|
|
1082
1148
|
function isObject$1(value) {
|
|
1083
1149
|
var type = _typeof(value);
|
|
1084
1150
|
return value !== null && (type === "object" || type === "function");
|
|
@@ -1168,7 +1234,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1168
1234
|
function debounced() {
|
|
1169
1235
|
var time = Date.now();
|
|
1170
1236
|
var isInvoking = shouldInvoke(time);
|
|
1171
|
-
for (var
|
|
1237
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key = 0; _key < _len2; _key++) {
|
|
1172
1238
|
args[_key] = arguments[_key];
|
|
1173
1239
|
}
|
|
1174
1240
|
lastArgs = args;
|
|
@@ -1375,7 +1441,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1375
1441
|
}
|
|
1376
1442
|
}
|
|
1377
1443
|
};
|
|
1378
|
-
var version = "3.0.
|
|
1444
|
+
var version = "3.0.10-alpha.4";
|
|
1379
1445
|
var ERROR_TYPE_MAP = {
|
|
1380
1446
|
1: "media",
|
|
1381
1447
|
2: "media",
|
|
@@ -1461,6 +1527,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1461
1527
|
var DURATION_CHANGE = "durationchange";
|
|
1462
1528
|
var VOLUME_CHANGE = "volumechange";
|
|
1463
1529
|
var LOADED_DATA = "loadeddata";
|
|
1530
|
+
var LOADED_METADATA = "loadedmetadata";
|
|
1464
1531
|
var RATE_CHANGE = "ratechange";
|
|
1465
1532
|
var PROGRESS = "progress";
|
|
1466
1533
|
var LOAD_START = "loadstart";
|
|
@@ -1500,7 +1567,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1500
1567
|
var SOURCE_ERROR = "source_error";
|
|
1501
1568
|
var SOURCE_SUCCESS = "source_success";
|
|
1502
1569
|
var SWITCH_SUBTITLE = "switch_subtitle";
|
|
1503
|
-
var VIDEO_EVENTS = ["play", "playing", "ended", "pause", "error", "seeking", "seeked", "timeupdate", "waiting", "canplay", "canplaythrough", "durationchange", "volumechange", "loadeddata", "ratechange", "progress", "loadstart", "emptied", "stalled", "suspend", "abort", "lowdecode"];
|
|
1570
|
+
var VIDEO_EVENTS = ["play", "playing", "ended", "pause", "error", "seeking", "seeked", "timeupdate", "waiting", "canplay", "canplaythrough", "durationchange", "volumechange", "loadeddata", "loadedmetadata", "ratechange", "progress", "loadstart", "emptied", "stalled", "suspend", "abort", "lowdecode"];
|
|
1504
1571
|
var STATS_EVENTS = {
|
|
1505
1572
|
STATS_INFO: "stats_info",
|
|
1506
1573
|
STATS_DOWNLOAD: "stats_download",
|
|
@@ -1529,6 +1596,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1529
1596
|
FPS_STUCK,
|
|
1530
1597
|
FULLSCREEN_CHANGE,
|
|
1531
1598
|
LOADED_DATA,
|
|
1599
|
+
LOADED_METADATA,
|
|
1532
1600
|
LOAD_START,
|
|
1533
1601
|
MINI_STATE_CHANGE,
|
|
1534
1602
|
PAUSE,
|
|
@@ -1666,6 +1734,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1666
1734
|
if (options.loop) {
|
|
1667
1735
|
_this.mediaConfig.loop = "loop";
|
|
1668
1736
|
}
|
|
1737
|
+
if (options.autoplayMuted && !Object.prototype.hasOwnProperty.call(_this.mediaConfig, "muted")) {
|
|
1738
|
+
_this.mediaConfig.muted = true;
|
|
1739
|
+
}
|
|
1669
1740
|
_this.media = util$1.createDom(_this.mediaConfig.mediaType, "", _this.mediaConfig, "");
|
|
1670
1741
|
if (options.defaultPlaybackRate) {
|
|
1671
1742
|
_this.media.defaultPlaybackRate = _this.media.playbackRate = options.defaultPlaybackRate;
|
|
@@ -1744,10 +1815,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1744
1815
|
var _this6 = this;
|
|
1745
1816
|
video.removeAttribute("src");
|
|
1746
1817
|
video.load();
|
|
1747
|
-
urls.forEach(function(item) {
|
|
1818
|
+
urls.forEach(function(item, index) {
|
|
1748
1819
|
_this6.media.appendChild(util$1.createDom("source", "", {
|
|
1749
1820
|
src: "".concat(item.src),
|
|
1750
|
-
type: "".concat(item.type || "")
|
|
1821
|
+
type: "".concat(item.type || ""),
|
|
1822
|
+
"data-index": index + 1
|
|
1751
1823
|
}));
|
|
1752
1824
|
});
|
|
1753
1825
|
var _c = video.children;
|
|
@@ -1755,6 +1827,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1755
1827
|
return;
|
|
1756
1828
|
}
|
|
1757
1829
|
this._videoSourceCount = _c.length;
|
|
1830
|
+
this._videoSourceIndex = _c.length;
|
|
1758
1831
|
this._vLoadeddata = function(e2) {
|
|
1759
1832
|
_this6.emit(SOURCE_SUCCESS, {
|
|
1760
1833
|
src: e2.target.currentSrc,
|
|
@@ -1769,8 +1842,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1769
1842
|
}
|
|
1770
1843
|
}
|
|
1771
1844
|
!this._sourceError && (this._sourceError = function(e2) {
|
|
1772
|
-
|
|
1773
|
-
|
|
1845
|
+
var _dIndex = parseInt(e2.target.getAttribute("data-index"), 10);
|
|
1846
|
+
_this6._videoSourceIndex--;
|
|
1847
|
+
if (_this6._videoSourceIndex === 0 || _dIndex >= _this6._videoSourceCount) {
|
|
1774
1848
|
var _err = {
|
|
1775
1849
|
code: 4,
|
|
1776
1850
|
message: "sources_load_error"
|
|
@@ -2097,7 +2171,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2097
2171
|
this.emit(WAITING);
|
|
2098
2172
|
this._currentTime = 0;
|
|
2099
2173
|
this._duration = 0;
|
|
2100
|
-
if (
|
|
2174
|
+
if (util$1.isMSE(this.media)) {
|
|
2101
2175
|
this.onWaiting();
|
|
2102
2176
|
return;
|
|
2103
2177
|
}
|
|
@@ -3805,6 +3879,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3805
3879
|
},
|
|
3806
3880
|
enableSwipeHandler: function enableSwipeHandler() {
|
|
3807
3881
|
},
|
|
3882
|
+
preProcessUrl: null,
|
|
3808
3883
|
ignores: [],
|
|
3809
3884
|
whitelist: [],
|
|
3810
3885
|
inactive: 3e3,
|
|
@@ -3886,7 +3961,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3886
3961
|
autoHide: false
|
|
3887
3962
|
});
|
|
3888
3963
|
});
|
|
3889
|
-
_defineProperty$1(_assertThisInitialized(_this), "onMouseLeave", function() {
|
|
3964
|
+
_defineProperty$1(_assertThisInitialized(_this), "onMouseLeave", function(e2) {
|
|
3890
3965
|
var _assertThisInitialize2 = _assertThisInitialized(_this), player = _assertThisInitialize2.player;
|
|
3891
3966
|
player.focus();
|
|
3892
3967
|
});
|
|
@@ -3964,12 +4039,13 @@ var __publicField = (obj, key, value) => {
|
|
|
3964
4039
|
}, {
|
|
3965
4040
|
key: "show",
|
|
3966
4041
|
value: function show() {
|
|
3967
|
-
|
|
4042
|
+
this.root.style.display = "";
|
|
4043
|
+
this.player.focus();
|
|
3968
4044
|
}
|
|
3969
4045
|
}, {
|
|
3970
4046
|
key: "hide",
|
|
3971
4047
|
value: function hide() {
|
|
3972
|
-
|
|
4048
|
+
this.root.style.display = "none";
|
|
3973
4049
|
}
|
|
3974
4050
|
}, {
|
|
3975
4051
|
key: "mode",
|
|
@@ -4371,6 +4447,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4371
4447
|
_this.cssfullscreen = false;
|
|
4372
4448
|
_this.isRotateFullscreen = false;
|
|
4373
4449
|
_this._fullscreenEl = null;
|
|
4450
|
+
_this.timeSegments = [];
|
|
4374
4451
|
_this._cssfullscreenEl = null;
|
|
4375
4452
|
_this.curDefinition = null;
|
|
4376
4453
|
_this._orgCss = "";
|
|
@@ -4380,7 +4457,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4380
4457
|
_this.videoPos = {
|
|
4381
4458
|
pi: 1,
|
|
4382
4459
|
scale: 0,
|
|
4383
|
-
rotate:
|
|
4460
|
+
rotate: -1,
|
|
4384
4461
|
x: 0,
|
|
4385
4462
|
y: 0,
|
|
4386
4463
|
h: -1,
|
|
@@ -4388,11 +4465,21 @@ var __publicField = (obj, key, value) => {
|
|
|
4388
4465
|
vy: 0,
|
|
4389
4466
|
vx: 0
|
|
4390
4467
|
};
|
|
4468
|
+
_this.sizeInfo = {
|
|
4469
|
+
width: 0,
|
|
4470
|
+
height: 0,
|
|
4471
|
+
left: 0,
|
|
4472
|
+
top: 0
|
|
4473
|
+
};
|
|
4391
4474
|
_this._accPlayed = {
|
|
4392
4475
|
t: 0,
|
|
4393
4476
|
acc: 0,
|
|
4394
4477
|
loopAcc: 0
|
|
4395
4478
|
};
|
|
4479
|
+
_this._offsetInfo = {
|
|
4480
|
+
currentTime: -1,
|
|
4481
|
+
duration: 0
|
|
4482
|
+
};
|
|
4396
4483
|
_this.innerContainer = null;
|
|
4397
4484
|
_this.controls = null;
|
|
4398
4485
|
_this.topBar = null;
|
|
@@ -4405,6 +4492,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4405
4492
|
_this.isUserActive = false;
|
|
4406
4493
|
_this._onceSeekCanplay = null;
|
|
4407
4494
|
_this._isPauseBeforeSeek = 0;
|
|
4495
|
+
_this.innerStates = {
|
|
4496
|
+
isActiveLocked: false
|
|
4497
|
+
};
|
|
4408
4498
|
var rootInit = _this._initDOM();
|
|
4409
4499
|
if (!rootInit) {
|
|
4410
4500
|
console.error(new Error("can't find the dom which id is ".concat(_this.config.id, " or this.config.el does not exist")));
|
|
@@ -4490,16 +4580,16 @@ var __publicField = (obj, key, value) => {
|
|
|
4490
4580
|
this.addClass(STATE_CLASS.NO_START);
|
|
4491
4581
|
}
|
|
4492
4582
|
if (this.config.fluid) {
|
|
4493
|
-
var _this$config3 = this.config,
|
|
4494
|
-
if (typeof
|
|
4495
|
-
|
|
4496
|
-
|
|
4583
|
+
var _this$config3 = this.config, _width = _this$config3.width, _height = _this$config3.height;
|
|
4584
|
+
if (typeof _width !== "number" || typeof _height !== "number") {
|
|
4585
|
+
_width = 600;
|
|
4586
|
+
_height = 337.5;
|
|
4497
4587
|
}
|
|
4498
4588
|
var style = {
|
|
4499
4589
|
width: "100%",
|
|
4500
4590
|
height: "0",
|
|
4501
4591
|
"max-width": "100%",
|
|
4502
|
-
"padding-top": "".concat(
|
|
4592
|
+
"padding-top": "".concat(_height * 100 / _width, "%")
|
|
4503
4593
|
};
|
|
4504
4594
|
Object.keys(style).forEach(function(key) {
|
|
4505
4595
|
_this2.root.style[key] = style[key];
|
|
@@ -4515,6 +4605,11 @@ var __publicField = (obj, key, value) => {
|
|
|
4515
4605
|
}
|
|
4516
4606
|
});
|
|
4517
4607
|
}
|
|
4608
|
+
var _this$root$getBoundin = this.root.getBoundingClientRect(), width = _this$root$getBoundin.width, height = _this$root$getBoundin.height, left = _this$root$getBoundin.left, top = _this$root$getBoundin.top;
|
|
4609
|
+
this.sizeInfo.width = width;
|
|
4610
|
+
this.sizeInfo.height = height;
|
|
4611
|
+
this.sizeInfo.left = left;
|
|
4612
|
+
this.sizeInfo.top = top;
|
|
4518
4613
|
return true;
|
|
4519
4614
|
}
|
|
4520
4615
|
}, {
|
|
@@ -4598,7 +4693,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4598
4693
|
var readyState = this.media.readyState;
|
|
4599
4694
|
XG_DEBUG.logInfo("_startInit readyState", readyState);
|
|
4600
4695
|
if (this.config.autoplay) {
|
|
4601
|
-
!
|
|
4696
|
+
!util$1.isMSE(this.media) && this.load();
|
|
4602
4697
|
(sniffer$1.os.isIpad || sniffer$1.os.isPhone) && this.mediaPlay();
|
|
4603
4698
|
}
|
|
4604
4699
|
if (readyState >= 2) {
|
|
@@ -4826,7 +4921,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4826
4921
|
if (!url) {
|
|
4827
4922
|
url = _this8.url || _this8.config.url;
|
|
4828
4923
|
}
|
|
4829
|
-
var
|
|
4924
|
+
var _furl = _this8.preProcessUrl(url);
|
|
4925
|
+
var ret = _this8._startInit(_furl.url);
|
|
4830
4926
|
return ret;
|
|
4831
4927
|
}).catch(function(e2) {
|
|
4832
4928
|
e2.fileName = "player";
|
|
@@ -4843,6 +4939,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4843
4939
|
if (util$1.typeOf(url) === "Object") {
|
|
4844
4940
|
_src = url.url;
|
|
4845
4941
|
}
|
|
4942
|
+
_src = this.preProcessUrl(_src).url;
|
|
4846
4943
|
var curTime = this.currentTime;
|
|
4847
4944
|
var isPaused = this.paused && !this.isError;
|
|
4848
4945
|
this.src = _src;
|
|
@@ -5181,7 +5278,11 @@ var __publicField = (obj, key, value) => {
|
|
|
5181
5278
|
this.addClass(STATE_CLASS.LOADING);
|
|
5182
5279
|
runHooks(this, "retry", function() {
|
|
5183
5280
|
var cur = _this20.currentTime;
|
|
5184
|
-
|
|
5281
|
+
var url = _this20.config.url;
|
|
5282
|
+
var _srcRet = !util$1.isMSE(_this20.media) ? _this20.preProcessUrl(url) : {
|
|
5283
|
+
url
|
|
5284
|
+
};
|
|
5285
|
+
_this20.src = _srcRet.url;
|
|
5185
5286
|
!_this20.config.isLive && (_this20.currentTime = cur);
|
|
5186
5287
|
_this20.once(CANPLAY, function() {
|
|
5187
5288
|
_this20.mediaPlay();
|
|
@@ -5242,7 +5343,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5242
5343
|
var fullEl = util$1.getFullScreenEl();
|
|
5243
5344
|
if (fullEl === this._fullscreenEl) {
|
|
5244
5345
|
this.onFullscreenChange();
|
|
5245
|
-
return;
|
|
5346
|
+
return Promise.resolve();
|
|
5246
5347
|
}
|
|
5247
5348
|
try {
|
|
5248
5349
|
for (var i2 = 0; i2 < GET_FULLSCREEN_API.length; i2++) {
|
|
@@ -5415,30 +5516,38 @@ var __publicField = (obj, key, value) => {
|
|
|
5415
5516
|
key: "onFocus",
|
|
5416
5517
|
value: function onFocus() {
|
|
5417
5518
|
var _this21 = this;
|
|
5418
|
-
var
|
|
5519
|
+
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
5520
|
+
autoHide: true,
|
|
5521
|
+
delay: 3e3
|
|
5522
|
+
};
|
|
5523
|
+
var innerStates = this.innerStates;
|
|
5419
5524
|
this.isActive = true;
|
|
5420
5525
|
this.removeClass(STATE_CLASS.INACTIVE);
|
|
5421
5526
|
if (this.userTimer) {
|
|
5422
5527
|
util$1.clearTimeout(this, this.userTimer);
|
|
5423
5528
|
this.userTimer = null;
|
|
5424
5529
|
}
|
|
5425
|
-
if (
|
|
5530
|
+
if (data.isLock !== void 0) {
|
|
5531
|
+
innerStates.isActiveLocked = data.isLock;
|
|
5532
|
+
}
|
|
5533
|
+
if (data.autoHide === false || data.isLock === true || innerStates.isActiveLocked) {
|
|
5426
5534
|
if (this.userTimer) {
|
|
5427
5535
|
util$1.clearTimeout(this, this.userTimer);
|
|
5428
5536
|
this.userTimer = null;
|
|
5429
5537
|
}
|
|
5430
5538
|
return;
|
|
5431
5539
|
}
|
|
5540
|
+
var time = data && data.delay ? data.delay : this.config.inactive;
|
|
5432
5541
|
this.userTimer = util$1.setTimeout(this, function() {
|
|
5433
5542
|
_this21.userTimer = null;
|
|
5434
5543
|
_this21.blur();
|
|
5435
|
-
},
|
|
5544
|
+
}, time);
|
|
5436
5545
|
}
|
|
5437
5546
|
}, {
|
|
5438
5547
|
key: "onBlur",
|
|
5439
5548
|
value: function onBlur() {
|
|
5440
|
-
var
|
|
5441
|
-
if (!this.isActive) {
|
|
5549
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$ignorePaused = _ref.ignorePaused, ignorePaused = _ref$ignorePaused === void 0 ? false : _ref$ignorePaused;
|
|
5550
|
+
if (!this.isActive || this.innerStates.isActiveLocked) {
|
|
5442
5551
|
return;
|
|
5443
5552
|
}
|
|
5444
5553
|
var closePauseVideoFocus = this.config.closePauseVideoFocus;
|
|
@@ -5561,7 +5670,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5561
5670
|
}, {
|
|
5562
5671
|
key: "onTimeupdate",
|
|
5563
5672
|
value: function onTimeupdate() {
|
|
5564
|
-
!this._videoHeight && this.resize();
|
|
5673
|
+
!this._videoHeight && this.media.videoHeight && this.resize();
|
|
5565
5674
|
if ((this.waitTimer || this.hasClass(STATE_CLASS.LOADING)) && this.media.readyState > 2) {
|
|
5566
5675
|
this.removeClass(STATE_CLASS.LOADING);
|
|
5567
5676
|
util$1.clearTimeout(this, this.waitTimer);
|
|
@@ -5636,8 +5745,11 @@ var __publicField = (obj, key, value) => {
|
|
|
5636
5745
|
key: "resizePosition",
|
|
5637
5746
|
value: function resizePosition() {
|
|
5638
5747
|
var _this$videoPos = this.videoPos, rotate = _this$videoPos.rotate, vy = _this$videoPos.vy, vx = _this$videoPos.vx, h2 = _this$videoPos.h, w2 = _this$videoPos.w;
|
|
5748
|
+
if (rotate < 0 && !vy && !vx) {
|
|
5749
|
+
return;
|
|
5750
|
+
}
|
|
5639
5751
|
var _pi = this.videoPos._pi;
|
|
5640
|
-
if (!_pi) {
|
|
5752
|
+
if (!_pi && this.media.videoHeight) {
|
|
5641
5753
|
_pi = this.media.videoWidth / this.media.videoHeight * 100;
|
|
5642
5754
|
}
|
|
5643
5755
|
if (!_pi) {
|
|
@@ -5737,9 +5849,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5737
5849
|
if (!this.media) {
|
|
5738
5850
|
return;
|
|
5739
5851
|
}
|
|
5852
|
+
var containerSize = this.root.getBoundingClientRect();
|
|
5853
|
+
this.sizeInfo.width = containerSize.width;
|
|
5854
|
+
this.sizeInfo.height = containerSize.height;
|
|
5855
|
+
this.sizeInfo.left = containerSize.left;
|
|
5856
|
+
this.sizeInfo.top = containerSize.top;
|
|
5740
5857
|
var _this$media = this.media, videoWidth = _this$media.videoWidth, videoHeight = _this$media.videoHeight;
|
|
5741
5858
|
var _this$config6 = this.config, fitVideoSize = _this$config6.fitVideoSize, videoFillMode = _this$config6.videoFillMode;
|
|
5742
|
-
if (videoFillMode === "fill" || videoFillMode === "cover") {
|
|
5859
|
+
if (videoFillMode === "fill" || videoFillMode === "cover" || videoFillMode === "contain") {
|
|
5743
5860
|
this.setAttribute("data-xgfill", videoFillMode);
|
|
5744
5861
|
}
|
|
5745
5862
|
if (!videoHeight || !videoWidth) {
|
|
@@ -5747,7 +5864,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5747
5864
|
}
|
|
5748
5865
|
this._videoHeight = videoHeight;
|
|
5749
5866
|
this._videoWidth = videoWidth;
|
|
5750
|
-
var containerSize = this.root.getBoundingClientRect();
|
|
5751
5867
|
var controlsHeight = this.controls && this.innerContainer ? this.controls.root.getBoundingClientRect().height : 0;
|
|
5752
5868
|
var width = containerSize.width;
|
|
5753
5869
|
var height = containerSize.height - controlsHeight;
|
|
@@ -5802,6 +5918,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5802
5918
|
XG_DEBUG.logInfo("setState", "state from:".concat(STATE_ARRAY[this.state], " to:").concat(STATE_ARRAY[newState]));
|
|
5803
5919
|
this._state = newState;
|
|
5804
5920
|
}
|
|
5921
|
+
}, {
|
|
5922
|
+
key: "preProcessUrl",
|
|
5923
|
+
value: function preProcessUrl(url, ext) {
|
|
5924
|
+
var preProcessUrl2 = this.config.preProcessUrl;
|
|
5925
|
+
return !util$1.isBlob(url) && preProcessUrl2 && typeof preProcessUrl2 === "function" ? preProcessUrl2(url, ext) : {
|
|
5926
|
+
url
|
|
5927
|
+
};
|
|
5928
|
+
}
|
|
5805
5929
|
}, {
|
|
5806
5930
|
key: "state",
|
|
5807
5931
|
get: function get() {
|
|
@@ -5975,9 +6099,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5975
6099
|
}, {
|
|
5976
6100
|
key: "cumulateTime",
|
|
5977
6101
|
get: function get() {
|
|
5978
|
-
var _accPlayed = this._accPlayed;
|
|
5979
|
-
|
|
5980
|
-
return _accPlayed.acc;
|
|
6102
|
+
var _this$_accPlayed = this._accPlayed, acc = _this$_accPlayed.acc, t2 = _this$_accPlayed.t;
|
|
6103
|
+
return t2 ? (/* @__PURE__ */ new Date()).getTime() - t2 + acc : acc;
|
|
5981
6104
|
}
|
|
5982
6105
|
}, {
|
|
5983
6106
|
key: "zoom",
|
|
@@ -6016,6 +6139,22 @@ var __publicField = (obj, key, value) => {
|
|
|
6016
6139
|
set: function set(val) {
|
|
6017
6140
|
REAL_TIME_SPEED = val;
|
|
6018
6141
|
}
|
|
6142
|
+
}, {
|
|
6143
|
+
key: "offsetCurrentTime",
|
|
6144
|
+
get: function get() {
|
|
6145
|
+
return this._offsetInfo.currentTime || 0;
|
|
6146
|
+
},
|
|
6147
|
+
set: function set(val) {
|
|
6148
|
+
this._offsetInfo.currentTime = val;
|
|
6149
|
+
}
|
|
6150
|
+
}, {
|
|
6151
|
+
key: "offsetDuration",
|
|
6152
|
+
get: function get() {
|
|
6153
|
+
return this._offsetInfo.duration || 0;
|
|
6154
|
+
},
|
|
6155
|
+
set: function set(val) {
|
|
6156
|
+
this._offsetInfo.duration = val || 0;
|
|
6157
|
+
}
|
|
6019
6158
|
}, {
|
|
6020
6159
|
key: "hook",
|
|
6021
6160
|
value: function hook$1(hookName, handler) {
|
|
@@ -7688,10 +7827,56 @@ var __publicField = (obj, key, value) => {
|
|
|
7688
7827
|
var Touche = /* @__PURE__ */ function() {
|
|
7689
7828
|
function Touche2(dom) {
|
|
7690
7829
|
var _this = this;
|
|
7691
|
-
var
|
|
7830
|
+
var _config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
7692
7831
|
eventType: "touch"
|
|
7693
7832
|
};
|
|
7694
7833
|
_classCallCheck(this, Touche2);
|
|
7834
|
+
_defineProperty$1(this, "onTouchStart", function(e2) {
|
|
7835
|
+
var _pos = _this._pos, root2 = _this.root;
|
|
7836
|
+
var touch = getTouch(e2.touches);
|
|
7837
|
+
_pos.x = touch ? parseInt(touch.pageX, 10) : e2.pageX;
|
|
7838
|
+
_pos.y = touch ? parseInt(touch.pageX, 10) : e2.pageX;
|
|
7839
|
+
_pos.start = true;
|
|
7840
|
+
_this.__setPress(e2);
|
|
7841
|
+
root2.addEventListener(_this.events.end, _this.onTouchEnd);
|
|
7842
|
+
root2.addEventListener(_this.events.cancel, _this.onTouchCancel);
|
|
7843
|
+
root2.addEventListener(_this.events.move, _this.onTouchMove);
|
|
7844
|
+
_this.trigger(EVENTS.TOUCH_START, e2);
|
|
7845
|
+
});
|
|
7846
|
+
_defineProperty$1(this, "onTouchCancel", function(e2) {
|
|
7847
|
+
_this.onTouchEnd(e2);
|
|
7848
|
+
});
|
|
7849
|
+
_defineProperty$1(this, "onTouchEnd", function(e2) {
|
|
7850
|
+
var _pos = _this._pos, root2 = _this.root;
|
|
7851
|
+
_this.__clearPress();
|
|
7852
|
+
root2.removeEventListener(_this.events.cancel, _this.onTouchCancel);
|
|
7853
|
+
root2.removeEventListener(_this.events.end, _this.onTouchEnd);
|
|
7854
|
+
root2.removeEventListener(_this.events.move, _this.onTouchMove);
|
|
7855
|
+
e2.moving = _pos.moving;
|
|
7856
|
+
e2.press = _pos.press;
|
|
7857
|
+
_pos.press && _this.trigger(EVENTS.PRESS_END, e2);
|
|
7858
|
+
_this.trigger(EVENTS.TOUCH_END, e2);
|
|
7859
|
+
!_pos.press && !_pos.moving && _this.__setDb(e2);
|
|
7860
|
+
_pos.press = false;
|
|
7861
|
+
_pos.start = false;
|
|
7862
|
+
_pos.moving = false;
|
|
7863
|
+
});
|
|
7864
|
+
_defineProperty$1(this, "onTouchMove", function(e2) {
|
|
7865
|
+
var _pos = _this._pos, config = _this.config;
|
|
7866
|
+
var touch = getTouch(e2.touches);
|
|
7867
|
+
var x2 = touch ? parseInt(touch.pageX, 10) : e2.pageX;
|
|
7868
|
+
var y2 = touch ? parseInt(touch.pageY, 10) : e2.pageX;
|
|
7869
|
+
var diffx = x2 - _pos.x;
|
|
7870
|
+
var diffy = y2 - _pos.y;
|
|
7871
|
+
if (Math.abs(diffy) < config.miniStep && Math.abs(diffx) < config.miniStep) {
|
|
7872
|
+
return;
|
|
7873
|
+
}
|
|
7874
|
+
_this.__clearPress();
|
|
7875
|
+
_pos.press && _this.trigger(EVENTS.PRESS_END, e2);
|
|
7876
|
+
_pos.press = false;
|
|
7877
|
+
_pos.moving = true;
|
|
7878
|
+
_this.trigger(EVENTS.TOUCH_MOVE, e2);
|
|
7879
|
+
});
|
|
7695
7880
|
this._pos = {
|
|
7696
7881
|
moving: false,
|
|
7697
7882
|
start: false,
|
|
@@ -7699,11 +7884,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7699
7884
|
y: 0
|
|
7700
7885
|
};
|
|
7701
7886
|
this.config = getDefaultConfig();
|
|
7702
|
-
Object.keys(
|
|
7703
|
-
_this.config[key] =
|
|
7887
|
+
Object.keys(_config).map(function(key) {
|
|
7888
|
+
_this.config[key] = _config[key];
|
|
7704
7889
|
});
|
|
7705
7890
|
this.root = dom;
|
|
7706
|
-
this.events =
|
|
7891
|
+
this.events = _config.eventType === "mouse" ? MOUSES : TOUCHS;
|
|
7707
7892
|
this.pressIntrvalId = null;
|
|
7708
7893
|
this.dbIntrvalId = null;
|
|
7709
7894
|
this.__handlers = {};
|
|
@@ -7712,10 +7897,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7712
7897
|
_createClass$1(Touche2, [{
|
|
7713
7898
|
key: "_initEvent",
|
|
7714
7899
|
value: function _initEvent() {
|
|
7715
|
-
this.onTouchStart = this.onTouchStart.bind(this);
|
|
7716
|
-
this.onTouchMove = this.onTouchMove.bind(this);
|
|
7717
|
-
this.onTouchEnd = this.onTouchEnd.bind(this);
|
|
7718
|
-
this.onTouchCancel = this.onTouchCancel.bind(this);
|
|
7719
7900
|
this.root.addEventListener(this.events.start, this.onTouchStart);
|
|
7720
7901
|
}
|
|
7721
7902
|
}, {
|
|
@@ -7801,60 +7982,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7801
7982
|
}
|
|
7802
7983
|
});
|
|
7803
7984
|
}
|
|
7804
|
-
}, {
|
|
7805
|
-
key: "onTouchStart",
|
|
7806
|
-
value: function onTouchStart(e2) {
|
|
7807
|
-
var _pos = this._pos, root2 = this.root;
|
|
7808
|
-
var touch = getTouch(e2.touches);
|
|
7809
|
-
_pos.x = touch ? parseInt(touch.pageX, 10) : e2.pageX;
|
|
7810
|
-
_pos.y = touch ? parseInt(touch.pageX, 10) : e2.pageX;
|
|
7811
|
-
_pos.start = true;
|
|
7812
|
-
this.__setPress(e2);
|
|
7813
|
-
root2.addEventListener(this.events.end, this.onTouchEnd);
|
|
7814
|
-
root2.addEventListener(this.events.cancel, this.onTouchCancel);
|
|
7815
|
-
root2.addEventListener(this.events.move, this.onTouchMove);
|
|
7816
|
-
this.trigger(EVENTS.TOUCH_START, e2);
|
|
7817
|
-
}
|
|
7818
|
-
}, {
|
|
7819
|
-
key: "onTouchCancel",
|
|
7820
|
-
value: function onTouchCancel(e2) {
|
|
7821
|
-
this.onTouchEnd(e2);
|
|
7822
|
-
}
|
|
7823
|
-
}, {
|
|
7824
|
-
key: "onTouchEnd",
|
|
7825
|
-
value: function onTouchEnd(e2) {
|
|
7826
|
-
var _pos = this._pos, root2 = this.root;
|
|
7827
|
-
this.__clearPress();
|
|
7828
|
-
root2.removeEventListener(this.events.cancel, this.onTouchCancel);
|
|
7829
|
-
root2.removeEventListener(this.events.end, this.onTouchEnd);
|
|
7830
|
-
root2.removeEventListener(this.events.move, this.onTouchMove);
|
|
7831
|
-
e2.moving = _pos.moving;
|
|
7832
|
-
e2.press = _pos.press;
|
|
7833
|
-
_pos.press && this.trigger(EVENTS.PRESS_END, e2);
|
|
7834
|
-
this.trigger(EVENTS.TOUCH_END, e2);
|
|
7835
|
-
!_pos.press && !_pos.moving && this.__setDb(e2);
|
|
7836
|
-
_pos.press = false;
|
|
7837
|
-
_pos.start = false;
|
|
7838
|
-
_pos.moving = false;
|
|
7839
|
-
}
|
|
7840
|
-
}, {
|
|
7841
|
-
key: "onTouchMove",
|
|
7842
|
-
value: function onTouchMove(e2) {
|
|
7843
|
-
var _pos = this._pos, config = this.config;
|
|
7844
|
-
var touch = getTouch(e2.touches);
|
|
7845
|
-
var x2 = touch ? parseInt(touch.pageX, 10) : e2.pageX;
|
|
7846
|
-
var y2 = touch ? parseInt(touch.pageY, 10) : e2.pageX;
|
|
7847
|
-
var diffx = x2 - _pos.x;
|
|
7848
|
-
var diffy = y2 - _pos.y;
|
|
7849
|
-
if (Math.abs(diffy) < config.miniStep && Math.abs(diffx) < config.miniStep) {
|
|
7850
|
-
return;
|
|
7851
|
-
}
|
|
7852
|
-
this.__clearPress();
|
|
7853
|
-
_pos.press && this.trigger(EVENTS.PRESS_END, e2);
|
|
7854
|
-
_pos.press = false;
|
|
7855
|
-
_pos.moving = true;
|
|
7856
|
-
this.trigger(EVENTS.TOUCH_MOVE, e2);
|
|
7857
|
-
}
|
|
7858
7985
|
}, {
|
|
7859
7986
|
key: "destroy",
|
|
7860
7987
|
value: function destroy() {
|
|
@@ -7864,8 +7991,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7864
7991
|
touchmove: "onTouchMove",
|
|
7865
7992
|
touchstart: "onTouchStart"
|
|
7866
7993
|
};
|
|
7867
|
-
Object.keys(map).
|
|
7868
|
-
_this4.root.removeEventListener(
|
|
7994
|
+
Object.keys(map).forEach(function(key) {
|
|
7995
|
+
_this4.root.removeEventListener(key, _this4[map[key]]);
|
|
7869
7996
|
});
|
|
7870
7997
|
}
|
|
7871
7998
|
}]);
|
|
@@ -8516,38 +8643,61 @@ var __publicField = (obj, key, value) => {
|
|
|
8516
8643
|
}
|
|
8517
8644
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
8518
8645
|
_defineProperty$1(_assertThisInitialized(_this), "onBodyKeyDown", function(event) {
|
|
8519
|
-
|
|
8520
|
-
if (!_this.player || !_this.player.isUserActive && !_this.config.isIgnoreUserActive) {
|
|
8646
|
+
if (!_this.player) {
|
|
8521
8647
|
return;
|
|
8522
8648
|
}
|
|
8523
|
-
|
|
8649
|
+
var e2 = event || window.event;
|
|
8650
|
+
var keyCode = e2.keyCode;
|
|
8651
|
+
var _assertThisInitialize = _assertThisInitialized(_this), _keyState = _assertThisInitialize._keyState, player = _assertThisInitialize.player;
|
|
8652
|
+
var _this$config = _this.config, disable = _this$config.disable, disableBodyTrigger = _this$config.disableBodyTrigger, isIgnoreUserActive = _this$config.isIgnoreUserActive;
|
|
8653
|
+
if (disable || disableBodyTrigger || !player.isUserActive && !isIgnoreUserActive || isDisableTag(e2.target) || !_this.checkIsVisible() || e2.metaKey || e2.altKey || e2.ctrlKey) {
|
|
8654
|
+
_keyState.isBodyKeyDown = false;
|
|
8524
8655
|
return;
|
|
8525
8656
|
}
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8657
|
+
if (!event.repeat && !_keyState.isKeyDown) {
|
|
8658
|
+
if ((e2.target === document.body || _this.config.isGlobalTrigger && !isDisableTag(e2.target)) && _this.checkCode(keyCode, true)) {
|
|
8659
|
+
_keyState.isBodyKeyDown = true;
|
|
8660
|
+
}
|
|
8661
|
+
document.addEventListener("keyup", _this.onBodyKeyUp);
|
|
8531
8662
|
}
|
|
8532
|
-
|
|
8663
|
+
_keyState.isBodyKeyDown && _this.handleKeyDown(e2);
|
|
8533
8664
|
});
|
|
8534
|
-
_defineProperty$1(_assertThisInitialized(_this), "
|
|
8535
|
-
|
|
8536
|
-
if (_this.config.disable || _this.config.disableRootTrigger || e2.metaKey || e2.altKey || e2.ctrlKey) {
|
|
8665
|
+
_defineProperty$1(_assertThisInitialized(_this), "onBodyKeyUp", function(event) {
|
|
8666
|
+
if (!_this.player) {
|
|
8537
8667
|
return;
|
|
8538
8668
|
}
|
|
8539
|
-
|
|
8669
|
+
document.removeEventListener("keyup", _this.onBodyKeyUp);
|
|
8670
|
+
_this.handleKeyUp(event);
|
|
8671
|
+
});
|
|
8672
|
+
_defineProperty$1(_assertThisInitialized(_this), "onKeydown", function(event) {
|
|
8673
|
+
if (!_this.player) {
|
|
8540
8674
|
return;
|
|
8541
8675
|
}
|
|
8542
|
-
|
|
8676
|
+
var e2 = event || window.event;
|
|
8677
|
+
var _assertThisInitialize2 = _assertThisInitialized(_this), _keyState = _assertThisInitialize2._keyState;
|
|
8678
|
+
if (!e2.repeat) {
|
|
8679
|
+
if (_this.config.disable || _this.config.disableRootTrigger || e2.metaKey || e2.altKey || e2.ctrlKey) {
|
|
8680
|
+
return;
|
|
8681
|
+
}
|
|
8682
|
+
if (!_this.player.isUserActive && !_this.config.isIgnoreUserActive) {
|
|
8683
|
+
return;
|
|
8684
|
+
}
|
|
8685
|
+
if (e2 && (e2.keyCode === 37 || _this.checkCode(e2.keyCode)) && (e2.target === _this.player.root || e2.target === _this.player.video || e2.target === _this.player.controls.el)) {
|
|
8686
|
+
_keyState.isKeyDown = true;
|
|
8687
|
+
}
|
|
8688
|
+
_this.player.root.addEventListener("keyup", _this.onKeyup);
|
|
8689
|
+
}
|
|
8690
|
+
if (!_keyState.isKeyDown) {
|
|
8543
8691
|
return;
|
|
8544
8692
|
}
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8693
|
+
_this.handleKeyDown(e2);
|
|
8694
|
+
});
|
|
8695
|
+
_defineProperty$1(_assertThisInitialized(_this), "onKeyup", function(event) {
|
|
8696
|
+
if (!_this.player) {
|
|
8697
|
+
return;
|
|
8549
8698
|
}
|
|
8550
|
-
_this.
|
|
8699
|
+
_this.player.root.removeEventListener("keyup", _this.onKeyup);
|
|
8700
|
+
_this.handleKeyUp(event);
|
|
8551
8701
|
});
|
|
8552
8702
|
return _this;
|
|
8553
8703
|
}
|
|
@@ -8561,7 +8711,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8561
8711
|
if (!_this2.keyCodeMap[key]) {
|
|
8562
8712
|
_this2.keyCodeMap[key] = extendkeyCodeMap[key];
|
|
8563
8713
|
} else {
|
|
8564
|
-
["keyCode", "action", "disable", "isBodyTarget"].map(function(key1) {
|
|
8714
|
+
["keyCode", "action", "disable", "pressAction", "disablePress", "isBodyTarget"].map(function(key1) {
|
|
8565
8715
|
extendkeyCodeMap[key][key1] && (_this2.keyCodeMap[key][key1] = extendkeyCodeMap[key][key1]);
|
|
8566
8716
|
});
|
|
8567
8717
|
}
|
|
@@ -8581,37 +8731,51 @@ var __publicField = (obj, key, value) => {
|
|
|
8581
8731
|
keyCode: 32,
|
|
8582
8732
|
action: "playPause",
|
|
8583
8733
|
disable: false,
|
|
8734
|
+
disablePress: false,
|
|
8584
8735
|
noBodyTarget: false
|
|
8585
8736
|
},
|
|
8586
8737
|
up: {
|
|
8587
8738
|
keyCode: 38,
|
|
8588
8739
|
action: "upVolume",
|
|
8589
8740
|
disable: false,
|
|
8741
|
+
disablePress: false,
|
|
8590
8742
|
noBodyTarget: true
|
|
8591
8743
|
},
|
|
8592
8744
|
down: {
|
|
8593
8745
|
keyCode: 40,
|
|
8594
8746
|
action: "downVolume",
|
|
8595
8747
|
disable: false,
|
|
8748
|
+
disablePress: false,
|
|
8596
8749
|
noBodyTarget: true
|
|
8597
8750
|
},
|
|
8598
8751
|
left: {
|
|
8599
8752
|
keyCode: 37,
|
|
8600
8753
|
action: "seekBack",
|
|
8754
|
+
disablePress: false,
|
|
8601
8755
|
disable: false
|
|
8602
8756
|
},
|
|
8603
8757
|
right: {
|
|
8604
8758
|
keyCode: 39,
|
|
8605
8759
|
action: "seek",
|
|
8760
|
+
pressAction: "changePlaybackRate",
|
|
8761
|
+
disablePress: false,
|
|
8606
8762
|
disable: false
|
|
8607
8763
|
},
|
|
8608
8764
|
esc: {
|
|
8609
8765
|
keyCode: 27,
|
|
8610
8766
|
action: "exitFullscreen",
|
|
8767
|
+
disablePress: true,
|
|
8611
8768
|
disable: false
|
|
8612
8769
|
}
|
|
8613
8770
|
};
|
|
8614
8771
|
this.mergekeyCodeMap();
|
|
8772
|
+
this._keyState = {
|
|
8773
|
+
isKeyDown: false,
|
|
8774
|
+
isBodyKeyDown: false,
|
|
8775
|
+
isPress: false,
|
|
8776
|
+
tt: 0,
|
|
8777
|
+
playbackRate: 0
|
|
8778
|
+
};
|
|
8615
8779
|
this.player.root.addEventListener("keydown", this.onKeydown);
|
|
8616
8780
|
document.addEventListener("keydown", this.onBodyKeyDown);
|
|
8617
8781
|
}
|
|
@@ -8645,6 +8809,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8645
8809
|
key: "downVolume",
|
|
8646
8810
|
value: function downVolume(event) {
|
|
8647
8811
|
var player = this.player;
|
|
8812
|
+
if (player.volume <= 0) {
|
|
8813
|
+
return;
|
|
8814
|
+
}
|
|
8648
8815
|
var val = parseFloat((player.volume - 0.1).toFixed(1));
|
|
8649
8816
|
var props = {
|
|
8650
8817
|
volume: {
|
|
@@ -8665,6 +8832,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8665
8832
|
key: "upVolume",
|
|
8666
8833
|
value: function upVolume(event) {
|
|
8667
8834
|
var player = this.player;
|
|
8835
|
+
if (player.volume >= 1) {
|
|
8836
|
+
return;
|
|
8837
|
+
}
|
|
8668
8838
|
var val = parseFloat((player.volume + 0.1).toFixed(1));
|
|
8669
8839
|
var props = {
|
|
8670
8840
|
volume: {
|
|
@@ -8684,42 +8854,57 @@ var __publicField = (obj, key, value) => {
|
|
|
8684
8854
|
}, {
|
|
8685
8855
|
key: "seek",
|
|
8686
8856
|
value: function seek(event) {
|
|
8687
|
-
var _this$player = this.player, currentTime = _this$player.currentTime, duration = _this$player.duration;
|
|
8688
|
-
var _time = currentTime;
|
|
8689
|
-
|
|
8690
|
-
|
|
8857
|
+
var _this$player = this.player, currentTime = _this$player.currentTime, offsetCurrentTime = _this$player.offsetCurrentTime, duration = _this$player.duration, offsetDuration = _this$player.offsetDuration, timeSegments = _this$player.timeSegments;
|
|
8858
|
+
var _time = offsetCurrentTime > -1 ? offsetCurrentTime : currentTime;
|
|
8859
|
+
var _duration = offsetDuration || duration;
|
|
8860
|
+
var _step = event.repeat && this.seekStep >= 4 ? parseInt(this.seekStep / 2, 10) : this.seekStep;
|
|
8861
|
+
if (_time + _step <= _duration) {
|
|
8862
|
+
_time = _time + _step;
|
|
8691
8863
|
} else {
|
|
8692
|
-
_time =
|
|
8864
|
+
_time = _duration;
|
|
8693
8865
|
}
|
|
8866
|
+
var _seekTime = util$1.getCurrentTimeByOffset(_time, timeSegments);
|
|
8694
8867
|
var props = {
|
|
8695
8868
|
currentTime: {
|
|
8696
8869
|
from: currentTime,
|
|
8697
|
-
to:
|
|
8870
|
+
to: _seekTime
|
|
8698
8871
|
}
|
|
8699
8872
|
};
|
|
8700
8873
|
this.emitUserAction(event, "seek", {
|
|
8701
8874
|
props
|
|
8702
8875
|
});
|
|
8703
|
-
this.player.currentTime =
|
|
8876
|
+
this.player.currentTime = _seekTime;
|
|
8704
8877
|
}
|
|
8705
8878
|
}, {
|
|
8706
8879
|
key: "seekBack",
|
|
8707
8880
|
value: function seekBack(event) {
|
|
8708
|
-
var
|
|
8709
|
-
var
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8881
|
+
var _this$player2 = this.player, currentTime = _this$player2.currentTime, offsetCurrentTime = _this$player2.offsetCurrentTime, timeSegments = _this$player2.timeSegments;
|
|
8882
|
+
var _step = event.repeat ? parseInt(this.seekStep / 2, 10) : this.seekStep;
|
|
8883
|
+
var _time = offsetCurrentTime > -1 ? offsetCurrentTime : currentTime;
|
|
8884
|
+
var _seekTime = _time - _step;
|
|
8885
|
+
if (_seekTime < 0) {
|
|
8886
|
+
_seekTime = 0;
|
|
8887
|
+
}
|
|
8888
|
+
_seekTime = util$1.getCurrentTimeByOffset(_seekTime, timeSegments);
|
|
8713
8889
|
var props = {
|
|
8714
8890
|
currentTime: {
|
|
8715
8891
|
from: currentTime,
|
|
8716
|
-
to:
|
|
8892
|
+
to: _seekTime
|
|
8717
8893
|
}
|
|
8718
8894
|
};
|
|
8719
8895
|
this.emitUserAction(event, "seek", {
|
|
8720
8896
|
props
|
|
8721
8897
|
});
|
|
8722
|
-
this.player.currentTime =
|
|
8898
|
+
this.player.currentTime = _seekTime;
|
|
8899
|
+
}
|
|
8900
|
+
}, {
|
|
8901
|
+
key: "changePlaybackRate",
|
|
8902
|
+
value: function changePlaybackRate(event) {
|
|
8903
|
+
var _keyState = this._keyState, config = this.config, player = this.player;
|
|
8904
|
+
if (_keyState.playbackRate === 0) {
|
|
8905
|
+
_keyState.playbackRate = player.playbackRate;
|
|
8906
|
+
player.playbackRate = config.playbackRate;
|
|
8907
|
+
}
|
|
8723
8908
|
}
|
|
8724
8909
|
}, {
|
|
8725
8910
|
key: "playPause",
|
|
@@ -8757,32 +8942,66 @@ var __publicField = (obj, key, value) => {
|
|
|
8757
8942
|
player.exitCssFullscreen();
|
|
8758
8943
|
}
|
|
8759
8944
|
}
|
|
8945
|
+
}, {
|
|
8946
|
+
key: "handleKeyDown",
|
|
8947
|
+
value: function handleKeyDown(e2) {
|
|
8948
|
+
var _keyState = this._keyState;
|
|
8949
|
+
if (e2.repeat) {
|
|
8950
|
+
_keyState.isPress = true;
|
|
8951
|
+
var _t = Date.now();
|
|
8952
|
+
if (_t - _keyState.tt < 200) {
|
|
8953
|
+
return;
|
|
8954
|
+
}
|
|
8955
|
+
_keyState.tt = _t;
|
|
8956
|
+
}
|
|
8957
|
+
preventDefault(e2);
|
|
8958
|
+
this.handleKeyCode(e2.keyCode, e2, _keyState.isPress);
|
|
8959
|
+
}
|
|
8960
|
+
}, {
|
|
8961
|
+
key: "handleKeyUp",
|
|
8962
|
+
value: function handleKeyUp(e2) {
|
|
8963
|
+
var _keyState = this._keyState;
|
|
8964
|
+
if (_keyState.playbackRate > 0) {
|
|
8965
|
+
this.player.playbackRate = _keyState.playbackRate;
|
|
8966
|
+
_keyState.playbackRate = 0;
|
|
8967
|
+
}
|
|
8968
|
+
_keyState.isKeyDown = false;
|
|
8969
|
+
_keyState.isPress = false;
|
|
8970
|
+
_keyState.tt = 0;
|
|
8971
|
+
}
|
|
8760
8972
|
}, {
|
|
8761
8973
|
key: "handleKeyCode",
|
|
8762
|
-
value: function handleKeyCode(curKeyCode, event) {
|
|
8763
|
-
var
|
|
8764
|
-
|
|
8765
|
-
var
|
|
8766
|
-
if (keyCode === curKeyCode
|
|
8767
|
-
if (
|
|
8768
|
-
action
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8974
|
+
value: function handleKeyCode(curKeyCode, event, isPress) {
|
|
8975
|
+
var arr = Object.keys(this.keyCodeMap);
|
|
8976
|
+
for (var i2 = 0; i2 < arr.length; i2++) {
|
|
8977
|
+
var _this$keyCodeMap$arr$ = this.keyCodeMap[arr[i2]], action = _this$keyCodeMap$arr$.action, keyCode = _this$keyCodeMap$arr$.keyCode, disable = _this$keyCodeMap$arr$.disable, pressAction = _this$keyCodeMap$arr$.pressAction, disablePress = _this$keyCodeMap$arr$.disablePress;
|
|
8978
|
+
if (keyCode === curKeyCode) {
|
|
8979
|
+
if (!disable && !(isPress && disablePress)) {
|
|
8980
|
+
var _action = !isPress ? action : pressAction || action;
|
|
8981
|
+
if (typeof _action === "function") {
|
|
8982
|
+
action(event, this.player, isPress);
|
|
8983
|
+
} else if (typeof _action === "string") {
|
|
8984
|
+
if (typeof this[_action] === "function") {
|
|
8985
|
+
this[_action](event, this.player, isPress);
|
|
8986
|
+
}
|
|
8772
8987
|
}
|
|
8988
|
+
this.emit(SHORTCUT, _objectSpread2$1({
|
|
8989
|
+
key: arr[i2],
|
|
8990
|
+
target: event.target,
|
|
8991
|
+
isPress
|
|
8992
|
+
}, this.keyCodeMap[arr[i2]]));
|
|
8773
8993
|
}
|
|
8774
|
-
|
|
8775
|
-
key,
|
|
8776
|
-
target: event.target
|
|
8777
|
-
}, _this4.keyCodeMap[key]));
|
|
8994
|
+
break;
|
|
8778
8995
|
}
|
|
8779
|
-
}
|
|
8996
|
+
}
|
|
8780
8997
|
}
|
|
8781
8998
|
}, {
|
|
8782
8999
|
key: "destroy",
|
|
8783
9000
|
value: function destroy() {
|
|
8784
9001
|
this.player.root.removeEventListener("keydown", this.onKeydown);
|
|
8785
9002
|
document.removeEventListener("keydown", this.onBodyKeyDown);
|
|
9003
|
+
this.player.root.removeEventListener("keyup", this.onKeyup);
|
|
9004
|
+
document.removeEventListener("keyup", this.onBodyKeyUp);
|
|
8786
9005
|
}
|
|
8787
9006
|
}, {
|
|
8788
9007
|
key: "disable",
|
|
@@ -8804,12 +9023,13 @@ var __publicField = (obj, key, value) => {
|
|
|
8804
9023
|
get: function get() {
|
|
8805
9024
|
return {
|
|
8806
9025
|
seekStep: 10,
|
|
8807
|
-
checkVisible:
|
|
9026
|
+
checkVisible: false,
|
|
8808
9027
|
disableBodyTrigger: false,
|
|
8809
9028
|
disableRootTrigger: false,
|
|
8810
9029
|
isGlobalTrigger: false,
|
|
8811
9030
|
keyCodeMap: {},
|
|
8812
9031
|
disable: false,
|
|
9032
|
+
playbackRate: 2,
|
|
8813
9033
|
isIgnoreUserActive: false
|
|
8814
9034
|
};
|
|
8815
9035
|
}
|
|
@@ -10178,6 +10398,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10178
10398
|
get url() {
|
|
10179
10399
|
return this._currentUrlRef.url;
|
|
10180
10400
|
}
|
|
10401
|
+
set url(url) {
|
|
10402
|
+
this._currentUrlRef.url = url;
|
|
10403
|
+
}
|
|
10181
10404
|
next() {
|
|
10182
10405
|
const next = this._currentUrlRef.next;
|
|
10183
10406
|
/* istanbul ignore next -- @preserve */
|
|
@@ -10255,7 +10478,6 @@ var __publicField = (obj, key, value) => {
|
|
|
10255
10478
|
__publicField(this, "defaultSource");
|
|
10256
10479
|
__publicField(this, "defaultDefinition");
|
|
10257
10480
|
__publicField(this, "maxFallbackRound");
|
|
10258
|
-
__publicField(this, "_prepareList", []);
|
|
10259
10481
|
__publicField(this, "_currentDefinition");
|
|
10260
10482
|
__publicField(this, "_sources");
|
|
10261
10483
|
__publicField(this, "_fallbackCount", 0);
|
|
@@ -10290,6 +10512,11 @@ var __publicField = (obj, key, value) => {
|
|
|
10290
10512
|
var _a;
|
|
10291
10513
|
return (_a = this.definition) == null ? void 0 : _a.url;
|
|
10292
10514
|
}
|
|
10515
|
+
set url(url) {
|
|
10516
|
+
if (this.definition) {
|
|
10517
|
+
this.definition.url = url;
|
|
10518
|
+
}
|
|
10519
|
+
}
|
|
10293
10520
|
/**
|
|
10294
10521
|
* 以给定的参数搜索源和对应清晰度。`source` 和 `definition`
|
|
10295
10522
|
* 都是可选的,当未指定时,使用当前的 {@link SourceManager.source}
|
|
@@ -10359,14 +10586,6 @@ var __publicField = (obj, key, value) => {
|
|
|
10359
10586
|
this.resetFallback();
|
|
10360
10587
|
return this;
|
|
10361
10588
|
}
|
|
10362
|
-
registerPrepare(prepare) {
|
|
10363
|
-
this._prepareList.push(prepare);
|
|
10364
|
-
}
|
|
10365
|
-
async prepare(url) {
|
|
10366
|
-
for (const prepare of this._prepareList) {
|
|
10367
|
-
await prepare(url);
|
|
10368
|
-
}
|
|
10369
|
-
}
|
|
10370
10589
|
resetFallback() {
|
|
10371
10590
|
this._fallbackCount = 0;
|
|
10372
10591
|
}
|
|
@@ -11957,9 +12176,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11957
12176
|
toastPlugin.remove(this._toastId);
|
|
11958
12177
|
}
|
|
11959
12178
|
this._toastId = toastPlugin.toast(
|
|
11960
|
-
`${i18nManager.getText("DEFINITION_SWITCHING")} ${
|
|
11961
|
-
definition.text
|
|
11962
|
-
)) ?? definition.definition} ...`,
|
|
12179
|
+
`${i18nManager.getText("DEFINITION_SWITCHING")} ${definition.showText ?? definition.definition} ...`,
|
|
11963
12180
|
{
|
|
11964
12181
|
duration: 2e3,
|
|
11965
12182
|
closable: true
|
|
@@ -12723,21 +12940,21 @@ var __publicField = (obj, key, value) => {
|
|
|
12723
12940
|
// 自动播放插件
|
|
12724
12941
|
UNMUTE: "Click to unmute",
|
|
12725
12942
|
// 报错
|
|
12726
|
-
MANIFEST: "
|
|
12943
|
+
MANIFEST: "Video parsing error",
|
|
12727
12944
|
NETWORK: "Network error",
|
|
12728
12945
|
NETWORK_TIMEOUT: "Network timeout",
|
|
12729
|
-
NETWORK_FORBIDDEN: "
|
|
12730
|
-
NETWORK_NOTFOUND: "
|
|
12731
|
-
DEMUX: "
|
|
12732
|
-
REMUX: "
|
|
12733
|
-
MEDIA: "
|
|
12734
|
-
MEDIA_ERR_CODEC_NOT_SUPPORTED: "
|
|
12735
|
-
MEDIA_ERR_URL_EMPTY: "
|
|
12736
|
-
DRM: "
|
|
12737
|
-
OTHER: "
|
|
12738
|
-
RUNTIME: "
|
|
12739
|
-
MODULE_LOAD_ERROR: "
|
|
12740
|
-
UNKNOWN: "
|
|
12946
|
+
NETWORK_FORBIDDEN: "Authentication error",
|
|
12947
|
+
NETWORK_NOTFOUND: "Stream does not exist",
|
|
12948
|
+
DEMUX: "Video parsing error",
|
|
12949
|
+
REMUX: "Video parsing error",
|
|
12950
|
+
MEDIA: "An error occurred, Please try again",
|
|
12951
|
+
MEDIA_ERR_CODEC_NOT_SUPPORTED: "Audio/video codec is not supported",
|
|
12952
|
+
MEDIA_ERR_URL_EMPTY: "The stream address is not specified",
|
|
12953
|
+
DRM: "Permission verification failed",
|
|
12954
|
+
OTHER: "Unknown error",
|
|
12955
|
+
RUNTIME: "An error occurred, Please try again",
|
|
12956
|
+
MODULE_LOAD_ERROR: "CDN fetch error",
|
|
12957
|
+
UNKNOWN: "Unknown error"
|
|
12741
12958
|
};
|
|
12742
12959
|
const ZH_CN$1 = {
|
|
12743
12960
|
...ZH.TEXT,
|
|
@@ -12756,12 +12973,12 @@ var __publicField = (obj, key, value) => {
|
|
|
12756
12973
|
NETWORK_NOTFOUND: "播放地址不存在",
|
|
12757
12974
|
DEMUX: "视频解析错误",
|
|
12758
12975
|
REMUX: "视频解析错误",
|
|
12759
|
-
MEDIA: "
|
|
12760
|
-
MEDIA_ERR_CODEC_NOT_SUPPORTED: "
|
|
12976
|
+
MEDIA: "播放异常,请重试",
|
|
12977
|
+
MEDIA_ERR_CODEC_NOT_SUPPORTED: "不支持的音频/视频格式",
|
|
12761
12978
|
MEDIA_ERR_URL_EMPTY: "当前播放地址为空",
|
|
12762
12979
|
DRM: "权限验证失败",
|
|
12763
12980
|
OTHER: "其他报错",
|
|
12764
|
-
RUNTIME: "
|
|
12981
|
+
RUNTIME: "播放异常,请重试",
|
|
12765
12982
|
MODULE_LOAD_ERROR: "插件模块加载异常",
|
|
12766
12983
|
UNKNOWN: "未知报错"
|
|
12767
12984
|
};
|
|
@@ -12905,7 +13122,6 @@ var __publicField = (obj, key, value) => {
|
|
|
12905
13122
|
veplayer: this
|
|
12906
13123
|
});
|
|
12907
13124
|
this.emit(Events$1.PLAYER_CREATE_FINISH, this._player);
|
|
12908
|
-
this._sourceManager.registerPrepare((url) => this.prepare(url));
|
|
12909
13125
|
this._errorCallback = (err) => this._handleFallback(err);
|
|
12910
13126
|
this._player.on(ERROR, this._errorCallback);
|
|
12911
13127
|
}
|
|
@@ -13071,7 +13287,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13071
13287
|
return;
|
|
13072
13288
|
}
|
|
13073
13289
|
if (!VeI18n.isLangValid(lang)) {
|
|
13074
|
-
const langKeys = VeI18n.langKeys
|
|
13290
|
+
const langKeys = VeI18n.langKeys.join(",");
|
|
13075
13291
|
const message = {
|
|
13076
13292
|
en: `Sorry, we couldn't set the language to ${lang} because it's not currently supported. The list of supported languages includes ${langKeys}.`,
|
|
13077
13293
|
"zh-cn": `不支持当前设置的语言${lang}, 支持的语言有${langKeys}, 请重新设置`
|
|
@@ -13090,7 +13306,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13090
13306
|
* @hidden
|
|
13091
13307
|
*/
|
|
13092
13308
|
static async create(options = {}, Constructor) {
|
|
13093
|
-
var _a;
|
|
13309
|
+
var _a, _b, _c;
|
|
13094
13310
|
const sourceManager = new SourceManager({
|
|
13095
13311
|
sources: Source.normalize({
|
|
13096
13312
|
url: options.url,
|
|
@@ -13102,8 +13318,14 @@ var __publicField = (obj, key, value) => {
|
|
|
13102
13318
|
defaultDefinition: options.defaultDefinition,
|
|
13103
13319
|
maxFallbackRound: options.maxFallbackRound
|
|
13104
13320
|
});
|
|
13321
|
+
const prepareResult = await ((_a = options == null ? void 0 : options.preparePlugins) == null ? void 0 : _a.call(
|
|
13322
|
+
options,
|
|
13323
|
+
sourceManager.url ?? ""
|
|
13324
|
+
));
|
|
13325
|
+
if ((_b = prepareResult == null ? void 0 : prepareResult.options) == null ? void 0 : _b.url) {
|
|
13326
|
+
sourceManager.url = (_c = prepareResult == null ? void 0 : prepareResult.options) == null ? void 0 : _c.url;
|
|
13327
|
+
}
|
|
13105
13328
|
options.url = sourceManager.url;
|
|
13106
|
-
const prepareResult = await ((_a = options == null ? void 0 : options.preparePlugins) == null ? void 0 : _a.call(options, options.url ?? ""));
|
|
13107
13329
|
return new (Constructor ?? VePlayerBase)({
|
|
13108
13330
|
...options,
|
|
13109
13331
|
prepareResult,
|
|
@@ -13118,7 +13340,6 @@ var __publicField = (obj, key, value) => {
|
|
|
13118
13340
|
async switch(target, options) {
|
|
13119
13341
|
var _a, _b;
|
|
13120
13342
|
if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
|
|
13121
|
-
this._sourceManager.updateSources(target);
|
|
13122
13343
|
await this._switchUrl(target);
|
|
13123
13344
|
return this._sourceManager.definition;
|
|
13124
13345
|
}
|
|
@@ -13257,7 +13478,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13257
13478
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
13258
13479
|
* @param el 全屏作用的 DOM 节点。
|
|
13259
13480
|
*/
|
|
13260
|
-
|
|
13481
|
+
requestFullscreen(el) {
|
|
13261
13482
|
return this._player.getFullscreen(el);
|
|
13262
13483
|
}
|
|
13263
13484
|
/**
|
|
@@ -13271,7 +13492,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13271
13492
|
* @brief 调用此方法进入网页样式全屏状态,播放器进入网页全屏,利用 CSS 模拟实现全屏效果。如果该接口调用的时候处于全屏状态,会自动退出全屏,下发事件 `Events.CSS_FULLSCREEN_CHANGE`。
|
|
13272
13493
|
* @param el 全屏作用的 DOM 节点。
|
|
13273
13494
|
*/
|
|
13274
|
-
|
|
13495
|
+
requestCssFullscreen(el) {
|
|
13275
13496
|
return this._player.getCssFullscreen(el);
|
|
13276
13497
|
}
|
|
13277
13498
|
/**
|
|
@@ -13354,9 +13575,12 @@ var __publicField = (obj, key, value) => {
|
|
|
13354
13575
|
if (result == null ? void 0 : result.options) {
|
|
13355
13576
|
this._player.setConfig(result.options);
|
|
13356
13577
|
}
|
|
13357
|
-
return
|
|
13358
|
-
|
|
13359
|
-
|
|
13578
|
+
return {
|
|
13579
|
+
plugins: addedPlugins.map((plugin) => {
|
|
13580
|
+
return this._player.registerPlugin(plugin);
|
|
13581
|
+
}),
|
|
13582
|
+
options: result == null ? void 0 : result.options
|
|
13583
|
+
};
|
|
13360
13584
|
}
|
|
13361
13585
|
async _handleFallback(err) {
|
|
13362
13586
|
this._player.addClass(STATE_CLASS.ENTER);
|
|
@@ -13391,7 +13615,10 @@ var __publicField = (obj, key, value) => {
|
|
|
13391
13615
|
async _switch(targetDefinition) {
|
|
13392
13616
|
var _a, _b, _c, _d, _e, _f;
|
|
13393
13617
|
const preDefinition = clonedeep(this._sourceManager.definition);
|
|
13394
|
-
const newPlugins = await this.prepare(targetDefinition.url);
|
|
13618
|
+
const { plugins: newPlugins, options } = await this.prepare(targetDefinition.url) || {};
|
|
13619
|
+
if (options == null ? void 0 : options.url) {
|
|
13620
|
+
targetDefinition.url = options == null ? void 0 : options.url;
|
|
13621
|
+
}
|
|
13395
13622
|
this._sourceManager.switch(targetDefinition);
|
|
13396
13623
|
(_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.sources.renderItemList();
|
|
13397
13624
|
(_d = (_c = this._player) == null ? void 0 : _c.plugins) == null ? void 0 : _d.definition.renderItemList();
|
|
@@ -13407,11 +13634,13 @@ var __publicField = (obj, key, value) => {
|
|
|
13407
13634
|
}
|
|
13408
13635
|
}
|
|
13409
13636
|
async _switchUrl(url) {
|
|
13410
|
-
const newPlugins = await this.prepare(url);
|
|
13637
|
+
const { plugins: newPlugins, options } = await this.prepare(url) || {};
|
|
13638
|
+
const newUrl = (options == null ? void 0 : options.url) ?? url;
|
|
13639
|
+
this._sourceManager.updateSources(newUrl);
|
|
13411
13640
|
if (newPlugins == null ? void 0 : newPlugins.length) {
|
|
13412
|
-
this._callBeforePlayerInitForUrl(newPlugins,
|
|
13641
|
+
this._callBeforePlayerInitForUrl(newPlugins, newUrl);
|
|
13413
13642
|
} else {
|
|
13414
|
-
const res = this._player.switchURL(
|
|
13643
|
+
const res = this._player.switchURL(newUrl, false);
|
|
13415
13644
|
const curTime = this._player.currentTime;
|
|
13416
13645
|
if (res && res.then) {
|
|
13417
13646
|
return res;
|
|
@@ -18144,15 +18373,34 @@ var __publicField = (obj, key, value) => {
|
|
|
18144
18373
|
function create(errorCode, i18n) {
|
|
18145
18374
|
return new VeError(ERRORS[errorCode], i18n);
|
|
18146
18375
|
}
|
|
18376
|
+
async function isRTMSupported() {
|
|
18377
|
+
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18378
|
+
return Rtm.isSupported();
|
|
18379
|
+
}
|
|
18380
|
+
async function isRTMSupportCodec(codec = RTMCodec.H264) {
|
|
18381
|
+
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18382
|
+
if (codec === RTMCodec.H264)
|
|
18383
|
+
return Rtm.isSupportedH264();
|
|
18384
|
+
return false;
|
|
18385
|
+
}
|
|
18147
18386
|
const rtmStrategy = {
|
|
18148
18387
|
options: {},
|
|
18149
18388
|
module: DynamicModule.PluginRtm
|
|
18150
18389
|
};
|
|
18151
|
-
const
|
|
18390
|
+
const generateFallbackUrl = (url) => {
|
|
18391
|
+
if (sniffer$1.device === "pc") {
|
|
18392
|
+
return url.replace(".sdp", ".flv");
|
|
18393
|
+
} else {
|
|
18394
|
+
return url.replace(".sdp", ".m3u8");
|
|
18395
|
+
}
|
|
18396
|
+
};
|
|
18397
|
+
const getRtmStrategy = async (options, player) => {
|
|
18152
18398
|
var _a;
|
|
18153
18399
|
let backupStrategy;
|
|
18154
|
-
const {
|
|
18155
|
-
const
|
|
18400
|
+
const { url } = options;
|
|
18401
|
+
const { fallbackUrl, enableFallback = true, ...ret } = options.rtm || {};
|
|
18402
|
+
const actualFallbackUrl = !enableFallback ? "" : !fallbackUrl && url ? generateFallbackUrl(url) : fallbackUrl;
|
|
18403
|
+
const backupType = actualFallbackUrl && util.getStreamType(actualFallbackUrl);
|
|
18156
18404
|
if (backupType === "flv" && util.isMseSupported(Codec.H264)) {
|
|
18157
18405
|
backupStrategy = createFlvMseStrategy(options);
|
|
18158
18406
|
} else if (backupType === "hls" && (sniffer$1.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE)) && util.isMseSupported(Codec.H264)) {
|
|
@@ -18162,40 +18410,55 @@ var __publicField = (obj, key, value) => {
|
|
|
18162
18410
|
load(rtmStrategy.module).catch(() => void 0),
|
|
18163
18411
|
backupStrategy && load(backupStrategy.module).catch(() => void 0)
|
|
18164
18412
|
]);
|
|
18413
|
+
const [RTMSupported, RTMSupportCodec] = await Promise.all([
|
|
18414
|
+
isRTMSupported(),
|
|
18415
|
+
isRTMSupportCodec()
|
|
18416
|
+
]);
|
|
18417
|
+
if (!RTMSupported || !RTMSupportCodec) {
|
|
18418
|
+
if (player) {
|
|
18419
|
+
player.emit("degrade", {
|
|
18420
|
+
url: actualFallbackUrl,
|
|
18421
|
+
originRtmUrl: url,
|
|
18422
|
+
code: "NOT_SUPPORT",
|
|
18423
|
+
message: "not support rtm or h264",
|
|
18424
|
+
isRTMSupported: RTMSupported,
|
|
18425
|
+
isRTMSupportCodec: RTMSupportCodec
|
|
18426
|
+
});
|
|
18427
|
+
}
|
|
18428
|
+
return {
|
|
18429
|
+
options: {
|
|
18430
|
+
...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
|
|
18431
|
+
url: actualFallbackUrl,
|
|
18432
|
+
_RTMdegrade: {
|
|
18433
|
+
_originRtmUrl: url,
|
|
18434
|
+
_isRTMSupported: RTMSupported,
|
|
18435
|
+
_isRTMSupportCodec: RTMSupportCodec
|
|
18436
|
+
}
|
|
18437
|
+
},
|
|
18438
|
+
plugins: backupCdn ? [backupCdn] : []
|
|
18439
|
+
};
|
|
18440
|
+
}
|
|
18165
18441
|
return {
|
|
18166
18442
|
options: {
|
|
18167
18443
|
...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
|
|
18444
|
+
_RTMdegrade: void 0,
|
|
18168
18445
|
rts: {
|
|
18169
18446
|
retryCount: 0,
|
|
18170
18447
|
...ret,
|
|
18171
|
-
backupURL:
|
|
18448
|
+
backupURL: actualFallbackUrl,
|
|
18172
18449
|
backupConstruct: backupCdn
|
|
18173
18450
|
}
|
|
18174
18451
|
},
|
|
18175
18452
|
plugins: rtmCdn ? [rtmCdn] : []
|
|
18176
18453
|
};
|
|
18177
18454
|
};
|
|
18178
|
-
|
|
18179
|
-
RTMCodec2["H264"] = "h264";
|
|
18180
|
-
return RTMCodec2;
|
|
18181
|
-
})(RTMCodec || {});
|
|
18182
|
-
const isRTMSupported = async () => {
|
|
18183
|
-
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18184
|
-
return Rtm.isSupported();
|
|
18185
|
-
};
|
|
18186
|
-
const isRTMSupportCodec = async (codec = "h264") => {
|
|
18187
|
-
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18188
|
-
if (codec === "h264")
|
|
18189
|
-
return Rtm.isSupportedH264();
|
|
18190
|
-
return false;
|
|
18191
|
-
};
|
|
18192
|
-
const getTypeStrategy = async (options) => {
|
|
18455
|
+
const getTypeStrategy = async (options, player) => {
|
|
18193
18456
|
const type = options.url ? util.getStreamType(options.url) : "";
|
|
18194
18457
|
if (!type || type === "unknown") {
|
|
18195
18458
|
return { options: {}, plugins: [] };
|
|
18196
18459
|
}
|
|
18197
18460
|
if (type === "rtm") {
|
|
18198
|
-
return await getRtmStrategy(options);
|
|
18461
|
+
return await getRtmStrategy(options, player);
|
|
18199
18462
|
}
|
|
18200
18463
|
if (type === "flv") {
|
|
18201
18464
|
return await getFlvStrategy(options);
|
|
@@ -18643,9 +18906,9 @@ var __publicField = (obj, key, value) => {
|
|
|
18643
18906
|
function isCodecSupport(codec) {
|
|
18644
18907
|
return typeof MediaSource !== "undefined" ? +MediaSource.isTypeSupported("video/mp4; codecs=" + codec) : 0;
|
|
18645
18908
|
}
|
|
18646
|
-
function getUrlQuery(url, key) {
|
|
18909
|
+
function getUrlQuery(url, key, key2) {
|
|
18647
18910
|
var x2 = new URLSearchParams(url.split("?")[1]);
|
|
18648
|
-
return x2.get(key);
|
|
18911
|
+
return x2.get(key) || x2.get(key2);
|
|
18649
18912
|
}
|
|
18650
18913
|
function getDeviceInfo() {
|
|
18651
18914
|
var res = {
|
|
@@ -18672,19 +18935,11 @@ var __publicField = (obj, key, value) => {
|
|
|
18672
18935
|
return player.plugins.hls;
|
|
18673
18936
|
} else if (player.plugins.rts) {
|
|
18674
18937
|
return player.plugins.rts;
|
|
18675
|
-
} else if (player.plugins.
|
|
18676
|
-
return player.plugins.
|
|
18677
|
-
}
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
return player.plugins.hlsvod;
|
|
18681
|
-
} else if (player.plugins.hlslivemobile) {
|
|
18682
|
-
return player.plugins.hlslivemobile;
|
|
18683
|
-
} else if (player.plugins.flvlivemobile) {
|
|
18684
|
-
return player.plugins.flvlivemobile;
|
|
18685
|
-
}
|
|
18686
|
-
}
|
|
18687
|
-
return player.newHls || player.newFlv || player.__core__ || player.flv;
|
|
18938
|
+
} else if (player.plugins.rtm) {
|
|
18939
|
+
return player.plugins.rtm;
|
|
18940
|
+
}
|
|
18941
|
+
}
|
|
18942
|
+
return null;
|
|
18688
18943
|
}
|
|
18689
18944
|
function getDefaultOptions(options) {
|
|
18690
18945
|
return {
|
|
@@ -18913,7 +19168,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18913
19168
|
live_sdk_version: getPlayerCore(player) || player.hlsOps ? "2" : "-1",
|
|
18914
19169
|
player_sdk_version: player.version,
|
|
18915
19170
|
// eslint-disable-next-line no-undef
|
|
18916
|
-
logger_version: "1.1.0-alpha.
|
|
19171
|
+
logger_version: "1.1.0-alpha.7",
|
|
18917
19172
|
// 由rollup 在编译时注入
|
|
18918
19173
|
report_version: "5",
|
|
18919
19174
|
product_line: options.product_line,
|
|
@@ -19037,9 +19292,13 @@ var __publicField = (obj, key, value) => {
|
|
|
19037
19292
|
if (this._player.video) {
|
|
19038
19293
|
log.play_current_time = this._player.currentTime;
|
|
19039
19294
|
}
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
|
|
19295
|
+
if (this.core && this.core.loader && this.core.loader.finnalUrl) {
|
|
19296
|
+
log.cdn_play_url = this.core.loader.finnalUrl;
|
|
19297
|
+
} else {
|
|
19298
|
+
log.cdn_play_url = url && url.startsWith("//") ? window.location.protocol + url : url;
|
|
19299
|
+
}
|
|
19300
|
+
log.live_stream_session_id = getUrlQuery(log.cdn_play_url, "_session_id", "session_id");
|
|
19301
|
+
log.play_format = getPlayFormat(log.cdn_play_url);
|
|
19043
19302
|
log.timestamp = getCurrentTime();
|
|
19044
19303
|
var _getDeviceInfo = getDeviceInfo(), cpu_core_number = _getDeviceInfo.cpu_core_number, memory_usage = _getDeviceInfo.memory_usage, network_downlink = _getDeviceInfo.network_downlink;
|
|
19045
19304
|
log.cpu_core_number = cpu_core_number;
|
|
@@ -19265,6 +19524,11 @@ var __publicField = (obj, key, value) => {
|
|
|
19265
19524
|
};
|
|
19266
19525
|
_proto2.reportStartPlay = function reportStartPlay() {
|
|
19267
19526
|
if (!this.started) {
|
|
19527
|
+
this.core = getPlayerCore(this.player);
|
|
19528
|
+
if (this.core) {
|
|
19529
|
+
this.commonParams.live_sdk_version = "2";
|
|
19530
|
+
this.logmanager.core = this.core;
|
|
19531
|
+
}
|
|
19268
19532
|
this.started = true;
|
|
19269
19533
|
this.log.start_play.start_play_time = this.log.start_play.timestamp = getCurrentTime();
|
|
19270
19534
|
this.logmanager.push(this.log.start_play, true);
|
|
@@ -19529,6 +19793,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19529
19793
|
this.core = getPlayerCore(this.player);
|
|
19530
19794
|
if (this.core) {
|
|
19531
19795
|
this.commonParams.live_sdk_version = "2";
|
|
19796
|
+
this.logmanager.core = this.core;
|
|
19532
19797
|
}
|
|
19533
19798
|
if (this.player.config.autoplay || this.player.config.videoInit) {
|
|
19534
19799
|
this.reportStartPlay();
|
|
@@ -20781,6 +21046,45 @@ var __publicField = (obj, key, value) => {
|
|
|
20781
21046
|
this.event("predefine_pageview", n2);
|
|
20782
21047
|
}, t2;
|
|
20783
21048
|
}(), q = new R("default");
|
|
21049
|
+
let getRandomValues;
|
|
21050
|
+
const rnds8 = new Uint8Array(16);
|
|
21051
|
+
function rng() {
|
|
21052
|
+
if (!getRandomValues) {
|
|
21053
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
21054
|
+
if (!getRandomValues) {
|
|
21055
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
21056
|
+
}
|
|
21057
|
+
}
|
|
21058
|
+
return getRandomValues(rnds8);
|
|
21059
|
+
}
|
|
21060
|
+
const byteToHex = [];
|
|
21061
|
+
for (let i2 = 0; i2 < 256; ++i2) {
|
|
21062
|
+
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
21063
|
+
}
|
|
21064
|
+
function unsafeStringify(arr, offset = 0) {
|
|
21065
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
21066
|
+
}
|
|
21067
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
21068
|
+
var native = {
|
|
21069
|
+
randomUUID
|
|
21070
|
+
};
|
|
21071
|
+
function v4(options, buf, offset) {
|
|
21072
|
+
if (native.randomUUID && !buf && !options) {
|
|
21073
|
+
return native.randomUUID();
|
|
21074
|
+
}
|
|
21075
|
+
options = options || {};
|
|
21076
|
+
const rnds = options.random || (options.rng || rng)();
|
|
21077
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
21078
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
21079
|
+
if (buf) {
|
|
21080
|
+
offset = offset || 0;
|
|
21081
|
+
for (let i2 = 0; i2 < 16; ++i2) {
|
|
21082
|
+
buf[offset + i2] = rnds[i2];
|
|
21083
|
+
}
|
|
21084
|
+
return buf;
|
|
21085
|
+
}
|
|
21086
|
+
return unsafeStringify(rnds);
|
|
21087
|
+
}
|
|
20784
21088
|
const DEVICE_ID_KEY = "veplayer_live_device_id";
|
|
20785
21089
|
const USER_ID_Key = "veplayer_live_user_id";
|
|
20786
21090
|
const genRandomID = (length) => {
|
|
@@ -20806,6 +21110,45 @@ var __publicField = (obj, key, value) => {
|
|
|
20806
21110
|
localStorage.setItem(USER_ID_Key, userId);
|
|
20807
21111
|
return userId;
|
|
20808
21112
|
};
|
|
21113
|
+
const generateUrlWithSessionId = (url) => {
|
|
21114
|
+
var _a, _b;
|
|
21115
|
+
if (!url) {
|
|
21116
|
+
return "";
|
|
21117
|
+
}
|
|
21118
|
+
const withoutProtocol = url.startsWith("//");
|
|
21119
|
+
if (withoutProtocol) {
|
|
21120
|
+
url = location.protocol + url;
|
|
21121
|
+
}
|
|
21122
|
+
try {
|
|
21123
|
+
const urlObject = new URL(url);
|
|
21124
|
+
if ((_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.get("_session_id")) {
|
|
21125
|
+
return url;
|
|
21126
|
+
}
|
|
21127
|
+
(_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append("_session_id", generateSessionId());
|
|
21128
|
+
return urlObject.toString();
|
|
21129
|
+
} catch (error2) {
|
|
21130
|
+
return url;
|
|
21131
|
+
}
|
|
21132
|
+
};
|
|
21133
|
+
const hashCode = (str) => {
|
|
21134
|
+
str += "";
|
|
21135
|
+
let h2 = 0;
|
|
21136
|
+
let off = 0;
|
|
21137
|
+
const len = str.length;
|
|
21138
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
21139
|
+
h2 = 31 * h2 + str.charCodeAt(off++);
|
|
21140
|
+
if (h2 > 140737488355327 || h2 < -140737488355328) {
|
|
21141
|
+
h2 &= 281474976710655;
|
|
21142
|
+
}
|
|
21143
|
+
}
|
|
21144
|
+
if (h2 < 0) {
|
|
21145
|
+
h2 += 2251799813685247;
|
|
21146
|
+
}
|
|
21147
|
+
return h2;
|
|
21148
|
+
};
|
|
21149
|
+
const generateSessionId = () => {
|
|
21150
|
+
return v4().replace(/-/g, "") + "." + Date.now() + "." + hashCode(v4().replace(/-/g, ""));
|
|
21151
|
+
};
|
|
20809
21152
|
const CN_APPID = 468759;
|
|
20810
21153
|
const CHANNEL = "cn";
|
|
20811
21154
|
const CHANNEL_DOMAIN = "//mcs.volceapplog.com";
|
|
@@ -20884,10 +21227,10 @@ var __publicField = (obj, key, value) => {
|
|
|
20884
21227
|
user_id: this._userId,
|
|
20885
21228
|
device_id: this._deviceId,
|
|
20886
21229
|
ext: {
|
|
20887
|
-
veplayer_version: "2.
|
|
20888
|
-
flv_version: "3.0.
|
|
20889
|
-
hls_version: "3.0.
|
|
20890
|
-
rts_version: "0.2.0-alpha.
|
|
21230
|
+
veplayer_version: "2.1.0-rc.0",
|
|
21231
|
+
flv_version: "3.0.10-alpha.4",
|
|
21232
|
+
hls_version: "3.0.10-alpha.4",
|
|
21233
|
+
rts_version: "0.2.0-alpha.5"
|
|
20891
21234
|
}
|
|
20892
21235
|
});
|
|
20893
21236
|
}
|
|
@@ -21164,6 +21507,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21164
21507
|
autoplay: { muted: true }
|
|
21165
21508
|
};
|
|
21166
21509
|
const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
|
|
21510
|
+
var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
|
|
21511
|
+
RTMCodec2["H264"] = "h264";
|
|
21512
|
+
return RTMCodec2;
|
|
21513
|
+
})(RTMCodec || {});
|
|
21167
21514
|
class VePlayerLive extends VePlayerBase {
|
|
21168
21515
|
/**
|
|
21169
21516
|
* @hidden
|
|
@@ -21203,6 +21550,8 @@ var __publicField = (obj, key, value) => {
|
|
|
21203
21550
|
}
|
|
21204
21551
|
}
|
|
21205
21552
|
async function createLivePlayer(options) {
|
|
21553
|
+
var _a, _b;
|
|
21554
|
+
let player = void 0;
|
|
21206
21555
|
if (!options || !options.url && !options.playlist) {
|
|
21207
21556
|
throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
|
|
21208
21557
|
}
|
|
@@ -21211,18 +21560,35 @@ var __publicField = (obj, key, value) => {
|
|
|
21211
21560
|
...options,
|
|
21212
21561
|
plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
|
|
21213
21562
|
};
|
|
21214
|
-
|
|
21563
|
+
player = await VePlayerBase.create(
|
|
21215
21564
|
{
|
|
21216
21565
|
...LIVE_DEFAULT_OPTIONS,
|
|
21217
21566
|
...finalOptions,
|
|
21218
21567
|
isLive: true,
|
|
21219
21568
|
i18nManager: i18n,
|
|
21569
|
+
preProcessUrl: (url) => {
|
|
21570
|
+
return {
|
|
21571
|
+
url: generateUrlWithSessionId(url)
|
|
21572
|
+
};
|
|
21573
|
+
},
|
|
21220
21574
|
async preparePlugins(url) {
|
|
21221
|
-
return getTypeStrategy({ ...finalOptions, url });
|
|
21575
|
+
return getTypeStrategy({ ...finalOptions, url }, player);
|
|
21222
21576
|
}
|
|
21223
21577
|
},
|
|
21224
21578
|
VePlayerLive
|
|
21225
21579
|
);
|
|
21580
|
+
if (player) {
|
|
21581
|
+
const RTMDegrade = (_b = (_a = player == null ? void 0 : player._player) == null ? void 0 : _a.config) == null ? void 0 : _b._RTMdegrade;
|
|
21582
|
+
if (RTMDegrade) {
|
|
21583
|
+
player.emit("degrade", {
|
|
21584
|
+
originRtmUrl: RTMDegrade._originRtmUrl,
|
|
21585
|
+
code: "NOT_SUPPORT",
|
|
21586
|
+
message: "not support rtm or h264",
|
|
21587
|
+
isRTMSupported: RTMDegrade._isRTMSupported,
|
|
21588
|
+
isRTMSupportCodec: RTMDegrade._isRTMSupportCodec
|
|
21589
|
+
});
|
|
21590
|
+
}
|
|
21591
|
+
}
|
|
21226
21592
|
return player;
|
|
21227
21593
|
}
|
|
21228
21594
|
var live = /* @__PURE__ */ Object.freeze({
|