@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
|
@@ -1015,6 +1015,9 @@ util$1.isMSE = function(video) {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
return /^blob/.test(video.currentSrc) || /^blob/.test(video.src);
|
|
1017
1017
|
};
|
|
1018
|
+
util$1.isBlob = function(url) {
|
|
1019
|
+
return /^blob/.test(url);
|
|
1020
|
+
};
|
|
1018
1021
|
util$1.generateSessionId = function() {
|
|
1019
1022
|
var did = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
1020
1023
|
var d2 = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -1075,6 +1078,69 @@ util$1.convertDeg = function(val) {
|
|
|
1075
1078
|
}
|
|
1076
1079
|
return val % 360;
|
|
1077
1080
|
};
|
|
1081
|
+
util$1.getIndexByTime = function(time, segments) {
|
|
1082
|
+
var _len = segments.length;
|
|
1083
|
+
var _index = -1;
|
|
1084
|
+
if (_len < 1) {
|
|
1085
|
+
return _index;
|
|
1086
|
+
}
|
|
1087
|
+
if (time <= segments[0].end || _len < 2) {
|
|
1088
|
+
_index = 0;
|
|
1089
|
+
} else if (time > segments[_len - 1].end) {
|
|
1090
|
+
_index = _len - 1;
|
|
1091
|
+
} else {
|
|
1092
|
+
for (var i2 = 1; i2 < _len; i2++) {
|
|
1093
|
+
if (time > segments[i2 - 1].end && time <= segments[i2].end) {
|
|
1094
|
+
_index = i2;
|
|
1095
|
+
break;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
return _index;
|
|
1100
|
+
};
|
|
1101
|
+
util$1.getOffsetCurrentTime = function(currentTime, segments) {
|
|
1102
|
+
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
|
|
1103
|
+
var _index = -1;
|
|
1104
|
+
if (index >= 0 && index < segments.length) {
|
|
1105
|
+
_index = index;
|
|
1106
|
+
} else {
|
|
1107
|
+
_index = util$1.getIndexByTime(currentTime, segments);
|
|
1108
|
+
}
|
|
1109
|
+
if (_index < 0) {
|
|
1110
|
+
return -1;
|
|
1111
|
+
}
|
|
1112
|
+
var _len = segments.length;
|
|
1113
|
+
var _segments$_index = segments[_index], start = _segments$_index.start, end = _segments$_index.end, cTime = _segments$_index.cTime, offset = _segments$_index.offset;
|
|
1114
|
+
if (currentTime < start) {
|
|
1115
|
+
return cTime;
|
|
1116
|
+
} else if (currentTime >= start && currentTime <= end) {
|
|
1117
|
+
return currentTime - offset;
|
|
1118
|
+
} else if (currentTime > end && _index >= _len - 1) {
|
|
1119
|
+
return end;
|
|
1120
|
+
}
|
|
1121
|
+
return -1;
|
|
1122
|
+
};
|
|
1123
|
+
util$1.getCurrentTimeByOffset = function(offsetTime, segments) {
|
|
1124
|
+
var _index = -1;
|
|
1125
|
+
if (!segments || segments.length < 0) {
|
|
1126
|
+
return offsetTime;
|
|
1127
|
+
}
|
|
1128
|
+
for (var i2 = 0; i2 < segments.length; i2++) {
|
|
1129
|
+
if (offsetTime <= segments[i2].duration) {
|
|
1130
|
+
_index = i2;
|
|
1131
|
+
break;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (_index !== -1) {
|
|
1135
|
+
var start = segments[_index].start;
|
|
1136
|
+
if (_index - 1 < 0) {
|
|
1137
|
+
return start + offsetTime;
|
|
1138
|
+
} else {
|
|
1139
|
+
return start + (offsetTime - segments[_index - 1].duration);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return offsetTime;
|
|
1143
|
+
};
|
|
1078
1144
|
function isObject$1(value) {
|
|
1079
1145
|
var type = _typeof(value);
|
|
1080
1146
|
return value !== null && (type === "object" || type === "function");
|
|
@@ -1164,7 +1230,7 @@ function debounce$2(func, wait, options) {
|
|
|
1164
1230
|
function debounced() {
|
|
1165
1231
|
var time = Date.now();
|
|
1166
1232
|
var isInvoking = shouldInvoke(time);
|
|
1167
|
-
for (var
|
|
1233
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key = 0; _key < _len2; _key++) {
|
|
1168
1234
|
args[_key] = arguments[_key];
|
|
1169
1235
|
}
|
|
1170
1236
|
lastArgs = args;
|
|
@@ -1371,7 +1437,7 @@ var sniffer$1 = {
|
|
|
1371
1437
|
}
|
|
1372
1438
|
}
|
|
1373
1439
|
};
|
|
1374
|
-
var version = "3.0.
|
|
1440
|
+
var version = "3.0.10-alpha.4";
|
|
1375
1441
|
var ERROR_TYPE_MAP = {
|
|
1376
1442
|
1: "media",
|
|
1377
1443
|
2: "media",
|
|
@@ -1457,6 +1523,7 @@ var CANPLAY_THROUGH = "canplaythrough";
|
|
|
1457
1523
|
var DURATION_CHANGE = "durationchange";
|
|
1458
1524
|
var VOLUME_CHANGE = "volumechange";
|
|
1459
1525
|
var LOADED_DATA = "loadeddata";
|
|
1526
|
+
var LOADED_METADATA = "loadedmetadata";
|
|
1460
1527
|
var RATE_CHANGE = "ratechange";
|
|
1461
1528
|
var PROGRESS = "progress";
|
|
1462
1529
|
var LOAD_START = "loadstart";
|
|
@@ -1496,7 +1563,7 @@ var RESET = "reset";
|
|
|
1496
1563
|
var SOURCE_ERROR = "source_error";
|
|
1497
1564
|
var SOURCE_SUCCESS = "source_success";
|
|
1498
1565
|
var SWITCH_SUBTITLE = "switch_subtitle";
|
|
1499
|
-
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"];
|
|
1566
|
+
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"];
|
|
1500
1567
|
var STATS_EVENTS = {
|
|
1501
1568
|
STATS_INFO: "stats_info",
|
|
1502
1569
|
STATS_DOWNLOAD: "stats_download",
|
|
@@ -1525,6 +1592,7 @@ var XGEvents = /* @__PURE__ */ Object.freeze({
|
|
|
1525
1592
|
FPS_STUCK,
|
|
1526
1593
|
FULLSCREEN_CHANGE,
|
|
1527
1594
|
LOADED_DATA,
|
|
1595
|
+
LOADED_METADATA,
|
|
1528
1596
|
LOAD_START,
|
|
1529
1597
|
MINI_STATE_CHANGE,
|
|
1530
1598
|
PAUSE,
|
|
@@ -1662,6 +1730,9 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
1662
1730
|
if (options.loop) {
|
|
1663
1731
|
_this.mediaConfig.loop = "loop";
|
|
1664
1732
|
}
|
|
1733
|
+
if (options.autoplayMuted && !Object.prototype.hasOwnProperty.call(_this.mediaConfig, "muted")) {
|
|
1734
|
+
_this.mediaConfig.muted = true;
|
|
1735
|
+
}
|
|
1665
1736
|
_this.media = util$1.createDom(_this.mediaConfig.mediaType, "", _this.mediaConfig, "");
|
|
1666
1737
|
if (options.defaultPlaybackRate) {
|
|
1667
1738
|
_this.media.defaultPlaybackRate = _this.media.playbackRate = options.defaultPlaybackRate;
|
|
@@ -1740,10 +1811,11 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
1740
1811
|
var _this6 = this;
|
|
1741
1812
|
video.removeAttribute("src");
|
|
1742
1813
|
video.load();
|
|
1743
|
-
urls.forEach(function(item) {
|
|
1814
|
+
urls.forEach(function(item, index) {
|
|
1744
1815
|
_this6.media.appendChild(util$1.createDom("source", "", {
|
|
1745
1816
|
src: "".concat(item.src),
|
|
1746
|
-
type: "".concat(item.type || "")
|
|
1817
|
+
type: "".concat(item.type || ""),
|
|
1818
|
+
"data-index": index + 1
|
|
1747
1819
|
}));
|
|
1748
1820
|
});
|
|
1749
1821
|
var _c = video.children;
|
|
@@ -1751,6 +1823,7 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
1751
1823
|
return;
|
|
1752
1824
|
}
|
|
1753
1825
|
this._videoSourceCount = _c.length;
|
|
1826
|
+
this._videoSourceIndex = _c.length;
|
|
1754
1827
|
this._vLoadeddata = function(e3) {
|
|
1755
1828
|
_this6.emit(SOURCE_SUCCESS, {
|
|
1756
1829
|
src: e3.target.currentSrc,
|
|
@@ -1765,8 +1838,9 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
1765
1838
|
}
|
|
1766
1839
|
}
|
|
1767
1840
|
!this._sourceError && (this._sourceError = function(e3) {
|
|
1768
|
-
|
|
1769
|
-
|
|
1841
|
+
var _dIndex = parseInt(e3.target.getAttribute("data-index"), 10);
|
|
1842
|
+
_this6._videoSourceIndex--;
|
|
1843
|
+
if (_this6._videoSourceIndex === 0 || _dIndex >= _this6._videoSourceCount) {
|
|
1770
1844
|
var _err = {
|
|
1771
1845
|
code: 4,
|
|
1772
1846
|
message: "sources_load_error"
|
|
@@ -2093,7 +2167,7 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
2093
2167
|
this.emit(WAITING);
|
|
2094
2168
|
this._currentTime = 0;
|
|
2095
2169
|
this._duration = 0;
|
|
2096
|
-
if (
|
|
2170
|
+
if (util$1.isMSE(this.media)) {
|
|
2097
2171
|
this.onWaiting();
|
|
2098
2172
|
return;
|
|
2099
2173
|
}
|
|
@@ -3801,6 +3875,7 @@ function getDefaultConfig$1() {
|
|
|
3801
3875
|
},
|
|
3802
3876
|
enableSwipeHandler: function enableSwipeHandler() {
|
|
3803
3877
|
},
|
|
3878
|
+
preProcessUrl: null,
|
|
3804
3879
|
ignores: [],
|
|
3805
3880
|
whitelist: [],
|
|
3806
3881
|
inactive: 3e3,
|
|
@@ -3882,7 +3957,7 @@ var Controls = /* @__PURE__ */ function(_Plugin) {
|
|
|
3882
3957
|
autoHide: false
|
|
3883
3958
|
});
|
|
3884
3959
|
});
|
|
3885
|
-
_defineProperty$1(_assertThisInitialized(_this), "onMouseLeave", function() {
|
|
3960
|
+
_defineProperty$1(_assertThisInitialized(_this), "onMouseLeave", function(e3) {
|
|
3886
3961
|
var _assertThisInitialize2 = _assertThisInitialized(_this), player = _assertThisInitialize2.player;
|
|
3887
3962
|
player.focus();
|
|
3888
3963
|
});
|
|
@@ -3960,12 +4035,13 @@ var Controls = /* @__PURE__ */ function(_Plugin) {
|
|
|
3960
4035
|
}, {
|
|
3961
4036
|
key: "show",
|
|
3962
4037
|
value: function show() {
|
|
3963
|
-
|
|
4038
|
+
this.root.style.display = "";
|
|
4039
|
+
this.player.focus();
|
|
3964
4040
|
}
|
|
3965
4041
|
}, {
|
|
3966
4042
|
key: "hide",
|
|
3967
4043
|
value: function hide() {
|
|
3968
|
-
|
|
4044
|
+
this.root.style.display = "none";
|
|
3969
4045
|
}
|
|
3970
4046
|
}, {
|
|
3971
4047
|
key: "mode",
|
|
@@ -4367,6 +4443,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4367
4443
|
_this.cssfullscreen = false;
|
|
4368
4444
|
_this.isRotateFullscreen = false;
|
|
4369
4445
|
_this._fullscreenEl = null;
|
|
4446
|
+
_this.timeSegments = [];
|
|
4370
4447
|
_this._cssfullscreenEl = null;
|
|
4371
4448
|
_this.curDefinition = null;
|
|
4372
4449
|
_this._orgCss = "";
|
|
@@ -4376,7 +4453,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4376
4453
|
_this.videoPos = {
|
|
4377
4454
|
pi: 1,
|
|
4378
4455
|
scale: 0,
|
|
4379
|
-
rotate:
|
|
4456
|
+
rotate: -1,
|
|
4380
4457
|
x: 0,
|
|
4381
4458
|
y: 0,
|
|
4382
4459
|
h: -1,
|
|
@@ -4384,11 +4461,21 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4384
4461
|
vy: 0,
|
|
4385
4462
|
vx: 0
|
|
4386
4463
|
};
|
|
4464
|
+
_this.sizeInfo = {
|
|
4465
|
+
width: 0,
|
|
4466
|
+
height: 0,
|
|
4467
|
+
left: 0,
|
|
4468
|
+
top: 0
|
|
4469
|
+
};
|
|
4387
4470
|
_this._accPlayed = {
|
|
4388
4471
|
t: 0,
|
|
4389
4472
|
acc: 0,
|
|
4390
4473
|
loopAcc: 0
|
|
4391
4474
|
};
|
|
4475
|
+
_this._offsetInfo = {
|
|
4476
|
+
currentTime: -1,
|
|
4477
|
+
duration: 0
|
|
4478
|
+
};
|
|
4392
4479
|
_this.innerContainer = null;
|
|
4393
4480
|
_this.controls = null;
|
|
4394
4481
|
_this.topBar = null;
|
|
@@ -4401,6 +4488,9 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4401
4488
|
_this.isUserActive = false;
|
|
4402
4489
|
_this._onceSeekCanplay = null;
|
|
4403
4490
|
_this._isPauseBeforeSeek = 0;
|
|
4491
|
+
_this.innerStates = {
|
|
4492
|
+
isActiveLocked: false
|
|
4493
|
+
};
|
|
4404
4494
|
var rootInit = _this._initDOM();
|
|
4405
4495
|
if (!rootInit) {
|
|
4406
4496
|
console.error(new Error("can't find the dom which id is ".concat(_this.config.id, " or this.config.el does not exist")));
|
|
@@ -4486,16 +4576,16 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4486
4576
|
this.addClass(STATE_CLASS.NO_START);
|
|
4487
4577
|
}
|
|
4488
4578
|
if (this.config.fluid) {
|
|
4489
|
-
var _this$config3 = this.config,
|
|
4490
|
-
if (typeof
|
|
4491
|
-
|
|
4492
|
-
|
|
4579
|
+
var _this$config3 = this.config, _width = _this$config3.width, _height = _this$config3.height;
|
|
4580
|
+
if (typeof _width !== "number" || typeof _height !== "number") {
|
|
4581
|
+
_width = 600;
|
|
4582
|
+
_height = 337.5;
|
|
4493
4583
|
}
|
|
4494
4584
|
var style = {
|
|
4495
4585
|
width: "100%",
|
|
4496
4586
|
height: "0",
|
|
4497
4587
|
"max-width": "100%",
|
|
4498
|
-
"padding-top": "".concat(
|
|
4588
|
+
"padding-top": "".concat(_height * 100 / _width, "%")
|
|
4499
4589
|
};
|
|
4500
4590
|
Object.keys(style).forEach(function(key) {
|
|
4501
4591
|
_this2.root.style[key] = style[key];
|
|
@@ -4511,6 +4601,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4511
4601
|
}
|
|
4512
4602
|
});
|
|
4513
4603
|
}
|
|
4604
|
+
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;
|
|
4605
|
+
this.sizeInfo.width = width;
|
|
4606
|
+
this.sizeInfo.height = height;
|
|
4607
|
+
this.sizeInfo.left = left;
|
|
4608
|
+
this.sizeInfo.top = top;
|
|
4514
4609
|
return true;
|
|
4515
4610
|
}
|
|
4516
4611
|
}, {
|
|
@@ -4594,7 +4689,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4594
4689
|
var readyState = this.media.readyState;
|
|
4595
4690
|
XG_DEBUG.logInfo("_startInit readyState", readyState);
|
|
4596
4691
|
if (this.config.autoplay) {
|
|
4597
|
-
!
|
|
4692
|
+
!util$1.isMSE(this.media) && this.load();
|
|
4598
4693
|
(sniffer$1.os.isIpad || sniffer$1.os.isPhone) && this.mediaPlay();
|
|
4599
4694
|
}
|
|
4600
4695
|
if (readyState >= 2) {
|
|
@@ -4822,7 +4917,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4822
4917
|
if (!url) {
|
|
4823
4918
|
url = _this8.url || _this8.config.url;
|
|
4824
4919
|
}
|
|
4825
|
-
var
|
|
4920
|
+
var _furl = _this8.preProcessUrl(url);
|
|
4921
|
+
var ret = _this8._startInit(_furl.url);
|
|
4826
4922
|
return ret;
|
|
4827
4923
|
}).catch(function(e3) {
|
|
4828
4924
|
e3.fileName = "player";
|
|
@@ -4839,6 +4935,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4839
4935
|
if (util$1.typeOf(url) === "Object") {
|
|
4840
4936
|
_src = url.url;
|
|
4841
4937
|
}
|
|
4938
|
+
_src = this.preProcessUrl(_src).url;
|
|
4842
4939
|
var curTime = this.currentTime;
|
|
4843
4940
|
var isPaused = this.paused && !this.isError;
|
|
4844
4941
|
this.src = _src;
|
|
@@ -5177,7 +5274,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5177
5274
|
this.addClass(STATE_CLASS.LOADING);
|
|
5178
5275
|
runHooks(this, "retry", function() {
|
|
5179
5276
|
var cur = _this20.currentTime;
|
|
5180
|
-
|
|
5277
|
+
var url = _this20.config.url;
|
|
5278
|
+
var _srcRet = !util$1.isMSE(_this20.media) ? _this20.preProcessUrl(url) : {
|
|
5279
|
+
url
|
|
5280
|
+
};
|
|
5281
|
+
_this20.src = _srcRet.url;
|
|
5181
5282
|
!_this20.config.isLive && (_this20.currentTime = cur);
|
|
5182
5283
|
_this20.once(CANPLAY, function() {
|
|
5183
5284
|
_this20.mediaPlay();
|
|
@@ -5238,7 +5339,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5238
5339
|
var fullEl = util$1.getFullScreenEl();
|
|
5239
5340
|
if (fullEl === this._fullscreenEl) {
|
|
5240
5341
|
this.onFullscreenChange();
|
|
5241
|
-
return;
|
|
5342
|
+
return Promise.resolve();
|
|
5242
5343
|
}
|
|
5243
5344
|
try {
|
|
5244
5345
|
for (var i2 = 0; i2 < GET_FULLSCREEN_API.length; i2++) {
|
|
@@ -5411,30 +5512,38 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5411
5512
|
key: "onFocus",
|
|
5412
5513
|
value: function onFocus() {
|
|
5413
5514
|
var _this21 = this;
|
|
5414
|
-
var
|
|
5515
|
+
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
5516
|
+
autoHide: true,
|
|
5517
|
+
delay: 3e3
|
|
5518
|
+
};
|
|
5519
|
+
var innerStates = this.innerStates;
|
|
5415
5520
|
this.isActive = true;
|
|
5416
5521
|
this.removeClass(STATE_CLASS.INACTIVE);
|
|
5417
5522
|
if (this.userTimer) {
|
|
5418
5523
|
util$1.clearTimeout(this, this.userTimer);
|
|
5419
5524
|
this.userTimer = null;
|
|
5420
5525
|
}
|
|
5421
|
-
if (
|
|
5526
|
+
if (data.isLock !== void 0) {
|
|
5527
|
+
innerStates.isActiveLocked = data.isLock;
|
|
5528
|
+
}
|
|
5529
|
+
if (data.autoHide === false || data.isLock === true || innerStates.isActiveLocked) {
|
|
5422
5530
|
if (this.userTimer) {
|
|
5423
5531
|
util$1.clearTimeout(this, this.userTimer);
|
|
5424
5532
|
this.userTimer = null;
|
|
5425
5533
|
}
|
|
5426
5534
|
return;
|
|
5427
5535
|
}
|
|
5536
|
+
var time = data && data.delay ? data.delay : this.config.inactive;
|
|
5428
5537
|
this.userTimer = util$1.setTimeout(this, function() {
|
|
5429
5538
|
_this21.userTimer = null;
|
|
5430
5539
|
_this21.blur();
|
|
5431
|
-
},
|
|
5540
|
+
}, time);
|
|
5432
5541
|
}
|
|
5433
5542
|
}, {
|
|
5434
5543
|
key: "onBlur",
|
|
5435
5544
|
value: function onBlur() {
|
|
5436
|
-
var
|
|
5437
|
-
if (!this.isActive) {
|
|
5545
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$ignorePaused = _ref.ignorePaused, ignorePaused = _ref$ignorePaused === void 0 ? false : _ref$ignorePaused;
|
|
5546
|
+
if (!this.isActive || this.innerStates.isActiveLocked) {
|
|
5438
5547
|
return;
|
|
5439
5548
|
}
|
|
5440
5549
|
var closePauseVideoFocus = this.config.closePauseVideoFocus;
|
|
@@ -5557,7 +5666,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5557
5666
|
}, {
|
|
5558
5667
|
key: "onTimeupdate",
|
|
5559
5668
|
value: function onTimeupdate() {
|
|
5560
|
-
!this._videoHeight && this.resize();
|
|
5669
|
+
!this._videoHeight && this.media.videoHeight && this.resize();
|
|
5561
5670
|
if ((this.waitTimer || this.hasClass(STATE_CLASS.LOADING)) && this.media.readyState > 2) {
|
|
5562
5671
|
this.removeClass(STATE_CLASS.LOADING);
|
|
5563
5672
|
util$1.clearTimeout(this, this.waitTimer);
|
|
@@ -5632,8 +5741,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5632
5741
|
key: "resizePosition",
|
|
5633
5742
|
value: function resizePosition() {
|
|
5634
5743
|
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;
|
|
5744
|
+
if (rotate < 0 && !vy && !vx) {
|
|
5745
|
+
return;
|
|
5746
|
+
}
|
|
5635
5747
|
var _pi = this.videoPos._pi;
|
|
5636
|
-
if (!_pi) {
|
|
5748
|
+
if (!_pi && this.media.videoHeight) {
|
|
5637
5749
|
_pi = this.media.videoWidth / this.media.videoHeight * 100;
|
|
5638
5750
|
}
|
|
5639
5751
|
if (!_pi) {
|
|
@@ -5733,9 +5845,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5733
5845
|
if (!this.media) {
|
|
5734
5846
|
return;
|
|
5735
5847
|
}
|
|
5848
|
+
var containerSize = this.root.getBoundingClientRect();
|
|
5849
|
+
this.sizeInfo.width = containerSize.width;
|
|
5850
|
+
this.sizeInfo.height = containerSize.height;
|
|
5851
|
+
this.sizeInfo.left = containerSize.left;
|
|
5852
|
+
this.sizeInfo.top = containerSize.top;
|
|
5736
5853
|
var _this$media = this.media, videoWidth = _this$media.videoWidth, videoHeight = _this$media.videoHeight;
|
|
5737
5854
|
var _this$config6 = this.config, fitVideoSize = _this$config6.fitVideoSize, videoFillMode = _this$config6.videoFillMode;
|
|
5738
|
-
if (videoFillMode === "fill" || videoFillMode === "cover") {
|
|
5855
|
+
if (videoFillMode === "fill" || videoFillMode === "cover" || videoFillMode === "contain") {
|
|
5739
5856
|
this.setAttribute("data-xgfill", videoFillMode);
|
|
5740
5857
|
}
|
|
5741
5858
|
if (!videoHeight || !videoWidth) {
|
|
@@ -5743,7 +5860,6 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5743
5860
|
}
|
|
5744
5861
|
this._videoHeight = videoHeight;
|
|
5745
5862
|
this._videoWidth = videoWidth;
|
|
5746
|
-
var containerSize = this.root.getBoundingClientRect();
|
|
5747
5863
|
var controlsHeight = this.controls && this.innerContainer ? this.controls.root.getBoundingClientRect().height : 0;
|
|
5748
5864
|
var width = containerSize.width;
|
|
5749
5865
|
var height = containerSize.height - controlsHeight;
|
|
@@ -5798,6 +5914,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5798
5914
|
XG_DEBUG.logInfo("setState", "state from:".concat(STATE_ARRAY[this.state], " to:").concat(STATE_ARRAY[newState]));
|
|
5799
5915
|
this._state = newState;
|
|
5800
5916
|
}
|
|
5917
|
+
}, {
|
|
5918
|
+
key: "preProcessUrl",
|
|
5919
|
+
value: function preProcessUrl(url, ext) {
|
|
5920
|
+
var preProcessUrl2 = this.config.preProcessUrl;
|
|
5921
|
+
return !util$1.isBlob(url) && preProcessUrl2 && typeof preProcessUrl2 === "function" ? preProcessUrl2(url, ext) : {
|
|
5922
|
+
url
|
|
5923
|
+
};
|
|
5924
|
+
}
|
|
5801
5925
|
}, {
|
|
5802
5926
|
key: "state",
|
|
5803
5927
|
get: function get() {
|
|
@@ -5971,9 +6095,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5971
6095
|
}, {
|
|
5972
6096
|
key: "cumulateTime",
|
|
5973
6097
|
get: function get() {
|
|
5974
|
-
var _accPlayed = this._accPlayed;
|
|
5975
|
-
|
|
5976
|
-
return _accPlayed.acc;
|
|
6098
|
+
var _this$_accPlayed = this._accPlayed, acc = _this$_accPlayed.acc, t2 = _this$_accPlayed.t;
|
|
6099
|
+
return t2 ? (/* @__PURE__ */ new Date()).getTime() - t2 + acc : acc;
|
|
5977
6100
|
}
|
|
5978
6101
|
}, {
|
|
5979
6102
|
key: "zoom",
|
|
@@ -6012,6 +6135,22 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6012
6135
|
set: function set(val) {
|
|
6013
6136
|
REAL_TIME_SPEED = val;
|
|
6014
6137
|
}
|
|
6138
|
+
}, {
|
|
6139
|
+
key: "offsetCurrentTime",
|
|
6140
|
+
get: function get() {
|
|
6141
|
+
return this._offsetInfo.currentTime || 0;
|
|
6142
|
+
},
|
|
6143
|
+
set: function set(val) {
|
|
6144
|
+
this._offsetInfo.currentTime = val;
|
|
6145
|
+
}
|
|
6146
|
+
}, {
|
|
6147
|
+
key: "offsetDuration",
|
|
6148
|
+
get: function get() {
|
|
6149
|
+
return this._offsetInfo.duration || 0;
|
|
6150
|
+
},
|
|
6151
|
+
set: function set(val) {
|
|
6152
|
+
this._offsetInfo.duration = val || 0;
|
|
6153
|
+
}
|
|
6015
6154
|
}, {
|
|
6016
6155
|
key: "hook",
|
|
6017
6156
|
value: function hook$1(hookName, handler) {
|
|
@@ -7684,10 +7823,56 @@ function getDefaultConfig() {
|
|
|
7684
7823
|
var Touche = /* @__PURE__ */ function() {
|
|
7685
7824
|
function Touche2(dom) {
|
|
7686
7825
|
var _this = this;
|
|
7687
|
-
var
|
|
7826
|
+
var _config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
7688
7827
|
eventType: "touch"
|
|
7689
7828
|
};
|
|
7690
7829
|
_classCallCheck(this, Touche2);
|
|
7830
|
+
_defineProperty$1(this, "onTouchStart", function(e3) {
|
|
7831
|
+
var _pos = _this._pos, root2 = _this.root;
|
|
7832
|
+
var touch = getTouch(e3.touches);
|
|
7833
|
+
_pos.x = touch ? parseInt(touch.pageX, 10) : e3.pageX;
|
|
7834
|
+
_pos.y = touch ? parseInt(touch.pageX, 10) : e3.pageX;
|
|
7835
|
+
_pos.start = true;
|
|
7836
|
+
_this.__setPress(e3);
|
|
7837
|
+
root2.addEventListener(_this.events.end, _this.onTouchEnd);
|
|
7838
|
+
root2.addEventListener(_this.events.cancel, _this.onTouchCancel);
|
|
7839
|
+
root2.addEventListener(_this.events.move, _this.onTouchMove);
|
|
7840
|
+
_this.trigger(EVENTS.TOUCH_START, e3);
|
|
7841
|
+
});
|
|
7842
|
+
_defineProperty$1(this, "onTouchCancel", function(e3) {
|
|
7843
|
+
_this.onTouchEnd(e3);
|
|
7844
|
+
});
|
|
7845
|
+
_defineProperty$1(this, "onTouchEnd", function(e3) {
|
|
7846
|
+
var _pos = _this._pos, root2 = _this.root;
|
|
7847
|
+
_this.__clearPress();
|
|
7848
|
+
root2.removeEventListener(_this.events.cancel, _this.onTouchCancel);
|
|
7849
|
+
root2.removeEventListener(_this.events.end, _this.onTouchEnd);
|
|
7850
|
+
root2.removeEventListener(_this.events.move, _this.onTouchMove);
|
|
7851
|
+
e3.moving = _pos.moving;
|
|
7852
|
+
e3.press = _pos.press;
|
|
7853
|
+
_pos.press && _this.trigger(EVENTS.PRESS_END, e3);
|
|
7854
|
+
_this.trigger(EVENTS.TOUCH_END, e3);
|
|
7855
|
+
!_pos.press && !_pos.moving && _this.__setDb(e3);
|
|
7856
|
+
_pos.press = false;
|
|
7857
|
+
_pos.start = false;
|
|
7858
|
+
_pos.moving = false;
|
|
7859
|
+
});
|
|
7860
|
+
_defineProperty$1(this, "onTouchMove", function(e3) {
|
|
7861
|
+
var _pos = _this._pos, config = _this.config;
|
|
7862
|
+
var touch = getTouch(e3.touches);
|
|
7863
|
+
var x2 = touch ? parseInt(touch.pageX, 10) : e3.pageX;
|
|
7864
|
+
var y2 = touch ? parseInt(touch.pageY, 10) : e3.pageX;
|
|
7865
|
+
var diffx = x2 - _pos.x;
|
|
7866
|
+
var diffy = y2 - _pos.y;
|
|
7867
|
+
if (Math.abs(diffy) < config.miniStep && Math.abs(diffx) < config.miniStep) {
|
|
7868
|
+
return;
|
|
7869
|
+
}
|
|
7870
|
+
_this.__clearPress();
|
|
7871
|
+
_pos.press && _this.trigger(EVENTS.PRESS_END, e3);
|
|
7872
|
+
_pos.press = false;
|
|
7873
|
+
_pos.moving = true;
|
|
7874
|
+
_this.trigger(EVENTS.TOUCH_MOVE, e3);
|
|
7875
|
+
});
|
|
7691
7876
|
this._pos = {
|
|
7692
7877
|
moving: false,
|
|
7693
7878
|
start: false,
|
|
@@ -7695,11 +7880,11 @@ var Touche = /* @__PURE__ */ function() {
|
|
|
7695
7880
|
y: 0
|
|
7696
7881
|
};
|
|
7697
7882
|
this.config = getDefaultConfig();
|
|
7698
|
-
Object.keys(
|
|
7699
|
-
_this.config[key] =
|
|
7883
|
+
Object.keys(_config).map(function(key) {
|
|
7884
|
+
_this.config[key] = _config[key];
|
|
7700
7885
|
});
|
|
7701
7886
|
this.root = dom;
|
|
7702
|
-
this.events =
|
|
7887
|
+
this.events = _config.eventType === "mouse" ? MOUSES : TOUCHS;
|
|
7703
7888
|
this.pressIntrvalId = null;
|
|
7704
7889
|
this.dbIntrvalId = null;
|
|
7705
7890
|
this.__handlers = {};
|
|
@@ -7708,10 +7893,6 @@ var Touche = /* @__PURE__ */ function() {
|
|
|
7708
7893
|
_createClass$1(Touche2, [{
|
|
7709
7894
|
key: "_initEvent",
|
|
7710
7895
|
value: function _initEvent() {
|
|
7711
|
-
this.onTouchStart = this.onTouchStart.bind(this);
|
|
7712
|
-
this.onTouchMove = this.onTouchMove.bind(this);
|
|
7713
|
-
this.onTouchEnd = this.onTouchEnd.bind(this);
|
|
7714
|
-
this.onTouchCancel = this.onTouchCancel.bind(this);
|
|
7715
7896
|
this.root.addEventListener(this.events.start, this.onTouchStart);
|
|
7716
7897
|
}
|
|
7717
7898
|
}, {
|
|
@@ -7797,60 +7978,6 @@ var Touche = /* @__PURE__ */ function() {
|
|
|
7797
7978
|
}
|
|
7798
7979
|
});
|
|
7799
7980
|
}
|
|
7800
|
-
}, {
|
|
7801
|
-
key: "onTouchStart",
|
|
7802
|
-
value: function onTouchStart(e3) {
|
|
7803
|
-
var _pos = this._pos, root2 = this.root;
|
|
7804
|
-
var touch = getTouch(e3.touches);
|
|
7805
|
-
_pos.x = touch ? parseInt(touch.pageX, 10) : e3.pageX;
|
|
7806
|
-
_pos.y = touch ? parseInt(touch.pageX, 10) : e3.pageX;
|
|
7807
|
-
_pos.start = true;
|
|
7808
|
-
this.__setPress(e3);
|
|
7809
|
-
root2.addEventListener(this.events.end, this.onTouchEnd);
|
|
7810
|
-
root2.addEventListener(this.events.cancel, this.onTouchCancel);
|
|
7811
|
-
root2.addEventListener(this.events.move, this.onTouchMove);
|
|
7812
|
-
this.trigger(EVENTS.TOUCH_START, e3);
|
|
7813
|
-
}
|
|
7814
|
-
}, {
|
|
7815
|
-
key: "onTouchCancel",
|
|
7816
|
-
value: function onTouchCancel(e3) {
|
|
7817
|
-
this.onTouchEnd(e3);
|
|
7818
|
-
}
|
|
7819
|
-
}, {
|
|
7820
|
-
key: "onTouchEnd",
|
|
7821
|
-
value: function onTouchEnd(e3) {
|
|
7822
|
-
var _pos = this._pos, root2 = this.root;
|
|
7823
|
-
this.__clearPress();
|
|
7824
|
-
root2.removeEventListener(this.events.cancel, this.onTouchCancel);
|
|
7825
|
-
root2.removeEventListener(this.events.end, this.onTouchEnd);
|
|
7826
|
-
root2.removeEventListener(this.events.move, this.onTouchMove);
|
|
7827
|
-
e3.moving = _pos.moving;
|
|
7828
|
-
e3.press = _pos.press;
|
|
7829
|
-
_pos.press && this.trigger(EVENTS.PRESS_END, e3);
|
|
7830
|
-
this.trigger(EVENTS.TOUCH_END, e3);
|
|
7831
|
-
!_pos.press && !_pos.moving && this.__setDb(e3);
|
|
7832
|
-
_pos.press = false;
|
|
7833
|
-
_pos.start = false;
|
|
7834
|
-
_pos.moving = false;
|
|
7835
|
-
}
|
|
7836
|
-
}, {
|
|
7837
|
-
key: "onTouchMove",
|
|
7838
|
-
value: function onTouchMove(e3) {
|
|
7839
|
-
var _pos = this._pos, config = this.config;
|
|
7840
|
-
var touch = getTouch(e3.touches);
|
|
7841
|
-
var x2 = touch ? parseInt(touch.pageX, 10) : e3.pageX;
|
|
7842
|
-
var y2 = touch ? parseInt(touch.pageY, 10) : e3.pageX;
|
|
7843
|
-
var diffx = x2 - _pos.x;
|
|
7844
|
-
var diffy = y2 - _pos.y;
|
|
7845
|
-
if (Math.abs(diffy) < config.miniStep && Math.abs(diffx) < config.miniStep) {
|
|
7846
|
-
return;
|
|
7847
|
-
}
|
|
7848
|
-
this.__clearPress();
|
|
7849
|
-
_pos.press && this.trigger(EVENTS.PRESS_END, e3);
|
|
7850
|
-
_pos.press = false;
|
|
7851
|
-
_pos.moving = true;
|
|
7852
|
-
this.trigger(EVENTS.TOUCH_MOVE, e3);
|
|
7853
|
-
}
|
|
7854
7981
|
}, {
|
|
7855
7982
|
key: "destroy",
|
|
7856
7983
|
value: function destroy2() {
|
|
@@ -7860,8 +7987,8 @@ var Touche = /* @__PURE__ */ function() {
|
|
|
7860
7987
|
touchmove: "onTouchMove",
|
|
7861
7988
|
touchstart: "onTouchStart"
|
|
7862
7989
|
};
|
|
7863
|
-
Object.keys(map).
|
|
7864
|
-
_this4.root.removeEventListener(
|
|
7990
|
+
Object.keys(map).forEach(function(key) {
|
|
7991
|
+
_this4.root.removeEventListener(key, _this4[map[key]]);
|
|
7865
7992
|
});
|
|
7866
7993
|
}
|
|
7867
7994
|
}]);
|
|
@@ -8512,38 +8639,61 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8512
8639
|
}
|
|
8513
8640
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
8514
8641
|
_defineProperty$1(_assertThisInitialized(_this), "onBodyKeyDown", function(event) {
|
|
8515
|
-
|
|
8516
|
-
if (!_this.player || !_this.player.isUserActive && !_this.config.isIgnoreUserActive) {
|
|
8642
|
+
if (!_this.player) {
|
|
8517
8643
|
return;
|
|
8518
8644
|
}
|
|
8519
|
-
|
|
8645
|
+
var e3 = event || window.event;
|
|
8646
|
+
var keyCode = e3.keyCode;
|
|
8647
|
+
var _assertThisInitialize = _assertThisInitialized(_this), _keyState = _assertThisInitialize._keyState, player = _assertThisInitialize.player;
|
|
8648
|
+
var _this$config = _this.config, disable = _this$config.disable, disableBodyTrigger = _this$config.disableBodyTrigger, isIgnoreUserActive = _this$config.isIgnoreUserActive;
|
|
8649
|
+
if (disable || disableBodyTrigger || !player.isUserActive && !isIgnoreUserActive || isDisableTag(e3.target) || !_this.checkIsVisible() || e3.metaKey || e3.altKey || e3.ctrlKey) {
|
|
8650
|
+
_keyState.isBodyKeyDown = false;
|
|
8520
8651
|
return;
|
|
8521
8652
|
}
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8653
|
+
if (!event.repeat && !_keyState.isKeyDown) {
|
|
8654
|
+
if ((e3.target === document.body || _this.config.isGlobalTrigger && !isDisableTag(e3.target)) && _this.checkCode(keyCode, true)) {
|
|
8655
|
+
_keyState.isBodyKeyDown = true;
|
|
8656
|
+
}
|
|
8657
|
+
document.addEventListener("keyup", _this.onBodyKeyUp);
|
|
8527
8658
|
}
|
|
8528
|
-
|
|
8659
|
+
_keyState.isBodyKeyDown && _this.handleKeyDown(e3);
|
|
8529
8660
|
});
|
|
8530
|
-
_defineProperty$1(_assertThisInitialized(_this), "
|
|
8531
|
-
|
|
8532
|
-
if (_this.config.disable || _this.config.disableRootTrigger || e3.metaKey || e3.altKey || e3.ctrlKey) {
|
|
8661
|
+
_defineProperty$1(_assertThisInitialized(_this), "onBodyKeyUp", function(event) {
|
|
8662
|
+
if (!_this.player) {
|
|
8533
8663
|
return;
|
|
8534
8664
|
}
|
|
8535
|
-
|
|
8665
|
+
document.removeEventListener("keyup", _this.onBodyKeyUp);
|
|
8666
|
+
_this.handleKeyUp(event);
|
|
8667
|
+
});
|
|
8668
|
+
_defineProperty$1(_assertThisInitialized(_this), "onKeydown", function(event) {
|
|
8669
|
+
if (!_this.player) {
|
|
8536
8670
|
return;
|
|
8537
8671
|
}
|
|
8538
|
-
|
|
8672
|
+
var e3 = event || window.event;
|
|
8673
|
+
var _assertThisInitialize2 = _assertThisInitialized(_this), _keyState = _assertThisInitialize2._keyState;
|
|
8674
|
+
if (!e3.repeat) {
|
|
8675
|
+
if (_this.config.disable || _this.config.disableRootTrigger || e3.metaKey || e3.altKey || e3.ctrlKey) {
|
|
8676
|
+
return;
|
|
8677
|
+
}
|
|
8678
|
+
if (!_this.player.isUserActive && !_this.config.isIgnoreUserActive) {
|
|
8679
|
+
return;
|
|
8680
|
+
}
|
|
8681
|
+
if (e3 && (e3.keyCode === 37 || _this.checkCode(e3.keyCode)) && (e3.target === _this.player.root || e3.target === _this.player.video || e3.target === _this.player.controls.el)) {
|
|
8682
|
+
_keyState.isKeyDown = true;
|
|
8683
|
+
}
|
|
8684
|
+
_this.player.root.addEventListener("keyup", _this.onKeyup);
|
|
8685
|
+
}
|
|
8686
|
+
if (!_keyState.isKeyDown) {
|
|
8539
8687
|
return;
|
|
8540
8688
|
}
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8689
|
+
_this.handleKeyDown(e3);
|
|
8690
|
+
});
|
|
8691
|
+
_defineProperty$1(_assertThisInitialized(_this), "onKeyup", function(event) {
|
|
8692
|
+
if (!_this.player) {
|
|
8693
|
+
return;
|
|
8545
8694
|
}
|
|
8546
|
-
_this.
|
|
8695
|
+
_this.player.root.removeEventListener("keyup", _this.onKeyup);
|
|
8696
|
+
_this.handleKeyUp(event);
|
|
8547
8697
|
});
|
|
8548
8698
|
return _this;
|
|
8549
8699
|
}
|
|
@@ -8557,7 +8707,7 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8557
8707
|
if (!_this2.keyCodeMap[key]) {
|
|
8558
8708
|
_this2.keyCodeMap[key] = extendkeyCodeMap[key];
|
|
8559
8709
|
} else {
|
|
8560
|
-
["keyCode", "action", "disable", "isBodyTarget"].map(function(key1) {
|
|
8710
|
+
["keyCode", "action", "disable", "pressAction", "disablePress", "isBodyTarget"].map(function(key1) {
|
|
8561
8711
|
extendkeyCodeMap[key][key1] && (_this2.keyCodeMap[key][key1] = extendkeyCodeMap[key][key1]);
|
|
8562
8712
|
});
|
|
8563
8713
|
}
|
|
@@ -8577,37 +8727,51 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8577
8727
|
keyCode: 32,
|
|
8578
8728
|
action: "playPause",
|
|
8579
8729
|
disable: false,
|
|
8730
|
+
disablePress: false,
|
|
8580
8731
|
noBodyTarget: false
|
|
8581
8732
|
},
|
|
8582
8733
|
up: {
|
|
8583
8734
|
keyCode: 38,
|
|
8584
8735
|
action: "upVolume",
|
|
8585
8736
|
disable: false,
|
|
8737
|
+
disablePress: false,
|
|
8586
8738
|
noBodyTarget: true
|
|
8587
8739
|
},
|
|
8588
8740
|
down: {
|
|
8589
8741
|
keyCode: 40,
|
|
8590
8742
|
action: "downVolume",
|
|
8591
8743
|
disable: false,
|
|
8744
|
+
disablePress: false,
|
|
8592
8745
|
noBodyTarget: true
|
|
8593
8746
|
},
|
|
8594
8747
|
left: {
|
|
8595
8748
|
keyCode: 37,
|
|
8596
8749
|
action: "seekBack",
|
|
8750
|
+
disablePress: false,
|
|
8597
8751
|
disable: false
|
|
8598
8752
|
},
|
|
8599
8753
|
right: {
|
|
8600
8754
|
keyCode: 39,
|
|
8601
8755
|
action: "seek",
|
|
8756
|
+
pressAction: "changePlaybackRate",
|
|
8757
|
+
disablePress: false,
|
|
8602
8758
|
disable: false
|
|
8603
8759
|
},
|
|
8604
8760
|
esc: {
|
|
8605
8761
|
keyCode: 27,
|
|
8606
8762
|
action: "exitFullscreen",
|
|
8763
|
+
disablePress: true,
|
|
8607
8764
|
disable: false
|
|
8608
8765
|
}
|
|
8609
8766
|
};
|
|
8610
8767
|
this.mergekeyCodeMap();
|
|
8768
|
+
this._keyState = {
|
|
8769
|
+
isKeyDown: false,
|
|
8770
|
+
isBodyKeyDown: false,
|
|
8771
|
+
isPress: false,
|
|
8772
|
+
tt: 0,
|
|
8773
|
+
playbackRate: 0
|
|
8774
|
+
};
|
|
8611
8775
|
this.player.root.addEventListener("keydown", this.onKeydown);
|
|
8612
8776
|
document.addEventListener("keydown", this.onBodyKeyDown);
|
|
8613
8777
|
}
|
|
@@ -8641,6 +8805,9 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8641
8805
|
key: "downVolume",
|
|
8642
8806
|
value: function downVolume(event) {
|
|
8643
8807
|
var player = this.player;
|
|
8808
|
+
if (player.volume <= 0) {
|
|
8809
|
+
return;
|
|
8810
|
+
}
|
|
8644
8811
|
var val = parseFloat((player.volume - 0.1).toFixed(1));
|
|
8645
8812
|
var props = {
|
|
8646
8813
|
volume: {
|
|
@@ -8661,6 +8828,9 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8661
8828
|
key: "upVolume",
|
|
8662
8829
|
value: function upVolume(event) {
|
|
8663
8830
|
var player = this.player;
|
|
8831
|
+
if (player.volume >= 1) {
|
|
8832
|
+
return;
|
|
8833
|
+
}
|
|
8664
8834
|
var val = parseFloat((player.volume + 0.1).toFixed(1));
|
|
8665
8835
|
var props = {
|
|
8666
8836
|
volume: {
|
|
@@ -8680,42 +8850,57 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8680
8850
|
}, {
|
|
8681
8851
|
key: "seek",
|
|
8682
8852
|
value: function seek(event) {
|
|
8683
|
-
var _this$player = this.player, currentTime = _this$player.currentTime, duration = _this$player.duration;
|
|
8684
|
-
var _time = currentTime;
|
|
8685
|
-
|
|
8686
|
-
|
|
8853
|
+
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;
|
|
8854
|
+
var _time = offsetCurrentTime > -1 ? offsetCurrentTime : currentTime;
|
|
8855
|
+
var _duration = offsetDuration || duration;
|
|
8856
|
+
var _step = event.repeat && this.seekStep >= 4 ? parseInt(this.seekStep / 2, 10) : this.seekStep;
|
|
8857
|
+
if (_time + _step <= _duration) {
|
|
8858
|
+
_time = _time + _step;
|
|
8687
8859
|
} else {
|
|
8688
|
-
_time =
|
|
8860
|
+
_time = _duration;
|
|
8689
8861
|
}
|
|
8862
|
+
var _seekTime = util$1.getCurrentTimeByOffset(_time, timeSegments);
|
|
8690
8863
|
var props = {
|
|
8691
8864
|
currentTime: {
|
|
8692
8865
|
from: currentTime,
|
|
8693
|
-
to:
|
|
8866
|
+
to: _seekTime
|
|
8694
8867
|
}
|
|
8695
8868
|
};
|
|
8696
8869
|
this.emitUserAction(event, "seek", {
|
|
8697
8870
|
props
|
|
8698
8871
|
});
|
|
8699
|
-
this.player.currentTime =
|
|
8872
|
+
this.player.currentTime = _seekTime;
|
|
8700
8873
|
}
|
|
8701
8874
|
}, {
|
|
8702
8875
|
key: "seekBack",
|
|
8703
8876
|
value: function seekBack(event) {
|
|
8704
|
-
var
|
|
8705
|
-
var
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8877
|
+
var _this$player2 = this.player, currentTime = _this$player2.currentTime, offsetCurrentTime = _this$player2.offsetCurrentTime, timeSegments = _this$player2.timeSegments;
|
|
8878
|
+
var _step = event.repeat ? parseInt(this.seekStep / 2, 10) : this.seekStep;
|
|
8879
|
+
var _time = offsetCurrentTime > -1 ? offsetCurrentTime : currentTime;
|
|
8880
|
+
var _seekTime = _time - _step;
|
|
8881
|
+
if (_seekTime < 0) {
|
|
8882
|
+
_seekTime = 0;
|
|
8883
|
+
}
|
|
8884
|
+
_seekTime = util$1.getCurrentTimeByOffset(_seekTime, timeSegments);
|
|
8709
8885
|
var props = {
|
|
8710
8886
|
currentTime: {
|
|
8711
8887
|
from: currentTime,
|
|
8712
|
-
to:
|
|
8888
|
+
to: _seekTime
|
|
8713
8889
|
}
|
|
8714
8890
|
};
|
|
8715
8891
|
this.emitUserAction(event, "seek", {
|
|
8716
8892
|
props
|
|
8717
8893
|
});
|
|
8718
|
-
this.player.currentTime =
|
|
8894
|
+
this.player.currentTime = _seekTime;
|
|
8895
|
+
}
|
|
8896
|
+
}, {
|
|
8897
|
+
key: "changePlaybackRate",
|
|
8898
|
+
value: function changePlaybackRate(event) {
|
|
8899
|
+
var _keyState = this._keyState, config = this.config, player = this.player;
|
|
8900
|
+
if (_keyState.playbackRate === 0) {
|
|
8901
|
+
_keyState.playbackRate = player.playbackRate;
|
|
8902
|
+
player.playbackRate = config.playbackRate;
|
|
8903
|
+
}
|
|
8719
8904
|
}
|
|
8720
8905
|
}, {
|
|
8721
8906
|
key: "playPause",
|
|
@@ -8753,32 +8938,66 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8753
8938
|
player.exitCssFullscreen();
|
|
8754
8939
|
}
|
|
8755
8940
|
}
|
|
8941
|
+
}, {
|
|
8942
|
+
key: "handleKeyDown",
|
|
8943
|
+
value: function handleKeyDown(e3) {
|
|
8944
|
+
var _keyState = this._keyState;
|
|
8945
|
+
if (e3.repeat) {
|
|
8946
|
+
_keyState.isPress = true;
|
|
8947
|
+
var _t = Date.now();
|
|
8948
|
+
if (_t - _keyState.tt < 200) {
|
|
8949
|
+
return;
|
|
8950
|
+
}
|
|
8951
|
+
_keyState.tt = _t;
|
|
8952
|
+
}
|
|
8953
|
+
preventDefault(e3);
|
|
8954
|
+
this.handleKeyCode(e3.keyCode, e3, _keyState.isPress);
|
|
8955
|
+
}
|
|
8956
|
+
}, {
|
|
8957
|
+
key: "handleKeyUp",
|
|
8958
|
+
value: function handleKeyUp(e3) {
|
|
8959
|
+
var _keyState = this._keyState;
|
|
8960
|
+
if (_keyState.playbackRate > 0) {
|
|
8961
|
+
this.player.playbackRate = _keyState.playbackRate;
|
|
8962
|
+
_keyState.playbackRate = 0;
|
|
8963
|
+
}
|
|
8964
|
+
_keyState.isKeyDown = false;
|
|
8965
|
+
_keyState.isPress = false;
|
|
8966
|
+
_keyState.tt = 0;
|
|
8967
|
+
}
|
|
8756
8968
|
}, {
|
|
8757
8969
|
key: "handleKeyCode",
|
|
8758
|
-
value: function handleKeyCode(curKeyCode, event) {
|
|
8759
|
-
var
|
|
8760
|
-
|
|
8761
|
-
var
|
|
8762
|
-
if (keyCode === curKeyCode
|
|
8763
|
-
if (
|
|
8764
|
-
action
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8970
|
+
value: function handleKeyCode(curKeyCode, event, isPress) {
|
|
8971
|
+
var arr = Object.keys(this.keyCodeMap);
|
|
8972
|
+
for (var i2 = 0; i2 < arr.length; i2++) {
|
|
8973
|
+
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;
|
|
8974
|
+
if (keyCode === curKeyCode) {
|
|
8975
|
+
if (!disable && !(isPress && disablePress)) {
|
|
8976
|
+
var _action = !isPress ? action : pressAction || action;
|
|
8977
|
+
if (typeof _action === "function") {
|
|
8978
|
+
action(event, this.player, isPress);
|
|
8979
|
+
} else if (typeof _action === "string") {
|
|
8980
|
+
if (typeof this[_action] === "function") {
|
|
8981
|
+
this[_action](event, this.player, isPress);
|
|
8982
|
+
}
|
|
8768
8983
|
}
|
|
8984
|
+
this.emit(SHORTCUT, _objectSpread2$1({
|
|
8985
|
+
key: arr[i2],
|
|
8986
|
+
target: event.target,
|
|
8987
|
+
isPress
|
|
8988
|
+
}, this.keyCodeMap[arr[i2]]));
|
|
8769
8989
|
}
|
|
8770
|
-
|
|
8771
|
-
key,
|
|
8772
|
-
target: event.target
|
|
8773
|
-
}, _this4.keyCodeMap[key]));
|
|
8990
|
+
break;
|
|
8774
8991
|
}
|
|
8775
|
-
}
|
|
8992
|
+
}
|
|
8776
8993
|
}
|
|
8777
8994
|
}, {
|
|
8778
8995
|
key: "destroy",
|
|
8779
8996
|
value: function destroy2() {
|
|
8780
8997
|
this.player.root.removeEventListener("keydown", this.onKeydown);
|
|
8781
8998
|
document.removeEventListener("keydown", this.onBodyKeyDown);
|
|
8999
|
+
this.player.root.removeEventListener("keyup", this.onKeyup);
|
|
9000
|
+
document.removeEventListener("keyup", this.onBodyKeyUp);
|
|
8782
9001
|
}
|
|
8783
9002
|
}, {
|
|
8784
9003
|
key: "disable",
|
|
@@ -8800,12 +9019,13 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8800
9019
|
get: function get() {
|
|
8801
9020
|
return {
|
|
8802
9021
|
seekStep: 10,
|
|
8803
|
-
checkVisible:
|
|
9022
|
+
checkVisible: false,
|
|
8804
9023
|
disableBodyTrigger: false,
|
|
8805
9024
|
disableRootTrigger: false,
|
|
8806
9025
|
isGlobalTrigger: false,
|
|
8807
9026
|
keyCodeMap: {},
|
|
8808
9027
|
disable: false,
|
|
9028
|
+
playbackRate: 2,
|
|
8809
9029
|
isIgnoreUserActive: false
|
|
8810
9030
|
};
|
|
8811
9031
|
}
|
|
@@ -10174,6 +10394,9 @@ class Definition {
|
|
|
10174
10394
|
get url() {
|
|
10175
10395
|
return this._currentUrlRef.url;
|
|
10176
10396
|
}
|
|
10397
|
+
set url(url) {
|
|
10398
|
+
this._currentUrlRef.url = url;
|
|
10399
|
+
}
|
|
10177
10400
|
next() {
|
|
10178
10401
|
const next = this._currentUrlRef.next;
|
|
10179
10402
|
/* istanbul ignore next -- @preserve */
|
|
@@ -10251,7 +10474,6 @@ class SourceManager {
|
|
|
10251
10474
|
__publicField(this, "defaultSource");
|
|
10252
10475
|
__publicField(this, "defaultDefinition");
|
|
10253
10476
|
__publicField(this, "maxFallbackRound");
|
|
10254
|
-
__publicField(this, "_prepareList", []);
|
|
10255
10477
|
__publicField(this, "_currentDefinition");
|
|
10256
10478
|
__publicField(this, "_sources");
|
|
10257
10479
|
__publicField(this, "_fallbackCount", 0);
|
|
@@ -10286,6 +10508,11 @@ class SourceManager {
|
|
|
10286
10508
|
var _a;
|
|
10287
10509
|
return (_a = this.definition) == null ? void 0 : _a.url;
|
|
10288
10510
|
}
|
|
10511
|
+
set url(url) {
|
|
10512
|
+
if (this.definition) {
|
|
10513
|
+
this.definition.url = url;
|
|
10514
|
+
}
|
|
10515
|
+
}
|
|
10289
10516
|
/**
|
|
10290
10517
|
* 以给定的参数搜索源和对应清晰度。`source` 和 `definition`
|
|
10291
10518
|
* 都是可选的,当未指定时,使用当前的 {@link SourceManager.source}
|
|
@@ -10355,14 +10582,6 @@ class SourceManager {
|
|
|
10355
10582
|
this.resetFallback();
|
|
10356
10583
|
return this;
|
|
10357
10584
|
}
|
|
10358
|
-
registerPrepare(prepare) {
|
|
10359
|
-
this._prepareList.push(prepare);
|
|
10360
|
-
}
|
|
10361
|
-
async prepare(url) {
|
|
10362
|
-
for (const prepare of this._prepareList) {
|
|
10363
|
-
await prepare(url);
|
|
10364
|
-
}
|
|
10365
|
-
}
|
|
10366
10585
|
resetFallback() {
|
|
10367
10586
|
this._fallbackCount = 0;
|
|
10368
10587
|
}
|
|
@@ -11953,9 +12172,7 @@ class DefinitionPlugin extends OptionsIcon {
|
|
|
11953
12172
|
toastPlugin.remove(this._toastId);
|
|
11954
12173
|
}
|
|
11955
12174
|
this._toastId = toastPlugin.toast(
|
|
11956
|
-
`${i18nManager.getText("DEFINITION_SWITCHING")} ${
|
|
11957
|
-
definition.text
|
|
11958
|
-
)) ?? definition.definition} ...`,
|
|
12175
|
+
`${i18nManager.getText("DEFINITION_SWITCHING")} ${definition.showText ?? definition.definition} ...`,
|
|
11959
12176
|
{
|
|
11960
12177
|
duration: 2e3,
|
|
11961
12178
|
closable: true
|
|
@@ -12719,21 +12936,21 @@ const EN$1 = {
|
|
|
12719
12936
|
// 自动播放插件
|
|
12720
12937
|
UNMUTE: "Click to unmute",
|
|
12721
12938
|
// 报错
|
|
12722
|
-
MANIFEST: "
|
|
12939
|
+
MANIFEST: "Video parsing error",
|
|
12723
12940
|
NETWORK: "Network error",
|
|
12724
12941
|
NETWORK_TIMEOUT: "Network timeout",
|
|
12725
|
-
NETWORK_FORBIDDEN: "
|
|
12726
|
-
NETWORK_NOTFOUND: "
|
|
12727
|
-
DEMUX: "
|
|
12728
|
-
REMUX: "
|
|
12729
|
-
MEDIA: "
|
|
12730
|
-
MEDIA_ERR_CODEC_NOT_SUPPORTED: "
|
|
12731
|
-
MEDIA_ERR_URL_EMPTY: "
|
|
12732
|
-
DRM: "
|
|
12733
|
-
OTHER: "
|
|
12734
|
-
RUNTIME: "
|
|
12735
|
-
MODULE_LOAD_ERROR: "
|
|
12736
|
-
UNKNOWN: "
|
|
12942
|
+
NETWORK_FORBIDDEN: "Authentication error",
|
|
12943
|
+
NETWORK_NOTFOUND: "Stream does not exist",
|
|
12944
|
+
DEMUX: "Video parsing error",
|
|
12945
|
+
REMUX: "Video parsing error",
|
|
12946
|
+
MEDIA: "An error occurred, Please try again",
|
|
12947
|
+
MEDIA_ERR_CODEC_NOT_SUPPORTED: "Audio/video codec is not supported",
|
|
12948
|
+
MEDIA_ERR_URL_EMPTY: "The stream address is not specified",
|
|
12949
|
+
DRM: "Permission verification failed",
|
|
12950
|
+
OTHER: "Unknown error",
|
|
12951
|
+
RUNTIME: "An error occurred, Please try again",
|
|
12952
|
+
MODULE_LOAD_ERROR: "CDN fetch error",
|
|
12953
|
+
UNKNOWN: "Unknown error"
|
|
12737
12954
|
};
|
|
12738
12955
|
const ZH_CN$1 = {
|
|
12739
12956
|
...ZH.TEXT,
|
|
@@ -12752,12 +12969,12 @@ const ZH_CN$1 = {
|
|
|
12752
12969
|
NETWORK_NOTFOUND: "播放地址不存在",
|
|
12753
12970
|
DEMUX: "视频解析错误",
|
|
12754
12971
|
REMUX: "视频解析错误",
|
|
12755
|
-
MEDIA: "
|
|
12756
|
-
MEDIA_ERR_CODEC_NOT_SUPPORTED: "
|
|
12972
|
+
MEDIA: "播放异常,请重试",
|
|
12973
|
+
MEDIA_ERR_CODEC_NOT_SUPPORTED: "不支持的音频/视频格式",
|
|
12757
12974
|
MEDIA_ERR_URL_EMPTY: "当前播放地址为空",
|
|
12758
12975
|
DRM: "权限验证失败",
|
|
12759
12976
|
OTHER: "其他报错",
|
|
12760
|
-
RUNTIME: "
|
|
12977
|
+
RUNTIME: "播放异常,请重试",
|
|
12761
12978
|
MODULE_LOAD_ERROR: "插件模块加载异常",
|
|
12762
12979
|
UNKNOWN: "未知报错"
|
|
12763
12980
|
};
|
|
@@ -12901,7 +13118,6 @@ class VePlayerBase {
|
|
|
12901
13118
|
veplayer: this
|
|
12902
13119
|
});
|
|
12903
13120
|
this.emit(Events$1.PLAYER_CREATE_FINISH, this._player);
|
|
12904
|
-
this._sourceManager.registerPrepare((url) => this.prepare(url));
|
|
12905
13121
|
this._errorCallback = (err) => this._handleFallback(err);
|
|
12906
13122
|
this._player.on(ERROR, this._errorCallback);
|
|
12907
13123
|
}
|
|
@@ -13067,7 +13283,7 @@ class VePlayerBase {
|
|
|
13067
13283
|
return;
|
|
13068
13284
|
}
|
|
13069
13285
|
if (!VeI18n.isLangValid(lang)) {
|
|
13070
|
-
const langKeys = VeI18n.langKeys
|
|
13286
|
+
const langKeys = VeI18n.langKeys.join(",");
|
|
13071
13287
|
const message = {
|
|
13072
13288
|
en: `Sorry, we couldn't set the language to ${lang} because it's not currently supported. The list of supported languages includes ${langKeys}.`,
|
|
13073
13289
|
"zh-cn": `不支持当前设置的语言${lang}, 支持的语言有${langKeys}, 请重新设置`
|
|
@@ -13086,7 +13302,7 @@ class VePlayerBase {
|
|
|
13086
13302
|
* @hidden
|
|
13087
13303
|
*/
|
|
13088
13304
|
static async create(options = {}, Constructor) {
|
|
13089
|
-
var _a;
|
|
13305
|
+
var _a, _b, _c;
|
|
13090
13306
|
const sourceManager = new SourceManager({
|
|
13091
13307
|
sources: Source.normalize({
|
|
13092
13308
|
url: options.url,
|
|
@@ -13098,8 +13314,14 @@ class VePlayerBase {
|
|
|
13098
13314
|
defaultDefinition: options.defaultDefinition,
|
|
13099
13315
|
maxFallbackRound: options.maxFallbackRound
|
|
13100
13316
|
});
|
|
13317
|
+
const prepareResult = await ((_a = options == null ? void 0 : options.preparePlugins) == null ? void 0 : _a.call(
|
|
13318
|
+
options,
|
|
13319
|
+
sourceManager.url ?? ""
|
|
13320
|
+
));
|
|
13321
|
+
if ((_b = prepareResult == null ? void 0 : prepareResult.options) == null ? void 0 : _b.url) {
|
|
13322
|
+
sourceManager.url = (_c = prepareResult == null ? void 0 : prepareResult.options) == null ? void 0 : _c.url;
|
|
13323
|
+
}
|
|
13101
13324
|
options.url = sourceManager.url;
|
|
13102
|
-
const prepareResult = await ((_a = options == null ? void 0 : options.preparePlugins) == null ? void 0 : _a.call(options, options.url ?? ""));
|
|
13103
13325
|
return new (Constructor ?? VePlayerBase)({
|
|
13104
13326
|
...options,
|
|
13105
13327
|
prepareResult,
|
|
@@ -13114,7 +13336,6 @@ class VePlayerBase {
|
|
|
13114
13336
|
async switch(target, options) {
|
|
13115
13337
|
var _a, _b;
|
|
13116
13338
|
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) {
|
|
13117
|
-
this._sourceManager.updateSources(target);
|
|
13118
13339
|
await this._switchUrl(target);
|
|
13119
13340
|
return this._sourceManager.definition;
|
|
13120
13341
|
}
|
|
@@ -13253,7 +13474,7 @@ class VePlayerBase {
|
|
|
13253
13474
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
13254
13475
|
* @param el 全屏作用的 DOM 节点。
|
|
13255
13476
|
*/
|
|
13256
|
-
|
|
13477
|
+
requestFullscreen(el) {
|
|
13257
13478
|
return this._player.getFullscreen(el);
|
|
13258
13479
|
}
|
|
13259
13480
|
/**
|
|
@@ -13267,7 +13488,7 @@ class VePlayerBase {
|
|
|
13267
13488
|
* @brief 调用此方法进入网页样式全屏状态,播放器进入网页全屏,利用 CSS 模拟实现全屏效果。如果该接口调用的时候处于全屏状态,会自动退出全屏,下发事件 `Events.CSS_FULLSCREEN_CHANGE`。
|
|
13268
13489
|
* @param el 全屏作用的 DOM 节点。
|
|
13269
13490
|
*/
|
|
13270
|
-
|
|
13491
|
+
requestCssFullscreen(el) {
|
|
13271
13492
|
return this._player.getCssFullscreen(el);
|
|
13272
13493
|
}
|
|
13273
13494
|
/**
|
|
@@ -13350,9 +13571,12 @@ class VePlayerBase {
|
|
|
13350
13571
|
if (result == null ? void 0 : result.options) {
|
|
13351
13572
|
this._player.setConfig(result.options);
|
|
13352
13573
|
}
|
|
13353
|
-
return
|
|
13354
|
-
|
|
13355
|
-
|
|
13574
|
+
return {
|
|
13575
|
+
plugins: addedPlugins.map((plugin) => {
|
|
13576
|
+
return this._player.registerPlugin(plugin);
|
|
13577
|
+
}),
|
|
13578
|
+
options: result == null ? void 0 : result.options
|
|
13579
|
+
};
|
|
13356
13580
|
}
|
|
13357
13581
|
async _handleFallback(err) {
|
|
13358
13582
|
this._player.addClass(STATE_CLASS.ENTER);
|
|
@@ -13387,7 +13611,10 @@ class VePlayerBase {
|
|
|
13387
13611
|
async _switch(targetDefinition) {
|
|
13388
13612
|
var _a, _b, _c, _d, _e, _f;
|
|
13389
13613
|
const preDefinition = clonedeep(this._sourceManager.definition);
|
|
13390
|
-
const newPlugins = await this.prepare(targetDefinition.url);
|
|
13614
|
+
const { plugins: newPlugins, options } = await this.prepare(targetDefinition.url) || {};
|
|
13615
|
+
if (options == null ? void 0 : options.url) {
|
|
13616
|
+
targetDefinition.url = options == null ? void 0 : options.url;
|
|
13617
|
+
}
|
|
13391
13618
|
this._sourceManager.switch(targetDefinition);
|
|
13392
13619
|
(_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.sources.renderItemList();
|
|
13393
13620
|
(_d = (_c = this._player) == null ? void 0 : _c.plugins) == null ? void 0 : _d.definition.renderItemList();
|
|
@@ -13403,11 +13630,13 @@ class VePlayerBase {
|
|
|
13403
13630
|
}
|
|
13404
13631
|
}
|
|
13405
13632
|
async _switchUrl(url) {
|
|
13406
|
-
const newPlugins = await this.prepare(url);
|
|
13633
|
+
const { plugins: newPlugins, options } = await this.prepare(url) || {};
|
|
13634
|
+
const newUrl = (options == null ? void 0 : options.url) ?? url;
|
|
13635
|
+
this._sourceManager.updateSources(newUrl);
|
|
13407
13636
|
if (newPlugins == null ? void 0 : newPlugins.length) {
|
|
13408
|
-
this._callBeforePlayerInitForUrl(newPlugins,
|
|
13637
|
+
this._callBeforePlayerInitForUrl(newPlugins, newUrl);
|
|
13409
13638
|
} else {
|
|
13410
|
-
const res = this._player.switchURL(
|
|
13639
|
+
const res = this._player.switchURL(newUrl, false);
|
|
13411
13640
|
const curTime = this._player.currentTime;
|
|
13412
13641
|
if (res && res.then) {
|
|
13413
13642
|
return res;
|
|
@@ -18140,15 +18369,34 @@ const ERRORS = {
|
|
|
18140
18369
|
function create(errorCode, i18n) {
|
|
18141
18370
|
return new VeError2(ERRORS[errorCode], i18n);
|
|
18142
18371
|
}
|
|
18372
|
+
async function isRTMSupported() {
|
|
18373
|
+
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18374
|
+
return Rtm.isSupported();
|
|
18375
|
+
}
|
|
18376
|
+
async function isRTMSupportCodec(codec = RTMCodec.H264) {
|
|
18377
|
+
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18378
|
+
if (codec === RTMCodec.H264)
|
|
18379
|
+
return Rtm.isSupportedH264();
|
|
18380
|
+
return false;
|
|
18381
|
+
}
|
|
18143
18382
|
const rtmStrategy = {
|
|
18144
18383
|
options: {},
|
|
18145
18384
|
module: DynamicModule.PluginRtm
|
|
18146
18385
|
};
|
|
18147
|
-
const
|
|
18386
|
+
const generateFallbackUrl = (url) => {
|
|
18387
|
+
if (sniffer$1.device === "pc") {
|
|
18388
|
+
return url.replace(".sdp", ".flv");
|
|
18389
|
+
} else {
|
|
18390
|
+
return url.replace(".sdp", ".m3u8");
|
|
18391
|
+
}
|
|
18392
|
+
};
|
|
18393
|
+
const getRtmStrategy = async (options, player) => {
|
|
18148
18394
|
var _a;
|
|
18149
18395
|
let backupStrategy;
|
|
18150
|
-
const {
|
|
18151
|
-
const
|
|
18396
|
+
const { url } = options;
|
|
18397
|
+
const { fallbackUrl, enableFallback = true, ...ret } = options.rtm || {};
|
|
18398
|
+
const actualFallbackUrl = !enableFallback ? "" : !fallbackUrl && url ? generateFallbackUrl(url) : fallbackUrl;
|
|
18399
|
+
const backupType = actualFallbackUrl && util.getStreamType(actualFallbackUrl);
|
|
18152
18400
|
if (backupType === "flv" && util.isMseSupported(Codec.H264)) {
|
|
18153
18401
|
backupStrategy = createFlvMseStrategy(options);
|
|
18154
18402
|
} else if (backupType === "hls" && (sniffer$1.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE)) && util.isMseSupported(Codec.H264)) {
|
|
@@ -18158,40 +18406,55 @@ const getRtmStrategy = async (options) => {
|
|
|
18158
18406
|
load(rtmStrategy.module).catch(() => void 0),
|
|
18159
18407
|
backupStrategy && load(backupStrategy.module).catch(() => void 0)
|
|
18160
18408
|
]);
|
|
18409
|
+
const [RTMSupported, RTMSupportCodec] = await Promise.all([
|
|
18410
|
+
isRTMSupported(),
|
|
18411
|
+
isRTMSupportCodec()
|
|
18412
|
+
]);
|
|
18413
|
+
if (!RTMSupported || !RTMSupportCodec) {
|
|
18414
|
+
if (player) {
|
|
18415
|
+
player.emit("degrade", {
|
|
18416
|
+
url: actualFallbackUrl,
|
|
18417
|
+
originRtmUrl: url,
|
|
18418
|
+
code: "NOT_SUPPORT",
|
|
18419
|
+
message: "not support rtm or h264",
|
|
18420
|
+
isRTMSupported: RTMSupported,
|
|
18421
|
+
isRTMSupportCodec: RTMSupportCodec
|
|
18422
|
+
});
|
|
18423
|
+
}
|
|
18424
|
+
return {
|
|
18425
|
+
options: {
|
|
18426
|
+
...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
|
|
18427
|
+
url: actualFallbackUrl,
|
|
18428
|
+
_RTMdegrade: {
|
|
18429
|
+
_originRtmUrl: url,
|
|
18430
|
+
_isRTMSupported: RTMSupported,
|
|
18431
|
+
_isRTMSupportCodec: RTMSupportCodec
|
|
18432
|
+
}
|
|
18433
|
+
},
|
|
18434
|
+
plugins: backupCdn ? [backupCdn] : []
|
|
18435
|
+
};
|
|
18436
|
+
}
|
|
18161
18437
|
return {
|
|
18162
18438
|
options: {
|
|
18163
18439
|
...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
|
|
18440
|
+
_RTMdegrade: void 0,
|
|
18164
18441
|
rts: {
|
|
18165
18442
|
retryCount: 0,
|
|
18166
18443
|
...ret,
|
|
18167
|
-
backupURL:
|
|
18444
|
+
backupURL: actualFallbackUrl,
|
|
18168
18445
|
backupConstruct: backupCdn
|
|
18169
18446
|
}
|
|
18170
18447
|
},
|
|
18171
18448
|
plugins: rtmCdn ? [rtmCdn] : []
|
|
18172
18449
|
};
|
|
18173
18450
|
};
|
|
18174
|
-
|
|
18175
|
-
RTMCodec2["H264"] = "h264";
|
|
18176
|
-
return RTMCodec2;
|
|
18177
|
-
})(RTMCodec || {});
|
|
18178
|
-
const isRTMSupported = async () => {
|
|
18179
|
-
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18180
|
-
return Rtm.isSupported();
|
|
18181
|
-
};
|
|
18182
|
-
const isRTMSupportCodec = async (codec = "h264") => {
|
|
18183
|
-
const Rtm = await load(DynamicModule.PluginRtm);
|
|
18184
|
-
if (codec === "h264")
|
|
18185
|
-
return Rtm.isSupportedH264();
|
|
18186
|
-
return false;
|
|
18187
|
-
};
|
|
18188
|
-
const getTypeStrategy = async (options) => {
|
|
18451
|
+
const getTypeStrategy = async (options, player) => {
|
|
18189
18452
|
const type = options.url ? util.getStreamType(options.url) : "";
|
|
18190
18453
|
if (!type || type === "unknown") {
|
|
18191
18454
|
return { options: {}, plugins: [] };
|
|
18192
18455
|
}
|
|
18193
18456
|
if (type === "rtm") {
|
|
18194
|
-
return await getRtmStrategy(options);
|
|
18457
|
+
return await getRtmStrategy(options, player);
|
|
18195
18458
|
}
|
|
18196
18459
|
if (type === "flv") {
|
|
18197
18460
|
return await getFlvStrategy(options);
|
|
@@ -18639,9 +18902,9 @@ function getPlayFormat(url) {
|
|
|
18639
18902
|
function isCodecSupport(codec) {
|
|
18640
18903
|
return typeof MediaSource !== "undefined" ? +MediaSource.isTypeSupported("video/mp4; codecs=" + codec) : 0;
|
|
18641
18904
|
}
|
|
18642
|
-
function getUrlQuery(url, key) {
|
|
18905
|
+
function getUrlQuery(url, key, key2) {
|
|
18643
18906
|
var x2 = new URLSearchParams(url.split("?")[1]);
|
|
18644
|
-
return x2.get(key);
|
|
18907
|
+
return x2.get(key) || x2.get(key2);
|
|
18645
18908
|
}
|
|
18646
18909
|
function getDeviceInfo() {
|
|
18647
18910
|
var res = {
|
|
@@ -18668,19 +18931,11 @@ function getPlayerCore(player) {
|
|
|
18668
18931
|
return player.plugins.hls;
|
|
18669
18932
|
} else if (player.plugins.rts) {
|
|
18670
18933
|
return player.plugins.rts;
|
|
18671
|
-
} else if (player.plugins.
|
|
18672
|
-
return player.plugins.
|
|
18673
|
-
}
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
return player.plugins.hlsvod;
|
|
18677
|
-
} else if (player.plugins.hlslivemobile) {
|
|
18678
|
-
return player.plugins.hlslivemobile;
|
|
18679
|
-
} else if (player.plugins.flvlivemobile) {
|
|
18680
|
-
return player.plugins.flvlivemobile;
|
|
18681
|
-
}
|
|
18682
|
-
}
|
|
18683
|
-
return player.newHls || player.newFlv || player.__core__ || player.flv;
|
|
18934
|
+
} else if (player.plugins.rtm) {
|
|
18935
|
+
return player.plugins.rtm;
|
|
18936
|
+
}
|
|
18937
|
+
}
|
|
18938
|
+
return null;
|
|
18684
18939
|
}
|
|
18685
18940
|
function getDefaultOptions(options) {
|
|
18686
18941
|
return {
|
|
@@ -18909,7 +19164,7 @@ function getCommonLog(options) {
|
|
|
18909
19164
|
live_sdk_version: getPlayerCore(player) || player.hlsOps ? "2" : "-1",
|
|
18910
19165
|
player_sdk_version: player.version,
|
|
18911
19166
|
// eslint-disable-next-line no-undef
|
|
18912
|
-
logger_version: "1.1.0-alpha.
|
|
19167
|
+
logger_version: "1.1.0-alpha.7",
|
|
18913
19168
|
// 由rollup 在编译时注入
|
|
18914
19169
|
report_version: "5",
|
|
18915
19170
|
product_line: options.product_line,
|
|
@@ -19033,9 +19288,13 @@ var Manage = /* @__PURE__ */ function() {
|
|
|
19033
19288
|
if (this._player.video) {
|
|
19034
19289
|
log.play_current_time = this._player.currentTime;
|
|
19035
19290
|
}
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19291
|
+
if (this.core && this.core.loader && this.core.loader.finnalUrl) {
|
|
19292
|
+
log.cdn_play_url = this.core.loader.finnalUrl;
|
|
19293
|
+
} else {
|
|
19294
|
+
log.cdn_play_url = url && url.startsWith("//") ? window.location.protocol + url : url;
|
|
19295
|
+
}
|
|
19296
|
+
log.live_stream_session_id = getUrlQuery(log.cdn_play_url, "_session_id", "session_id");
|
|
19297
|
+
log.play_format = getPlayFormat(log.cdn_play_url);
|
|
19039
19298
|
log.timestamp = getCurrentTime();
|
|
19040
19299
|
var _getDeviceInfo = getDeviceInfo(), cpu_core_number = _getDeviceInfo.cpu_core_number, memory_usage = _getDeviceInfo.memory_usage, network_downlink = _getDeviceInfo.network_downlink;
|
|
19041
19300
|
log.cpu_core_number = cpu_core_number;
|
|
@@ -19261,6 +19520,11 @@ var XgLiveLogger = /* @__PURE__ */ function() {
|
|
|
19261
19520
|
};
|
|
19262
19521
|
_proto2.reportStartPlay = function reportStartPlay() {
|
|
19263
19522
|
if (!this.started) {
|
|
19523
|
+
this.core = getPlayerCore(this.player);
|
|
19524
|
+
if (this.core) {
|
|
19525
|
+
this.commonParams.live_sdk_version = "2";
|
|
19526
|
+
this.logmanager.core = this.core;
|
|
19527
|
+
}
|
|
19264
19528
|
this.started = true;
|
|
19265
19529
|
this.log.start_play.start_play_time = this.log.start_play.timestamp = getCurrentTime();
|
|
19266
19530
|
this.logmanager.push(this.log.start_play, true);
|
|
@@ -19525,6 +19789,7 @@ var XgLiveLogger = /* @__PURE__ */ function() {
|
|
|
19525
19789
|
this.core = getPlayerCore(this.player);
|
|
19526
19790
|
if (this.core) {
|
|
19527
19791
|
this.commonParams.live_sdk_version = "2";
|
|
19792
|
+
this.logmanager.core = this.core;
|
|
19528
19793
|
}
|
|
19529
19794
|
if (this.player.config.autoplay || this.player.config.videoInit) {
|
|
19530
19795
|
this.reportStartPlay();
|
|
@@ -20777,6 +21042,45 @@ var T = 4003, C = function() {
|
|
|
20777
21042
|
this.event("predefine_pageview", n2);
|
|
20778
21043
|
}, t2;
|
|
20779
21044
|
}(), q = new R("default");
|
|
21045
|
+
let getRandomValues;
|
|
21046
|
+
const rnds8 = new Uint8Array(16);
|
|
21047
|
+
function rng() {
|
|
21048
|
+
if (!getRandomValues) {
|
|
21049
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
21050
|
+
if (!getRandomValues) {
|
|
21051
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
21052
|
+
}
|
|
21053
|
+
}
|
|
21054
|
+
return getRandomValues(rnds8);
|
|
21055
|
+
}
|
|
21056
|
+
const byteToHex = [];
|
|
21057
|
+
for (let i2 = 0; i2 < 256; ++i2) {
|
|
21058
|
+
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
21059
|
+
}
|
|
21060
|
+
function unsafeStringify(arr, offset = 0) {
|
|
21061
|
+
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]];
|
|
21062
|
+
}
|
|
21063
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
21064
|
+
var native = {
|
|
21065
|
+
randomUUID
|
|
21066
|
+
};
|
|
21067
|
+
function v4(options, buf, offset) {
|
|
21068
|
+
if (native.randomUUID && !buf && !options) {
|
|
21069
|
+
return native.randomUUID();
|
|
21070
|
+
}
|
|
21071
|
+
options = options || {};
|
|
21072
|
+
const rnds = options.random || (options.rng || rng)();
|
|
21073
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
21074
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
21075
|
+
if (buf) {
|
|
21076
|
+
offset = offset || 0;
|
|
21077
|
+
for (let i2 = 0; i2 < 16; ++i2) {
|
|
21078
|
+
buf[offset + i2] = rnds[i2];
|
|
21079
|
+
}
|
|
21080
|
+
return buf;
|
|
21081
|
+
}
|
|
21082
|
+
return unsafeStringify(rnds);
|
|
21083
|
+
}
|
|
20780
21084
|
const DEVICE_ID_KEY = "veplayer_live_device_id";
|
|
20781
21085
|
const USER_ID_Key = "veplayer_live_user_id";
|
|
20782
21086
|
const genRandomID2 = (length) => {
|
|
@@ -20802,6 +21106,45 @@ const getUserId2 = () => {
|
|
|
20802
21106
|
localStorage.setItem(USER_ID_Key, userId);
|
|
20803
21107
|
return userId;
|
|
20804
21108
|
};
|
|
21109
|
+
const generateUrlWithSessionId = (url) => {
|
|
21110
|
+
var _a, _b;
|
|
21111
|
+
if (!url) {
|
|
21112
|
+
return "";
|
|
21113
|
+
}
|
|
21114
|
+
const withoutProtocol = url.startsWith("//");
|
|
21115
|
+
if (withoutProtocol) {
|
|
21116
|
+
url = location.protocol + url;
|
|
21117
|
+
}
|
|
21118
|
+
try {
|
|
21119
|
+
const urlObject = new URL(url);
|
|
21120
|
+
if ((_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.get("_session_id")) {
|
|
21121
|
+
return url;
|
|
21122
|
+
}
|
|
21123
|
+
(_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append("_session_id", generateSessionId());
|
|
21124
|
+
return urlObject.toString();
|
|
21125
|
+
} catch (error2) {
|
|
21126
|
+
return url;
|
|
21127
|
+
}
|
|
21128
|
+
};
|
|
21129
|
+
const hashCode = (str) => {
|
|
21130
|
+
str += "";
|
|
21131
|
+
let h2 = 0;
|
|
21132
|
+
let off = 0;
|
|
21133
|
+
const len = str.length;
|
|
21134
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
21135
|
+
h2 = 31 * h2 + str.charCodeAt(off++);
|
|
21136
|
+
if (h2 > 140737488355327 || h2 < -140737488355328) {
|
|
21137
|
+
h2 &= 281474976710655;
|
|
21138
|
+
}
|
|
21139
|
+
}
|
|
21140
|
+
if (h2 < 0) {
|
|
21141
|
+
h2 += 2251799813685247;
|
|
21142
|
+
}
|
|
21143
|
+
return h2;
|
|
21144
|
+
};
|
|
21145
|
+
const generateSessionId = () => {
|
|
21146
|
+
return v4().replace(/-/g, "") + "." + Date.now() + "." + hashCode(v4().replace(/-/g, ""));
|
|
21147
|
+
};
|
|
20805
21148
|
const CN_APPID = 468759;
|
|
20806
21149
|
const CHANNEL = "cn";
|
|
20807
21150
|
const CHANNEL_DOMAIN = "//mcs.volceapplog.com";
|
|
@@ -20880,10 +21223,10 @@ class Logger extends Plugin {
|
|
|
20880
21223
|
user_id: this._userId,
|
|
20881
21224
|
device_id: this._deviceId,
|
|
20882
21225
|
ext: {
|
|
20883
|
-
veplayer_version: "2.
|
|
20884
|
-
flv_version: "3.0.
|
|
20885
|
-
hls_version: "3.0.
|
|
20886
|
-
rts_version: "0.2.0-alpha.
|
|
21226
|
+
veplayer_version: "2.1.0-rc.0",
|
|
21227
|
+
flv_version: "3.0.10-alpha.4",
|
|
21228
|
+
hls_version: "3.0.10-alpha.4",
|
|
21229
|
+
rts_version: "0.2.0-alpha.5"
|
|
20887
21230
|
}
|
|
20888
21231
|
});
|
|
20889
21232
|
}
|
|
@@ -21160,6 +21503,10 @@ const LIVE_DEFAULT_OPTIONS = {
|
|
|
21160
21503
|
autoplay: { muted: true }
|
|
21161
21504
|
};
|
|
21162
21505
|
const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
|
|
21506
|
+
var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
|
|
21507
|
+
RTMCodec2["H264"] = "h264";
|
|
21508
|
+
return RTMCodec2;
|
|
21509
|
+
})(RTMCodec || {});
|
|
21163
21510
|
class VePlayerLive extends VePlayerBase {
|
|
21164
21511
|
/**
|
|
21165
21512
|
* @hidden
|
|
@@ -21199,6 +21546,8 @@ class VePlayerLive extends VePlayerBase {
|
|
|
21199
21546
|
}
|
|
21200
21547
|
}
|
|
21201
21548
|
async function createLivePlayer(options) {
|
|
21549
|
+
var _a, _b;
|
|
21550
|
+
let player = void 0;
|
|
21202
21551
|
if (!options || !options.url && !options.playlist) {
|
|
21203
21552
|
throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
|
|
21204
21553
|
}
|
|
@@ -21207,18 +21556,35 @@ async function createLivePlayer(options) {
|
|
|
21207
21556
|
...options,
|
|
21208
21557
|
plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
|
|
21209
21558
|
};
|
|
21210
|
-
|
|
21559
|
+
player = await VePlayerBase.create(
|
|
21211
21560
|
{
|
|
21212
21561
|
...LIVE_DEFAULT_OPTIONS,
|
|
21213
21562
|
...finalOptions,
|
|
21214
21563
|
isLive: true,
|
|
21215
21564
|
i18nManager: i18n,
|
|
21565
|
+
preProcessUrl: (url) => {
|
|
21566
|
+
return {
|
|
21567
|
+
url: generateUrlWithSessionId(url)
|
|
21568
|
+
};
|
|
21569
|
+
},
|
|
21216
21570
|
async preparePlugins(url) {
|
|
21217
|
-
return getTypeStrategy({ ...finalOptions, url });
|
|
21571
|
+
return getTypeStrategy({ ...finalOptions, url }, player);
|
|
21218
21572
|
}
|
|
21219
21573
|
},
|
|
21220
21574
|
VePlayerLive
|
|
21221
21575
|
);
|
|
21576
|
+
if (player) {
|
|
21577
|
+
const RTMDegrade = (_b = (_a = player == null ? void 0 : player._player) == null ? void 0 : _a.config) == null ? void 0 : _b._RTMdegrade;
|
|
21578
|
+
if (RTMDegrade) {
|
|
21579
|
+
player.emit("degrade", {
|
|
21580
|
+
originRtmUrl: RTMDegrade._originRtmUrl,
|
|
21581
|
+
code: "NOT_SUPPORT",
|
|
21582
|
+
message: "not support rtm or h264",
|
|
21583
|
+
isRTMSupported: RTMDegrade._isRTMSupported,
|
|
21584
|
+
isRTMSupportCodec: RTMDegrade._isRTMSupportCodec
|
|
21585
|
+
});
|
|
21586
|
+
}
|
|
21587
|
+
}
|
|
21222
21588
|
return player;
|
|
21223
21589
|
}
|
|
21224
21590
|
var live = /* @__PURE__ */ Object.freeze({
|