@byteplus/veplayer 2.11.1 → 2.12.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/esm/veplayer.biz.live.development.js +37 -3
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +6 -2
- package/esm/veplayer.development.css +21 -5
- package/esm/veplayer.development.js +407 -4
- package/esm/veplayer.live.d.ts +6 -2
- package/esm/veplayer.live.development.css +21 -5
- package/esm/veplayer.live.development.js +407 -4
- package/esm/veplayer.live.production.css +1 -1
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.css +1 -1
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.development.css +21 -5
- package/esm/veplayer.vod.development.js +370 -1
- package/esm/veplayer.vod.production.css +1 -1
- package/esm/veplayer.vod.production.js +3 -3
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +37 -3
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +6 -2
- package/umd/veplayer.development.css +21 -5
- package/umd/veplayer.development.js +407 -4
- package/umd/veplayer.live.d.ts +6 -2
- package/umd/veplayer.live.development.css +21 -5
- package/umd/veplayer.live.development.js +407 -4
- 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.development.css +21 -5
- package/umd/veplayer.vod.development.js +370 -1
- package/umd/veplayer.vod.production.css +1 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +6 -2
- package/veplayer.live.d.ts +6 -2
|
@@ -14337,6 +14337,373 @@ class CustomMedia {
|
|
|
14337
14337
|
replaceAttributes(this._el, this._videoAttributes);
|
|
14338
14338
|
}
|
|
14339
14339
|
}
|
|
14340
|
+
var Web2NativeMessageEvent = /* @__PURE__ */ ((Web2NativeMessageEvent2) => {
|
|
14341
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["INIT_FINISH"] = 10001] = "INIT_FINISH";
|
|
14342
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["CREATE_PLAYER"] = 11e3] = "CREATE_PLAYER";
|
|
14343
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["DESTROY_PLAYER"] = 11001] = "DESTROY_PLAYER";
|
|
14344
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["OPEN_FULLSCREEN"] = 11002] = "OPEN_FULLSCREEN";
|
|
14345
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["EXIT_FULLSCREEN"] = 11003] = "EXIT_FULLSCREEN";
|
|
14346
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["LIVE_ROOM_STATE_CHANGE"] = 11004] = "LIVE_ROOM_STATE_CHANGE";
|
|
14347
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["PLAYER_STATE_CHANGE"] = 11005] = "PLAYER_STATE_CHANGE";
|
|
14348
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["MEDIA_LOAD_FINISH"] = 11006] = "MEDIA_LOAD_FINISH";
|
|
14349
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["OPEN_MINI_WINDOW"] = 11007] = "OPEN_MINI_WINDOW";
|
|
14350
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["CLOSE_MINI_WINDOW"] = 11008] = "CLOSE_MINI_WINDOW";
|
|
14351
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["OPEN_WAKE_LOCK"] = 11009] = "OPEN_WAKE_LOCK";
|
|
14352
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["EXIT_WAKE_LOCK"] = 110010] = "EXIT_WAKE_LOCK";
|
|
14353
|
+
Web2NativeMessageEvent2[Web2NativeMessageEvent2["PUSH_WEB_DATA_INFO"] = 110011] = "PUSH_WEB_DATA_INFO";
|
|
14354
|
+
return Web2NativeMessageEvent2;
|
|
14355
|
+
})(Web2NativeMessageEvent || {});
|
|
14356
|
+
var Native2WebMessageEvent = /* @__PURE__ */ ((Native2WebMessageEvent2) => {
|
|
14357
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["ENTER_MINI_WINDOW"] = 21e3] = "ENTER_MINI_WINDOW";
|
|
14358
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["EXIT_MINI_WINDOW"] = 21001] = "EXIT_MINI_WINDOW";
|
|
14359
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["PAUSE"] = 21002] = "PAUSE";
|
|
14360
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["START_PLAY"] = 21003] = "START_PLAY";
|
|
14361
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["PLAY"] = 21004] = "PLAY";
|
|
14362
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["WEBVIEW_CONFIG"] = 21005] = "WEBVIEW_CONFIG";
|
|
14363
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["GET_WEB_DATA_INFO"] = 21006] = "GET_WEB_DATA_INFO";
|
|
14364
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["ENTER_FULLSCREEN"] = 21007] = "ENTER_FULLSCREEN";
|
|
14365
|
+
Native2WebMessageEvent2[Native2WebMessageEvent2["EXIT_FULLSCREEN"] = 21008] = "EXIT_FULLSCREEN";
|
|
14366
|
+
return Native2WebMessageEvent2;
|
|
14367
|
+
})(Native2WebMessageEvent || {});
|
|
14368
|
+
class ByteLiveJsBridge {
|
|
14369
|
+
constructor(data2) {
|
|
14370
|
+
__publicField(this, "_emitter", new EventEmitter$1());
|
|
14371
|
+
__publicField(this, "isInIOS", false);
|
|
14372
|
+
__publicField(this, "jsBridgeName", "ByteLiveJsBridge");
|
|
14373
|
+
__publicField(this, "jsBridge", null);
|
|
14374
|
+
__publicField(this, "data", {
|
|
14375
|
+
room: {},
|
|
14376
|
+
player: {}
|
|
14377
|
+
});
|
|
14378
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
14379
|
+
__publicField(this, "nativeConfig", {});
|
|
14380
|
+
if (data2 == null ? void 0 : data2.name) {
|
|
14381
|
+
this.jsBridgeName = data2.name;
|
|
14382
|
+
}
|
|
14383
|
+
this.init();
|
|
14384
|
+
}
|
|
14385
|
+
init() {
|
|
14386
|
+
this.initVariables();
|
|
14387
|
+
if (!this.jsBridge) {
|
|
14388
|
+
this.mountGlobal();
|
|
14389
|
+
}
|
|
14390
|
+
this.callToNative(Web2NativeMessageEvent.INIT_FINISH, {});
|
|
14391
|
+
}
|
|
14392
|
+
getJsBridge() {
|
|
14393
|
+
const jsBridge = Reflect.get(window, this.jsBridgeName);
|
|
14394
|
+
if (jsBridge) {
|
|
14395
|
+
this.jsBridge = jsBridge;
|
|
14396
|
+
}
|
|
14397
|
+
return this.jsBridge;
|
|
14398
|
+
}
|
|
14399
|
+
setJsBridge(jsBridge) {
|
|
14400
|
+
Reflect.set(window, this.jsBridgeName, jsBridge);
|
|
14401
|
+
Reflect.set(window, "VeCloudJsBridge", jsBridge);
|
|
14402
|
+
console.log("设置到 window 上");
|
|
14403
|
+
this.jsBridge = jsBridge;
|
|
14404
|
+
}
|
|
14405
|
+
initVariables() {
|
|
14406
|
+
this.isInIOS = Boolean(sniffer$1.os.isIos);
|
|
14407
|
+
}
|
|
14408
|
+
mountGlobal() {
|
|
14409
|
+
const JsBridge = this.getJsBridge();
|
|
14410
|
+
console.log("从 window 上获取到的 jsBridge", JsBridge);
|
|
14411
|
+
if (JsBridge) {
|
|
14412
|
+
JsBridge.nativeCallBack = (data2) => {
|
|
14413
|
+
console.log("收到native发来消息", data2);
|
|
14414
|
+
this.handelEventCallBack(data2);
|
|
14415
|
+
};
|
|
14416
|
+
this.jsBridge = JsBridge;
|
|
14417
|
+
} else {
|
|
14418
|
+
const JsBridge2 = {
|
|
14419
|
+
nativeCallBack: (data2) => {
|
|
14420
|
+
console.log("收到native发来消息", data2);
|
|
14421
|
+
this.handelEventCallBack(data2);
|
|
14422
|
+
}
|
|
14423
|
+
// invokeNative: (data: IMessage) => {
|
|
14424
|
+
// console.log('发送给native', data);
|
|
14425
|
+
// },
|
|
14426
|
+
};
|
|
14427
|
+
this.setJsBridge(JsBridge2);
|
|
14428
|
+
}
|
|
14429
|
+
this.bindWebDataInfo();
|
|
14430
|
+
this.bindGetNativeConfig();
|
|
14431
|
+
}
|
|
14432
|
+
on(action, func) {
|
|
14433
|
+
this._emitter.on(action, func);
|
|
14434
|
+
}
|
|
14435
|
+
handelEventCallBack(data2) {
|
|
14436
|
+
const { eventKey, info } = data2 ?? {};
|
|
14437
|
+
if (!eventKey || !Native2WebMessageEvent[eventKey]) {
|
|
14438
|
+
console.log("Native2Web未匹配到对应事件", eventKey);
|
|
14439
|
+
return;
|
|
14440
|
+
}
|
|
14441
|
+
this._emitter.emit(Native2WebMessageEvent[eventKey], info);
|
|
14442
|
+
}
|
|
14443
|
+
invokeNative(data2) {
|
|
14444
|
+
var _a, _b, _c;
|
|
14445
|
+
console.log("发送给native", data2);
|
|
14446
|
+
if (this.isInIOS) {
|
|
14447
|
+
(_c = (_b = (_a = window == null ? void 0 : window.webkit) == null ? void 0 : _a.messageHandlers) == null ? void 0 : _b.invokeNative) == null ? void 0 : _c.postMessage(data2);
|
|
14448
|
+
}
|
|
14449
|
+
const JsBridge = this.jsBridge || Reflect.get(window, this.jsBridgeName);
|
|
14450
|
+
console.log(
|
|
14451
|
+
"JsBridge",
|
|
14452
|
+
this.jsBridge,
|
|
14453
|
+
Reflect.get(window, this.jsBridgeName)
|
|
14454
|
+
);
|
|
14455
|
+
if (JsBridge.invokeNative) {
|
|
14456
|
+
JsBridge.invokeNative(JSON.stringify(data2));
|
|
14457
|
+
} else {
|
|
14458
|
+
console.log("未找到对应invokeNative方法");
|
|
14459
|
+
}
|
|
14460
|
+
}
|
|
14461
|
+
bindWebDataInfo() {
|
|
14462
|
+
this.on("GET_WEB_DATA_INFO", () => {
|
|
14463
|
+
this.callToNative(Web2NativeMessageEvent.PUSH_WEB_DATA_INFO, {
|
|
14464
|
+
...this.data
|
|
14465
|
+
});
|
|
14466
|
+
});
|
|
14467
|
+
}
|
|
14468
|
+
bindGetNativeConfig() {
|
|
14469
|
+
this.on("WEBVIEW_CONFIG", (data2) => {
|
|
14470
|
+
this.nativeConfig = {
|
|
14471
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14472
|
+
// @ts-ignore
|
|
14473
|
+
...this.nativeConfig,
|
|
14474
|
+
...data2
|
|
14475
|
+
};
|
|
14476
|
+
});
|
|
14477
|
+
}
|
|
14478
|
+
callToNative(eventKey, info) {
|
|
14479
|
+
if (!eventKey || !Web2NativeMessageEvent[eventKey]) {
|
|
14480
|
+
console.log("Web2Native未匹配到对应事件", eventKey);
|
|
14481
|
+
return;
|
|
14482
|
+
}
|
|
14483
|
+
this.invokeNative({ eventKey, info });
|
|
14484
|
+
}
|
|
14485
|
+
callToNativeCreatePlayer(data2) {
|
|
14486
|
+
this.data.room = {
|
|
14487
|
+
...this.data.room,
|
|
14488
|
+
isPortrait: data2.isPortrait
|
|
14489
|
+
};
|
|
14490
|
+
this.callToNative(Web2NativeMessageEvent.CREATE_PLAYER, data2);
|
|
14491
|
+
}
|
|
14492
|
+
callToNativeDestroyPlayer() {
|
|
14493
|
+
this.callToNative(Web2NativeMessageEvent.DESTROY_PLAYER, {});
|
|
14494
|
+
}
|
|
14495
|
+
callToNativeOpenFullScreen() {
|
|
14496
|
+
this.data.player = {
|
|
14497
|
+
...this.data.player,
|
|
14498
|
+
fullscreen: true
|
|
14499
|
+
};
|
|
14500
|
+
this.callToNative(Web2NativeMessageEvent.OPEN_FULLSCREEN, {});
|
|
14501
|
+
}
|
|
14502
|
+
callToNativeExitFullScreen() {
|
|
14503
|
+
this.data.player = {
|
|
14504
|
+
...this.data.player,
|
|
14505
|
+
fullscreen: false
|
|
14506
|
+
};
|
|
14507
|
+
this.callToNative(Web2NativeMessageEvent.EXIT_FULLSCREEN, {});
|
|
14508
|
+
}
|
|
14509
|
+
callToNativeLiveRoomStateChange(data2) {
|
|
14510
|
+
this.data.room = {
|
|
14511
|
+
...this.data.room,
|
|
14512
|
+
status: data2.status
|
|
14513
|
+
};
|
|
14514
|
+
this.callToNative(Web2NativeMessageEvent.LIVE_ROOM_STATE_CHANGE, data2);
|
|
14515
|
+
}
|
|
14516
|
+
callToNativePlayerStateChange(data2) {
|
|
14517
|
+
this.data.player = {
|
|
14518
|
+
...this.data.player,
|
|
14519
|
+
created: data2.created,
|
|
14520
|
+
paused: data2.paused
|
|
14521
|
+
};
|
|
14522
|
+
this.callToNative(Web2NativeMessageEvent.PLAYER_STATE_CHANGE, data2);
|
|
14523
|
+
}
|
|
14524
|
+
callToNativeMediaLoadFinish(data2) {
|
|
14525
|
+
this.data.player = {
|
|
14526
|
+
...this.data.player,
|
|
14527
|
+
videoWidth: data2.videoWidth,
|
|
14528
|
+
videoHeight: data2.videoHeight
|
|
14529
|
+
};
|
|
14530
|
+
this.callToNative(Web2NativeMessageEvent.MEDIA_LOAD_FINISH, data2);
|
|
14531
|
+
}
|
|
14532
|
+
callToNativeOpenMiniWindow() {
|
|
14533
|
+
this.data.player = {
|
|
14534
|
+
...this.data.player,
|
|
14535
|
+
mini: true
|
|
14536
|
+
};
|
|
14537
|
+
this.callToNative(Web2NativeMessageEvent.OPEN_MINI_WINDOW, {});
|
|
14538
|
+
}
|
|
14539
|
+
callToNativeCloseMiniWindow() {
|
|
14540
|
+
this.data.player = {
|
|
14541
|
+
...this.data.player,
|
|
14542
|
+
mini: false
|
|
14543
|
+
};
|
|
14544
|
+
console.log("通知Native关闭小窗", /* @__PURE__ */ new Date());
|
|
14545
|
+
this.callToNative(Web2NativeMessageEvent.CLOSE_MINI_WINDOW, {});
|
|
14546
|
+
}
|
|
14547
|
+
callToNativeOpenWakeLock() {
|
|
14548
|
+
this.callToNative(Web2NativeMessageEvent.OPEN_WAKE_LOCK, {});
|
|
14549
|
+
}
|
|
14550
|
+
callToNativeExitWakeLock() {
|
|
14551
|
+
this.callToNative(Web2NativeMessageEvent.EXIT_WAKE_LOCK, {});
|
|
14552
|
+
}
|
|
14553
|
+
}
|
|
14554
|
+
let InnerJsBridge;
|
|
14555
|
+
const getJsbInstance = () => {
|
|
14556
|
+
if (InnerJsBridge)
|
|
14557
|
+
return InnerJsBridge;
|
|
14558
|
+
InnerJsBridge = new ByteLiveJsBridge();
|
|
14559
|
+
return InnerJsBridge;
|
|
14560
|
+
};
|
|
14561
|
+
var InnerJsBridge$1 = getJsbInstance();
|
|
14562
|
+
const bindPlayerEventsCallJSB = (player) => {
|
|
14563
|
+
const isPortrait = true;
|
|
14564
|
+
const isLive = true;
|
|
14565
|
+
if (!InnerJsBridge$1) {
|
|
14566
|
+
return;
|
|
14567
|
+
}
|
|
14568
|
+
if (!sniffer$1.os.isPc) {
|
|
14569
|
+
bindMiniWindowEvents(player);
|
|
14570
|
+
}
|
|
14571
|
+
InnerJsBridge$1.callToNativeCreatePlayer({
|
|
14572
|
+
isLive,
|
|
14573
|
+
isPortrait
|
|
14574
|
+
});
|
|
14575
|
+
InnerJsBridge$1.callToNativePlayerStateChange({
|
|
14576
|
+
created: true,
|
|
14577
|
+
paused: false
|
|
14578
|
+
});
|
|
14579
|
+
player.on(Events$2.PLAY, () => {
|
|
14580
|
+
InnerJsBridge$1 == null ? void 0 : InnerJsBridge$1.callToNativePlayerStateChange({
|
|
14581
|
+
created: true,
|
|
14582
|
+
paused: false
|
|
14583
|
+
});
|
|
14584
|
+
});
|
|
14585
|
+
player.on(Events$2.PAUSE, () => {
|
|
14586
|
+
InnerJsBridge$1 == null ? void 0 : InnerJsBridge$1.callToNativePlayerStateChange({
|
|
14587
|
+
created: true,
|
|
14588
|
+
paused: true
|
|
14589
|
+
});
|
|
14590
|
+
});
|
|
14591
|
+
player.on(Events$2.ERROR, () => {
|
|
14592
|
+
existMiniWindow();
|
|
14593
|
+
});
|
|
14594
|
+
player.on(Events$2.LOADED_DATA, () => {
|
|
14595
|
+
getVideoSizeWithRetry(player, isPortrait).then(
|
|
14596
|
+
({ videoWidth, videoHeight }) => {
|
|
14597
|
+
InnerJsBridge$1 == null ? void 0 : InnerJsBridge$1.callToNativeMediaLoadFinish({
|
|
14598
|
+
isPortrait: videoHeight > videoWidth,
|
|
14599
|
+
videoWidth,
|
|
14600
|
+
videoHeight
|
|
14601
|
+
});
|
|
14602
|
+
}
|
|
14603
|
+
);
|
|
14604
|
+
});
|
|
14605
|
+
};
|
|
14606
|
+
const destroyPlayerEventsCallJSB = () => {
|
|
14607
|
+
if (InnerJsBridge$1) {
|
|
14608
|
+
InnerJsBridge$1.callToNativeDestroyPlayer();
|
|
14609
|
+
InnerJsBridge$1.callToNativePlayerStateChange({
|
|
14610
|
+
created: false,
|
|
14611
|
+
paused: true
|
|
14612
|
+
});
|
|
14613
|
+
}
|
|
14614
|
+
existMiniWindow();
|
|
14615
|
+
};
|
|
14616
|
+
const bindMiniWindowEvents = (player) => {
|
|
14617
|
+
if (!InnerJsBridge$1) {
|
|
14618
|
+
return;
|
|
14619
|
+
}
|
|
14620
|
+
const handleMiniWindowChange = (state) => {
|
|
14621
|
+
if (!player || !player.root) {
|
|
14622
|
+
return;
|
|
14623
|
+
}
|
|
14624
|
+
if (state) {
|
|
14625
|
+
player.addClass("xgplayer-mobile-mini-window");
|
|
14626
|
+
} else {
|
|
14627
|
+
player.removeClass("xgplayer-mobile-mini-window");
|
|
14628
|
+
}
|
|
14629
|
+
};
|
|
14630
|
+
InnerJsBridge$1.on("WEBVIEW_CONFIG", (data2) => {
|
|
14631
|
+
console.log("WEBVIEW_CONFIG", data2);
|
|
14632
|
+
if (data2 == null ? void 0 : data2.keepPlayWhenPageHide) {
|
|
14633
|
+
player.unRegisterPlugin("PageChangePlugin");
|
|
14634
|
+
}
|
|
14635
|
+
});
|
|
14636
|
+
InnerJsBridge$1.on("ENTER_MINI_WINDOW", () => {
|
|
14637
|
+
handleMiniWindowChange(true);
|
|
14638
|
+
});
|
|
14639
|
+
InnerJsBridge$1.on("EXIT_MINI_WINDOW", () => {
|
|
14640
|
+
console.log("切回小窗播放器处于暂停: ", player.paused, /* @__PURE__ */ new Date());
|
|
14641
|
+
if (player.paused) {
|
|
14642
|
+
player.play();
|
|
14643
|
+
}
|
|
14644
|
+
handleMiniWindowChange(false);
|
|
14645
|
+
});
|
|
14646
|
+
InnerJsBridge$1.on("PAUSE", () => {
|
|
14647
|
+
if (!player) {
|
|
14648
|
+
return;
|
|
14649
|
+
}
|
|
14650
|
+
player.pause();
|
|
14651
|
+
});
|
|
14652
|
+
InnerJsBridge$1.on("START_PLAY", () => {
|
|
14653
|
+
handleMiniWindowChange(false);
|
|
14654
|
+
if (!player) {
|
|
14655
|
+
return;
|
|
14656
|
+
}
|
|
14657
|
+
player.play();
|
|
14658
|
+
});
|
|
14659
|
+
InnerJsBridge$1.on("PLAY", () => {
|
|
14660
|
+
if (!player) {
|
|
14661
|
+
return;
|
|
14662
|
+
}
|
|
14663
|
+
player.play();
|
|
14664
|
+
});
|
|
14665
|
+
InnerJsBridge$1.on("ENTER_FULLSCREEN", () => {
|
|
14666
|
+
var _a;
|
|
14667
|
+
if (!(player == null ? void 0 : player.fullscreen)) {
|
|
14668
|
+
(_a = player.getPlugin("fullscreen")) == null ? void 0 : _a.toggleFullScreen();
|
|
14669
|
+
}
|
|
14670
|
+
});
|
|
14671
|
+
InnerJsBridge$1.on("EXIT_FULLSCREEN", () => {
|
|
14672
|
+
var _a;
|
|
14673
|
+
if (player == null ? void 0 : player.fullscreen) {
|
|
14674
|
+
(_a = player.getPlugin("fullscreen")) == null ? void 0 : _a.toggleFullScreen();
|
|
14675
|
+
}
|
|
14676
|
+
});
|
|
14677
|
+
};
|
|
14678
|
+
const existMiniWindow = () => {
|
|
14679
|
+
InnerJsBridge$1 && (InnerJsBridge$1 == null ? void 0 : InnerJsBridge$1.callToNativeCloseMiniWindow());
|
|
14680
|
+
};
|
|
14681
|
+
const getVideoSizeWithRetry = (player, isPortrait) => {
|
|
14682
|
+
const retryGetVideoSize = (retryCount = 0) => {
|
|
14683
|
+
return new Promise((resolve) => {
|
|
14684
|
+
let { videoWidth, videoHeight } = player.video;
|
|
14685
|
+
if (videoWidth > 0 && videoHeight > 0) {
|
|
14686
|
+
resolve({ videoWidth, videoHeight });
|
|
14687
|
+
return;
|
|
14688
|
+
}
|
|
14689
|
+
if (retryCount < 15) {
|
|
14690
|
+
setTimeout(() => {
|
|
14691
|
+
retryGetVideoSize(retryCount + 1).then(resolve);
|
|
14692
|
+
}, 500);
|
|
14693
|
+
return;
|
|
14694
|
+
}
|
|
14695
|
+
if (isPortrait) {
|
|
14696
|
+
videoWidth = 1080;
|
|
14697
|
+
videoHeight = 1920;
|
|
14698
|
+
} else {
|
|
14699
|
+
videoWidth = 1920;
|
|
14700
|
+
videoHeight = 1080;
|
|
14701
|
+
}
|
|
14702
|
+
resolve({ videoWidth, videoHeight });
|
|
14703
|
+
});
|
|
14704
|
+
};
|
|
14705
|
+
return retryGetVideoSize();
|
|
14706
|
+
};
|
|
14340
14707
|
const { POSITIONS: XGPosition } = Plugin;
|
|
14341
14708
|
const POSITIONS$1 = {
|
|
14342
14709
|
...XGPosition,
|
|
@@ -14451,6 +14818,7 @@ class VePlayerBase {
|
|
|
14451
14818
|
this.emit(Events$2.PLAYER_CREATE_FINISH, this._player);
|
|
14452
14819
|
this._errorCallback = (err) => this._handleFallback(err);
|
|
14453
14820
|
this._player.on(ERROR, this._errorCallback);
|
|
14821
|
+
bindPlayerEventsCallJSB(this._player);
|
|
14454
14822
|
}
|
|
14455
14823
|
/** {zh}
|
|
14456
14824
|
* @brief 获取视频的就绪状态,其状态枚举值、枚举名称和说明如下:
|
|
@@ -14616,7 +14984,7 @@ class VePlayerBase {
|
|
|
14616
14984
|
* @brief Retrieve the player SDK version number.
|
|
14617
14985
|
*/
|
|
14618
14986
|
get playerVersion() {
|
|
14619
|
-
return "2.
|
|
14987
|
+
return "2.12.0-rc.0";
|
|
14620
14988
|
}
|
|
14621
14989
|
/** {zh}
|
|
14622
14990
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -15121,6 +15489,7 @@ class VePlayerBase {
|
|
|
15121
15489
|
*/
|
|
15122
15490
|
destroy() {
|
|
15123
15491
|
var _a;
|
|
15492
|
+
destroyPlayerEventsCallJSB();
|
|
15124
15493
|
this._player.off(ERROR, this._errorCallback);
|
|
15125
15494
|
this._player.destroy();
|
|
15126
15495
|
(_a = this._customMedia) == null ? void 0 : _a.destroy();
|
|
@@ -31060,6 +31429,7 @@ var LicenseFeature = /* @__PURE__ */ ((LicenseFeature2) => {
|
|
|
31060
31429
|
LicenseFeature2["H265"] = "h265";
|
|
31061
31430
|
LicenseFeature2["PRELOAD"] = "preload";
|
|
31062
31431
|
LicenseFeature2["RTM"] = "rtm";
|
|
31432
|
+
LicenseFeature2["RTM_ADAPTIVE_BUFFER"] = "rtmAdaptiveBuffer";
|
|
31063
31433
|
LicenseFeature2["ABR"] = "abr";
|
|
31064
31434
|
LicenseFeature2["FLV_LOW_LATENCY"] = "flvLowLatency";
|
|
31065
31435
|
return LicenseFeature2;
|
|
@@ -56475,7 +56845,7 @@ let Logger$1 = class Logger2 extends Plugin {
|
|
|
56475
56845
|
device_id: deviceId,
|
|
56476
56846
|
error_report_stop: true,
|
|
56477
56847
|
ext: {
|
|
56478
|
-
veplayer_version: "2.
|
|
56848
|
+
veplayer_version: "2.12.0-rc.0",
|
|
56479
56849
|
flv_version: "3.0.23-rc.6",
|
|
56480
56850
|
hls_version: "3.0.21-rc.21",
|
|
56481
56851
|
rts_version: "0.2.1-alpha.57"
|
|
@@ -62016,6 +62386,19 @@ const LicenseWarningMap = {
|
|
|
62016
62386
|
code: ErrorCode.LICENSE_EXPIRED_RTM
|
|
62017
62387
|
}
|
|
62018
62388
|
},
|
|
62389
|
+
[
|
|
62390
|
+
"rtmAdaptiveBuffer"
|
|
62391
|
+
/* RTM_ADAPTIVE_BUFFER */
|
|
62392
|
+
]: {
|
|
62393
|
+
BASE_LICENSE_NOT_SUPPORT: {
|
|
62394
|
+
type: "BASE_LICENSE_NOT_SUPPORT",
|
|
62395
|
+
feature: LicenseFeature.RTM_ADAPTIVE_BUFFER
|
|
62396
|
+
},
|
|
62397
|
+
LICENSE_EXPIRED: {
|
|
62398
|
+
type: "LICENSE_EXPIRED",
|
|
62399
|
+
feature: LicenseFeature.RTM_ADAPTIVE_BUFFER
|
|
62400
|
+
}
|
|
62401
|
+
},
|
|
62019
62402
|
[LicenseFeature.PRELOAD]: {
|
|
62020
62403
|
BASE_LICENSE_NOT_SUPPORT: {
|
|
62021
62404
|
type: "BASE_LICENSE_NOT_SUPPORT",
|
|
@@ -62047,6 +62430,16 @@ const LicenseWarningMap = {
|
|
|
62047
62430
|
}
|
|
62048
62431
|
}
|
|
62049
62432
|
};
|
|
62433
|
+
const premiumFeatureList = (
|
|
62434
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
62435
|
+
// @ts-ignore
|
|
62436
|
+
[
|
|
62437
|
+
LicenseFeature.RTM,
|
|
62438
|
+
LicenseFeature.RTM_ADAPTIVE_BUFFER,
|
|
62439
|
+
LicenseFeature.ABR,
|
|
62440
|
+
LicenseFeature.FLV_LOW_LATENCY
|
|
62441
|
+
]
|
|
62442
|
+
);
|
|
62050
62443
|
class LicenseEventEmitter {
|
|
62051
62444
|
constructor() {
|
|
62052
62445
|
__publicField(this, "player");
|
|
@@ -62117,6 +62510,9 @@ class LiveLicenseManager {
|
|
|
62117
62510
|
// 验证 License 是否支持该 feature
|
|
62118
62511
|
checkLiveLicenseFeature(feature) {
|
|
62119
62512
|
var _a, _b;
|
|
62513
|
+
if (!premiumFeatureList.includes(feature)) {
|
|
62514
|
+
return;
|
|
62515
|
+
}
|
|
62120
62516
|
const result = licenseManager.licenseSupportModuleList.includes(feature);
|
|
62121
62517
|
if (!result) {
|
|
62122
62518
|
if (this.licenseCheckResult === LicenseEdition.EDITION_STANDARD) {
|
|
@@ -62644,7 +63040,7 @@ class RtmProtocol extends BaseProtocol {
|
|
|
62644
63040
|
return LiveUrlType.Rtm;
|
|
62645
63041
|
}
|
|
62646
63042
|
get defaultFallbackStrategy() {
|
|
62647
|
-
return { [FallbackKind.Error]: {
|
|
63043
|
+
return { [FallbackKind.Error]: { excludeList: [2104, 2103, 2101, 2100] } };
|
|
62648
63044
|
}
|
|
62649
63045
|
static canGenerateOtherProtocol(options) {
|
|
62650
63046
|
var _a;
|
|
@@ -62687,10 +63083,17 @@ class RtmProtocol extends BaseProtocol {
|
|
|
62687
63083
|
i18n,
|
|
62688
63084
|
enableSelector
|
|
62689
63085
|
}) {
|
|
63086
|
+
var _a;
|
|
62690
63087
|
const licenseRtmNotSupportedError = liveLicenseManager.checkLiveLicenseFeature(LicenseFeature.RTM);
|
|
62691
63088
|
if (licenseRtmNotSupportedError == null ? void 0 : licenseRtmNotSupportedError.code) {
|
|
62692
63089
|
throw create(licenseRtmNotSupportedError.code, i18n);
|
|
62693
63090
|
}
|
|
63091
|
+
const licenseRtmAdaptiveBufferNotSupportedError = liveLicenseManager.checkLiveLicenseFeature(
|
|
63092
|
+
LicenseFeature.RTM_ADAPTIVE_BUFFER
|
|
63093
|
+
);
|
|
63094
|
+
if (licenseRtmAdaptiveBufferNotSupportedError && ((_a = options.rtm) == null ? void 0 : _a.enableAdaptiveJitterBuffer)) {
|
|
63095
|
+
options.rtm.enableAdaptiveJitterBuffer = false;
|
|
63096
|
+
}
|
|
62694
63097
|
this.protocolStrategy = await getRtmStrategy(
|
|
62695
63098
|
enableSelector ? {
|
|
62696
63099
|
options,
|
|
@@ -74153,7 +74556,7 @@ async function prepare(options) {
|
|
|
74153
74556
|
}
|
|
74154
74557
|
await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
|
|
74155
74558
|
...options,
|
|
74156
|
-
playerVersion: "2.
|
|
74559
|
+
playerVersion: "2.12.0-rc.0",
|
|
74157
74560
|
type: "LIVE"
|
|
74158
74561
|
}));
|
|
74159
74562
|
return liveVeStrategy.veStrategyManager;
|