@volcengine/veplayer 2.8.0-rc.1 → 2.8.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/esm/index.d.ts +523 -130
- package/esm/veplayer.biz.live.development.js +370 -123
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +1205 -264
- package/esm/veplayer.development.js +352 -89
- package/esm/veplayer.live.d.ts +1211 -265
- package/esm/veplayer.live.development.js +360 -90
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +523 -130
- package/esm/veplayer.vod.development.js +96 -8
- package/esm/veplayer.vod.production.js +3 -3
- package/package.json +1 -1
- package/umd/index.d.ts +523 -130
- package/umd/veplayer.biz.live.development.js +363 -123
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +1205 -264
- package/umd/veplayer.development.js +352 -89
- package/umd/veplayer.live.d.ts +1211 -265
- package/umd/veplayer.live.development.js +352 -89
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +523 -130
- package/umd/veplayer.vod.development.js +96 -8
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +1205 -264
- package/veplayer.live.d.ts +1211 -265
- package/veplayer.vod.d.ts +523 -130
|
@@ -6539,11 +6539,20 @@ var ErrorCode$1 = /* @__PURE__ */ ((ErrorCode2) => {
|
|
|
6539
6539
|
ErrorCode2[ErrorCode2["MEDIA_MSE_HIJACK"] = 5204] = "MEDIA_MSE_HIJACK";
|
|
6540
6540
|
ErrorCode2[ErrorCode2["MEDIA_EME_HIJACK"] = 5301] = "MEDIA_EME_HIJACK";
|
|
6541
6541
|
ErrorCode2[ErrorCode2["DRM_LICENSE"] = 7100] = "DRM_LICENSE";
|
|
6542
|
+
ErrorCode2[ErrorCode2["DRM_UNSUPPORTED"] = 7101] = "DRM_UNSUPPORTED";
|
|
6543
|
+
ErrorCode2[ErrorCode2["DRM_NO_MEDIA_KEY"] = 7103] = "DRM_NO_MEDIA_KEY";
|
|
6544
|
+
ErrorCode2[ErrorCode2["DRM_NO_KEY_SESSION"] = 7104] = "DRM_NO_KEY_SESSION";
|
|
6545
|
+
ErrorCode2[ErrorCode2["DRM_GENERATE_QUEST_FAIL"] = 7105] = "DRM_GENERATE_QUEST_FAIL";
|
|
6546
|
+
ErrorCode2[ErrorCode2["DRM_LACK_SERVER_CERTIFICATE_PATH"] = 7106] = "DRM_LACK_SERVER_CERTIFICATE_PATH";
|
|
6547
|
+
ErrorCode2[ErrorCode2["DRM_LACK_SERVER_PROCESS_SPC_PATH"] = 7107] = "DRM_LACK_SERVER_PROCESS_SPC_PATH";
|
|
6548
|
+
ErrorCode2[ErrorCode2["DRM_LICENSE_FAIL"] = 7108] = "DRM_LICENSE_FAIL";
|
|
6549
|
+
ErrorCode2[ErrorCode2["DRM_KEY_ERROR"] = 7109] = "DRM_KEY_ERROR";
|
|
6550
|
+
ErrorCode2[ErrorCode2["DRM_CERT_FAIL"] = 7110] = "DRM_CERT_FAIL";
|
|
6542
6551
|
ErrorCode2[ErrorCode2["DRM_CUSTOM_LICENSE"] = 7200] = "DRM_CUSTOM_LICENSE";
|
|
6543
6552
|
ErrorCode2[ErrorCode2["OTHER"] = 8e3] = "OTHER";
|
|
6544
6553
|
ErrorCode2[ErrorCode2["RUNTIME_NO_CANPLAY_ERROR"] = 9001] = "RUNTIME_NO_CANPLAY_ERROR";
|
|
6545
6554
|
ErrorCode2[ErrorCode2["RUNTIME_BUFFERBREAK_ERROR"] = 9002] = "RUNTIME_BUFFERBREAK_ERROR";
|
|
6546
|
-
ErrorCode2[ErrorCode2["
|
|
6555
|
+
ErrorCode2[ErrorCode2["RUNTIME_WAITING_TIMEOUT_ERROR"] = 9003] = "RUNTIME_WAITING_TIMEOUT_ERROR";
|
|
6547
6556
|
ErrorCode2[ErrorCode2["MODULE_LOAD_ERROR"] = 110] = "MODULE_LOAD_ERROR";
|
|
6548
6557
|
ErrorCode2["UNKNOWN"] = "UNKNOWN";
|
|
6549
6558
|
return ErrorCode2;
|
|
@@ -6655,6 +6664,78 @@ const ERROR_INFO = {
|
|
|
6655
6664
|
messageTextKey: "DRM_LICENSE",
|
|
6656
6665
|
level: "Fatal"
|
|
6657
6666
|
/* Fatal */
|
|
6667
|
+
},
|
|
6668
|
+
[
|
|
6669
|
+
7101
|
|
6670
|
+
/* DRM_UNSUPPORTED */
|
|
6671
|
+
]: {
|
|
6672
|
+
messageTextKey: "DRM_UNSUPPORTED",
|
|
6673
|
+
level: "Fatal"
|
|
6674
|
+
/* Fatal */
|
|
6675
|
+
},
|
|
6676
|
+
[
|
|
6677
|
+
7103
|
|
6678
|
+
/* DRM_NO_MEDIA_KEY */
|
|
6679
|
+
]: {
|
|
6680
|
+
messageTextKey: "DRM_NO_MEDIA_KEY",
|
|
6681
|
+
level: "Fatal"
|
|
6682
|
+
/* Fatal */
|
|
6683
|
+
},
|
|
6684
|
+
[
|
|
6685
|
+
7104
|
|
6686
|
+
/* DRM_NO_KEY_SESSION */
|
|
6687
|
+
]: {
|
|
6688
|
+
messageTextKey: "DRM_NO_KEY_SESSION",
|
|
6689
|
+
level: "Fatal"
|
|
6690
|
+
/* Fatal */
|
|
6691
|
+
},
|
|
6692
|
+
[
|
|
6693
|
+
7105
|
|
6694
|
+
/* DRM_GENERATE_QUEST_FAIL */
|
|
6695
|
+
]: {
|
|
6696
|
+
messageTextKey: "DRM_GENERATE_QUEST_FAIL",
|
|
6697
|
+
level: "Fatal"
|
|
6698
|
+
/* Fatal */
|
|
6699
|
+
},
|
|
6700
|
+
[
|
|
6701
|
+
7106
|
|
6702
|
+
/* DRM_LACK_SERVER_CERTIFICATE_PATH */
|
|
6703
|
+
]: {
|
|
6704
|
+
messageTextKey: "DRM_LACK_SERVER_CERTIFICATE_PATH",
|
|
6705
|
+
level: "Fatal"
|
|
6706
|
+
/* Fatal */
|
|
6707
|
+
},
|
|
6708
|
+
[
|
|
6709
|
+
7107
|
|
6710
|
+
/* DRM_LACK_SERVER_PROCESS_SPC_PATH */
|
|
6711
|
+
]: {
|
|
6712
|
+
messageTextKey: "DRM_LACK_SERVER_PROCESS_SPC_PATH",
|
|
6713
|
+
level: "Fatal"
|
|
6714
|
+
/* Fatal */
|
|
6715
|
+
},
|
|
6716
|
+
[
|
|
6717
|
+
7108
|
|
6718
|
+
/* DRM_LICENSE_FAIL */
|
|
6719
|
+
]: {
|
|
6720
|
+
messageTextKey: "DRM_LICENSE_FAIL",
|
|
6721
|
+
level: "Fatal"
|
|
6722
|
+
/* Fatal */
|
|
6723
|
+
},
|
|
6724
|
+
[
|
|
6725
|
+
7109
|
|
6726
|
+
/* DRM_KEY_ERROR */
|
|
6727
|
+
]: {
|
|
6728
|
+
messageTextKey: "DRM_KEY_ERROR",
|
|
6729
|
+
level: "Fatal"
|
|
6730
|
+
/* Fatal */
|
|
6731
|
+
},
|
|
6732
|
+
[
|
|
6733
|
+
7110
|
|
6734
|
+
/* DRM_CERT_FAIL */
|
|
6735
|
+
]: {
|
|
6736
|
+
messageTextKey: "DRM_CERT_FAIL",
|
|
6737
|
+
level: "Fatal"
|
|
6738
|
+
/* Fatal */
|
|
6658
6739
|
}
|
|
6659
6740
|
};
|
|
6660
6741
|
const ERROR_TYPE_INFO = {
|
|
@@ -12717,6 +12798,7 @@ const NAME_MAP = {
|
|
|
12717
12798
|
"plugin:mp4": "veplayer.plugin.mp4.[env].[ext]",
|
|
12718
12799
|
"plugin:hls": "veplayer.plugin.hls.[env].[ext]",
|
|
12719
12800
|
"plugin:hlsjs": "veplayer.plugin.hlsjs.[env].[ext]",
|
|
12801
|
+
"plugin:dashjs": "veplayer.plugin.dashjs.[env].[ext]",
|
|
12720
12802
|
"plugin:shaka": "veplayer.plugin.shaka.[env].[ext]",
|
|
12721
12803
|
"plugin:rtm": "veplayer.plugin.rtm.[env].[ext]",
|
|
12722
12804
|
"plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]",
|
|
@@ -12732,6 +12814,7 @@ var DynamicModule = /* @__PURE__ */ ((DynamicModule2) => {
|
|
|
12732
12814
|
DynamicModule2["PluginMp4"] = "plugin:mp4";
|
|
12733
12815
|
DynamicModule2["PluginHls"] = "plugin:hls";
|
|
12734
12816
|
DynamicModule2["PluginHlsJs"] = "plugin:hlsjs";
|
|
12817
|
+
DynamicModule2["PluginDashJs"] = "plugin:dashjs";
|
|
12735
12818
|
DynamicModule2["PluginShaka"] = "plugin:shaka";
|
|
12736
12819
|
DynamicModule2["PluginRtm"] = "plugin:rtm";
|
|
12737
12820
|
DynamicModule2["PluginXgvideo"] = "plugin:xgvideo";
|
|
@@ -14076,6 +14159,15 @@ const EN$1 = {
|
|
|
14076
14159
|
MEDIA_ERR_URL_EMPTY: "The stream address is not specified",
|
|
14077
14160
|
DRM: "Permission verification failed",
|
|
14078
14161
|
DRM_LICENSE: "Commercial DRM Permission verification failed",
|
|
14162
|
+
DRM_UNSUPPORTED: "DRM encrypted playback is not supported",
|
|
14163
|
+
DRM_NO_MEDIA_KEY: "Video data lacks the corresponding MediaKey",
|
|
14164
|
+
DRM_NO_KEY_SESSION: "Browser does not support the corresponding DRM KeySession",
|
|
14165
|
+
DRM_GENERATE_QUEST_FAIL: "Decryption playback error",
|
|
14166
|
+
DRM_LACK_SERVER_CERTIFICATE_PATH: "Missing DRM certificate request link",
|
|
14167
|
+
DRM_LACK_SERVER_PROCESS_SPC_PATH: "Missing DRM License request link",
|
|
14168
|
+
DRM_LICENSE_FAIL: "Request or update License failed",
|
|
14169
|
+
DRM_KEY_ERROR: "Decryption error",
|
|
14170
|
+
DRM_CERT_FAIL: "Request for DRM certificate failed",
|
|
14079
14171
|
OTHER: "Unknown error",
|
|
14080
14172
|
RUNTIME: "An error occurred, Please try again",
|
|
14081
14173
|
MODULE_LOAD_ERROR: "CDN fetch error",
|
|
@@ -14103,6 +14195,15 @@ const ZH_CN$1 = {
|
|
|
14103
14195
|
MEDIA_ERR_URL_EMPTY: "当前播放地址为空",
|
|
14104
14196
|
DRM: "权限验证失败",
|
|
14105
14197
|
DRM_LICENSE: "商业 DRM LICENSE 鉴权失败",
|
|
14198
|
+
DRM_UNSUPPORTED: "不支持 DRM 加密播放",
|
|
14199
|
+
DRM_NO_MEDIA_KEY: "视频数据缺少相应 MediaKey",
|
|
14200
|
+
DRM_NO_KEY_SESSION: "浏览器不支持相应 DRM KeySession",
|
|
14201
|
+
DRM_GENERATE_QUEST_FAIL: "解密播放错误",
|
|
14202
|
+
DRM_LACK_SERVER_CERTIFICATE_PATH: "缺少 DRM 证书请求链接",
|
|
14203
|
+
DRM_LACK_SERVER_PROCESS_SPC_PATH: "缺少 DRM License 请求链接",
|
|
14204
|
+
DRM_LICENSE_FAIL: "请求或更新 License 失败",
|
|
14205
|
+
DRM_KEY_ERROR: "解密错误",
|
|
14206
|
+
DRM_CERT_FAIL: "请求 DRM 证书失败",
|
|
14106
14207
|
OTHER: "其他报错",
|
|
14107
14208
|
RUNTIME: "播放异常,请重试",
|
|
14108
14209
|
MODULE_LOAD_ERROR: "插件模块加载异常",
|
|
@@ -14199,10 +14300,15 @@ const transformOption = (
|
|
|
14199
14300
|
* @param options 更多配置信息。
|
|
14200
14301
|
*/
|
|
14201
14302
|
(options) => {
|
|
14303
|
+
var _a, _b;
|
|
14202
14304
|
const { autoplay: autoplay2, ...rest } = options;
|
|
14203
14305
|
const xgOptions = rest;
|
|
14204
14306
|
if (xgOptions.poster) {
|
|
14205
|
-
xgOptions.poster
|
|
14307
|
+
if (typeof xgOptions.poster === "string") {
|
|
14308
|
+
xgOptions.poster = escapeHtml(xgOptions.poster);
|
|
14309
|
+
} else if (typeof ((_a = xgOptions.poster) == null ? void 0 : _a.poster) === "string") {
|
|
14310
|
+
xgOptions.poster.poster = escapeHtml((_b = xgOptions.poster) == null ? void 0 : _b.poster);
|
|
14311
|
+
}
|
|
14206
14312
|
}
|
|
14207
14313
|
xgOptions.icons = {
|
|
14208
14314
|
...DEFAULT_ICONS,
|
|
@@ -14454,7 +14560,7 @@ class VePlayerBase {
|
|
|
14454
14560
|
* @brief Retrieve the player SDK version number.
|
|
14455
14561
|
*/
|
|
14456
14562
|
get playerVersion() {
|
|
14457
|
-
return "2.8.0
|
|
14563
|
+
return "2.8.0";
|
|
14458
14564
|
}
|
|
14459
14565
|
/** {zh}
|
|
14460
14566
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -14729,7 +14835,7 @@ class VePlayerBase {
|
|
|
14729
14835
|
}
|
|
14730
14836
|
}
|
|
14731
14837
|
/** {zh}
|
|
14732
|
-
* @brief
|
|
14838
|
+
* @brief 调用此方法开始播放。
|
|
14733
14839
|
*/
|
|
14734
14840
|
/** {en}
|
|
14735
14841
|
* @brief Starts playback.
|
|
@@ -15013,7 +15119,7 @@ class VePlayerBase {
|
|
|
15013
15119
|
return transform(event, callback);
|
|
15014
15120
|
}
|
|
15015
15121
|
async _switch(targetDefinition) {
|
|
15016
|
-
var _a, _b, _c, _d, _e2, _f;
|
|
15122
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h;
|
|
15017
15123
|
const preDefinition = clonedeep(this._sourceManager.definition);
|
|
15018
15124
|
const isPaused = this._player.paused && !this._player.isError;
|
|
15019
15125
|
const {
|
|
@@ -15026,9 +15132,9 @@ class VePlayerBase {
|
|
|
15026
15132
|
targetDefinition.url = options == null ? void 0 : options.url;
|
|
15027
15133
|
}
|
|
15028
15134
|
this._sourceManager.switch(targetDefinition);
|
|
15029
|
-
(_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.sources.renderItemList();
|
|
15030
|
-
(
|
|
15031
|
-
const isSourceSwitching = ((
|
|
15135
|
+
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.sources) == null ? void 0 : _c.renderItemList();
|
|
15136
|
+
(_f = (_e2 = (_d = this._player) == null ? void 0 : _d.plugins) == null ? void 0 : _e2.definition) == null ? void 0 : _f.renderItemList();
|
|
15137
|
+
const isSourceSwitching = ((_g = targetDefinition == null ? void 0 : targetDefinition.source) == null ? void 0 : _g.name) !== ((_h = preDefinition == null ? void 0 : preDefinition.source) == null ? void 0 : _h.name);
|
|
15032
15138
|
this._player.config.url = targetDefinition.url;
|
|
15033
15139
|
if (isSameProtocol) {
|
|
15034
15140
|
if (isSourceSwitching) {
|
|
@@ -21941,10 +22047,10 @@ let Logger$1 = class Logger extends Plugin {
|
|
|
21941
22047
|
device_id: (_f = (_e2 = this.player.config) == null ? void 0 : _e2.teaTracker) == null ? void 0 : _f.deviceId,
|
|
21942
22048
|
error_report_stop: true,
|
|
21943
22049
|
ext: {
|
|
21944
|
-
veplayer_version: "2.8.0
|
|
22050
|
+
veplayer_version: "2.8.0",
|
|
21945
22051
|
flv_version: "3.0.21-rc.21",
|
|
21946
22052
|
hls_version: "3.0.21-rc.21",
|
|
21947
|
-
rts_version: "0.2.1-alpha.
|
|
22053
|
+
rts_version: "0.2.1-alpha.35"
|
|
21948
22054
|
}
|
|
21949
22055
|
});
|
|
21950
22056
|
}
|
|
@@ -22318,7 +22424,28 @@ const LiveUrlType = {
|
|
|
22318
22424
|
LLHls: "ll-hls",
|
|
22319
22425
|
Flv: "flv",
|
|
22320
22426
|
Rtm: "rtm",
|
|
22321
|
-
LLFlv: "ll-flv"
|
|
22427
|
+
LLFlv: "ll-flv",
|
|
22428
|
+
Dash: "dash"
|
|
22429
|
+
};
|
|
22430
|
+
var DrmType = /* @__PURE__ */ ((DrmType2) => {
|
|
22431
|
+
DrmType2["Widevine"] = "widevine";
|
|
22432
|
+
DrmType2["Fairplay"] = "fairplay";
|
|
22433
|
+
DrmType2["Playready"] = "playready";
|
|
22434
|
+
return DrmType2;
|
|
22435
|
+
})(DrmType || {});
|
|
22436
|
+
const KeyNameMap = {
|
|
22437
|
+
[
|
|
22438
|
+
"widevine"
|
|
22439
|
+
/* Widevine */
|
|
22440
|
+
]: "com.widevine.alpha",
|
|
22441
|
+
[
|
|
22442
|
+
"playready"
|
|
22443
|
+
/* Playready */
|
|
22444
|
+
]: "com.microsoft.playready",
|
|
22445
|
+
[
|
|
22446
|
+
"fairplay"
|
|
22447
|
+
/* Fairplay */
|
|
22448
|
+
]: "com.apple.fps"
|
|
22322
22449
|
};
|
|
22323
22450
|
const { isMMSSupported: isMMSSupported$1, isMseSupported: isMseSupported$2 } = util;
|
|
22324
22451
|
function enableMMS() {
|
|
@@ -22482,6 +22609,9 @@ class FlvProtocol extends BaseProtocol {
|
|
|
22482
22609
|
getVeStrategy() {
|
|
22483
22610
|
return void 0;
|
|
22484
22611
|
}
|
|
22612
|
+
updateDrmConfig() {
|
|
22613
|
+
return void 0;
|
|
22614
|
+
}
|
|
22485
22615
|
}
|
|
22486
22616
|
class FlvLowLatencyProtocol extends FlvProtocol {
|
|
22487
22617
|
get protocolType() {
|
|
@@ -22497,47 +22627,54 @@ class FlvLowLatencyProtocol extends FlvProtocol {
|
|
|
22497
22627
|
});
|
|
22498
22628
|
}
|
|
22499
22629
|
}
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
return
|
|
22503
|
-
}
|
|
22504
|
-
function
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
}
|
|
22508
|
-
return;
|
|
22509
|
-
}
|
|
22510
|
-
function isMseSupportedWithDrm({
|
|
22511
|
-
drm,
|
|
22512
|
-
streamType
|
|
22513
|
-
}) {
|
|
22514
|
-
const drmType = getDrmType(drm);
|
|
22515
|
-
if (!drmType) {
|
|
22516
|
-
return true;
|
|
22517
|
-
}
|
|
22518
|
-
if (drmType === "fairplay" && streamType === "hls") {
|
|
22630
|
+
function preferNativeForFairplay(options) {
|
|
22631
|
+
var _a;
|
|
22632
|
+
return ((_a = options == null ? void 0 : options.drm) == null ? void 0 : _a.fairplay) && (sniffer$1.browser === "safari" || sniffer$1.os.isIos);
|
|
22633
|
+
}
|
|
22634
|
+
function enableMse(options) {
|
|
22635
|
+
var _a;
|
|
22636
|
+
if (preferNativeForFairplay(options)) {
|
|
22519
22637
|
return false;
|
|
22520
22638
|
}
|
|
22521
|
-
return
|
|
22639
|
+
return sniffer$1.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE);
|
|
22522
22640
|
}
|
|
22523
|
-
const { isMseSupported: isMseSupported$1 } = util;
|
|
22524
22641
|
function enableHlsJs(options) {
|
|
22525
|
-
var _a, _b;
|
|
22526
|
-
if ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableHlsJs) {
|
|
22642
|
+
var _a, _b, _c;
|
|
22643
|
+
if (typeof ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableHlsJs) !== "undefined") {
|
|
22644
|
+
return (_b = options.hls) == null ? void 0 : _b.enableHlsJs;
|
|
22645
|
+
}
|
|
22646
|
+
if (((_c = options == null ? void 0 : options.ad) == null ? void 0 : _c.adType) === "ssai") {
|
|
22527
22647
|
return true;
|
|
22528
22648
|
}
|
|
22529
|
-
if (
|
|
22649
|
+
if (options.drm) {
|
|
22530
22650
|
return true;
|
|
22531
22651
|
}
|
|
22532
22652
|
return false;
|
|
22533
22653
|
}
|
|
22654
|
+
function transformHlsDrmConfig(drmConfig) {
|
|
22655
|
+
const drmSystems = {};
|
|
22656
|
+
for (const key in drmConfig) {
|
|
22657
|
+
if (drmConfig.hasOwnProperty(key)) {
|
|
22658
|
+
const drmSystemKey = KeyNameMap[key];
|
|
22659
|
+
const drmSystemUrls = drmConfig[key];
|
|
22660
|
+
if (drmSystemKey && drmSystemUrls) {
|
|
22661
|
+
drmSystems[drmSystemKey] = {
|
|
22662
|
+
licenseUrl: drmSystemUrls == null ? void 0 : drmSystemUrls.serverProcessSPCPath,
|
|
22663
|
+
serverCertificateUrl: drmSystemUrls == null ? void 0 : drmSystemUrls.serverCertificatePath
|
|
22664
|
+
};
|
|
22665
|
+
}
|
|
22666
|
+
}
|
|
22667
|
+
}
|
|
22668
|
+
return {
|
|
22669
|
+
emeEnabled: true,
|
|
22670
|
+
drmSystems
|
|
22671
|
+
};
|
|
22672
|
+
}
|
|
22673
|
+
const { isMseSupported: isMseSupported$1 } = util;
|
|
22534
22674
|
const getHlsStrategy = async (options) => {
|
|
22535
|
-
var _a
|
|
22675
|
+
var _a;
|
|
22536
22676
|
let mseStrategy;
|
|
22537
22677
|
let softStrategy;
|
|
22538
|
-
if (!isMseSupportedWithDrm({ drm: options.drm, streamType: "hls" })) {
|
|
22539
|
-
return { options: {}, plugins: [] };
|
|
22540
|
-
}
|
|
22541
22678
|
const codec = await getCodec(options);
|
|
22542
22679
|
const isSoftDecode$1 = await isSoftDecode(options, codec);
|
|
22543
22680
|
const useHlsJs = enableHlsJs(options);
|
|
@@ -22545,7 +22682,7 @@ const getHlsStrategy = async (options) => {
|
|
|
22545
22682
|
softStrategy = codec === Codec$1.H265 ? createSoftDecodeH265Strategy() : createSoftDecodeH264Strategy();
|
|
22546
22683
|
mseStrategy = createHlsMseStrategy(options, useHlsJs);
|
|
22547
22684
|
}
|
|
22548
|
-
if ((
|
|
22685
|
+
if (enableMse(options) && (codec === "unknown" ? isMseSupported$1(Codec$1.H264) : isMseSupported$1(codec))) {
|
|
22549
22686
|
mseStrategy = createHlsMseStrategy(options, useHlsJs);
|
|
22550
22687
|
}
|
|
22551
22688
|
if (!mseStrategy && !softStrategy) {
|
|
@@ -22555,7 +22692,7 @@ const getHlsStrategy = async (options) => {
|
|
|
22555
22692
|
(mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0),
|
|
22556
22693
|
(softStrategy == null ? void 0 : softStrategy.module) && load(softStrategy.module).catch(() => void 0)
|
|
22557
22694
|
]);
|
|
22558
|
-
(softModule == null ? void 0 : softModule.XGVideoPlugin) && ((
|
|
22695
|
+
(softModule == null ? void 0 : softModule.XGVideoPlugin) && ((_a = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _a.call(softStrategy, softModule == null ? void 0 : softModule.XGVideoPlugin));
|
|
22559
22696
|
const combineOptions$1 = combineOptions([mseStrategy, softStrategy]);
|
|
22560
22697
|
return {
|
|
22561
22698
|
options: combineOptions$1,
|
|
@@ -22626,37 +22763,6 @@ function modifyPlaylistUrl(playlist, callback) {
|
|
|
22626
22763
|
});
|
|
22627
22764
|
return newPlaylist;
|
|
22628
22765
|
}
|
|
22629
|
-
const getDrmStrategy = async (options, player) => {
|
|
22630
|
-
var _a;
|
|
22631
|
-
const drmType = getDrmType(options.drm);
|
|
22632
|
-
if (options.url && drmType === DrmType.Fairplay) {
|
|
22633
|
-
try {
|
|
22634
|
-
const { getDrmConfig, ...originFairplayConfig } = ((_a = options == null ? void 0 : options.drm) == null ? void 0 : _a.fairplay) ?? {};
|
|
22635
|
-
const [drmPlugin, drmConfig] = await Promise.all([
|
|
22636
|
-
load(DynamicModule.PluginDrm).then((module) => module.DrmPlugin).catch(() => void 0),
|
|
22637
|
-
getDrmConfig == null ? void 0 : getDrmConfig({
|
|
22638
|
-
url: options.url
|
|
22639
|
-
})
|
|
22640
|
-
]);
|
|
22641
|
-
const fairplayDrmConfig = Object.assign(
|
|
22642
|
-
{},
|
|
22643
|
-
originFairplayConfig,
|
|
22644
|
-
options == null ? void 0 : options.drm,
|
|
22645
|
-
drmConfig
|
|
22646
|
-
);
|
|
22647
|
-
drmConfig && (player == null ? void 0 : player.updateDrmConfig(drmConfig));
|
|
22648
|
-
return {
|
|
22649
|
-
options: {
|
|
22650
|
-
drm: fairplayDrmConfig
|
|
22651
|
-
},
|
|
22652
|
-
plugins: drmPlugin ? [drmPlugin] : []
|
|
22653
|
-
};
|
|
22654
|
-
} catch (error2) {
|
|
22655
|
-
console.log(error2);
|
|
22656
|
-
}
|
|
22657
|
-
}
|
|
22658
|
-
return {};
|
|
22659
|
-
};
|
|
22660
22766
|
class HlsProtocol extends BaseProtocol {
|
|
22661
22767
|
static get suffix() {
|
|
22662
22768
|
return ".m3u8";
|
|
@@ -22713,14 +22819,58 @@ class HlsProtocol extends BaseProtocol {
|
|
|
22713
22819
|
plugins: [abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin]
|
|
22714
22820
|
};
|
|
22715
22821
|
}
|
|
22716
|
-
|
|
22717
|
-
|
|
22822
|
+
async updateDrmConfig(drmConfig, player) {
|
|
22823
|
+
var _a, _b, _c, _d;
|
|
22824
|
+
if (!drmConfig) {
|
|
22825
|
+
return;
|
|
22826
|
+
}
|
|
22827
|
+
const drmPlugin = (_b = (_a = player == null ? void 0 : player._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm;
|
|
22828
|
+
const hlsPlugin = (_d = (_c = player == null ? void 0 : player._player) == null ? void 0 : _c.plugins) == null ? void 0 : _d.hls;
|
|
22829
|
+
if (drmPlugin) {
|
|
22830
|
+
drmPlugin.restart();
|
|
22831
|
+
return drmPlugin.updateConfig(drmConfig);
|
|
22832
|
+
} else if (hlsPlugin) {
|
|
22833
|
+
hlsPlugin.config = {
|
|
22834
|
+
...hlsPlugin.config,
|
|
22835
|
+
...transformHlsDrmConfig(drmConfig)
|
|
22836
|
+
};
|
|
22837
|
+
}
|
|
22838
|
+
}
|
|
22839
|
+
async getDrmStrategy(options, { player }) {
|
|
22840
|
+
try {
|
|
22841
|
+
if (!(options == null ? void 0 : options.drm)) {
|
|
22842
|
+
return { options: {}, plugins: [] };
|
|
22843
|
+
}
|
|
22844
|
+
const drmConfig = (options == null ? void 0 : options.drm) ?? {};
|
|
22845
|
+
if (!preferNativeForFairplay(options) && enableHlsJs(options)) {
|
|
22846
|
+
return {
|
|
22847
|
+
options: {
|
|
22848
|
+
hls: {
|
|
22849
|
+
...options.hls,
|
|
22850
|
+
...transformHlsDrmConfig(drmConfig)
|
|
22851
|
+
}
|
|
22852
|
+
},
|
|
22853
|
+
plugins: []
|
|
22854
|
+
};
|
|
22855
|
+
}
|
|
22856
|
+
const drmPlugin = await load(DynamicModule.PluginDrm).then((module) => module.DrmPlugin).catch(() => void 0);
|
|
22857
|
+
drmConfig && await (player == null ? void 0 : player.updateDrmConfig(drmConfig));
|
|
22858
|
+
return {
|
|
22859
|
+
options: {
|
|
22860
|
+
drm: drmConfig
|
|
22861
|
+
},
|
|
22862
|
+
plugins: drmPlugin ? [drmPlugin] : []
|
|
22863
|
+
};
|
|
22864
|
+
} catch (error2) {
|
|
22865
|
+
console.log(error2);
|
|
22866
|
+
}
|
|
22867
|
+
return {};
|
|
22718
22868
|
}
|
|
22719
22869
|
getVeStrategy() {
|
|
22720
22870
|
return void 0;
|
|
22721
22871
|
}
|
|
22722
22872
|
}
|
|
22723
|
-
class HlsLowLatencyProtocol extends
|
|
22873
|
+
class HlsLowLatencyProtocol extends HlsProtocol {
|
|
22724
22874
|
static get suffix() {
|
|
22725
22875
|
return ".m3u8";
|
|
22726
22876
|
}
|
|
@@ -22745,12 +22895,6 @@ class HlsLowLatencyProtocol extends BaseProtocol {
|
|
|
22745
22895
|
async getProtocolStrategy(options) {
|
|
22746
22896
|
return getHlsStrategy(options);
|
|
22747
22897
|
}
|
|
22748
|
-
getAbrStrategy() {
|
|
22749
|
-
return void 0;
|
|
22750
|
-
}
|
|
22751
|
-
getDrmStrategy() {
|
|
22752
|
-
return void 0;
|
|
22753
|
-
}
|
|
22754
22898
|
getVeStrategy() {
|
|
22755
22899
|
return void 0;
|
|
22756
22900
|
}
|
|
@@ -22940,6 +23084,9 @@ class RtmProtocol extends BaseProtocol {
|
|
|
22940
23084
|
plugins: []
|
|
22941
23085
|
};
|
|
22942
23086
|
}
|
|
23087
|
+
updateDrmConfig() {
|
|
23088
|
+
return void 0;
|
|
23089
|
+
}
|
|
22943
23090
|
}
|
|
22944
23091
|
class ProtocolSelector {
|
|
22945
23092
|
constructor({ queue, streams, options }) {
|
|
@@ -23709,6 +23856,97 @@ lodash_merge.exports;
|
|
|
23709
23856
|
})(lodash_merge, lodash_merge.exports);
|
|
23710
23857
|
var lodash_mergeExports = lodash_merge.exports;
|
|
23711
23858
|
var merge = /* @__PURE__ */ getDefaultExportFromCjs$1(lodash_mergeExports);
|
|
23859
|
+
const createDashMseStrategy = () => ({
|
|
23860
|
+
options: {},
|
|
23861
|
+
module: DynamicModule.PluginDashJs
|
|
23862
|
+
});
|
|
23863
|
+
function isDASHSupported(codec = Codec$1.H264) {
|
|
23864
|
+
return isMMSSupported$2(codec) || isMseSupported$3(codec);
|
|
23865
|
+
}
|
|
23866
|
+
class DashProtocol extends BaseProtocol {
|
|
23867
|
+
static get suffix() {
|
|
23868
|
+
return ".mpd";
|
|
23869
|
+
}
|
|
23870
|
+
get protocolType() {
|
|
23871
|
+
return LiveUrlType.Dash;
|
|
23872
|
+
}
|
|
23873
|
+
get defaultFallbackStrategy() {
|
|
23874
|
+
return {};
|
|
23875
|
+
}
|
|
23876
|
+
static canGenerateOtherProtocol() {
|
|
23877
|
+
return true;
|
|
23878
|
+
}
|
|
23879
|
+
static generateUrl(urls, {
|
|
23880
|
+
generateUrlFromOtherProtocol: generateUrlFromOtherProtocol2
|
|
23881
|
+
}) {
|
|
23882
|
+
return urls[LiveUrlType.Dash] ?? generateUrlFromOtherProtocol2();
|
|
23883
|
+
}
|
|
23884
|
+
async canPlay() {
|
|
23885
|
+
return {
|
|
23886
|
+
canPlay: isDASHSupported()
|
|
23887
|
+
};
|
|
23888
|
+
}
|
|
23889
|
+
shouldFallbackWhenStall() {
|
|
23890
|
+
return false;
|
|
23891
|
+
}
|
|
23892
|
+
async getProtocolStrategy(options) {
|
|
23893
|
+
const mseStrategy = createDashMseStrategy();
|
|
23894
|
+
if (!mseStrategy) {
|
|
23895
|
+
return {};
|
|
23896
|
+
}
|
|
23897
|
+
const mseModule = await ((mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0));
|
|
23898
|
+
return {
|
|
23899
|
+
options: mseStrategy.options,
|
|
23900
|
+
plugins: (mseModule == null ? void 0 : mseModule.DashPlugin) ? [mseModule.DashPlugin] : []
|
|
23901
|
+
};
|
|
23902
|
+
}
|
|
23903
|
+
getAbrStrategy() {
|
|
23904
|
+
return void 0;
|
|
23905
|
+
}
|
|
23906
|
+
getVeStrategy() {
|
|
23907
|
+
return void 0;
|
|
23908
|
+
}
|
|
23909
|
+
async getDrmStrategy(options) {
|
|
23910
|
+
if (!(options == null ? void 0 : options.drm)) {
|
|
23911
|
+
return {};
|
|
23912
|
+
}
|
|
23913
|
+
const dashDrm = this._generateDashDrmConfig(options.drm);
|
|
23914
|
+
return {
|
|
23915
|
+
options: {
|
|
23916
|
+
dash: {
|
|
23917
|
+
...options.dash,
|
|
23918
|
+
protData: dashDrm
|
|
23919
|
+
}
|
|
23920
|
+
},
|
|
23921
|
+
plugins: []
|
|
23922
|
+
};
|
|
23923
|
+
}
|
|
23924
|
+
updateDrmConfig(drm, player) {
|
|
23925
|
+
var _a, _b;
|
|
23926
|
+
if (!drm) {
|
|
23927
|
+
return;
|
|
23928
|
+
}
|
|
23929
|
+
const dashDrm = this._generateDashDrmConfig(drm);
|
|
23930
|
+
const dashPlugin = (_b = (_a = player == null ? void 0 : player._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.dash;
|
|
23931
|
+
if (dashPlugin) {
|
|
23932
|
+
dashPlugin.protData = dashDrm;
|
|
23933
|
+
}
|
|
23934
|
+
}
|
|
23935
|
+
_generateDashDrmConfig(drm) {
|
|
23936
|
+
return Object.keys(drm).reduce((pre, cur) => {
|
|
23937
|
+
var _a;
|
|
23938
|
+
const keyName = KeyNameMap[cur];
|
|
23939
|
+
if (keyName) {
|
|
23940
|
+
pre[keyName] = {
|
|
23941
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23942
|
+
// @ts-ignore
|
|
23943
|
+
serverURL: (_a = drm == null ? void 0 : drm[cur]) == null ? void 0 : _a.serverProcessSPCPath
|
|
23944
|
+
};
|
|
23945
|
+
}
|
|
23946
|
+
return pre;
|
|
23947
|
+
}, {});
|
|
23948
|
+
}
|
|
23949
|
+
}
|
|
23712
23950
|
const _ProtocolManager = class {
|
|
23713
23951
|
constructor(options) {
|
|
23714
23952
|
__publicField(this, "_options");
|
|
@@ -23863,7 +24101,8 @@ __publicField(ProtocolManager, "_protocolMap", {
|
|
|
23863
24101
|
[LiveUrlType.LLFlv]: FlvLowLatencyProtocol,
|
|
23864
24102
|
[LiveUrlType.Hls]: HlsProtocol,
|
|
23865
24103
|
[LiveUrlType.LLHls]: HlsLowLatencyProtocol,
|
|
23866
|
-
[LiveUrlType.Rtm]: RtmProtocol
|
|
24104
|
+
[LiveUrlType.Rtm]: RtmProtocol,
|
|
24105
|
+
[LiveUrlType.Dash]: DashProtocol
|
|
23867
24106
|
});
|
|
23868
24107
|
class Fallback {
|
|
23869
24108
|
constructor() {
|
|
@@ -36932,7 +37171,7 @@ class VeStrategyManager {
|
|
|
36932
37171
|
}
|
|
36933
37172
|
const { appId, deviceId, Module } = this.config;
|
|
36934
37173
|
if (appId && deviceId && Module) {
|
|
36935
|
-
|
|
37174
|
+
Module.bootstrap({
|
|
36936
37175
|
...this.config,
|
|
36937
37176
|
tracker: {
|
|
36938
37177
|
Collector: this.Collector,
|
|
@@ -41479,6 +41718,12 @@ class VePlayerLive extends VePlayerBase {
|
|
|
41479
41718
|
*/
|
|
41480
41719
|
constructor(options) {
|
|
41481
41720
|
super(options);
|
|
41721
|
+
/** {en}
|
|
41722
|
+
* @hidden
|
|
41723
|
+
*/
|
|
41724
|
+
/** {zh}
|
|
41725
|
+
* @hidden
|
|
41726
|
+
*/
|
|
41482
41727
|
__publicField(this, "_protocolManager");
|
|
41483
41728
|
}
|
|
41484
41729
|
/** {zh}
|
|
@@ -41589,14 +41834,15 @@ class VePlayerLive extends VePlayerBase {
|
|
|
41589
41834
|
}
|
|
41590
41835
|
/** {zh}
|
|
41591
41836
|
* @brief 调用此方法更新 DRM 配置。
|
|
41837
|
+
* @param config DRM 配置对象,包含 Fairplay DRM 的相关设置。
|
|
41592
41838
|
*/
|
|
41593
41839
|
/** {en}
|
|
41594
41840
|
* @brief Use this method to update DRM configuration.
|
|
41595
|
-
* @param config
|
|
41841
|
+
* @param config A configuration object containing settings for Fairplay DRM.
|
|
41596
41842
|
*/
|
|
41597
|
-
updateDrmConfig(config2) {
|
|
41598
|
-
var _a, _b
|
|
41599
|
-
|
|
41843
|
+
async updateDrmConfig(config2) {
|
|
41844
|
+
var _a, _b;
|
|
41845
|
+
return (_b = (_a = this._protocolManager) == null ? void 0 : _a.protocol) == null ? void 0 : _b.updateDrmConfig(config2, this);
|
|
41600
41846
|
}
|
|
41601
41847
|
/** {zh}
|
|
41602
41848
|
* @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
|
|
@@ -41670,10 +41916,29 @@ class VePlayerLive extends VePlayerBase {
|
|
|
41670
41916
|
var _a, _b, _c;
|
|
41671
41917
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.hls) == null ? void 0 : _c.getStats();
|
|
41672
41918
|
}
|
|
41919
|
+
/** {en}
|
|
41920
|
+
* @brief This method is used to update the playlist, supporting updates to source, resolution, and related information.
|
|
41921
|
+
* @param playlist The playlist, consisting of multiple `Source` type elements.
|
|
41922
|
+
* @param target An optional target configuration, which can specify the resolution or source. Providing this information helps update the playback source for a specific resolution or stream.
|
|
41923
|
+
* @param needUpdateProtocol Whether the protocol needs to be updated.
|
|
41924
|
+
*
|
|
41925
|
+
* - `true`: Forces the protocol update to ensure compatibility with the playback configuration or source.
|
|
41926
|
+
* - `false`: Does not update the protocol and continues to use the current configuration.
|
|
41927
|
+
*/
|
|
41928
|
+
/** {zh}
|
|
41929
|
+
* @brief 调用此方法更新播放列表,支持更新源、清晰度等相关信息。
|
|
41930
|
+
* @param playlist 播放列表,包含多个 `Source` 类型的元素。
|
|
41931
|
+
* @param target 可选的目标配置项,可以指定清晰度或源。提供这些信息可以帮助更新特定清晰度或线路的播放源。
|
|
41932
|
+
* @param needUpdateProtocol 是否需要更新协议。
|
|
41933
|
+
* - `true`:强制更新协议,以确保播放配置或源的兼容性。
|
|
41934
|
+
* - `false`:不更新协议,继续使用当前配置。
|
|
41935
|
+
*/
|
|
41673
41936
|
async updatePlaylist(playlist, target, needUpdateProtocol = true) {
|
|
41674
41937
|
var _a;
|
|
41675
41938
|
if (needUpdateProtocol) {
|
|
41676
|
-
await ((_a = this._protocolManager) == null ? void 0 : _a.update({
|
|
41939
|
+
await ((_a = this._protocolManager) == null ? void 0 : _a.update({
|
|
41940
|
+
playlist
|
|
41941
|
+
}));
|
|
41677
41942
|
}
|
|
41678
41943
|
return super.updatePlaylist(playlist, target);
|
|
41679
41944
|
}
|
|
@@ -41713,7 +41978,9 @@ async function createLivePlayer(options) {
|
|
|
41713
41978
|
teaTracker,
|
|
41714
41979
|
preProcessUrl: (url2) => {
|
|
41715
41980
|
if (isType(".ts", url2)) {
|
|
41716
|
-
return {
|
|
41981
|
+
return {
|
|
41982
|
+
url: url2
|
|
41983
|
+
};
|
|
41717
41984
|
}
|
|
41718
41985
|
return {
|
|
41719
41986
|
url: generateUrlWithSessionId(url2)
|
|
@@ -41721,7 +41988,9 @@ async function createLivePlayer(options) {
|
|
|
41721
41988
|
},
|
|
41722
41989
|
async preparePlugins(url2) {
|
|
41723
41990
|
if (!protocolManager.enableSelector) {
|
|
41724
|
-
await protocolManager.update({
|
|
41991
|
+
await protocolManager.update({
|
|
41992
|
+
url: url2
|
|
41993
|
+
});
|
|
41725
41994
|
}
|
|
41726
41995
|
return protocolManager.getStrategy(
|
|
41727
41996
|
player,
|
|
@@ -41777,6 +42046,7 @@ export {
|
|
|
41777
42046
|
Codec$1 as Codec,
|
|
41778
42047
|
DecodeType,
|
|
41779
42048
|
Degradation,
|
|
42049
|
+
DrmType,
|
|
41780
42050
|
DynamicModule,
|
|
41781
42051
|
EN$1 as EN,
|
|
41782
42052
|
ListType,
|