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