@volcengine/veplayer 2.8.0-rc.2 → 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 +386 -27
- package/esm/veplayer.biz.live.development.js +335 -118
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +719 -79
- package/esm/veplayer.development.js +319 -84
- package/esm/veplayer.live.d.ts +725 -80
- package/esm/veplayer.live.development.js +327 -85
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +386 -27
- package/esm/veplayer.vod.development.js +98 -8
- package/esm/veplayer.vod.production.js +3 -3
- package/package.json +1 -1
- package/umd/index.d.ts +386 -27
- package/umd/veplayer.biz.live.development.js +328 -118
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +719 -79
- package/umd/veplayer.development.js +319 -84
- package/umd/veplayer.live.d.ts +725 -80
- package/umd/veplayer.live.development.js +319 -84
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +386 -27
- package/umd/veplayer.vod.development.js +98 -8
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +719 -79
- package/veplayer.live.d.ts +725 -80
- package/veplayer.vod.d.ts +386 -27
|
@@ -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)。
|
|
@@ -14975,7 +15081,9 @@ class VePlayerBase {
|
|
|
14975
15081
|
if (!url2) {
|
|
14976
15082
|
const transformedError = transform$1(err, this._i18nManager);
|
|
14977
15083
|
try {
|
|
14978
|
-
const { canEmitError } = await this._beforeFallbackError(
|
|
15084
|
+
const { canEmitError } = await this._beforeFallbackError(
|
|
15085
|
+
transformedError
|
|
15086
|
+
);
|
|
14979
15087
|
if (!canEmitError) {
|
|
14980
15088
|
return;
|
|
14981
15089
|
}
|
|
@@ -15011,7 +15119,7 @@ class VePlayerBase {
|
|
|
15011
15119
|
return transform(event, callback);
|
|
15012
15120
|
}
|
|
15013
15121
|
async _switch(targetDefinition) {
|
|
15014
|
-
var _a, _b, _c, _d, _e2, _f;
|
|
15122
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h;
|
|
15015
15123
|
const preDefinition = clonedeep(this._sourceManager.definition);
|
|
15016
15124
|
const isPaused = this._player.paused && !this._player.isError;
|
|
15017
15125
|
const {
|
|
@@ -15024,9 +15132,9 @@ class VePlayerBase {
|
|
|
15024
15132
|
targetDefinition.url = options == null ? void 0 : options.url;
|
|
15025
15133
|
}
|
|
15026
15134
|
this._sourceManager.switch(targetDefinition);
|
|
15027
|
-
(_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.sources.renderItemList();
|
|
15028
|
-
(
|
|
15029
|
-
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);
|
|
15030
15138
|
this._player.config.url = targetDefinition.url;
|
|
15031
15139
|
if (isSameProtocol) {
|
|
15032
15140
|
if (isSourceSwitching) {
|
|
@@ -21939,10 +22047,10 @@ let Logger$1 = class Logger extends Plugin {
|
|
|
21939
22047
|
device_id: (_f = (_e2 = this.player.config) == null ? void 0 : _e2.teaTracker) == null ? void 0 : _f.deviceId,
|
|
21940
22048
|
error_report_stop: true,
|
|
21941
22049
|
ext: {
|
|
21942
|
-
veplayer_version: "2.8.0
|
|
22050
|
+
veplayer_version: "2.8.0",
|
|
21943
22051
|
flv_version: "3.0.21-rc.21",
|
|
21944
22052
|
hls_version: "3.0.21-rc.21",
|
|
21945
|
-
rts_version: "0.2.1-alpha.
|
|
22053
|
+
rts_version: "0.2.1-alpha.35"
|
|
21946
22054
|
}
|
|
21947
22055
|
});
|
|
21948
22056
|
}
|
|
@@ -22316,7 +22424,28 @@ const LiveUrlType = {
|
|
|
22316
22424
|
LLHls: "ll-hls",
|
|
22317
22425
|
Flv: "flv",
|
|
22318
22426
|
Rtm: "rtm",
|
|
22319
|
-
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"
|
|
22320
22449
|
};
|
|
22321
22450
|
const { isMMSSupported: isMMSSupported$1, isMseSupported: isMseSupported$2 } = util;
|
|
22322
22451
|
function enableMMS() {
|
|
@@ -22480,6 +22609,9 @@ class FlvProtocol extends BaseProtocol {
|
|
|
22480
22609
|
getVeStrategy() {
|
|
22481
22610
|
return void 0;
|
|
22482
22611
|
}
|
|
22612
|
+
updateDrmConfig() {
|
|
22613
|
+
return void 0;
|
|
22614
|
+
}
|
|
22483
22615
|
}
|
|
22484
22616
|
class FlvLowLatencyProtocol extends FlvProtocol {
|
|
22485
22617
|
get protocolType() {
|
|
@@ -22495,47 +22627,54 @@ class FlvLowLatencyProtocol extends FlvProtocol {
|
|
|
22495
22627
|
});
|
|
22496
22628
|
}
|
|
22497
22629
|
}
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
return
|
|
22501
|
-
}
|
|
22502
|
-
function
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
}
|
|
22506
|
-
return;
|
|
22507
|
-
}
|
|
22508
|
-
function isMseSupportedWithDrm({
|
|
22509
|
-
drm,
|
|
22510
|
-
streamType
|
|
22511
|
-
}) {
|
|
22512
|
-
const drmType = getDrmType(drm);
|
|
22513
|
-
if (!drmType) {
|
|
22514
|
-
return true;
|
|
22515
|
-
}
|
|
22516
|
-
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)) {
|
|
22517
22637
|
return false;
|
|
22518
22638
|
}
|
|
22519
|
-
return
|
|
22639
|
+
return sniffer$1.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE);
|
|
22520
22640
|
}
|
|
22521
|
-
const { isMseSupported: isMseSupported$1 } = util;
|
|
22522
22641
|
function enableHlsJs(options) {
|
|
22523
|
-
var _a, _b;
|
|
22524
|
-
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") {
|
|
22525
22647
|
return true;
|
|
22526
22648
|
}
|
|
22527
|
-
if (
|
|
22649
|
+
if (options.drm) {
|
|
22528
22650
|
return true;
|
|
22529
22651
|
}
|
|
22530
22652
|
return false;
|
|
22531
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;
|
|
22532
22674
|
const getHlsStrategy = async (options) => {
|
|
22533
|
-
var _a
|
|
22675
|
+
var _a;
|
|
22534
22676
|
let mseStrategy;
|
|
22535
22677
|
let softStrategy;
|
|
22536
|
-
if (!isMseSupportedWithDrm({ drm: options.drm, streamType: "hls" })) {
|
|
22537
|
-
return { options: {}, plugins: [] };
|
|
22538
|
-
}
|
|
22539
22678
|
const codec = await getCodec(options);
|
|
22540
22679
|
const isSoftDecode$1 = await isSoftDecode(options, codec);
|
|
22541
22680
|
const useHlsJs = enableHlsJs(options);
|
|
@@ -22543,7 +22682,7 @@ const getHlsStrategy = async (options) => {
|
|
|
22543
22682
|
softStrategy = codec === Codec$1.H265 ? createSoftDecodeH265Strategy() : createSoftDecodeH264Strategy();
|
|
22544
22683
|
mseStrategy = createHlsMseStrategy(options, useHlsJs);
|
|
22545
22684
|
}
|
|
22546
|
-
if ((
|
|
22685
|
+
if (enableMse(options) && (codec === "unknown" ? isMseSupported$1(Codec$1.H264) : isMseSupported$1(codec))) {
|
|
22547
22686
|
mseStrategy = createHlsMseStrategy(options, useHlsJs);
|
|
22548
22687
|
}
|
|
22549
22688
|
if (!mseStrategy && !softStrategy) {
|
|
@@ -22553,7 +22692,7 @@ const getHlsStrategy = async (options) => {
|
|
|
22553
22692
|
(mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0),
|
|
22554
22693
|
(softStrategy == null ? void 0 : softStrategy.module) && load(softStrategy.module).catch(() => void 0)
|
|
22555
22694
|
]);
|
|
22556
|
-
(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));
|
|
22557
22696
|
const combineOptions$1 = combineOptions([mseStrategy, softStrategy]);
|
|
22558
22697
|
return {
|
|
22559
22698
|
options: combineOptions$1,
|
|
@@ -22624,37 +22763,6 @@ function modifyPlaylistUrl(playlist, callback) {
|
|
|
22624
22763
|
});
|
|
22625
22764
|
return newPlaylist;
|
|
22626
22765
|
}
|
|
22627
|
-
const getDrmStrategy = async (options, player) => {
|
|
22628
|
-
var _a;
|
|
22629
|
-
const drmType = getDrmType(options.drm);
|
|
22630
|
-
if (options.url && drmType === DrmType.Fairplay) {
|
|
22631
|
-
try {
|
|
22632
|
-
const { getDrmConfig, ...originFairplayConfig } = ((_a = options == null ? void 0 : options.drm) == null ? void 0 : _a.fairplay) ?? {};
|
|
22633
|
-
const [drmPlugin, drmConfig] = await Promise.all([
|
|
22634
|
-
load(DynamicModule.PluginDrm).then((module) => module.DrmPlugin).catch(() => void 0),
|
|
22635
|
-
getDrmConfig == null ? void 0 : getDrmConfig({
|
|
22636
|
-
url: options.url
|
|
22637
|
-
})
|
|
22638
|
-
]);
|
|
22639
|
-
const fairplayDrmConfig = Object.assign(
|
|
22640
|
-
{},
|
|
22641
|
-
originFairplayConfig,
|
|
22642
|
-
options == null ? void 0 : options.drm,
|
|
22643
|
-
drmConfig
|
|
22644
|
-
);
|
|
22645
|
-
drmConfig && (player == null ? void 0 : player.updateDrmConfig(drmConfig));
|
|
22646
|
-
return {
|
|
22647
|
-
options: {
|
|
22648
|
-
drm: fairplayDrmConfig
|
|
22649
|
-
},
|
|
22650
|
-
plugins: drmPlugin ? [drmPlugin] : []
|
|
22651
|
-
};
|
|
22652
|
-
} catch (error2) {
|
|
22653
|
-
console.log(error2);
|
|
22654
|
-
}
|
|
22655
|
-
}
|
|
22656
|
-
return {};
|
|
22657
|
-
};
|
|
22658
22766
|
class HlsProtocol extends BaseProtocol {
|
|
22659
22767
|
static get suffix() {
|
|
22660
22768
|
return ".m3u8";
|
|
@@ -22711,14 +22819,58 @@ class HlsProtocol extends BaseProtocol {
|
|
|
22711
22819
|
plugins: [abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin]
|
|
22712
22820
|
};
|
|
22713
22821
|
}
|
|
22714
|
-
|
|
22715
|
-
|
|
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 {};
|
|
22716
22868
|
}
|
|
22717
22869
|
getVeStrategy() {
|
|
22718
22870
|
return void 0;
|
|
22719
22871
|
}
|
|
22720
22872
|
}
|
|
22721
|
-
class HlsLowLatencyProtocol extends
|
|
22873
|
+
class HlsLowLatencyProtocol extends HlsProtocol {
|
|
22722
22874
|
static get suffix() {
|
|
22723
22875
|
return ".m3u8";
|
|
22724
22876
|
}
|
|
@@ -22743,12 +22895,6 @@ class HlsLowLatencyProtocol extends BaseProtocol {
|
|
|
22743
22895
|
async getProtocolStrategy(options) {
|
|
22744
22896
|
return getHlsStrategy(options);
|
|
22745
22897
|
}
|
|
22746
|
-
getAbrStrategy() {
|
|
22747
|
-
return void 0;
|
|
22748
|
-
}
|
|
22749
|
-
getDrmStrategy() {
|
|
22750
|
-
return void 0;
|
|
22751
|
-
}
|
|
22752
22898
|
getVeStrategy() {
|
|
22753
22899
|
return void 0;
|
|
22754
22900
|
}
|
|
@@ -22938,6 +23084,9 @@ class RtmProtocol extends BaseProtocol {
|
|
|
22938
23084
|
plugins: []
|
|
22939
23085
|
};
|
|
22940
23086
|
}
|
|
23087
|
+
updateDrmConfig() {
|
|
23088
|
+
return void 0;
|
|
23089
|
+
}
|
|
22941
23090
|
}
|
|
22942
23091
|
class ProtocolSelector {
|
|
22943
23092
|
constructor({ queue, streams, options }) {
|
|
@@ -23707,6 +23856,97 @@ lodash_merge.exports;
|
|
|
23707
23856
|
})(lodash_merge, lodash_merge.exports);
|
|
23708
23857
|
var lodash_mergeExports = lodash_merge.exports;
|
|
23709
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
|
+
}
|
|
23710
23950
|
const _ProtocolManager = class {
|
|
23711
23951
|
constructor(options) {
|
|
23712
23952
|
__publicField(this, "_options");
|
|
@@ -23861,7 +24101,8 @@ __publicField(ProtocolManager, "_protocolMap", {
|
|
|
23861
24101
|
[LiveUrlType.LLFlv]: FlvLowLatencyProtocol,
|
|
23862
24102
|
[LiveUrlType.Hls]: HlsProtocol,
|
|
23863
24103
|
[LiveUrlType.LLHls]: HlsLowLatencyProtocol,
|
|
23864
|
-
[LiveUrlType.Rtm]: RtmProtocol
|
|
24104
|
+
[LiveUrlType.Rtm]: RtmProtocol,
|
|
24105
|
+
[LiveUrlType.Dash]: DashProtocol
|
|
23865
24106
|
});
|
|
23866
24107
|
class Fallback {
|
|
23867
24108
|
constructor() {
|
|
@@ -41599,9 +41840,9 @@ class VePlayerLive extends VePlayerBase {
|
|
|
41599
41840
|
* @brief Use this method to update DRM configuration.
|
|
41600
41841
|
* @param config A configuration object containing settings for Fairplay DRM.
|
|
41601
41842
|
*/
|
|
41602
|
-
updateDrmConfig(config2) {
|
|
41603
|
-
var _a, _b
|
|
41604
|
-
|
|
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);
|
|
41605
41846
|
}
|
|
41606
41847
|
/** {zh}
|
|
41607
41848
|
* @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
|
|
@@ -41805,6 +42046,7 @@ export {
|
|
|
41805
42046
|
Codec$1 as Codec,
|
|
41806
42047
|
DecodeType,
|
|
41807
42048
|
Degradation,
|
|
42049
|
+
DrmType,
|
|
41808
42050
|
DynamicModule,
|
|
41809
42051
|
EN$1 as EN,
|
|
41810
42052
|
ListType,
|