@ezuikit/player-theme 3.1.6 → 3.1.7-beta.1
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/dist/constant.js +65 -6
- package/dist/index.cjs +831 -603
- package/dist/index.esm.js +831 -604
- package/dist/index.umd.js +830 -603
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +643 -423
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.
|
|
3
|
-
* Copyright (c) 2026-09-
|
|
2
|
+
* @ezuikit/player-theme v3.1.7-beta.1
|
|
3
|
+
* Copyright (c) 2026-09-23 13:45:09 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -365,6 +365,16 @@
|
|
|
365
365
|
var eventemitter3Exports = requireEventemitter3();
|
|
366
366
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
367
367
|
|
|
368
|
+
function _extends$C() {
|
|
369
|
+
_extends$C = Object.assign || function assign(target) {
|
|
370
|
+
for(var i = 1; i < arguments.length; i++){
|
|
371
|
+
var source = arguments[i];
|
|
372
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
373
|
+
}
|
|
374
|
+
return target;
|
|
375
|
+
};
|
|
376
|
+
return _extends$C.apply(this, arguments);
|
|
377
|
+
}
|
|
368
378
|
/**
|
|
369
379
|
* 播放器的类名前缀
|
|
370
380
|
*/ var PREFIX_CLASS$1 = 'ezplayer';
|
|
@@ -444,6 +454,54 @@
|
|
|
444
454
|
'date',
|
|
445
455
|
'segmentProgress'
|
|
446
456
|
];
|
|
457
|
+
/**
|
|
458
|
+
* 全部播放类型:直播 + 三种回放
|
|
459
|
+
*
|
|
460
|
+
* 控件用静态属性 `supportedPlayTypes` 声明支持范围,默认取本数组(即全支持)。
|
|
461
|
+
* 与 {@link REC_GROUP} 的区别:REC_GROUP 是「回放类型切换控件的 iconId 分组」,
|
|
462
|
+
* 这里是「播放地址实际解析出的播放类型」,两者取值恰好在回放侧重合。
|
|
463
|
+
*/ var PLAY_TYPES = [
|
|
464
|
+
'live',
|
|
465
|
+
'rec',
|
|
466
|
+
'cloudRec',
|
|
467
|
+
'cloudRecord'
|
|
468
|
+
];
|
|
469
|
+
/**
|
|
470
|
+
* 控件初始化完成事件名
|
|
471
|
+
*
|
|
472
|
+
* 键与 `Controls`(`src/Controls/index.ts`)的键一一对应,值为 `Control.<键>ControlInit`,
|
|
473
|
+
* 在控件实例创建成功后由 `_renderTheme` 派发一次,无载荷。
|
|
474
|
+
*
|
|
475
|
+
* 这些成员会被展开进 {@link EVENTS}.control,因此既可以 `EVENTS.control.playControlInit`
|
|
476
|
+
* 这样按名取用,也可以在只拿到 `iconId` 的场合用 `CONTROL_INIT_EVENTS[iconId]` 查表。
|
|
477
|
+
*
|
|
478
|
+
* @remarks `changeTheme` 会先卸载旧控件并重置 `theme.controls`,因此切换主题时这些事件会再次派发;
|
|
479
|
+
* 同一次渲染内则由 `!theme.controls.xxxControl` 守卫保证只派发一次。
|
|
480
|
+
*/ var CONTROL_INIT_EVENTS = {
|
|
481
|
+
/** 播放/暂停控件初始化完成 */ playControlInit: 'Control.playControlInit',
|
|
482
|
+
/** 音量控件初始化完成 */ volumeControlInit: 'Control.volumeControlInit',
|
|
483
|
+
/** 设备信息控件初始化完成 */ deviceControlInit: 'Control.deviceControlInit',
|
|
484
|
+
/** 截图控件初始化完成 */ capturePictureControlInit: 'Control.capturePictureControlInit',
|
|
485
|
+
/** 云台控件初始化完成 */ ptzControlInit: 'Control.ptzControlInit',
|
|
486
|
+
/** 录制控件初始化完成 */ recordControlInit: 'Control.recordControlInit',
|
|
487
|
+
/** 对讲控件初始化完成 */ talkControlInit: 'Control.talkControlInit',
|
|
488
|
+
/** 语音广播控件初始化完成 */ broadcastControlInit: 'Control.broadcastControlInit',
|
|
489
|
+
/** AI 对话控件初始化完成 */ aiChatControlInit: 'Control.aiChatControlInit',
|
|
490
|
+
/** 直播按钮控件初始化完成 */ liveControlInit: 'Control.liveControlInit',
|
|
491
|
+
/** 回放下拉控件初始化完成 */ recDropdownControlInit: 'Control.recDropdownControlInit',
|
|
492
|
+
/** 录像列表控件初始化完成 */ recListControlInit: 'Control.recListControlInit',
|
|
493
|
+
/** 告警消息控件初始化完成 */ alarmMessageControlInit: 'Control.alarmMessageControlInit',
|
|
494
|
+
/** 电子放大控件初始化完成 */ zoomControlInit: 'Control.zoomControlInit',
|
|
495
|
+
/** 清晰度控件初始化完成 */ definitionControlInit: 'Control.definitionControlInit',
|
|
496
|
+
/** web 全屏控件初始化完成 */ fullscreenControlInit: 'Control.fullscreenControlInit',
|
|
497
|
+
/** 全局全屏控件初始化完成 */ globalFullscreenControlInit: 'Control.globalFullscreenControlInit',
|
|
498
|
+
/** 回放类型控件初始化完成 */ recControlInit: 'Control.recControlInit',
|
|
499
|
+
/** 倍速控件初始化完成 */ speedControlInit: 'Control.speedControlInit',
|
|
500
|
+
/** 日历控件初始化完成 */ dateControlInit: 'Control.dateControlInit',
|
|
501
|
+
/** 时间选择控件初始化完成 */ timeControlInit: 'Control.timeControlInit',
|
|
502
|
+
/** 时间轴控件初始化完成 */ timeLineControlInit: 'Control.timeLineControlInit',
|
|
503
|
+
/** 回放片段进度条控件初始化完成 */ segmentProgressControlInit: 'Control.segmentProgressControlInit'
|
|
504
|
+
};
|
|
447
505
|
/**
|
|
448
506
|
*
|
|
449
507
|
* 事件名
|
|
@@ -510,7 +568,7 @@
|
|
|
510
568
|
/** 播放区间播放结束(SDK 层 playbackRange 特性) */ playbackEnd: 'playbackEnd',
|
|
511
569
|
/**
|
|
512
570
|
* 控件相关
|
|
513
|
-
*/ control: {
|
|
571
|
+
*/ control: _extends$C({}, CONTROL_INIT_EVENTS, {
|
|
514
572
|
/** 点击播放播放/暂停按钮 */ play: 'Control.play',
|
|
515
573
|
/** 播放控件销毁 */ playDestroy: 'Control.playDestroy',
|
|
516
574
|
/** 截图 */ capturePicture: 'Control.capturePicture',
|
|
@@ -566,12 +624,13 @@
|
|
|
566
624
|
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
567
625
|
/** 日期面板展示的月份变化 */ datePanelMonthChange: 'Control.datePanelMonthChange',
|
|
568
626
|
/** 日期面板展示的年份变化 */ datePanelYearChange: 'Control.datePanelYearChange',
|
|
569
|
-
/** 日期销毁 */ dateDestroy: 'Control.
|
|
627
|
+
/** 日期销毁 */ dateDestroy: 'Control.dateDestroy',
|
|
570
628
|
/** 时间面板展示隐藏变换 */ timePanelOpenChange: 'Control.timePanelOpenChange',
|
|
571
629
|
/** 时间改变 */ timeChange: 'Control.timeChange',
|
|
572
630
|
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
573
631
|
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
574
632
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
633
|
+
/** 控件不支持当前播放类型(仅提示,控件仍会渲染) */ unsupportedPlayType: 'Control.unsupportedPlayType',
|
|
575
634
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
576
635
|
/** 主题控件挂载完成, 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ mountedControls: 'Control.mountedControls',
|
|
577
636
|
/** 主题控件卸载前, 已有控件卸载时才可触发 */ beforeUnmountControls: 'Control.beforeUnmountControls',
|
|
@@ -581,7 +640,7 @@
|
|
|
581
640
|
/** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
|
|
582
641
|
/** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
|
|
583
642
|
/** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
|
|
584
|
-
},
|
|
643
|
+
}),
|
|
585
644
|
/**
|
|
586
645
|
* 主题控件相关
|
|
587
646
|
*/ theme: {
|
|
@@ -631,17 +690,17 @@
|
|
|
631
690
|
};
|
|
632
691
|
return _set_prototype_of$D(o, p);
|
|
633
692
|
}
|
|
634
|
-
/**
|
|
635
|
-
* 控件基类
|
|
636
|
-
* @category Control
|
|
637
|
-
* @example
|
|
638
|
-
* ```ts
|
|
639
|
-
* // 创建控件
|
|
640
|
-
* class MyControl extends Control {}
|
|
641
|
-
*
|
|
642
|
-
* // 使用控件
|
|
643
|
-
* const myControl = new MyControl({})
|
|
644
|
-
* ```
|
|
693
|
+
/**
|
|
694
|
+
* 控件基类
|
|
695
|
+
* @category Control
|
|
696
|
+
* @example
|
|
697
|
+
* ```ts
|
|
698
|
+
* // 创建控件
|
|
699
|
+
* class MyControl extends Control {}
|
|
700
|
+
*
|
|
701
|
+
* // 使用控件
|
|
702
|
+
* const myControl = new MyControl({})
|
|
703
|
+
* ```
|
|
645
704
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
646
705
|
_inherits$z(Control, EventEmitter);
|
|
647
706
|
function Control(options) {
|
|
@@ -683,22 +742,22 @@
|
|
|
683
742
|
return _this;
|
|
684
743
|
}
|
|
685
744
|
var _proto = Control.prototype;
|
|
686
|
-
/**
|
|
687
|
-
* 重置整个控件
|
|
745
|
+
/**
|
|
746
|
+
* 重置整个控件
|
|
688
747
|
*/ _proto.reset = function reset(hide) {
|
|
689
748
|
if (this._camelCaseName) {
|
|
690
749
|
this.emit("Control." + this._camelCaseName + "Reset", hide);
|
|
691
750
|
}
|
|
692
751
|
};
|
|
693
|
-
/**
|
|
694
|
-
* 重置控件挂载节点
|
|
695
|
-
* @param popupContainer 重新挂载的节点
|
|
696
|
-
* @param append 添加的方式, 默认 append
|
|
697
|
-
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
698
|
-
*
|
|
699
|
-
* | prepend | append |
|
|
700
|
-
* |:-------------:|:---------------:|
|
|
701
|
-
* | 插入第一个位置 | 追加在末尾 |
|
|
752
|
+
/**
|
|
753
|
+
* 重置控件挂载节点
|
|
754
|
+
* @param popupContainer 重新挂载的节点
|
|
755
|
+
* @param append 添加的方式, 默认 append
|
|
756
|
+
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
757
|
+
*
|
|
758
|
+
* | prepend | append |
|
|
759
|
+
* |:-------------:|:---------------:|
|
|
760
|
+
* | 插入第一个位置 | 追加在末尾 |
|
|
702
761
|
*/ _proto.resetPopupContainer = function resetPopupContainer(popupContainer, append, element) {
|
|
703
762
|
if (popupContainer !== this.$popupContainer) {
|
|
704
763
|
if (this.$popupContainer.contains(this.$container)) {
|
|
@@ -720,16 +779,16 @@
|
|
|
720
779
|
}
|
|
721
780
|
}
|
|
722
781
|
};
|
|
723
|
-
/**
|
|
724
|
-
* 隐藏整个控件
|
|
782
|
+
/**
|
|
783
|
+
* 隐藏整个控件
|
|
725
784
|
*/ _proto.hide = function hide() {
|
|
726
785
|
if (this.$container) {
|
|
727
786
|
this.$container.style.display = 'none';
|
|
728
787
|
this.$container.classList.add("" + PREFIX_CLASS$1 + "-hide");
|
|
729
788
|
}
|
|
730
789
|
};
|
|
731
|
-
/**
|
|
732
|
-
* 销毁控件
|
|
790
|
+
/**
|
|
791
|
+
* 销毁控件
|
|
733
792
|
*/ _proto.destroy = function destroy() {
|
|
734
793
|
var _this___options, _this_$container_remove, _this_$container;
|
|
735
794
|
if (this._camelCaseName) {
|
|
@@ -766,8 +825,8 @@
|
|
|
766
825
|
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS$1 + "-active");
|
|
767
826
|
}
|
|
768
827
|
};
|
|
769
|
-
/**
|
|
770
|
-
* 当点击 Control 时 触发子类的 _onControlClick
|
|
828
|
+
/**
|
|
829
|
+
* 当点击 Control 时 触发子类的 _onControlClick
|
|
771
830
|
*/ _proto._onClick = function _onClick() {
|
|
772
831
|
var _this = this;
|
|
773
832
|
// 使用具名 handler 便于在 destroy 时精确移除,避免匿名监听残留
|
|
@@ -785,19 +844,29 @@
|
|
|
785
844
|
e.stopPropagation();
|
|
786
845
|
e.preventDefault();
|
|
787
846
|
};
|
|
788
|
-
/**
|
|
789
|
-
* 点击 Control 控件触发
|
|
790
|
-
* @param {Event} e
|
|
791
|
-
* @returns {void}
|
|
847
|
+
/**
|
|
848
|
+
* 点击 Control 控件触发
|
|
849
|
+
* @param {Event} e
|
|
850
|
+
* @returns {void}
|
|
792
851
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
793
852
|
// 这是一个空函数, 子类可以实现重新改方法
|
|
794
853
|
this.__options.onClick == null ? void 0 : this.__options.onClick.call(this.__options, e);
|
|
795
854
|
};
|
|
855
|
+
/**
|
|
856
|
+
* 判断某个播放类型是否被本控件支持
|
|
857
|
+
*
|
|
858
|
+
* @param playType 播放类型;传空串(无法从地址判定)时一律返回 `true`,避免误报
|
|
859
|
+
* @returns 是否支持
|
|
860
|
+
* @since 3.1.7
|
|
861
|
+
*/ Control.supportsPlayType = function supportsPlayType(playType) {
|
|
862
|
+
if (!playType) return true;
|
|
863
|
+
return this.supportedPlayTypes.includes(playType);
|
|
864
|
+
};
|
|
796
865
|
_create_class$k(Control, [
|
|
797
866
|
{
|
|
798
867
|
key: "active",
|
|
799
|
-
get: /**
|
|
800
|
-
* 是否激活
|
|
868
|
+
get: /**
|
|
869
|
+
* 是否激活
|
|
801
870
|
*/ function get() {
|
|
802
871
|
return this._active;
|
|
803
872
|
},
|
|
@@ -812,8 +881,8 @@
|
|
|
812
881
|
},
|
|
813
882
|
{
|
|
814
883
|
key: "disabled",
|
|
815
|
-
get: /**
|
|
816
|
-
* 是否禁用
|
|
884
|
+
get: /**
|
|
885
|
+
* 是否禁用
|
|
817
886
|
*/ function get() {
|
|
818
887
|
return this._disabled;
|
|
819
888
|
},
|
|
@@ -825,6 +894,24 @@
|
|
|
825
894
|
]);
|
|
826
895
|
return Control;
|
|
827
896
|
}(EventEmitter);
|
|
897
|
+
/**
|
|
898
|
+
* 该控件支持的播放类型,默认全支持
|
|
899
|
+
*
|
|
900
|
+
* 子类用 `static supportedPlayTypes = [...]` 覆盖来收窄范围。声明是**静态**的,
|
|
901
|
+
* 因为渲染层需要在不实例化控件的前提下就能读到(`Controls[iconId].supportedPlayTypes`)。
|
|
902
|
+
*
|
|
903
|
+
* 渲染时会拿 `theme.playType` 与此比对,不匹配只发警告与 `Control.unsupportedPlayType`
|
|
904
|
+
* 事件,**不阻止渲染**,控件照常创建、照常可交互,行为是否生效由 SDK 层与设备能力决定。
|
|
905
|
+
*
|
|
906
|
+
* @since 3.1.7
|
|
907
|
+
* @example
|
|
908
|
+
* ```ts
|
|
909
|
+
* class MyControl extends Control {
|
|
910
|
+
* // 只在云存储回放下有意义
|
|
911
|
+
* static supportedPlayTypes: ThemePlayType[] = ['cloudRec'];
|
|
912
|
+
* }
|
|
913
|
+
* ```
|
|
914
|
+
*/ Control.supportedPlayTypes = [].concat(PLAY_TYPES);
|
|
828
915
|
|
|
829
916
|
function _extends$B() {
|
|
830
917
|
_extends$B = Object.assign || function assign(target) {
|
|
@@ -857,9 +944,9 @@
|
|
|
857
944
|
return _set_prototype_of$C(o, p);
|
|
858
945
|
}
|
|
859
946
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
860
|
-
/**
|
|
861
|
-
* 加载动画控件
|
|
862
|
-
* @category Control
|
|
947
|
+
/**
|
|
948
|
+
* 加载动画控件
|
|
949
|
+
* @category Control
|
|
863
950
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
864
951
|
_inherits$y(Loading, Control);
|
|
865
952
|
function Loading(options) {
|
|
@@ -884,9 +971,9 @@
|
|
|
884
971
|
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS$1 + "-loading-dot " + PREFIX_CLASS$1 + '-loading-dot-load">\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n </span>\n <div class="' + PREFIX_CLASS$1 + '-loading-text">' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.LOADING) || 'loading...') + "</div>\n ";
|
|
885
972
|
}
|
|
886
973
|
};
|
|
887
|
-
/**
|
|
888
|
-
* 动画展示
|
|
889
|
-
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
974
|
+
/**
|
|
975
|
+
* 动画展示
|
|
976
|
+
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
890
977
|
*/ _proto.show = function show(html) {
|
|
891
978
|
if (html) this.$container.innerHTML = html;
|
|
892
979
|
// 初始化, 出流再等待中(回放出流结束不包括)
|
|
@@ -894,8 +981,8 @@
|
|
|
894
981
|
this.$container.classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
895
982
|
this.$popupContainer.classList.add("" + PREFIX_CLASS$1 + "-has-loading");
|
|
896
983
|
};
|
|
897
|
-
/**
|
|
898
|
-
* 隐藏动画
|
|
984
|
+
/**
|
|
985
|
+
* 隐藏动画
|
|
899
986
|
*/ _proto.hide = function hide() {
|
|
900
987
|
Control.prototype.hide.call(this);
|
|
901
988
|
this.$popupContainer.classList.remove("" + PREFIX_CLASS$1 + "-has-loading");
|
|
@@ -939,9 +1026,9 @@
|
|
|
939
1026
|
var POSTER_OPTIONS = {
|
|
940
1027
|
poster: DEFAULT_POSTER
|
|
941
1028
|
};
|
|
942
|
-
/**
|
|
943
|
-
* 封面控件
|
|
944
|
-
* @category Control
|
|
1029
|
+
/**
|
|
1030
|
+
* 封面控件
|
|
1031
|
+
* @category Control
|
|
945
1032
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
946
1033
|
_inherits$x(Poster, Control);
|
|
947
1034
|
function Poster(options) {
|
|
@@ -961,18 +1048,18 @@
|
|
|
961
1048
|
return _this;
|
|
962
1049
|
}
|
|
963
1050
|
var _proto = Poster.prototype;
|
|
964
|
-
/**
|
|
965
|
-
* 封面图片加载失败
|
|
966
|
-
* @param error
|
|
1051
|
+
/**
|
|
1052
|
+
* 封面图片加载失败
|
|
1053
|
+
* @param error
|
|
967
1054
|
*/ _proto._imgLoadErrorEvent = function _imgLoadErrorEvent(error) {
|
|
968
1055
|
var _error_target;
|
|
969
1056
|
// 封面加载失败, 一般只有自定义封面会出现这种情况
|
|
970
1057
|
// 这里不做img src重置处理 防止无限循环
|
|
971
1058
|
this._options.onLoadImgError == null ? void 0 : this._options.onLoadImgError.call(this._options, ((_error_target = error.target) == null ? void 0 : _error_target.getAttribute('src')) || '');
|
|
972
1059
|
};
|
|
973
|
-
/**
|
|
974
|
-
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
975
|
-
* @param {string} poster 封面地址或 base64 数据
|
|
1060
|
+
/**
|
|
1061
|
+
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
1062
|
+
* @param {string} poster 封面地址或 base64 数据
|
|
976
1063
|
*/ _proto.setPoster = function setPoster(poster) {
|
|
977
1064
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
978
1065
|
// prettier-ignore
|
|
@@ -985,24 +1072,24 @@
|
|
|
985
1072
|
this.$container.innerHTML = '<img class="' + PREFIX_CLASS$1 + '-poster-img" src="' + poster + '" />';
|
|
986
1073
|
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS$1 + "-poster-img")) == null ? void 0 : _this_$container_querySelector.addEventListener("error", this._imgLoadErrorEvent);
|
|
987
1074
|
};
|
|
988
|
-
/**
|
|
989
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
1075
|
+
/**
|
|
1076
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
990
1077
|
*/ _proto.show = function show() {
|
|
991
1078
|
if (this.$container) {
|
|
992
1079
|
this.$container.style.display = 'flex';
|
|
993
1080
|
this.$container.classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
994
1081
|
}
|
|
995
1082
|
};
|
|
996
|
-
/**
|
|
997
|
-
* 隐藏封面
|
|
1083
|
+
/**
|
|
1084
|
+
* 隐藏封面
|
|
998
1085
|
*/ _proto.hide = function hide() {
|
|
999
1086
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
1000
1087
|
_this_$container_querySelector, _this_$container;
|
|
1001
1088
|
Control.prototype.hide.call(this);
|
|
1002
1089
|
(_this_$container = this.$container) == null ? void 0 : (_this_$container_querySelector = _this_$container.querySelector("." + PREFIX_CLASS$1 + "-poster-img")) == null ? void 0 : _this_$container_querySelector.removeEventListener('error', this._imgLoadErrorEvent);
|
|
1003
1090
|
};
|
|
1004
|
-
/**
|
|
1005
|
-
* 销毁
|
|
1091
|
+
/**
|
|
1092
|
+
* 销毁
|
|
1006
1093
|
*/ _proto.destroy = function destroy() {
|
|
1007
1094
|
this.hide();
|
|
1008
1095
|
Control.prototype.destroy.call(this);
|
|
@@ -1061,15 +1148,15 @@
|
|
|
1061
1148
|
list: '<svg stroke="currentColor" fill="none" width="1em" height="1em" viewBox="0 0 24 24" focusable="false" aria-hidden="true" data-icon="list">\n <path d="M10.9995 5H21.0005" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M10.9995 12H21.0005" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M10.9995 19H21.0005" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 5C6.99951 3.896 6.10351 3 4.99951 3C3.89551 3 2.99951 3.896 2.99951 5C2.99951 6.105 3.89551 7 4.99951 7C6.10351 7 6.99951 6.105 6.99951 5V5Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 12C6.99951 10.896 6.10351 10 4.99951 10C3.89551 10 2.99951 10.896 2.99951 12C2.99951 13.105 3.89551 14 4.99951 14C6.10351 14 6.99951 13.105 6.99951 12V12Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 12C6.99951 10.896 6.10351 10 4.99951 10C3.89551 10 2.99951 10.896 2.99951 12C2.99951 13.105 3.89551 14 4.99951 14C6.10351 14 6.99951 13.105 6.99951 12V12Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 19C6.99951 17.896 6.10351 17 4.99951 17C3.89551 17 2.99951 17.896 2.99951 19C2.99951 20.105 3.89551 21 4.99951 21C6.10351 21 6.99951 20.105 6.99951 19V19Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'
|
|
1062
1149
|
};
|
|
1063
1150
|
|
|
1064
|
-
/**
|
|
1065
|
-
* 创建 icon 组件
|
|
1066
|
-
* @param svg - svg 字符串
|
|
1067
|
-
* @param type - icon 类型
|
|
1068
|
-
* @returns icon 组件
|
|
1069
|
-
* @example
|
|
1070
|
-
* ```ts
|
|
1071
|
-
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
1072
|
-
* ```
|
|
1151
|
+
/**
|
|
1152
|
+
* 创建 icon 组件
|
|
1153
|
+
* @param svg - svg 字符串
|
|
1154
|
+
* @param type - icon 类型
|
|
1155
|
+
* @returns icon 组件
|
|
1156
|
+
* @example
|
|
1157
|
+
* ```ts
|
|
1158
|
+
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
1159
|
+
* ```
|
|
1073
1160
|
*/ function createIcon(svg, type, attr) {
|
|
1074
1161
|
if (attr === void 0) attr = {};
|
|
1075
1162
|
var attrStr = '';
|
|
@@ -1270,9 +1357,9 @@
|
|
|
1270
1357
|
return _set_prototype_of$A(o, p);
|
|
1271
1358
|
}
|
|
1272
1359
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
1273
|
-
/**
|
|
1274
|
-
* 消息控件
|
|
1275
|
-
* @category Control
|
|
1360
|
+
/**
|
|
1361
|
+
* 消息控件
|
|
1362
|
+
* @category Control
|
|
1276
1363
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
1277
1364
|
_inherits$w(Message, Control);
|
|
1278
1365
|
function Message(options) {
|
|
@@ -1287,34 +1374,34 @@
|
|
|
1287
1374
|
return _this;
|
|
1288
1375
|
}
|
|
1289
1376
|
var _proto = Message.prototype;
|
|
1290
|
-
/**
|
|
1291
|
-
* info 普通消息, 内容默认字体白色
|
|
1292
|
-
* @param {string} msg 消息内容
|
|
1293
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1377
|
+
/**
|
|
1378
|
+
* info 普通消息, 内容默认字体白色
|
|
1379
|
+
* @param {string} msg 消息内容
|
|
1380
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1294
1381
|
*/ _proto.info = function info(msg, duration) {
|
|
1295
1382
|
if (duration === void 0) duration = 2;
|
|
1296
1383
|
this._toast(msg, 'info', duration);
|
|
1297
1384
|
};
|
|
1298
|
-
/**
|
|
1299
|
-
* warn 警告消息, 内容默认字体黄色
|
|
1300
|
-
* @param {string} msg 消息内容
|
|
1301
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1385
|
+
/**
|
|
1386
|
+
* warn 警告消息, 内容默认字体黄色
|
|
1387
|
+
* @param {string} msg 消息内容
|
|
1388
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1302
1389
|
*/ _proto.warn = function warn(msg, duration) {
|
|
1303
1390
|
if (duration === void 0) duration = 2;
|
|
1304
1391
|
this._toast(msg, 'warn', duration);
|
|
1305
1392
|
};
|
|
1306
|
-
/**
|
|
1307
|
-
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
1308
|
-
* @param {string} msg 消息内容
|
|
1309
|
-
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
1393
|
+
/**
|
|
1394
|
+
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
1395
|
+
* @param {string} msg 消息内容
|
|
1396
|
+
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
1310
1397
|
*/ _proto.toastError = function toastError(msg, duration) {
|
|
1311
1398
|
if (duration === void 0) duration = 2;
|
|
1312
1399
|
this._toast(msg, 'error', duration);
|
|
1313
1400
|
};
|
|
1314
|
-
/**
|
|
1315
|
-
* error 错误消息, 内容默认字体红色
|
|
1316
|
-
* @param {string} msg 消息内容
|
|
1317
|
-
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
1401
|
+
/**
|
|
1402
|
+
* error 错误消息, 内容默认字体红色
|
|
1403
|
+
* @param {string} msg 消息内容
|
|
1404
|
+
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
1318
1405
|
*/ _proto.error = function error(msg, duration) {
|
|
1319
1406
|
if (duration === void 0) duration = 0;
|
|
1320
1407
|
this._show(this._getIcon('error') + '<div class="' + PREFIX_CLASS$1 + '-message-msg">' + (msg || '') + "</div>", duration, 'error');
|
|
@@ -1343,11 +1430,11 @@
|
|
|
1343
1430
|
}
|
|
1344
1431
|
}
|
|
1345
1432
|
};
|
|
1346
|
-
/**
|
|
1347
|
-
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1348
|
-
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1349
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1350
|
-
* @param {MessageType} type 消息类型
|
|
1433
|
+
/**
|
|
1434
|
+
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1435
|
+
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1436
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1437
|
+
* @param {MessageType} type 消息类型
|
|
1351
1438
|
*/ _proto._show = function _show(msg, duration, type) {
|
|
1352
1439
|
var _this = this;
|
|
1353
1440
|
if (duration === void 0) duration = 0;
|
|
@@ -1375,8 +1462,8 @@
|
|
|
1375
1462
|
}, duration * 1000);
|
|
1376
1463
|
}
|
|
1377
1464
|
};
|
|
1378
|
-
/**
|
|
1379
|
-
* 销毁
|
|
1465
|
+
/**
|
|
1466
|
+
* 销毁
|
|
1380
1467
|
*/ _proto.destroy = function destroy() {
|
|
1381
1468
|
var _this__$toast;
|
|
1382
1469
|
if (this._timer) {
|
|
@@ -1391,8 +1478,8 @@
|
|
|
1391
1478
|
this.hide();
|
|
1392
1479
|
Control.prototype.destroy.call(this);
|
|
1393
1480
|
};
|
|
1394
|
-
/**
|
|
1395
|
-
* 隐藏消息, 并清空消息内容
|
|
1481
|
+
/**
|
|
1482
|
+
* 隐藏消息, 并清空消息内容
|
|
1396
1483
|
*/ _proto.hide = function hide() {
|
|
1397
1484
|
var _this = this;
|
|
1398
1485
|
// 每次隐藏都清空内 消息内容
|
|
@@ -1465,9 +1552,9 @@
|
|
|
1465
1552
|
};
|
|
1466
1553
|
return _set_prototype_of$z(o, p);
|
|
1467
1554
|
}
|
|
1468
|
-
/**
|
|
1469
|
-
* 播放/暂停控件
|
|
1470
|
-
* @category Control
|
|
1555
|
+
/**
|
|
1556
|
+
* 播放/暂停控件
|
|
1557
|
+
* @category Control
|
|
1471
1558
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1472
1559
|
_inherits$v(Play, Control);
|
|
1473
1560
|
function Play(options) {
|
|
@@ -1489,8 +1576,8 @@
|
|
|
1489
1576
|
return _this;
|
|
1490
1577
|
}
|
|
1491
1578
|
var _proto = Play.prototype;
|
|
1492
|
-
/**
|
|
1493
|
-
* 点击 Control 会触发
|
|
1579
|
+
/**
|
|
1580
|
+
* 点击 Control 会触发
|
|
1494
1581
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
1495
1582
|
this._playing = !this._playing;
|
|
1496
1583
|
this.emit(EVENTS$2.control.play, this._playing);
|
|
@@ -1513,8 +1600,8 @@
|
|
|
1513
1600
|
_create_class$j(Play, [
|
|
1514
1601
|
{
|
|
1515
1602
|
key: "playing",
|
|
1516
|
-
get: /**
|
|
1517
|
-
* 播放状态
|
|
1603
|
+
get: /**
|
|
1604
|
+
* 播放状态
|
|
1518
1605
|
*/ function get() {
|
|
1519
1606
|
return this._playing;
|
|
1520
1607
|
}
|
|
@@ -2425,12 +2512,12 @@
|
|
|
2425
2512
|
|
|
2426
2513
|
var distExports$3 = requireDist$3();
|
|
2427
2514
|
|
|
2428
|
-
/**
|
|
2429
|
-
* 节流函数
|
|
2430
|
-
* @param {Function} func
|
|
2431
|
-
* @param {number} wait
|
|
2432
|
-
* @typeParam T - 函数类型
|
|
2433
|
-
* @returns {Function}
|
|
2515
|
+
/**
|
|
2516
|
+
* 节流函数
|
|
2517
|
+
* @param {Function} func
|
|
2518
|
+
* @param {number} wait
|
|
2519
|
+
* @typeParam T - 函数类型
|
|
2520
|
+
* @returns {Function}
|
|
2434
2521
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
2435
2522
|
function throttle(func, wait) {
|
|
2436
2523
|
var timeout = null;
|
|
@@ -2486,28 +2573,28 @@
|
|
|
2486
2573
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2487
2574
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
2488
2575
|
}
|
|
2489
|
-
/**
|
|
2490
|
-
* 工具类
|
|
2491
|
-
* @category Util
|
|
2576
|
+
/**
|
|
2577
|
+
* 工具类
|
|
2578
|
+
* @category Util
|
|
2492
2579
|
*/ var Utils = /*#__PURE__*/ function() {
|
|
2493
2580
|
function Utils() {}
|
|
2494
2581
|
// /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(navigator?.userAgent) ||
|
|
2495
2582
|
// (/Macintosh/i.test(navigator?.userAgent) && navigator?.maxTouchPoints > 1); // iPad 支持多点触控;
|
|
2496
|
-
/**
|
|
2497
|
-
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
2498
|
-
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
2499
|
-
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
2500
|
-
*
|
|
2501
|
-
* @example
|
|
2502
|
-
* ```ts
|
|
2503
|
-
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
2504
|
-
* console.log("orientation", orientation)
|
|
2505
|
-
* })
|
|
2506
|
-
*
|
|
2507
|
-
* console.log("orientation", orientation)
|
|
2508
|
-
* // 清除监听
|
|
2509
|
-
* cleanUp()
|
|
2510
|
-
* ```
|
|
2583
|
+
/**
|
|
2584
|
+
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
2585
|
+
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
2586
|
+
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
2587
|
+
*
|
|
2588
|
+
* @example
|
|
2589
|
+
* ```ts
|
|
2590
|
+
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
2591
|
+
* console.log("orientation", orientation)
|
|
2592
|
+
* })
|
|
2593
|
+
*
|
|
2594
|
+
* console.log("orientation", orientation)
|
|
2595
|
+
* // 清除监听
|
|
2596
|
+
* cleanUp()
|
|
2597
|
+
* ```
|
|
2511
2598
|
*/ // prettier-ignore
|
|
2512
2599
|
Utils.orientationEventListener = function orientationEventListener(change) {
|
|
2513
2600
|
var _orientationTimer = null;
|
|
@@ -2597,18 +2684,18 @@
|
|
|
2597
2684
|
}
|
|
2598
2685
|
];
|
|
2599
2686
|
};
|
|
2600
|
-
/**
|
|
2601
|
-
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
2602
|
-
* @param {Element} node
|
|
2603
|
-
* @param callback
|
|
2604
|
-
* @returns {CleanUpResizeObserver}
|
|
2605
|
-
* @example
|
|
2606
|
-
* ```ts
|
|
2607
|
-
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
2608
|
-
*
|
|
2609
|
-
* // 移除监听
|
|
2610
|
-
* unobserve()
|
|
2611
|
-
* ```
|
|
2687
|
+
/**
|
|
2688
|
+
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
2689
|
+
* @param {Element} node
|
|
2690
|
+
* @param callback
|
|
2691
|
+
* @returns {CleanUpResizeObserver}
|
|
2692
|
+
* @example
|
|
2693
|
+
* ```ts
|
|
2694
|
+
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
2695
|
+
*
|
|
2696
|
+
* // 移除监听
|
|
2697
|
+
* unobserve()
|
|
2698
|
+
* ```
|
|
2612
2699
|
*/ // prettier-ignore
|
|
2613
2700
|
Utils.resizeObserver = function resizeObserver(node, callback) {
|
|
2614
2701
|
// prettier-ignore
|
|
@@ -2643,12 +2730,12 @@
|
|
|
2643
2730
|
return Utils;
|
|
2644
2731
|
}();
|
|
2645
2732
|
// 不要使用 window, 如果在 worker 中会报错
|
|
2646
|
-
/**
|
|
2647
|
-
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
2648
|
-
* @example
|
|
2649
|
-
* ```ts
|
|
2650
|
-
* Utils.isMobile // true | false
|
|
2651
|
-
* ```
|
|
2733
|
+
/**
|
|
2734
|
+
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
2735
|
+
* @example
|
|
2736
|
+
* ```ts
|
|
2737
|
+
* Utils.isMobile // true | false
|
|
2738
|
+
* ```
|
|
2652
2739
|
*/ Utils.isMobile = distExports$3.isMobile();
|
|
2653
2740
|
|
|
2654
2741
|
function _defineProperties$7(target, props) {
|
|
@@ -2682,23 +2769,23 @@
|
|
|
2682
2769
|
return (percent * 100).toFixed(0);
|
|
2683
2770
|
}
|
|
2684
2771
|
};
|
|
2685
|
-
/**
|
|
2686
|
-
* 进度条
|
|
2687
|
-
*
|
|
2688
|
-
* @category Control
|
|
2689
|
-
* @example
|
|
2690
|
-
* ```ts
|
|
2691
|
-
* const progress = new Progress({
|
|
2692
|
-
* container: document.getElementById('progress-container'),
|
|
2693
|
-
* step: 0.01,
|
|
2694
|
-
* range: [0, 1],
|
|
2695
|
-
* onChange: (value, range) => {
|
|
2696
|
-
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
2697
|
-
* },
|
|
2698
|
-
* defaultValue: 0.5,
|
|
2699
|
-
* draggable: true,
|
|
2700
|
-
* disabled: false,
|
|
2701
|
-
* })
|
|
2772
|
+
/**
|
|
2773
|
+
* 进度条
|
|
2774
|
+
*
|
|
2775
|
+
* @category Control
|
|
2776
|
+
* @example
|
|
2777
|
+
* ```ts
|
|
2778
|
+
* const progress = new Progress({
|
|
2779
|
+
* container: document.getElementById('progress-container'),
|
|
2780
|
+
* step: 0.01,
|
|
2781
|
+
* range: [0, 1],
|
|
2782
|
+
* onChange: (value, range) => {
|
|
2783
|
+
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
2784
|
+
* },
|
|
2785
|
+
* defaultValue: 0.5,
|
|
2786
|
+
* draggable: true,
|
|
2787
|
+
* disabled: false,
|
|
2788
|
+
* })
|
|
2702
2789
|
*/ var Progress = /*#__PURE__*/ function() {
|
|
2703
2790
|
function Progress(options) {
|
|
2704
2791
|
var _this_options_defaultValue;
|
|
@@ -2731,20 +2818,20 @@
|
|
|
2731
2818
|
this.disabled = this.options.disabled;
|
|
2732
2819
|
}
|
|
2733
2820
|
var _proto = Progress.prototype;
|
|
2734
|
-
/**
|
|
2735
|
-
* 是否旋转了
|
|
2736
|
-
* @param rotated
|
|
2821
|
+
/**
|
|
2822
|
+
* 是否旋转了
|
|
2823
|
+
* @param rotated
|
|
2737
2824
|
*/ _proto.isRotate = function isRotate(rotated) {
|
|
2738
2825
|
this._isRotated = rotated;
|
|
2739
2826
|
};
|
|
2740
|
-
/**
|
|
2741
|
-
* 销毁 Progress 实例,移除事件监听器
|
|
2742
|
-
* @returns {void}
|
|
2743
|
-
* @memberof Progress
|
|
2744
|
-
* @example
|
|
2745
|
-
* ```ts
|
|
2746
|
-
* progress.destroy();
|
|
2747
|
-
* ```
|
|
2827
|
+
/**
|
|
2828
|
+
* 销毁 Progress 实例,移除事件监听器
|
|
2829
|
+
* @returns {void}
|
|
2830
|
+
* @memberof Progress
|
|
2831
|
+
* @example
|
|
2832
|
+
* ```ts
|
|
2833
|
+
* progress.destroy();
|
|
2834
|
+
* ```
|
|
2748
2835
|
*/ _proto.destroy = function destroy() {
|
|
2749
2836
|
var _this__delegateSliderMouseDown_destroy, _this__delegateSliderMouseDown, _this__delegateSliderHandleMouseDown_destroy, _this__delegateSliderHandleMouseDown, _this__delegateProgressMouseDown_destroy, _this__delegateProgressMouseDown, _this__delegatePlusClick_destroy, _this__delegatePlusClick, _this__delegateMinusClick_destroy, _this__delegateMinusClick;
|
|
2750
2837
|
(_this__delegateSliderMouseDown = this._delegateSliderMouseDown) == null ? void 0 : (_this__delegateSliderMouseDown_destroy = _this__delegateSliderMouseDown.destroy) == null ? void 0 : _this__delegateSliderMouseDown_destroy.call(_this__delegateSliderMouseDown);
|
|
@@ -2939,14 +3026,14 @@
|
|
|
2939
3026
|
},
|
|
2940
3027
|
{
|
|
2941
3028
|
key: "value",
|
|
2942
|
-
get: /**
|
|
2943
|
-
* 获取进度条值
|
|
2944
|
-
* @returns {number} 当前进度条值
|
|
2945
|
-
* @example
|
|
2946
|
-
* ```ts
|
|
2947
|
-
* const value = progress.value; // 获取当前进度条值
|
|
2948
|
-
* console.log(value); // 输出值
|
|
2949
|
-
* ```
|
|
3029
|
+
get: /**
|
|
3030
|
+
* 获取进度条值
|
|
3031
|
+
* @returns {number} 当前进度条值
|
|
3032
|
+
* @example
|
|
3033
|
+
* ```ts
|
|
3034
|
+
* const value = progress.value; // 获取当前进度条值
|
|
3035
|
+
* console.log(value); // 输出值
|
|
3036
|
+
* ```
|
|
2950
3037
|
*/ function get() {
|
|
2951
3038
|
return this._value; //
|
|
2952
3039
|
},
|
|
@@ -2956,14 +3043,14 @@
|
|
|
2956
3043
|
},
|
|
2957
3044
|
{
|
|
2958
3045
|
key: "percent",
|
|
2959
|
-
get: /**
|
|
2960
|
-
* 获取进度百分比
|
|
2961
|
-
* @returns {number} 当前进度条百分比
|
|
2962
|
-
* @example
|
|
2963
|
-
* ```ts
|
|
2964
|
-
* const percent = progress.percent; // 获取当前进度条百分比
|
|
2965
|
-
* console.log(percent); // 输出百分比
|
|
2966
|
-
* ```
|
|
3046
|
+
get: /**
|
|
3047
|
+
* 获取进度百分比
|
|
3048
|
+
* @returns {number} 当前进度条百分比
|
|
3049
|
+
* @example
|
|
3050
|
+
* ```ts
|
|
3051
|
+
* const percent = progress.percent; // 获取当前进度条百分比
|
|
3052
|
+
* console.log(percent); // 输出百分比
|
|
3053
|
+
* ```
|
|
2967
3054
|
*/ function get() {
|
|
2968
3055
|
return this._percent;
|
|
2969
3056
|
},
|
|
@@ -3026,9 +3113,9 @@
|
|
|
3026
3113
|
onOpenChange: function onOpenChange() {},
|
|
3027
3114
|
onChange: function onChange() {}
|
|
3028
3115
|
};
|
|
3029
|
-
/**
|
|
3030
|
-
* 音量调节控件
|
|
3031
|
-
* @category Control
|
|
3116
|
+
/**
|
|
3117
|
+
* 音量调节控件
|
|
3118
|
+
* @category Control
|
|
3032
3119
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
3033
3120
|
_inherits$u(Volume, Control);
|
|
3034
3121
|
function Volume(options) {
|
|
@@ -3102,8 +3189,8 @@
|
|
|
3102
3189
|
return _this;
|
|
3103
3190
|
}
|
|
3104
3191
|
var _proto = Volume.prototype;
|
|
3105
|
-
/**
|
|
3106
|
-
* 销毁
|
|
3192
|
+
/**
|
|
3193
|
+
* 销毁
|
|
3107
3194
|
*/ _proto.destroy = function destroy() {
|
|
3108
3195
|
var _this__progress_destroy, _this__progress, _this_picker;
|
|
3109
3196
|
(_this__progress = this._progress) == null ? void 0 : (_this__progress_destroy = _this__progress.destroy) == null ? void 0 : _this__progress_destroy.call(_this__progress);
|
|
@@ -3161,8 +3248,8 @@
|
|
|
3161
3248
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_VOLUME
|
|
3162
3249
|
});
|
|
3163
3250
|
};
|
|
3164
|
-
/**
|
|
3165
|
-
* 点击 Control 会触发
|
|
3251
|
+
/**
|
|
3252
|
+
* 点击 Control 会触发
|
|
3166
3253
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
3167
3254
|
// this._options.onClick?.(e);
|
|
3168
3255
|
};
|
|
@@ -3179,8 +3266,8 @@
|
|
|
3179
3266
|
_create_class$h(Volume, [
|
|
3180
3267
|
{
|
|
3181
3268
|
key: "muted",
|
|
3182
|
-
get: /**
|
|
3183
|
-
* 是否静音
|
|
3269
|
+
get: /**
|
|
3270
|
+
* 是否静音
|
|
3184
3271
|
*/ function get() {
|
|
3185
3272
|
return this._muted;
|
|
3186
3273
|
},
|
|
@@ -3204,8 +3291,8 @@
|
|
|
3204
3291
|
},
|
|
3205
3292
|
{
|
|
3206
3293
|
key: "volume",
|
|
3207
|
-
get: /**
|
|
3208
|
-
* 当前音量值(真实值 即使静音)
|
|
3294
|
+
get: /**
|
|
3295
|
+
* 当前音量值(真实值 即使静音)
|
|
3209
3296
|
*/ function get() {
|
|
3210
3297
|
return this._lastVolume;
|
|
3211
3298
|
},
|
|
@@ -3228,8 +3315,8 @@
|
|
|
3228
3315
|
},
|
|
3229
3316
|
{
|
|
3230
3317
|
key: "disabled",
|
|
3231
|
-
get: /**
|
|
3232
|
-
* 是否禁用
|
|
3318
|
+
get: /**
|
|
3319
|
+
* 是否禁用
|
|
3233
3320
|
*/ function get() {
|
|
3234
3321
|
return this._disabled;
|
|
3235
3322
|
},
|
|
@@ -3928,9 +4015,9 @@
|
|
|
3928
4015
|
};
|
|
3929
4016
|
return _set_prototype_of$x(o, p);
|
|
3930
4017
|
}
|
|
3931
|
-
/**
|
|
3932
|
-
* 全屏控件
|
|
3933
|
-
* @category Control
|
|
4018
|
+
/**
|
|
4019
|
+
* 全屏控件
|
|
4020
|
+
* @category Control
|
|
3934
4021
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
3935
4022
|
_inherits$t(Fullscreen, Control);
|
|
3936
4023
|
function Fullscreen(options) {
|
|
@@ -3957,8 +4044,8 @@
|
|
|
3957
4044
|
return _this;
|
|
3958
4045
|
}
|
|
3959
4046
|
var _proto = Fullscreen.prototype;
|
|
3960
|
-
/**
|
|
3961
|
-
* 销毁
|
|
4047
|
+
/**
|
|
4048
|
+
* 销毁
|
|
3962
4049
|
*/ _proto.destroy = function destroy() {
|
|
3963
4050
|
var _this__fullscreenUtil;
|
|
3964
4051
|
this.$container.innerHTML = '';
|
|
@@ -3986,8 +4073,8 @@
|
|
|
3986
4073
|
this._render();
|
|
3987
4074
|
this.options.onChange == null ? void 0 : this.options.onChange.call(this.options, info);
|
|
3988
4075
|
};
|
|
3989
|
-
/**
|
|
3990
|
-
* 点击 Control 会触发
|
|
4076
|
+
/**
|
|
4077
|
+
* 点击 Control 会触发
|
|
3991
4078
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
3992
4079
|
if (this.isCurrentFullscreen) {
|
|
3993
4080
|
var _this__fullscreenUtil;
|
|
@@ -4031,9 +4118,9 @@
|
|
|
4031
4118
|
};
|
|
4032
4119
|
return _set_prototype_of$w(o, p);
|
|
4033
4120
|
}
|
|
4034
|
-
/**
|
|
4035
|
-
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
4036
|
-
* @category Control
|
|
4121
|
+
/**
|
|
4122
|
+
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
4123
|
+
* @category Control
|
|
4037
4124
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
4038
4125
|
_inherits$s(Rec, Control);
|
|
4039
4126
|
function Rec(options) {
|
|
@@ -4052,8 +4139,8 @@
|
|
|
4052
4139
|
return _this;
|
|
4053
4140
|
}
|
|
4054
4141
|
var _proto = Rec.prototype;
|
|
4055
|
-
/**
|
|
4056
|
-
* 销毁
|
|
4142
|
+
/**
|
|
4143
|
+
* 销毁
|
|
4057
4144
|
*/ _proto.destroy = function destroy() {
|
|
4058
4145
|
var _this__delegation;
|
|
4059
4146
|
this.$container.removeEventListener('dblclick', this._onDBlClick);
|
|
@@ -4061,9 +4148,9 @@
|
|
|
4061
4148
|
this._delegation = null;
|
|
4062
4149
|
Control.prototype.destroy.call(this);
|
|
4063
4150
|
};
|
|
4064
|
-
/**
|
|
4065
|
-
* 添加回放类型图标
|
|
4066
|
-
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
4151
|
+
/**
|
|
4152
|
+
* 添加回放类型图标
|
|
4153
|
+
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
4067
4154
|
*/ _proto.addRecType = function addRecType(id) {
|
|
4068
4155
|
var spanIcon = '';
|
|
4069
4156
|
switch(id){
|
|
@@ -4130,11 +4217,16 @@
|
|
|
4130
4217
|
}
|
|
4131
4218
|
});
|
|
4132
4219
|
};
|
|
4133
|
-
/**
|
|
4134
|
-
* 点击 Control 会触发
|
|
4220
|
+
/**
|
|
4221
|
+
* 点击 Control 会触发
|
|
4135
4222
|
*/ _proto._onControlClick = function _onControlClick(e) {};
|
|
4136
4223
|
return Rec;
|
|
4137
4224
|
}(Control);
|
|
4225
|
+
/** 回放类型切换组,本身就是三种回放之间的切换入口,直播下无意义 */ Rec.supportedPlayTypes = [
|
|
4226
|
+
'rec',
|
|
4227
|
+
'cloudRec',
|
|
4228
|
+
'cloudRecord'
|
|
4229
|
+
];
|
|
4138
4230
|
|
|
4139
4231
|
var dist$2 = {exports: {}};
|
|
4140
4232
|
|
|
@@ -4858,8 +4950,8 @@
|
|
|
4858
4950
|
}
|
|
4859
4951
|
};
|
|
4860
4952
|
|
|
4861
|
-
/**
|
|
4862
|
-
* flv 预览
|
|
4953
|
+
/**
|
|
4954
|
+
* flv 预览
|
|
4863
4955
|
*/ var hlsLiveTemplate = {
|
|
4864
4956
|
autoFocus: 3,
|
|
4865
4957
|
// poster:
|
|
@@ -4911,8 +5003,8 @@
|
|
|
4911
5003
|
}
|
|
4912
5004
|
};
|
|
4913
5005
|
|
|
4914
|
-
/**
|
|
4915
|
-
* flv 预览
|
|
5006
|
+
/**
|
|
5007
|
+
* flv 预览
|
|
4916
5008
|
*/ var hlsRecTemplate = {
|
|
4917
5009
|
autoFocus: 3,
|
|
4918
5010
|
// poster:
|
|
@@ -4970,8 +5062,8 @@
|
|
|
4970
5062
|
}
|
|
4971
5063
|
};
|
|
4972
5064
|
|
|
4973
|
-
/**
|
|
4974
|
-
* pc 预览
|
|
5065
|
+
/**
|
|
5066
|
+
* pc 预览
|
|
4975
5067
|
*/ var pcLive = {
|
|
4976
5068
|
autoFocus: 3,
|
|
4977
5069
|
header: {
|
|
@@ -5070,8 +5162,8 @@
|
|
|
5070
5162
|
}
|
|
5071
5163
|
};
|
|
5072
5164
|
|
|
5073
|
-
/**
|
|
5074
|
-
* pc 回放
|
|
5165
|
+
/**
|
|
5166
|
+
* pc 回放
|
|
5075
5167
|
*/ var pcRec = {
|
|
5076
5168
|
header: {
|
|
5077
5169
|
// color: DEFAULT_COLOR,
|
|
@@ -5182,8 +5274,8 @@
|
|
|
5182
5274
|
}
|
|
5183
5275
|
};
|
|
5184
5276
|
|
|
5185
|
-
/**
|
|
5186
|
-
* mobile 预览
|
|
5277
|
+
/**
|
|
5278
|
+
* mobile 预览
|
|
5187
5279
|
*/ var mobileLive = {
|
|
5188
5280
|
header: {
|
|
5189
5281
|
// color: DEFAULT_COLOR,
|
|
@@ -5271,8 +5363,8 @@
|
|
|
5271
5363
|
}
|
|
5272
5364
|
};
|
|
5273
5365
|
|
|
5274
|
-
/**
|
|
5275
|
-
* mobile 回放
|
|
5366
|
+
/**
|
|
5367
|
+
* mobile 回放
|
|
5276
5368
|
*/ var mobileRec = {
|
|
5277
5369
|
header: {
|
|
5278
5370
|
// color: DEFAULT_COLOR,
|
|
@@ -5366,8 +5458,8 @@
|
|
|
5366
5458
|
}
|
|
5367
5459
|
};
|
|
5368
5460
|
|
|
5369
|
-
/**
|
|
5370
|
-
* 安防版(预览/回放)
|
|
5461
|
+
/**
|
|
5462
|
+
* 安防版(预览/回放)
|
|
5371
5463
|
*/ var security = {
|
|
5372
5464
|
header: {
|
|
5373
5465
|
// color: DEFAULT_COLOR,
|
|
@@ -5443,8 +5535,8 @@
|
|
|
5443
5535
|
}
|
|
5444
5536
|
};
|
|
5445
5537
|
|
|
5446
|
-
/**
|
|
5447
|
-
* 语音版(预览)
|
|
5538
|
+
/**
|
|
5539
|
+
* 语音版(预览)
|
|
5448
5540
|
*/ var voice = {
|
|
5449
5541
|
header: {
|
|
5450
5542
|
// color: DEFAULT_COLOR,
|
|
@@ -5496,11 +5588,11 @@
|
|
|
5496
5588
|
}
|
|
5497
5589
|
};
|
|
5498
5590
|
|
|
5499
|
-
/**
|
|
5500
|
-
* standard 做特殊处理
|
|
5501
|
-
*
|
|
5502
|
-
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
5503
|
-
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
5591
|
+
/**
|
|
5592
|
+
* standard 做特殊处理
|
|
5593
|
+
*
|
|
5594
|
+
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
5595
|
+
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
5504
5596
|
*/ var TEMPLATES = {
|
|
5505
5597
|
pcLive: pcLive,
|
|
5506
5598
|
pcRec: pcRec,
|
|
@@ -5530,9 +5622,9 @@
|
|
|
5530
5622
|
};
|
|
5531
5623
|
return _set_prototype_of$v(o, p);
|
|
5532
5624
|
}
|
|
5533
|
-
/**
|
|
5534
|
-
* 截图控件
|
|
5535
|
-
* @category Content
|
|
5625
|
+
/**
|
|
5626
|
+
* 截图控件
|
|
5627
|
+
* @category Content
|
|
5536
5628
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
5537
5629
|
_inherits$r(Content, EventEmitter);
|
|
5538
5630
|
function Content(options) {
|
|
@@ -5562,11 +5654,11 @@
|
|
|
5562
5654
|
return _this;
|
|
5563
5655
|
}
|
|
5564
5656
|
var _proto = Content.prototype;
|
|
5565
|
-
/**
|
|
5566
|
-
* 重新画面区域
|
|
5567
|
-
* @param {number} originWidth 画面宽度
|
|
5568
|
-
* @param {number} originHeight 画面高度
|
|
5569
|
-
* @returns {void}
|
|
5657
|
+
/**
|
|
5658
|
+
* 重新画面区域
|
|
5659
|
+
* @param {number} originWidth 画面宽度
|
|
5660
|
+
* @param {number} originHeight 画面高度
|
|
5661
|
+
* @returns {void}
|
|
5570
5662
|
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
5571
5663
|
if (originWidth === void 0) originWidth = 0;
|
|
5572
5664
|
if (originHeight === void 0) originHeight = 0;
|
|
@@ -5679,9 +5771,9 @@
|
|
|
5679
5771
|
};
|
|
5680
5772
|
return _set_prototype_of$u(o, p);
|
|
5681
5773
|
}
|
|
5682
|
-
/**
|
|
5683
|
-
* 更多控件
|
|
5684
|
-
* @category Control
|
|
5774
|
+
/**
|
|
5775
|
+
* 更多控件
|
|
5776
|
+
* @category Control
|
|
5685
5777
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
5686
5778
|
_inherits$q(More, Control);
|
|
5687
5779
|
function More(options) {
|
|
@@ -5727,9 +5819,9 @@
|
|
|
5727
5819
|
}
|
|
5728
5820
|
// debug
|
|
5729
5821
|
};
|
|
5730
|
-
/**
|
|
5731
|
-
* 添加
|
|
5732
|
-
* @param control
|
|
5822
|
+
/**
|
|
5823
|
+
* 添加
|
|
5824
|
+
* @param control
|
|
5733
5825
|
*/ _proto.add = function add(key, part, control, props) {
|
|
5734
5826
|
this.list.unshift({
|
|
5735
5827
|
part: part,
|
|
@@ -5739,9 +5831,9 @@
|
|
|
5739
5831
|
height: props.height
|
|
5740
5832
|
});
|
|
5741
5833
|
};
|
|
5742
|
-
/**
|
|
5743
|
-
* 移除
|
|
5744
|
-
* @param control
|
|
5834
|
+
/**
|
|
5835
|
+
* 移除
|
|
5836
|
+
* @param control
|
|
5745
5837
|
*/ _proto.remove = function remove(control) {
|
|
5746
5838
|
var index = this.list.findIndex(function(item) {
|
|
5747
5839
|
return item.control === control;
|
|
@@ -5761,20 +5853,20 @@
|
|
|
5761
5853
|
}
|
|
5762
5854
|
Control.prototype.destroy.call(this);
|
|
5763
5855
|
};
|
|
5764
|
-
/**
|
|
5765
|
-
* 点击 Control 会触发
|
|
5856
|
+
/**
|
|
5857
|
+
* 点击 Control 会触发
|
|
5766
5858
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
5767
5859
|
// this._options.onClick?.(e);
|
|
5768
5860
|
};
|
|
5769
5861
|
return More;
|
|
5770
5862
|
}(Control);
|
|
5771
5863
|
|
|
5772
|
-
/**
|
|
5773
|
-
* 函数防抖
|
|
5774
|
-
* @param {Function} func
|
|
5775
|
-
* @param {number} wait
|
|
5776
|
-
* @typeParam T - 函数类型
|
|
5777
|
-
* @returns {Function}
|
|
5864
|
+
/**
|
|
5865
|
+
* 函数防抖
|
|
5866
|
+
* @param {Function} func
|
|
5867
|
+
* @param {number} wait
|
|
5868
|
+
* @typeParam T - 函数类型
|
|
5869
|
+
* @returns {Function}
|
|
5778
5870
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
5779
5871
|
function debounce(func, wait) {
|
|
5780
5872
|
var timeout;
|
|
@@ -6404,23 +6496,23 @@
|
|
|
6404
6496
|
});
|
|
6405
6497
|
}
|
|
6406
6498
|
|
|
6407
|
-
/**
|
|
6408
|
-
* 重新调整播放器窗口大小
|
|
6409
|
-
*
|
|
6410
|
-
* Adjust the player window size
|
|
6411
|
-
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
6412
|
-
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
6413
|
-
* @since 0.0.1
|
|
6414
|
-
* @example
|
|
6415
|
-
* ```ts
|
|
6416
|
-
* theme.resize(600, 400) // 600px * 400px
|
|
6417
|
-
* theme.resize("600px", "400px") // 600px * 400px
|
|
6418
|
-
* theme.resize("50%", "1vh")
|
|
6419
|
-
* theme.resize("2em", "2rem")
|
|
6420
|
-
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
6421
|
-
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
6422
|
-
* ```
|
|
6423
|
-
* @returns {void}
|
|
6499
|
+
/**
|
|
6500
|
+
* 重新调整播放器窗口大小
|
|
6501
|
+
*
|
|
6502
|
+
* Adjust the player window size
|
|
6503
|
+
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
6504
|
+
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
6505
|
+
* @since 0.0.1
|
|
6506
|
+
* @example
|
|
6507
|
+
* ```ts
|
|
6508
|
+
* theme.resize(600, 400) // 600px * 400px
|
|
6509
|
+
* theme.resize("600px", "400px") // 600px * 400px
|
|
6510
|
+
* theme.resize("50%", "1vh")
|
|
6511
|
+
* theme.resize("2em", "2rem")
|
|
6512
|
+
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
6513
|
+
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
6514
|
+
* ```
|
|
6515
|
+
* @returns {void}
|
|
6424
6516
|
*/ function _resize(theme, width, height) {
|
|
6425
6517
|
var cssText = '';
|
|
6426
6518
|
if (/^\d+(\.\d+)?$/.test(width + '')) {
|
|
@@ -6483,9 +6575,9 @@
|
|
|
6483
6575
|
open: false,
|
|
6484
6576
|
max: 8
|
|
6485
6577
|
};
|
|
6486
|
-
/**
|
|
6487
|
-
* 电子放大控件
|
|
6488
|
-
* @category Control
|
|
6578
|
+
/**
|
|
6579
|
+
* 电子放大控件
|
|
6580
|
+
* @category Control
|
|
6489
6581
|
*/ var Zoom$1 = /*#__PURE__*/ function(Control) {
|
|
6490
6582
|
_inherits$p(Zoom, Control);
|
|
6491
6583
|
function Zoom(options) {
|
|
@@ -6562,8 +6654,8 @@
|
|
|
6562
6654
|
}
|
|
6563
6655
|
Control.prototype.destroy.call(this);
|
|
6564
6656
|
};
|
|
6565
|
-
/**
|
|
6566
|
-
* 点击 Control 会触发
|
|
6657
|
+
/**
|
|
6658
|
+
* 点击 Control 会触发
|
|
6567
6659
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6568
6660
|
this.active = !this.active;
|
|
6569
6661
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -6583,8 +6675,8 @@
|
|
|
6583
6675
|
},
|
|
6584
6676
|
{
|
|
6585
6677
|
key: "active",
|
|
6586
|
-
get: /**
|
|
6587
|
-
* 是否激活
|
|
6678
|
+
get: /**
|
|
6679
|
+
* 是否激活
|
|
6588
6680
|
*/ function get() {
|
|
6589
6681
|
return this._active;
|
|
6590
6682
|
},
|
|
@@ -7240,8 +7332,8 @@
|
|
|
7240
7332
|
return '';
|
|
7241
7333
|
}
|
|
7242
7334
|
|
|
7243
|
-
/**
|
|
7244
|
-
* Header
|
|
7335
|
+
/**
|
|
7336
|
+
* Header
|
|
7245
7337
|
*/ var Component = /*#__PURE__*/ function() {
|
|
7246
7338
|
function Component(options) {
|
|
7247
7339
|
if (options === void 0) options = {};
|
|
@@ -7293,8 +7385,8 @@
|
|
|
7293
7385
|
this.$popupContainer.appendChild(this.$container);
|
|
7294
7386
|
}
|
|
7295
7387
|
var _proto = Component.prototype;
|
|
7296
|
-
/**
|
|
7297
|
-
* 销毁 header
|
|
7388
|
+
/**
|
|
7389
|
+
* 销毁 header
|
|
7298
7390
|
*/ _proto.destroy = function destroy() {
|
|
7299
7391
|
var _this_$popupContainer;
|
|
7300
7392
|
(_this_$popupContainer = this.$popupContainer) == null ? void 0 : _this_$popupContainer.removeChild(this.$container);
|
|
@@ -7570,10 +7662,10 @@
|
|
|
7570
7662
|
};
|
|
7571
7663
|
return _set_prototype_of$q(o, p);
|
|
7572
7664
|
}
|
|
7573
|
-
/**
|
|
7574
|
-
* 全局全屏
|
|
7575
|
-
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
7576
|
-
* @category Control
|
|
7665
|
+
/**
|
|
7666
|
+
* 全局全屏
|
|
7667
|
+
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
7668
|
+
* @category Control
|
|
7577
7669
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
7578
7670
|
_inherits$m(GlobalFullscreen, Fullscreen);
|
|
7579
7671
|
function GlobalFullscreen(options) {
|
|
@@ -7591,8 +7683,8 @@
|
|
|
7591
7683
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_GLOBAL_FULLSCREEN
|
|
7592
7684
|
});
|
|
7593
7685
|
};
|
|
7594
|
-
/**
|
|
7595
|
-
* 点击 Control 会触发
|
|
7686
|
+
/**
|
|
7687
|
+
* 点击 Control 会触发
|
|
7596
7688
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
7597
7689
|
// 网页全屏的情况下 还可以执行全局全屏
|
|
7598
7690
|
if (this.isCurrentFullscreen && this._$rootContainer.classList.contains("" + PREFIX_CLASS$1 + "-global-fullscreen")) {
|
|
@@ -7638,9 +7730,9 @@
|
|
|
7638
7730
|
};
|
|
7639
7731
|
return _set_prototype_of$p(o, p);
|
|
7640
7732
|
}
|
|
7641
|
-
/**
|
|
7642
|
-
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
7643
|
-
* @category Control
|
|
7733
|
+
/**
|
|
7734
|
+
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
7735
|
+
* @category Control
|
|
7644
7736
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
7645
7737
|
_inherits$l(CapturePicture, Control);
|
|
7646
7738
|
function CapturePicture(options) {
|
|
@@ -7671,8 +7763,8 @@
|
|
|
7671
7763
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CAPTURE
|
|
7672
7764
|
});
|
|
7673
7765
|
};
|
|
7674
|
-
/**
|
|
7675
|
-
* 点击 Control 会触发
|
|
7766
|
+
/**
|
|
7767
|
+
* 点击 Control 会触发
|
|
7676
7768
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7677
7769
|
var _this = this;
|
|
7678
7770
|
var _this_options_type, _this_options_cloudRecUpload;
|
|
@@ -7748,9 +7840,9 @@
|
|
|
7748
7840
|
};
|
|
7749
7841
|
return _set_prototype_of$n(o, p);
|
|
7750
7842
|
}
|
|
7751
|
-
/**
|
|
7752
|
-
* 云台控件
|
|
7753
|
-
* @category Control
|
|
7843
|
+
/**
|
|
7844
|
+
* 云台控件
|
|
7845
|
+
* @category Control
|
|
7754
7846
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
7755
7847
|
_inherits$k(Ptz, Control);
|
|
7756
7848
|
function Ptz(options) {
|
|
@@ -7839,8 +7931,8 @@
|
|
|
7839
7931
|
}
|
|
7840
7932
|
};
|
|
7841
7933
|
};
|
|
7842
|
-
/**
|
|
7843
|
-
* 点击 Control 会触发
|
|
7934
|
+
/**
|
|
7935
|
+
* 点击 Control 会触发
|
|
7844
7936
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7845
7937
|
Control.prototype._onControlClick.call(this, e);
|
|
7846
7938
|
this.active = !this.active;
|
|
@@ -7885,6 +7977,14 @@
|
|
|
7885
7977
|
]);
|
|
7886
7978
|
return Ptz;
|
|
7887
7979
|
}(Control);
|
|
7980
|
+
/**
|
|
7981
|
+
* 云台是对设备的实时控制,回放场景下转动云台不影响已录制的画面。
|
|
7982
|
+
*
|
|
7983
|
+
* 依据是语义与 mobileRec 模板(不含云台)。`pcRec` 模板的配置里虽然还留着 `pantile`,
|
|
7984
|
+
* 但实测在回放地址下它不会被渲染出来,因此这里声明为 live-only 不会对内置模板误报。
|
|
7985
|
+
*/ Ptz.supportedPlayTypes = [
|
|
7986
|
+
'live'
|
|
7987
|
+
];
|
|
7888
7988
|
|
|
7889
7989
|
function formatTime(seconds, format) {
|
|
7890
7990
|
if (format === void 0) format = 'MM:SS';
|
|
@@ -7943,14 +8043,14 @@
|
|
|
7943
8043
|
var RECORD_DEFAULT_OPTIONS = {
|
|
7944
8044
|
maxDuration: 3600
|
|
7945
8045
|
};
|
|
7946
|
-
/**
|
|
7947
|
-
* 录制控件,点击开始录制,再次点击停止录制,
|
|
7948
|
-
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
7949
|
-
*
|
|
7950
|
-
* 注意:
|
|
7951
|
-
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
7952
|
-
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
7953
|
-
* @category Control
|
|
8046
|
+
/**
|
|
8047
|
+
* 录制控件,点击开始录制,再次点击停止录制,
|
|
8048
|
+
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
8049
|
+
*
|
|
8050
|
+
* 注意:
|
|
8051
|
+
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
8052
|
+
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
8053
|
+
* @category Control
|
|
7954
8054
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
7955
8055
|
_inherits$j(Record, Control);
|
|
7956
8056
|
function Record(options) {
|
|
@@ -7965,16 +8065,16 @@
|
|
|
7965
8065
|
return _this;
|
|
7966
8066
|
}
|
|
7967
8067
|
var _proto = Record.prototype;
|
|
7968
|
-
/**
|
|
7969
|
-
* 渲染图标
|
|
8068
|
+
/**
|
|
8069
|
+
* 渲染图标
|
|
7970
8070
|
*/ _proto._render = function _render() {
|
|
7971
8071
|
var _this_locale;
|
|
7972
8072
|
this.$container.innerHTML = IconComponents.record({
|
|
7973
8073
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_RECORDVIDEO
|
|
7974
8074
|
});
|
|
7975
8075
|
};
|
|
7976
|
-
/**
|
|
7977
|
-
* 渲染计时器
|
|
8076
|
+
/**
|
|
8077
|
+
* 渲染计时器
|
|
7978
8078
|
*/ _proto._renderTimer = function _renderTimer() {
|
|
7979
8079
|
var _this = this;
|
|
7980
8080
|
var _this__options_rootContainer, _this__options;
|
|
@@ -8003,8 +8103,8 @@
|
|
|
8003
8103
|
this._destroyTimer();
|
|
8004
8104
|
Control.prototype.destroy.call(this);
|
|
8005
8105
|
};
|
|
8006
|
-
/**
|
|
8007
|
-
* 销毁定时器和销毁节点
|
|
8106
|
+
/**
|
|
8107
|
+
* 销毁定时器和销毁节点
|
|
8008
8108
|
*/ _proto._destroyTimer = function _destroyTimer() {
|
|
8009
8109
|
this._seconds = 0;
|
|
8010
8110
|
if (this._timer) {
|
|
@@ -8019,8 +8119,8 @@
|
|
|
8019
8119
|
}
|
|
8020
8120
|
this._active = false;
|
|
8021
8121
|
};
|
|
8022
|
-
/**
|
|
8023
|
-
* 点击 Control 会触发
|
|
8122
|
+
/**
|
|
8123
|
+
* 点击 Control 会触发
|
|
8024
8124
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8025
8125
|
this.active = !this.active;
|
|
8026
8126
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -8028,8 +8128,8 @@
|
|
|
8028
8128
|
_create_class$c(Record, [
|
|
8029
8129
|
{
|
|
8030
8130
|
key: "active",
|
|
8031
|
-
get: /**
|
|
8032
|
-
* 是否激活
|
|
8131
|
+
get: /**
|
|
8132
|
+
* 是否激活
|
|
8033
8133
|
*/ function get() {
|
|
8034
8134
|
return this._active;
|
|
8035
8135
|
},
|
|
@@ -8222,14 +8322,14 @@
|
|
|
8222
8322
|
};
|
|
8223
8323
|
}
|
|
8224
8324
|
}
|
|
8225
|
-
/**
|
|
8226
|
-
* 对讲控件
|
|
8227
|
-
*
|
|
8228
|
-
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
8229
|
-
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
8230
|
-
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
8231
|
-
*
|
|
8232
|
-
* @category Control
|
|
8325
|
+
/**
|
|
8326
|
+
* 对讲控件
|
|
8327
|
+
*
|
|
8328
|
+
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
8329
|
+
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
8330
|
+
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
8331
|
+
*
|
|
8332
|
+
* @category Control
|
|
8233
8333
|
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
8234
8334
|
_inherits$i(Talk, Control);
|
|
8235
8335
|
function Talk(options) {
|
|
@@ -8272,16 +8372,16 @@
|
|
|
8272
8372
|
Control.prototype.reset.call(this, hide);
|
|
8273
8373
|
}
|
|
8274
8374
|
};
|
|
8275
|
-
/**
|
|
8276
|
-
* 销毁对讲
|
|
8375
|
+
/**
|
|
8376
|
+
* 销毁对讲
|
|
8277
8377
|
*/ _proto.destroy = function destroy() {
|
|
8278
8378
|
if (this.active) {
|
|
8279
8379
|
this.reset();
|
|
8280
8380
|
}
|
|
8281
8381
|
Control.prototype.destroy.call(this);
|
|
8282
8382
|
};
|
|
8283
|
-
/**
|
|
8284
|
-
* 点击 Control 会触发
|
|
8383
|
+
/**
|
|
8384
|
+
* 点击 Control 会触发
|
|
8285
8385
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8286
8386
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
8287
8387
|
return Control.prototype._onControlClick;
|
|
@@ -8301,13 +8401,13 @@
|
|
|
8301
8401
|
_create_class$b(Talk, [
|
|
8302
8402
|
{
|
|
8303
8403
|
key: "value",
|
|
8304
|
-
get: /**
|
|
8305
|
-
* 获取当前值
|
|
8404
|
+
get: /**
|
|
8405
|
+
* 获取当前值
|
|
8306
8406
|
*/ function get() {
|
|
8307
8407
|
return this._value;
|
|
8308
8408
|
},
|
|
8309
|
-
set: /**
|
|
8310
|
-
* 设置当前值 [0-1]
|
|
8409
|
+
set: /**
|
|
8410
|
+
* 设置当前值 [0-1]
|
|
8311
8411
|
*/ function set(value) {
|
|
8312
8412
|
// 没有激活状态,则不处理
|
|
8313
8413
|
if (!this.active) {
|
|
@@ -8337,6 +8437,9 @@
|
|
|
8337
8437
|
]);
|
|
8338
8438
|
return Talk;
|
|
8339
8439
|
}(Control);
|
|
8440
|
+
/** 对讲是实时上行通道,只有直播场景有意义 */ Talk.supportedPlayTypes = [
|
|
8441
|
+
'live'
|
|
8442
|
+
];
|
|
8340
8443
|
|
|
8341
8444
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8342
8445
|
try {
|
|
@@ -8493,12 +8596,12 @@
|
|
|
8493
8596
|
};
|
|
8494
8597
|
}
|
|
8495
8598
|
}
|
|
8496
|
-
/**
|
|
8497
|
-
* 语音广播控件
|
|
8498
|
-
*
|
|
8499
|
-
* 用于触发语音广播功能的按钮控件
|
|
8500
|
-
*
|
|
8501
|
-
* @category Control
|
|
8599
|
+
/**
|
|
8600
|
+
* 语音广播控件
|
|
8601
|
+
*
|
|
8602
|
+
* 用于触发语音广播功能的按钮控件
|
|
8603
|
+
*
|
|
8604
|
+
* @category Control
|
|
8502
8605
|
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
8503
8606
|
_inherits$h(Broadcast, Control);
|
|
8504
8607
|
function Broadcast(options) {
|
|
@@ -8538,16 +8641,16 @@
|
|
|
8538
8641
|
Control.prototype.reset.call(this, hide);
|
|
8539
8642
|
}
|
|
8540
8643
|
};
|
|
8541
|
-
/**
|
|
8542
|
-
* 销毁语音广播控件
|
|
8644
|
+
/**
|
|
8645
|
+
* 销毁语音广播控件
|
|
8543
8646
|
*/ _proto.destroy = function destroy() {
|
|
8544
8647
|
if (this.active) {
|
|
8545
8648
|
this.reset();
|
|
8546
8649
|
}
|
|
8547
8650
|
Control.prototype.destroy.call(this);
|
|
8548
8651
|
};
|
|
8549
|
-
/**
|
|
8550
|
-
* 点击 Control 会触发
|
|
8652
|
+
/**
|
|
8653
|
+
* 点击 Control 会触发
|
|
8551
8654
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8552
8655
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
8553
8656
|
return Control.prototype._onControlClick;
|
|
@@ -8568,6 +8671,9 @@
|
|
|
8568
8671
|
};
|
|
8569
8672
|
return Broadcast;
|
|
8570
8673
|
}(Control);
|
|
8674
|
+
/** 语音广播是实时上行通道,只有直播场景有意义(另需 `sdkType === 'base'`,见构造函数) */ Broadcast.supportedPlayTypes = [
|
|
8675
|
+
'live'
|
|
8676
|
+
];
|
|
8571
8677
|
|
|
8572
8678
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8573
8679
|
try {
|
|
@@ -8724,12 +8830,12 @@
|
|
|
8724
8830
|
};
|
|
8725
8831
|
}
|
|
8726
8832
|
}
|
|
8727
|
-
/**
|
|
8728
|
-
* AI对话框控件
|
|
8729
|
-
*
|
|
8730
|
-
* 用于触发AI对话框功能的按钮控件
|
|
8731
|
-
*
|
|
8732
|
-
* @category Control
|
|
8833
|
+
/**
|
|
8834
|
+
* AI对话框控件
|
|
8835
|
+
*
|
|
8836
|
+
* 用于触发AI对话框功能的按钮控件
|
|
8837
|
+
*
|
|
8838
|
+
* @category Control
|
|
8733
8839
|
*/ var AIChat = /*#__PURE__*/ function(Control) {
|
|
8734
8840
|
_inherits$g(AIChat, Control);
|
|
8735
8841
|
function AIChat(options) {
|
|
@@ -8770,16 +8876,16 @@
|
|
|
8770
8876
|
Control.prototype.reset.call(this, hide);
|
|
8771
8877
|
}
|
|
8772
8878
|
};
|
|
8773
|
-
/**
|
|
8774
|
-
* 销毁AI对话框控件
|
|
8879
|
+
/**
|
|
8880
|
+
* 销毁AI对话框控件
|
|
8775
8881
|
*/ _proto.destroy = function destroy() {
|
|
8776
8882
|
if (this.active) {
|
|
8777
8883
|
this.reset();
|
|
8778
8884
|
}
|
|
8779
8885
|
Control.prototype.destroy.call(this);
|
|
8780
8886
|
};
|
|
8781
|
-
/**
|
|
8782
|
-
* 点击 Control 会触发
|
|
8887
|
+
/**
|
|
8888
|
+
* 点击 Control 会触发
|
|
8783
8889
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8784
8890
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
8785
8891
|
return Control.prototype._onControlClick;
|
|
@@ -8800,6 +8906,14 @@
|
|
|
8800
8906
|
};
|
|
8801
8907
|
return AIChat;
|
|
8802
8908
|
}(Control);
|
|
8909
|
+
/**
|
|
8910
|
+
* 只在云存储回放下可用。
|
|
8911
|
+
*
|
|
8912
|
+
* 这是全部控件里证据最强的一条:构造函数里已显式要求 `recType === 'cloud'`
|
|
8913
|
+
* 且排除 `busType === '7'`(云录制),不满足时直接 `display: none`。
|
|
8914
|
+
*/ AIChat.supportedPlayTypes = [
|
|
8915
|
+
'cloudRec'
|
|
8916
|
+
];
|
|
8803
8917
|
|
|
8804
8918
|
function _extends$h() {
|
|
8805
8919
|
_extends$h = Object.assign || function assign(target) {
|
|
@@ -8831,12 +8945,12 @@
|
|
|
8831
8945
|
};
|
|
8832
8946
|
return _set_prototype_of$i(o, p);
|
|
8833
8947
|
}
|
|
8834
|
-
/**
|
|
8835
|
-
* 直播按钮控件
|
|
8836
|
-
*
|
|
8837
|
-
* 点击切换到直播模式
|
|
8838
|
-
*
|
|
8839
|
-
* @category Control
|
|
8948
|
+
/**
|
|
8949
|
+
* 直播按钮控件
|
|
8950
|
+
*
|
|
8951
|
+
* 点击切换到直播模式
|
|
8952
|
+
*
|
|
8953
|
+
* @category Control
|
|
8840
8954
|
*/ var Live = /*#__PURE__*/ function(Control) {
|
|
8841
8955
|
_inherits$f(Live, Control);
|
|
8842
8956
|
function Live(options) {
|
|
@@ -8858,9 +8972,9 @@
|
|
|
8858
8972
|
return _this;
|
|
8859
8973
|
}
|
|
8860
8974
|
var _proto = Live.prototype;
|
|
8861
|
-
/**
|
|
8862
|
-
* 根据 urlInfo 同步激活状态
|
|
8863
|
-
* 在初始化和播放地址切换后调用
|
|
8975
|
+
/**
|
|
8976
|
+
* 根据 urlInfo 同步激活状态
|
|
8977
|
+
* 在初始化和播放地址切换后调用
|
|
8864
8978
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
8865
8979
|
var shouldBeActive = !!(urlInfo && urlInfo.type === 'live');
|
|
8866
8980
|
this.active = shouldBeActive;
|
|
@@ -8871,13 +8985,13 @@
|
|
|
8871
8985
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_LIVE) || '直播'
|
|
8872
8986
|
});
|
|
8873
8987
|
};
|
|
8874
|
-
/**
|
|
8875
|
-
* 销毁
|
|
8988
|
+
/**
|
|
8989
|
+
* 销毁
|
|
8876
8990
|
*/ _proto.destroy = function destroy() {
|
|
8877
8991
|
Control.prototype.destroy.call(this);
|
|
8878
8992
|
};
|
|
8879
|
-
/**
|
|
8880
|
-
* 点击 Control 会触发
|
|
8993
|
+
/**
|
|
8994
|
+
* 点击 Control 会触发
|
|
8881
8995
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8882
8996
|
var _this__options_onChange, _this__options;
|
|
8883
8997
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -8922,12 +9036,12 @@
|
|
|
8922
9036
|
};
|
|
8923
9037
|
return _set_prototype_of$h(o, p);
|
|
8924
9038
|
}
|
|
8925
|
-
/**
|
|
8926
|
-
* 回放下拉控件
|
|
8927
|
-
*
|
|
8928
|
-
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
8929
|
-
*
|
|
8930
|
-
* @category Control
|
|
9039
|
+
/**
|
|
9040
|
+
* 回放下拉控件
|
|
9041
|
+
*
|
|
9042
|
+
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
9043
|
+
*
|
|
9044
|
+
* @category Control
|
|
8931
9045
|
*/ var RecDropdown = /*#__PURE__*/ function(Control) {
|
|
8932
9046
|
_inherits$e(RecDropdown, Control);
|
|
8933
9047
|
function RecDropdown(options) {
|
|
@@ -8944,16 +9058,16 @@
|
|
|
8944
9058
|
_this.$container.style.display = 'none';
|
|
8945
9059
|
}
|
|
8946
9060
|
// 初始化时根据 urlInfo 确定当前回放类型和激活状态
|
|
8947
|
-
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || '
|
|
9061
|
+
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || '';
|
|
8948
9062
|
_this._syncActiveByUrlInfo((_this___options_props1 = _this.__options.props) == null ? void 0 : _this___options_props1.urlInfo);
|
|
8949
9063
|
_this._render();
|
|
8950
9064
|
_this._initPicker();
|
|
8951
9065
|
return _this;
|
|
8952
9066
|
}
|
|
8953
9067
|
var _proto = RecDropdown.prototype;
|
|
8954
|
-
/**
|
|
8955
|
-
* 根据 urlInfo 同步激活状态和回放类型
|
|
8956
|
-
* 在初始化和播放地址切换后调用
|
|
9068
|
+
/**
|
|
9069
|
+
* 根据 urlInfo 同步激活状态和回放类型
|
|
9070
|
+
* 在初始化和播放地址切换后调用
|
|
8957
9071
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
8958
9072
|
if (urlInfo && urlInfo.type === 'rec') {
|
|
8959
9073
|
var _urlInfo_searchParams1;
|
|
@@ -9030,8 +9144,8 @@
|
|
|
9030
9144
|
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS$1 + "-active");
|
|
9031
9145
|
}
|
|
9032
9146
|
};
|
|
9033
|
-
/**
|
|
9034
|
-
* 销毁
|
|
9147
|
+
/**
|
|
9148
|
+
* 销毁
|
|
9035
9149
|
*/ _proto.destroy = function destroy() {
|
|
9036
9150
|
var _this__delegation_destroy, _this__delegation;
|
|
9037
9151
|
(_this__delegation = this._delegation) == null ? void 0 : (_this__delegation_destroy = _this__delegation.destroy) == null ? void 0 : _this__delegation_destroy.call(_this__delegation);
|
|
@@ -9043,8 +9157,8 @@
|
|
|
9043
9157
|
}
|
|
9044
9158
|
Control.prototype.destroy.call(this);
|
|
9045
9159
|
};
|
|
9046
|
-
/**
|
|
9047
|
-
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
9160
|
+
/**
|
|
9161
|
+
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
9048
9162
|
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9049
9163
|
_proto._onControlClick = function _onControlClick(_e) {
|
|
9050
9164
|
// picker 自行处理 click/hover,这里不额外处理
|
|
@@ -9197,7 +9311,6 @@
|
|
|
9197
9311
|
if (this._panelOpen) {
|
|
9198
9312
|
this.emit(EVENTS$2.control.recListChange, false);
|
|
9199
9313
|
}
|
|
9200
|
-
this.emit(EVENTS$2.control.recListDestroy);
|
|
9201
9314
|
if (this._modal) {
|
|
9202
9315
|
this._modal.destroy();
|
|
9203
9316
|
this._modal = null;
|
|
@@ -9229,6 +9342,16 @@
|
|
|
9229
9342
|
};
|
|
9230
9343
|
return RecList;
|
|
9231
9344
|
}(Control);
|
|
9345
|
+
/**
|
|
9346
|
+
* 录像片段列表,只对回放有意义。
|
|
9347
|
+
*
|
|
9348
|
+
* 依据是内置模板分布(仅 pcRec 含 `recList`)与语义。若后续确认本地卡回放
|
|
9349
|
+
* 没有片段列表接口,把 `'rec'` 去掉即可。
|
|
9350
|
+
*/ RecList.supportedPlayTypes = [
|
|
9351
|
+
'rec',
|
|
9352
|
+
'cloudRec',
|
|
9353
|
+
'cloudRecord'
|
|
9354
|
+
];
|
|
9232
9355
|
|
|
9233
9356
|
function _extends$d() {
|
|
9234
9357
|
_extends$d = Object.assign || function assign(target) {
|
|
@@ -9260,12 +9383,12 @@
|
|
|
9260
9383
|
};
|
|
9261
9384
|
return _set_prototype_of$e(o, p);
|
|
9262
9385
|
}
|
|
9263
|
-
/**
|
|
9264
|
-
* 告警消息按钮控件
|
|
9265
|
-
*
|
|
9266
|
-
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
9267
|
-
*
|
|
9268
|
-
* @category Control
|
|
9386
|
+
/**
|
|
9387
|
+
* 告警消息按钮控件
|
|
9388
|
+
*
|
|
9389
|
+
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
9390
|
+
*
|
|
9391
|
+
* @category Control
|
|
9269
9392
|
*/ var AlarmMessage = /*#__PURE__*/ function(Control) {
|
|
9270
9393
|
_inherits$c(AlarmMessage, Control);
|
|
9271
9394
|
function AlarmMessage(options) {
|
|
@@ -9289,16 +9412,16 @@
|
|
|
9289
9412
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_ALARM_MESSAGE) || '消息'
|
|
9290
9413
|
});
|
|
9291
9414
|
};
|
|
9292
|
-
/**
|
|
9293
|
-
* 销毁
|
|
9415
|
+
/**
|
|
9416
|
+
* 销毁
|
|
9294
9417
|
*/ _proto.destroy = function destroy() {
|
|
9295
9418
|
if (this._panelOpen) {
|
|
9296
9419
|
this.emit(EVENTS$2.control.alarmMessageChange, false);
|
|
9297
9420
|
}
|
|
9298
9421
|
Control.prototype.destroy.call(this);
|
|
9299
9422
|
};
|
|
9300
|
-
/**
|
|
9301
|
-
* 点击 Control 会触发
|
|
9423
|
+
/**
|
|
9424
|
+
* 点击 Control 会触发
|
|
9302
9425
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9303
9426
|
var _this__options_onChange, _this__options;
|
|
9304
9427
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -9363,54 +9486,54 @@
|
|
|
9363
9486
|
onChange: function onChange() {},
|
|
9364
9487
|
onOpenChange: function onOpenChange() {}
|
|
9365
9488
|
};
|
|
9366
|
-
/**
|
|
9367
|
-
* 选择器切换 (支持PC/Mobile)
|
|
9368
|
-
* @category Control
|
|
9369
|
-
* @example
|
|
9370
|
-
* ```ts
|
|
9371
|
-
* new Select({
|
|
9372
|
-
* title: '清晰度',
|
|
9373
|
-
* list: [
|
|
9374
|
-
* {
|
|
9375
|
-
* label: '高清',
|
|
9376
|
-
* value: 'hd',
|
|
9377
|
-
* streamTypeIn: 1,
|
|
9378
|
-
* },
|
|
9379
|
-
* {
|
|
9380
|
-
* label: '超清',
|
|
9381
|
-
* value: 'super',
|
|
9382
|
-
* streamTypeIn: 2,
|
|
9383
|
-
* }
|
|
9384
|
-
* ],
|
|
9385
|
-
* value: 'hd',
|
|
9386
|
-
* onChange: (value, item) => {
|
|
9387
|
-
* console.log('选择了', value, item);
|
|
9388
|
-
* }
|
|
9389
|
-
* })
|
|
9390
|
-
*
|
|
9391
|
-
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
9392
|
-
* // 例如清晰度切换组件
|
|
9393
|
-
* class Definition extends Select {
|
|
9394
|
-
* options: DefinitionOptions;
|
|
9395
|
-
* constructor(options: DefinitionOptions) {
|
|
9396
|
-
* super({
|
|
9397
|
-
* ...options,
|
|
9398
|
-
* fieldNames: { label: 'name', value: 'level',},
|
|
9399
|
-
* title: options?.locale?.definition,
|
|
9400
|
-
* controlType: 'button',
|
|
9401
|
-
* classNameSuffix: 'definition',
|
|
9402
|
-
* onChange: (value: SelectItem['value'], item) => {
|
|
9403
|
-
* options?.onChange?.(value, item);
|
|
9404
|
-
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
9405
|
-
* },
|
|
9406
|
-
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
9407
|
-
* options?.onOpenChange?.(open, value, item);
|
|
9408
|
-
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
9409
|
-
* }
|
|
9410
|
-
* });
|
|
9411
|
-
* }
|
|
9412
|
-
* }
|
|
9413
|
-
* ```
|
|
9489
|
+
/**
|
|
9490
|
+
* 选择器切换 (支持PC/Mobile)
|
|
9491
|
+
* @category Control
|
|
9492
|
+
* @example
|
|
9493
|
+
* ```ts
|
|
9494
|
+
* new Select({
|
|
9495
|
+
* title: '清晰度',
|
|
9496
|
+
* list: [
|
|
9497
|
+
* {
|
|
9498
|
+
* label: '高清',
|
|
9499
|
+
* value: 'hd',
|
|
9500
|
+
* streamTypeIn: 1,
|
|
9501
|
+
* },
|
|
9502
|
+
* {
|
|
9503
|
+
* label: '超清',
|
|
9504
|
+
* value: 'super',
|
|
9505
|
+
* streamTypeIn: 2,
|
|
9506
|
+
* }
|
|
9507
|
+
* ],
|
|
9508
|
+
* value: 'hd',
|
|
9509
|
+
* onChange: (value, item) => {
|
|
9510
|
+
* console.log('选择了', value, item);
|
|
9511
|
+
* }
|
|
9512
|
+
* })
|
|
9513
|
+
*
|
|
9514
|
+
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
9515
|
+
* // 例如清晰度切换组件
|
|
9516
|
+
* class Definition extends Select {
|
|
9517
|
+
* options: DefinitionOptions;
|
|
9518
|
+
* constructor(options: DefinitionOptions) {
|
|
9519
|
+
* super({
|
|
9520
|
+
* ...options,
|
|
9521
|
+
* fieldNames: { label: 'name', value: 'level',},
|
|
9522
|
+
* title: options?.locale?.definition,
|
|
9523
|
+
* controlType: 'button',
|
|
9524
|
+
* classNameSuffix: 'definition',
|
|
9525
|
+
* onChange: (value: SelectItem['value'], item) => {
|
|
9526
|
+
* options?.onChange?.(value, item);
|
|
9527
|
+
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
9528
|
+
* },
|
|
9529
|
+
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
9530
|
+
* options?.onOpenChange?.(open, value, item);
|
|
9531
|
+
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
9532
|
+
* }
|
|
9533
|
+
* });
|
|
9534
|
+
* }
|
|
9535
|
+
* }
|
|
9536
|
+
* ```
|
|
9414
9537
|
*/ var Select = /*#__PURE__*/ function(Control) {
|
|
9415
9538
|
_inherits$b(Select, Control);
|
|
9416
9539
|
function Select(options) {
|
|
@@ -9462,9 +9585,9 @@
|
|
|
9462
9585
|
return _this;
|
|
9463
9586
|
}
|
|
9464
9587
|
var _proto = Select.prototype;
|
|
9465
|
-
/**
|
|
9466
|
-
* 更新选项列表
|
|
9467
|
-
* @param list - 选项列表
|
|
9588
|
+
/**
|
|
9589
|
+
* 更新选项列表
|
|
9590
|
+
* @param list - 选项列表
|
|
9468
9591
|
*/ _proto.updateOptions = function updateOptions(list) {
|
|
9469
9592
|
var _this = this;
|
|
9470
9593
|
if (list === void 0) list = [];
|
|
@@ -9549,8 +9672,8 @@
|
|
|
9549
9672
|
});
|
|
9550
9673
|
}
|
|
9551
9674
|
};
|
|
9552
|
-
/**
|
|
9553
|
-
* 销毁
|
|
9675
|
+
/**
|
|
9676
|
+
* 销毁
|
|
9554
9677
|
*/ _proto.destroy = function destroy() {
|
|
9555
9678
|
var _this__delegationOption_destroy, _this__delegationOption, _this__delegationClose_destroy, _this__delegationClose, _this__delegationCancel_destroy, _this__delegationCancel;
|
|
9556
9679
|
(_this__delegationOption = this._delegationOption) == null ? void 0 : (_this__delegationOption_destroy = _this__delegationOption.destroy) == null ? void 0 : _this__delegationOption_destroy.call(_this__delegationOption);
|
|
@@ -9572,8 +9695,8 @@
|
|
|
9572
9695
|
e.stopPropagation();
|
|
9573
9696
|
e.preventDefault();
|
|
9574
9697
|
};
|
|
9575
|
-
/**
|
|
9576
|
-
* 点击 Control 会触发
|
|
9698
|
+
/**
|
|
9699
|
+
* 点击 Control 会触发
|
|
9577
9700
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9578
9701
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
9579
9702
|
};
|
|
@@ -9592,8 +9715,8 @@
|
|
|
9592
9715
|
},
|
|
9593
9716
|
{
|
|
9594
9717
|
key: "disabled",
|
|
9595
|
-
get: /**
|
|
9596
|
-
* 是否禁用
|
|
9718
|
+
get: /**
|
|
9719
|
+
* 是否禁用
|
|
9597
9720
|
*/ function get() {
|
|
9598
9721
|
return this._disabled;
|
|
9599
9722
|
},
|
|
@@ -9679,15 +9802,15 @@
|
|
|
9679
9802
|
};
|
|
9680
9803
|
});
|
|
9681
9804
|
}
|
|
9682
|
-
/**
|
|
9683
|
-
* 清晰度切换控件
|
|
9684
|
-
*
|
|
9685
|
-
* 清晰度切换控件有三套UI
|
|
9686
|
-
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
9687
|
-
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
9688
|
-
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
9689
|
-
*
|
|
9690
|
-
* @category Control
|
|
9805
|
+
/**
|
|
9806
|
+
* 清晰度切换控件
|
|
9807
|
+
*
|
|
9808
|
+
* 清晰度切换控件有三套UI
|
|
9809
|
+
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
9810
|
+
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
9811
|
+
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
9812
|
+
*
|
|
9813
|
+
* @category Control
|
|
9691
9814
|
*/ var Definition = /*#__PURE__*/ function(Select) {
|
|
9692
9815
|
_inherits$a(Definition, Select);
|
|
9693
9816
|
function Definition(options) {
|
|
@@ -9753,14 +9876,22 @@
|
|
|
9753
9876
|
return _this;
|
|
9754
9877
|
}
|
|
9755
9878
|
var _proto = Definition.prototype;
|
|
9756
|
-
/**
|
|
9757
|
-
* 重置,恢复默认值
|
|
9758
|
-
* @param hide 默认不隐藏
|
|
9879
|
+
/**
|
|
9880
|
+
* 重置,恢复默认值
|
|
9881
|
+
* @param hide 默认不隐藏
|
|
9759
9882
|
*/ _proto.reset = function reset(hide) {
|
|
9760
9883
|
Select.prototype.reset.call(this, hide);
|
|
9761
9884
|
};
|
|
9762
9885
|
return Definition;
|
|
9763
9886
|
}(Select);
|
|
9887
|
+
/**
|
|
9888
|
+
* 清晰度切换只在直播下有意义:回放播的是已落盘的码流,清晰度由录制时决定。
|
|
9889
|
+
*
|
|
9890
|
+
* 依据是内置模板分布(`hd` 只出现在 pcLive / mobileLive / security),控件本身无硬约束。
|
|
9891
|
+
* 若后续确认本地卡回放支持主/子码流切换,把 `'rec'` 加进来即可。
|
|
9892
|
+
*/ Definition.supportedPlayTypes = [
|
|
9893
|
+
'live'
|
|
9894
|
+
];
|
|
9764
9895
|
|
|
9765
9896
|
function _assert_this_initialized(self) {
|
|
9766
9897
|
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -9806,13 +9937,13 @@
|
|
|
9806
9937
|
16
|
|
9807
9938
|
]; // 8, 16
|
|
9808
9939
|
var SPEED_DEFAULT_OPTIONS = {
|
|
9809
|
-
/**
|
|
9810
|
-
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
9811
|
-
* 暂时不支持初始化时设置倍速
|
|
9940
|
+
/**
|
|
9941
|
+
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
9942
|
+
* 暂时不支持初始化时设置倍速
|
|
9812
9943
|
*/ // value: 1, // 对应list 中的 value
|
|
9813
9944
|
// 这里不要设置多语言, 比较麻烦
|
|
9814
|
-
/**
|
|
9815
|
-
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
9945
|
+
/**
|
|
9946
|
+
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
9816
9947
|
*/ list: SUPPORT_SPEED.reverse().map(function(speed) {
|
|
9817
9948
|
return {
|
|
9818
9949
|
label: "" + speed + "x",
|
|
@@ -9820,13 +9951,13 @@
|
|
|
9820
9951
|
};
|
|
9821
9952
|
})
|
|
9822
9953
|
};
|
|
9823
|
-
/**
|
|
9824
|
-
* 倍速切换控件, 不支持动态切换倍速列表
|
|
9825
|
-
*
|
|
9826
|
-
* 注意:
|
|
9827
|
-
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
9828
|
-
* 2. 标准流不支持;
|
|
9829
|
-
* @category Control
|
|
9954
|
+
/**
|
|
9955
|
+
* 倍速切换控件, 不支持动态切换倍速列表
|
|
9956
|
+
*
|
|
9957
|
+
* 注意:
|
|
9958
|
+
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
9959
|
+
* 2. 标准流不支持;
|
|
9960
|
+
* @category Control
|
|
9830
9961
|
*/ var Speed = /*#__PURE__*/ function(Select) {
|
|
9831
9962
|
_inherits$9(Speed, Select);
|
|
9832
9963
|
function Speed(options) {
|
|
@@ -9860,10 +9991,10 @@
|
|
|
9860
9991
|
return _this;
|
|
9861
9992
|
}
|
|
9862
9993
|
var _proto = Speed.prototype;
|
|
9863
|
-
/**
|
|
9864
|
-
* 滤掉本地回放不支持的倍速
|
|
9865
|
-
* @param optionsList 初始化配置倍速列表
|
|
9866
|
-
* @param type 回放类型
|
|
9994
|
+
/**
|
|
9995
|
+
* 滤掉本地回放不支持的倍速
|
|
9996
|
+
* @param optionsList 初始化配置倍速列表
|
|
9997
|
+
* @param type 回放类型
|
|
9867
9998
|
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
|
|
9868
9999
|
if (!optionsList) {
|
|
9869
10000
|
// 非用户自定义 /openpb/ 是标准流回放路径
|
|
@@ -9891,6 +10022,16 @@
|
|
|
9891
10022
|
};
|
|
9892
10023
|
return Speed;
|
|
9893
10024
|
}(Select);
|
|
10025
|
+
/**
|
|
10026
|
+
* 倍速只对回放有意义;直播是实时流,没有倍速语义。
|
|
10027
|
+
*
|
|
10028
|
+
* 三类回放都支持,但档位上限不同(见 `_filterSpeedList`):
|
|
10029
|
+
* 本地卡回放与标准流 ≤ 4x,云存储 / 云录制 ≤ 16x。
|
|
10030
|
+
*/ Speed.supportedPlayTypes = [
|
|
10031
|
+
'rec',
|
|
10032
|
+
'cloudRec',
|
|
10033
|
+
'cloudRecord'
|
|
10034
|
+
];
|
|
9894
10035
|
|
|
9895
10036
|
/*
|
|
9896
10037
|
* @ezuikit/control-date-picker v2.1.2-beta.1
|
|
@@ -10105,6 +10246,11 @@
|
|
|
10105
10246
|
};
|
|
10106
10247
|
return DatePickerControl;
|
|
10107
10248
|
}(Control);
|
|
10249
|
+
/** 选日期是为了定位录像,只对回放有意义(初值取自 `urlInfo.searchParams.begin`) */ DatePickerControl.supportedPlayTypes = [
|
|
10250
|
+
'rec',
|
|
10251
|
+
'cloudRec',
|
|
10252
|
+
'cloudRecord'
|
|
10253
|
+
];
|
|
10108
10254
|
|
|
10109
10255
|
function _extends$7() {
|
|
10110
10256
|
_extends$7 = Object.assign || function assign(target) {
|
|
@@ -10137,9 +10283,9 @@
|
|
|
10137
10283
|
return _set_prototype_of$8(o, p);
|
|
10138
10284
|
}
|
|
10139
10285
|
/** 时间格式 HH:mm:ss */ var TIME_FORMAT = 'HH:mm:ss';
|
|
10140
|
-
/**
|
|
10141
|
-
* 时间选择器控件
|
|
10142
|
-
* @category Control
|
|
10286
|
+
/**
|
|
10287
|
+
* 时间选择器控件
|
|
10288
|
+
* @category Control
|
|
10143
10289
|
*/ var TimePickerControl = /*#__PURE__*/ function(Control) {
|
|
10144
10290
|
_inherits$7(TimePickerControl, Control);
|
|
10145
10291
|
function TimePickerControl(options) {
|
|
@@ -10200,9 +10346,9 @@
|
|
|
10200
10346
|
}
|
|
10201
10347
|
}));
|
|
10202
10348
|
};
|
|
10203
|
-
/**
|
|
10204
|
-
* 设置时间
|
|
10205
|
-
* @param time 设置的时间 HH:mm:ss
|
|
10349
|
+
/**
|
|
10350
|
+
* 设置时间
|
|
10351
|
+
* @param time 设置的时间 HH:mm:ss
|
|
10206
10352
|
*/ _proto.setTime = function setTime(time) {
|
|
10207
10353
|
var _this_timePicker;
|
|
10208
10354
|
(_this_timePicker = this.timePicker) == null ? void 0 : _this_timePicker.setCurrent(time);
|
|
@@ -10218,9 +10364,9 @@
|
|
|
10218
10364
|
if (this.timePicker) this.timePicker.open = false;
|
|
10219
10365
|
Control.prototype.reset.call(this);
|
|
10220
10366
|
};
|
|
10221
|
-
/**
|
|
10222
|
-
* 销毁控件
|
|
10223
|
-
* @override
|
|
10367
|
+
/**
|
|
10368
|
+
* 销毁控件
|
|
10369
|
+
* @override
|
|
10224
10370
|
*/ _proto.destroy = function destroy() {
|
|
10225
10371
|
if (this.timePicker) {
|
|
10226
10372
|
this.timePicker.destroy();
|
|
@@ -10232,14 +10378,19 @@
|
|
|
10232
10378
|
_proto._getTimeStr = function _getTimeStr() {
|
|
10233
10379
|
return this._value;
|
|
10234
10380
|
};
|
|
10235
|
-
/**
|
|
10236
|
-
* 点击 Control 会触发
|
|
10237
|
-
* @overload super._onControlClick(e: Event)
|
|
10381
|
+
/**
|
|
10382
|
+
* 点击 Control 会触发
|
|
10383
|
+
* @overload super._onControlClick(e: Event)
|
|
10238
10384
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
10239
10385
|
Control.prototype._onControlClick.call(this, e);
|
|
10240
10386
|
};
|
|
10241
10387
|
return TimePickerControl;
|
|
10242
10388
|
}(Control);
|
|
10389
|
+
/** 选时间是为了定位录像,只对回放有意义(初值取自 `urlInfo.searchParams.begin`) */ TimePickerControl.supportedPlayTypes = [
|
|
10390
|
+
'rec',
|
|
10391
|
+
'cloudRec',
|
|
10392
|
+
'cloudRecord'
|
|
10393
|
+
];
|
|
10243
10394
|
|
|
10244
10395
|
/**
|
|
10245
10396
|
* drag scroll support move and touch
|
|
@@ -10735,8 +10886,8 @@
|
|
|
10735
10886
|
};
|
|
10736
10887
|
return _set_prototype_of$6(o, p);
|
|
10737
10888
|
}
|
|
10738
|
-
/**
|
|
10739
|
-
* 回放时间轴控件
|
|
10889
|
+
/**
|
|
10890
|
+
* 回放时间轴控件
|
|
10740
10891
|
*/ var TimeLineControl = /*#__PURE__*/ function(Control) {
|
|
10741
10892
|
_inherits$6(TimeLineControl, Control);
|
|
10742
10893
|
function TimeLineControl(options) {
|
|
@@ -10896,13 +11047,18 @@
|
|
|
10896
11047
|
}
|
|
10897
11048
|
Control.prototype.destroy.call(this);
|
|
10898
11049
|
};
|
|
10899
|
-
/**
|
|
10900
|
-
* 点击 Control 会触发
|
|
11050
|
+
/**
|
|
11051
|
+
* 点击 Control 会触发
|
|
10901
11052
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
10902
11053
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
10903
11054
|
};
|
|
10904
11055
|
return TimeLineControl;
|
|
10905
11056
|
}(Control);
|
|
11057
|
+
/** 时间轴展示的是录像片段,只对回放有意义(渲染层的 `_needTimeLine` 也要求 `urlInfo.type === 'rec'`) */ TimeLineControl.supportedPlayTypes = [
|
|
11058
|
+
'rec',
|
|
11059
|
+
'cloudRec',
|
|
11060
|
+
'cloudRecord'
|
|
11061
|
+
];
|
|
10906
11062
|
|
|
10907
11063
|
/*
|
|
10908
11064
|
* @ezuikit/control-segment-progress v0.0.1
|
|
@@ -10940,24 +11096,24 @@
|
|
|
10940
11096
|
};
|
|
10941
11097
|
return _set_prototype_of$5(o, p);
|
|
10942
11098
|
}
|
|
10943
|
-
/**
|
|
10944
|
-
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
10945
|
-
*
|
|
10946
|
-
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
10947
|
-
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
10948
|
-
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
10949
|
-
*
|
|
10950
|
-
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
10951
|
-
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
11099
|
+
/**
|
|
11100
|
+
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
11101
|
+
*
|
|
11102
|
+
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
11103
|
+
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
11104
|
+
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
11105
|
+
*
|
|
11106
|
+
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
11107
|
+
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
10952
11108
|
*/ var PLAYBACK_END_SILENCE_MS = 3000;
|
|
10953
|
-
/**
|
|
10954
|
-
* 读取录像片段的起止时间(毫秒)
|
|
10955
|
-
*
|
|
10956
|
-
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
10957
|
-
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
10958
|
-
*
|
|
10959
|
-
* @param seg 录像片段
|
|
10960
|
-
* @param which 取起点还是终点
|
|
11109
|
+
/**
|
|
11110
|
+
* 读取录像片段的起止时间(毫秒)
|
|
11111
|
+
*
|
|
11112
|
+
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
11113
|
+
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
11114
|
+
*
|
|
11115
|
+
* @param seg 录像片段
|
|
11116
|
+
* @param which 取起点还是终点
|
|
10961
11117
|
*/ function segMs(seg, which) {
|
|
10962
11118
|
var _ref, _ref1;
|
|
10963
11119
|
var value = which === 'start' ? (_ref = seg == null ? void 0 : seg.startTime) != null ? _ref : seg == null ? void 0 : seg.begin : (_ref1 = seg == null ? void 0 : seg.endTime) != null ? _ref1 : seg == null ? void 0 : seg.end;
|
|
@@ -10965,12 +11121,12 @@
|
|
|
10965
11121
|
if (typeof value === 'number') return value < 1e12 ? value * 1000 : value;
|
|
10966
11122
|
return distExports$3.DateTime.toDate(value).getTime();
|
|
10967
11123
|
}
|
|
10968
|
-
/**
|
|
10969
|
-
* 回放片段进度条控件(移动端)
|
|
10970
|
-
*
|
|
10971
|
-
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
10972
|
-
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
10973
|
-
* @category Control
|
|
11124
|
+
/**
|
|
11125
|
+
* 回放片段进度条控件(移动端)
|
|
11126
|
+
*
|
|
11127
|
+
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
11128
|
+
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
11129
|
+
* @category Control
|
|
10974
11130
|
*/ var SegmentProgressControl = /*#__PURE__*/ function(Control) {
|
|
10975
11131
|
_inherits$5(SegmentProgressControl, Control);
|
|
10976
11132
|
function SegmentProgressControl(options) {
|
|
@@ -11037,9 +11193,9 @@
|
|
|
11037
11193
|
});
|
|
11038
11194
|
this._updateVisible();
|
|
11039
11195
|
};
|
|
11040
|
-
/**
|
|
11041
|
-
* 设置播放区间
|
|
11042
|
-
* @param range 区间;null 表示解除约束
|
|
11196
|
+
/**
|
|
11197
|
+
* 设置播放区间
|
|
11198
|
+
* @param range 区间;null 表示解除约束
|
|
11043
11199
|
*/ _proto._setRange = function _setRange(range) {
|
|
11044
11200
|
if ((range == null ? void 0 : range.begin) && (range == null ? void 0 : range.end)) {
|
|
11045
11201
|
this._rangeBeginMs = distExports$3.DateTime.toDate(range.begin).getTime();
|
|
@@ -11050,9 +11206,9 @@
|
|
|
11050
11206
|
}
|
|
11051
11207
|
this._updateVisible();
|
|
11052
11208
|
};
|
|
11053
|
-
/**
|
|
11054
|
-
* 用区间裁剪录像片段
|
|
11055
|
-
* @param records 全天录像片段
|
|
11209
|
+
/**
|
|
11210
|
+
* 用区间裁剪录像片段
|
|
11211
|
+
* @param records 全天录像片段
|
|
11056
11212
|
*/ _proto._setSegments = function _setSegments(records) {
|
|
11057
11213
|
var _this = this;
|
|
11058
11214
|
if (!this._hasRange() || !Array.isArray(records)) {
|
|
@@ -11080,9 +11236,9 @@
|
|
|
11080
11236
|
if (force) this._currentIndex = -1;
|
|
11081
11237
|
this._updateVisible();
|
|
11082
11238
|
};
|
|
11083
|
-
/**
|
|
11084
|
-
* 按播放进度更新片段与进度
|
|
11085
|
-
* @param currentMs 当前播放时间(毫秒)
|
|
11239
|
+
/**
|
|
11240
|
+
* 按播放进度更新片段与进度
|
|
11241
|
+
* @param currentMs 当前播放时间(毫秒)
|
|
11086
11242
|
*/ _proto._syncCurrent = function _syncCurrent(currentMs) {
|
|
11087
11243
|
if (!this._hasRange()) return;
|
|
11088
11244
|
var index = this._segments.findIndex(function(seg) {
|
|
@@ -11122,6 +11278,11 @@
|
|
|
11122
11278
|
};
|
|
11123
11279
|
return SegmentProgressControl;
|
|
11124
11280
|
}(Control);
|
|
11281
|
+
/** 片段进度条拖动的是录像片段内的位置,只对回放有意义(另需移动端 + 已设置播放区间) */ SegmentProgressControl.supportedPlayTypes = [
|
|
11282
|
+
'rec',
|
|
11283
|
+
'cloudRec',
|
|
11284
|
+
'cloudRecord'
|
|
11285
|
+
];
|
|
11125
11286
|
|
|
11126
11287
|
function _extends$3() {
|
|
11127
11288
|
_extends$3 = Object.assign || function assign(target) {
|
|
@@ -11153,9 +11314,9 @@
|
|
|
11153
11314
|
};
|
|
11154
11315
|
return _set_prototype_of$4(o, p);
|
|
11155
11316
|
}
|
|
11156
|
-
/**
|
|
11157
|
-
* 展示设备序列号控件
|
|
11158
|
-
* @category Control
|
|
11317
|
+
/**
|
|
11318
|
+
* 展示设备序列号控件
|
|
11319
|
+
* @category Control
|
|
11159
11320
|
*/ var Device = /*#__PURE__*/ function(Control) {
|
|
11160
11321
|
_inherits$4(Device, Control);
|
|
11161
11322
|
function Device(options) {
|
|
@@ -11173,10 +11334,10 @@
|
|
|
11173
11334
|
var _this___options_props_urlInfo, _this___options_props;
|
|
11174
11335
|
this.$container.innerHTML = '<span class="' + PREFIX_CLASS$1 + "-text " + PREFIX_CLASS$1 + '-text-device">' + this._splicingString(this.__options.deviceName, (_this___options_props = this.__options.props) == null ? void 0 : (_this___options_props_urlInfo = _this___options_props.urlInfo) == null ? void 0 : _this___options_props_urlInfo.deviceSerial) + "</span>";
|
|
11175
11336
|
};
|
|
11176
|
-
/**
|
|
11177
|
-
* 更新设备序列号
|
|
11178
|
-
* @param deviceSerial - 设备序列号
|
|
11179
|
-
* @param deviceName - 设备名称
|
|
11337
|
+
/**
|
|
11338
|
+
* 更新设备序列号
|
|
11339
|
+
* @param deviceSerial - 设备序列号
|
|
11340
|
+
* @param deviceName - 设备名称
|
|
11180
11341
|
*/ _proto.update = function update(deviceName, deviceSerial) {
|
|
11181
11342
|
if (this.$container.querySelector("." + PREFIX_CLASS$1 + "-text-device")) {
|
|
11182
11343
|
var $span = this.$container.querySelector("." + PREFIX_CLASS$1 + "-text-device");
|
|
@@ -11334,8 +11495,8 @@
|
|
|
11334
11495
|
// const MobileExtend_DEFAULT_Options = {
|
|
11335
11496
|
// controls: MOBILE_EXTENDS,
|
|
11336
11497
|
// };
|
|
11337
|
-
/**
|
|
11338
|
-
* 移动端扩展
|
|
11498
|
+
/**
|
|
11499
|
+
* 移动端扩展
|
|
11339
11500
|
*/ var MobileExtend = /*#__PURE__*/ function(EventEmitter) {
|
|
11340
11501
|
_inherits$2(MobileExtend, EventEmitter);
|
|
11341
11502
|
function MobileExtend($siblingContainer) {
|
|
@@ -11412,9 +11573,9 @@
|
|
|
11412
11573
|
return _set_prototype_of$1(o, p);
|
|
11413
11574
|
}
|
|
11414
11575
|
var PAUSE_DEFAULT_OPTIONS = {};
|
|
11415
|
-
/**
|
|
11416
|
-
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
11417
|
-
* @category Control
|
|
11576
|
+
/**
|
|
11577
|
+
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
11578
|
+
* @category Control
|
|
11418
11579
|
*/ var Pause = /*#__PURE__*/ function(Control) {
|
|
11419
11580
|
_inherits$1(Pause, Control);
|
|
11420
11581
|
function Pause(options) {
|
|
@@ -11430,8 +11591,8 @@
|
|
|
11430
11591
|
return _this;
|
|
11431
11592
|
}
|
|
11432
11593
|
var _proto = Pause.prototype;
|
|
11433
|
-
/**
|
|
11434
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
11594
|
+
/**
|
|
11595
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
11435
11596
|
*/ _proto.show = function show(playing, always) {
|
|
11436
11597
|
var _this = this;
|
|
11437
11598
|
var _this_$container_classList, _this_$container;
|
|
@@ -11476,8 +11637,8 @@
|
|
|
11476
11637
|
}, 300);
|
|
11477
11638
|
}, 10);
|
|
11478
11639
|
};
|
|
11479
|
-
/**
|
|
11480
|
-
* 销毁
|
|
11640
|
+
/**
|
|
11641
|
+
* 销毁
|
|
11481
11642
|
*/ _proto.destroy = function destroy() {
|
|
11482
11643
|
if (this._timer) {
|
|
11483
11644
|
clearTimeout(this._timer);
|
|
@@ -11765,10 +11926,30 @@
|
|
|
11765
11926
|
'recDropdown',
|
|
11766
11927
|
'alarmMessage'
|
|
11767
11928
|
];
|
|
11768
|
-
/**
|
|
11769
|
-
*
|
|
11770
|
-
*
|
|
11771
|
-
*
|
|
11929
|
+
/**
|
|
11930
|
+
* 校验控件是否支持当前播放类型,不支持只提示、**不阻止渲染**
|
|
11931
|
+
*
|
|
11932
|
+
* 之所以只提示:控件能否真正工作还取决于设备能力与 SDK 层实现,主题层没有足够信息
|
|
11933
|
+
* 直接判死;而模板可能来自开放平台配置(`getThemeData` 远程拉取)或开发者自定义的
|
|
11934
|
+
* `themeData`,直接隐藏会让人无从排查。
|
|
11935
|
+
*
|
|
11936
|
+
* `theme.playType` 为空串(地址判不出类型,如 rtmp / webrtc / 地址未设置)时整体跳过校验。
|
|
11937
|
+
*
|
|
11938
|
+
* @param theme - Theme
|
|
11939
|
+
* @param iconId - 控件 iconId
|
|
11940
|
+
* @param ControlClass - 控件类,读其静态 `supportedPlayTypes`
|
|
11941
|
+
*/ function _checkPlayTypeSupport(theme, iconId, ControlClass) {
|
|
11942
|
+
var playType = theme.playType;
|
|
11943
|
+
if (!playType || ControlClass.supportsPlayType(playType)) return;
|
|
11944
|
+
var supported = ControlClass.supportedPlayTypes;
|
|
11945
|
+
// prettier-ignore
|
|
11946
|
+
theme.logger.warn("[" + iconId + '] control does not support playType "' + playType + '" (supported: ' + supported.join(', ') + "). It is still rendered, but may not work as expected.");
|
|
11947
|
+
theme.emit(EVENTS$2.control.unsupportedPlayType, iconId, playType, supported);
|
|
11948
|
+
}
|
|
11949
|
+
/**
|
|
11950
|
+
* 渲染控件
|
|
11951
|
+
* @param $container - 控件渲染节点
|
|
11952
|
+
* @param btnList - 控件按钮列表
|
|
11772
11953
|
*/ // prettier-ignore
|
|
11773
11954
|
function _renderControls(theme, $container, btnList, props) {
|
|
11774
11955
|
if (props === void 0) props = {};
|
|
@@ -11807,6 +11988,8 @@
|
|
|
11807
11988
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
|
|
11808
11989
|
props: props
|
|
11809
11990
|
}));
|
|
11991
|
+
theme.emit(EVENTS$2.control.deviceControlInit);
|
|
11992
|
+
_checkPlayTypeSupport(theme, item.iconId, Controls["device"]);
|
|
11810
11993
|
}
|
|
11811
11994
|
}
|
|
11812
11995
|
continue;
|
|
@@ -11836,6 +12019,9 @@
|
|
|
11836
12019
|
}, ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["" + item.iconId + "Options"]) || {}, {
|
|
11837
12020
|
props: props
|
|
11838
12021
|
}));
|
|
12022
|
+
// iconId 已由 Controls 查表校验过,这里必然能取到对应的初始化事件名
|
|
12023
|
+
theme.emit(CONTROL_INIT_EVENTS["" + item.iconId + "ControlInit"]);
|
|
12024
|
+
_checkPlayTypeSupport(theme, item.iconId, Controls[item.iconId]);
|
|
11839
12025
|
}
|
|
11840
12026
|
} else {
|
|
11841
12027
|
theme.logger.warn("[" + item.iconId + "] control does not exist");
|
|
@@ -12044,7 +12230,7 @@
|
|
|
12044
12230
|
});
|
|
12045
12231
|
}
|
|
12046
12232
|
// 移动端:在 rec 控件旁渲染 alarmMessage 按钮
|
|
12047
|
-
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl'])) {
|
|
12233
|
+
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl']) && theme.options.sdkType === 'base') {
|
|
12048
12234
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12049
12235
|
theme.controls['alarmMessageControl'] = new Controls['alarmMessage'](_extends$1({
|
|
12050
12236
|
rootContainer: theme.$container,
|
|
@@ -12059,6 +12245,8 @@
|
|
|
12059
12245
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options.alarmMessageOptions) || {}, {
|
|
12060
12246
|
props: props
|
|
12061
12247
|
}));
|
|
12248
|
+
theme.emit(EVENTS$2.control.alarmMessageControlInit);
|
|
12249
|
+
_checkPlayTypeSupport(theme, 'alarmMessage', Controls['alarmMessage']);
|
|
12062
12250
|
}
|
|
12063
12251
|
if ((theme.options.timeLineOptions !== null || !theme.options.disabledTimeLine) && ((_theme_options_mobileExtendOptions5 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions5.controls.includes('timeLine')) && _needTimeLine) {
|
|
12064
12252
|
_renderTimeLine(theme, theme._mobileExtend.$content, props);
|
|
@@ -12099,6 +12287,8 @@
|
|
|
12099
12287
|
showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_ref = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _ref : true : true,
|
|
12100
12288
|
props: props
|
|
12101
12289
|
}));
|
|
12290
|
+
theme.emit(EVENTS$2.control.timeLineControlInit);
|
|
12291
|
+
_checkPlayTypeSupport(theme, 'timeLine', Controls['timeLine']);
|
|
12102
12292
|
}
|
|
12103
12293
|
};
|
|
12104
12294
|
var _renderSegmentProgress = function _renderSegmentProgress(theme, container, props) {
|
|
@@ -12116,6 +12306,8 @@
|
|
|
12116
12306
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["segmentProgressOptions"]) || {}, {
|
|
12117
12307
|
props: props
|
|
12118
12308
|
}));
|
|
12309
|
+
theme.emit(EVENTS$2.control.segmentProgressControlInit);
|
|
12310
|
+
_checkPlayTypeSupport(theme, 'segmentProgress', Controls['segmentProgress']);
|
|
12119
12311
|
}
|
|
12120
12312
|
};
|
|
12121
12313
|
var _renderDatePicker = function _renderDatePicker(theme, container, props) {
|
|
@@ -12132,6 +12324,8 @@
|
|
|
12132
12324
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
|
|
12133
12325
|
props: props
|
|
12134
12326
|
}));
|
|
12327
|
+
theme.emit(EVENTS$2.control.dateControlInit);
|
|
12328
|
+
_checkPlayTypeSupport(theme, 'date', Controls['date']);
|
|
12135
12329
|
}
|
|
12136
12330
|
};
|
|
12137
12331
|
var _renderTimePicker = function _renderTimePicker(theme, container, props) {
|
|
@@ -12148,6 +12342,8 @@
|
|
|
12148
12342
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeOptions"]) || {}, {
|
|
12149
12343
|
props: props
|
|
12150
12344
|
}));
|
|
12345
|
+
theme.emit(EVENTS$2.control.timeControlInit);
|
|
12346
|
+
_checkPlayTypeSupport(theme, 'time', Controls['time']);
|
|
12151
12347
|
}
|
|
12152
12348
|
};
|
|
12153
12349
|
var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
@@ -12166,31 +12362,33 @@
|
|
|
12166
12362
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["recOptions"]) || {}, {
|
|
12167
12363
|
props: props
|
|
12168
12364
|
}));
|
|
12365
|
+
theme.emit(EVENTS$2.control.recControlInit);
|
|
12366
|
+
_checkPlayTypeSupport(theme, 'rec', Controls['rec']);
|
|
12169
12367
|
}
|
|
12170
12368
|
if ((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1['recControl']) ((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['recControl']).addRecType(recType);
|
|
12171
12369
|
};
|
|
12172
12370
|
|
|
12173
|
-
/**
|
|
12174
|
-
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
12175
|
-
*
|
|
12176
|
-
* @remarks
|
|
12177
|
-
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
12178
|
-
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
12179
|
-
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
12180
|
-
*/ /**
|
|
12181
|
-
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
12182
|
-
*/ /**
|
|
12183
|
-
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
12184
|
-
*
|
|
12185
|
-
* 档位规则:
|
|
12186
|
-
* - `(280, 375]` → medium
|
|
12187
|
-
* - `(200, 280]` → small
|
|
12188
|
-
* - `<= 200` → mini
|
|
12189
|
-
* - 其它(> 375)→ 无档位(移除全部)
|
|
12190
|
-
*
|
|
12191
|
-
* @param size 尺寸(px)
|
|
12192
|
-
* @param axis `'width'` 或 `'height'`
|
|
12193
|
-
* @param prefix 类名前缀(如 `ezplayer`)
|
|
12371
|
+
/**
|
|
12372
|
+
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
12373
|
+
*
|
|
12374
|
+
* @remarks
|
|
12375
|
+
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
12376
|
+
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
12377
|
+
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
12378
|
+
*/ /**
|
|
12379
|
+
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
12380
|
+
*/ /**
|
|
12381
|
+
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
12382
|
+
*
|
|
12383
|
+
* 档位规则:
|
|
12384
|
+
* - `(280, 375]` → medium
|
|
12385
|
+
* - `(200, 280]` → small
|
|
12386
|
+
* - `<= 200` → mini
|
|
12387
|
+
* - 其它(> 375)→ 无档位(移除全部)
|
|
12388
|
+
*
|
|
12389
|
+
* @param size 尺寸(px)
|
|
12390
|
+
* @param axis `'width'` 或 `'height'`
|
|
12391
|
+
* @param prefix 类名前缀(如 `ezplayer`)
|
|
12194
12392
|
*/ function computeDimensionClasses(size, axis, prefix) {
|
|
12195
12393
|
var medium = prefix + "-medium-" + axis;
|
|
12196
12394
|
var small = prefix + "-small-" + axis;
|
|
@@ -12216,11 +12414,11 @@
|
|
|
12216
12414
|
remove: remove
|
|
12217
12415
|
};
|
|
12218
12416
|
}
|
|
12219
|
-
/**
|
|
12220
|
-
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
12221
|
-
* @param width 容器宽度(px)
|
|
12222
|
-
* @param height 容器高度(px)
|
|
12223
|
-
* @param prefix 类名前缀
|
|
12417
|
+
/**
|
|
12418
|
+
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
12419
|
+
* @param width 容器宽度(px)
|
|
12420
|
+
* @param height 容器高度(px)
|
|
12421
|
+
* @param prefix 类名前缀
|
|
12224
12422
|
*/ function computeSizeClasses(width, height, prefix) {
|
|
12225
12423
|
var w = computeDimensionClasses(width, 'width', prefix);
|
|
12226
12424
|
var h = computeDimensionClasses(height, 'height', prefix);
|
|
@@ -12229,34 +12427,34 @@
|
|
|
12229
12427
|
remove: [].concat(w.remove, h.remove)
|
|
12230
12428
|
};
|
|
12231
12429
|
}
|
|
12232
|
-
/**
|
|
12233
|
-
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
12430
|
+
/**
|
|
12431
|
+
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
12234
12432
|
*/ function shouldShowHeaderMore(width, leftWidth, rightWidth) {
|
|
12235
12433
|
return leftWidth + rightWidth + 30 > width;
|
|
12236
12434
|
}
|
|
12237
|
-
/**
|
|
12238
|
-
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
12435
|
+
/**
|
|
12436
|
+
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
12239
12437
|
*/ function shouldRemoveHeaderMore(width, leftWidth, rightWidth) {
|
|
12240
12438
|
return width - leftWidth - rightWidth > 100;
|
|
12241
12439
|
}
|
|
12242
|
-
/**
|
|
12243
|
-
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
12440
|
+
/**
|
|
12441
|
+
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
12244
12442
|
*/ function shouldCollapseFooter(width, leftWidth, rightWidth) {
|
|
12245
12443
|
return width - leftWidth - rightWidth < 16;
|
|
12246
12444
|
}
|
|
12247
|
-
/**
|
|
12248
|
-
* footer 从 More 中释放控件时的展开阈值。
|
|
12249
|
-
*
|
|
12250
|
-
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
12251
|
-
* `50 + firstItemWidth || 0`)。
|
|
12252
|
-
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
12445
|
+
/**
|
|
12446
|
+
* footer 从 More 中释放控件时的展开阈值。
|
|
12447
|
+
*
|
|
12448
|
+
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
12449
|
+
* `50 + firstItemWidth || 0`)。
|
|
12450
|
+
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
12253
12451
|
*/ function computeFooterExpandOffset(firstItemWidth) {
|
|
12254
12452
|
var base = 50;
|
|
12255
12453
|
if (firstItemWidth === undefined) return base;
|
|
12256
12454
|
return base + firstItemWidth || 0;
|
|
12257
12455
|
}
|
|
12258
|
-
/**
|
|
12259
|
-
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
12456
|
+
/**
|
|
12457
|
+
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
12260
12458
|
*/ function shouldExpandFooter(width, leftWidth, rightWidth, offset) {
|
|
12261
12459
|
return width - leftWidth - rightWidth > offset;
|
|
12262
12460
|
}
|
|
@@ -12887,14 +13085,14 @@
|
|
|
12887
13085
|
});
|
|
12888
13086
|
this.$container.classList.remove("" + PREFIX_CLASS$1);
|
|
12889
13087
|
this._themeData = null;
|
|
12890
|
-
if (this.i18n) this.i18n = null
|
|
13088
|
+
// if (this.i18n) this.i18n = null!; // 注释是为了防止出错
|
|
12891
13089
|
this.recType = '';
|
|
12892
13090
|
this.recMonth = []; // 清空数据
|
|
12893
13091
|
// 重置
|
|
12894
13092
|
this._videoInfo = {};
|
|
12895
13093
|
this.emit(EVENTS$2.theme.destroyed);
|
|
12896
13094
|
this.removeAllListeners();
|
|
12897
|
-
if (this.logger) this.logger = null
|
|
13095
|
+
// if (this.logger) this.logger = null!; // 注释是为了防止出错
|
|
12898
13096
|
// 销毁后,将 destroyed 设置为 true
|
|
12899
13097
|
this.destroyed = true;
|
|
12900
13098
|
};
|
|
@@ -13487,6 +13685,9 @@
|
|
|
13487
13685
|
},
|
|
13488
13686
|
set: function set(url) {
|
|
13489
13687
|
this._url = url;
|
|
13688
|
+
// 地址变了回放类型也要跟着变,否则 recType / playType 会停留在上一个地址的结果,
|
|
13689
|
+
// 进而影响倍速档位过滤、回放类型控件激活态与控件支持性校验
|
|
13690
|
+
this._getRecType(url);
|
|
13490
13691
|
}
|
|
13491
13692
|
},
|
|
13492
13693
|
{
|
|
@@ -13500,6 +13701,32 @@
|
|
|
13500
13701
|
return {};
|
|
13501
13702
|
}
|
|
13502
13703
|
},
|
|
13704
|
+
{
|
|
13705
|
+
key: "playType",
|
|
13706
|
+
get: /**
|
|
13707
|
+
* 当前播放类型,由播放地址解析得出
|
|
13708
|
+
*
|
|
13709
|
+
* 取值 `'live' | 'rec' | 'cloudRec' | 'cloudRecord'`,无法判定时为空字符串 `''`。
|
|
13710
|
+
*
|
|
13711
|
+
* 与 {@link recType} 的关系:`recType` 只覆盖三种回放,直播时为空串;
|
|
13712
|
+
* 本 getter 把直播也纳入同一个枚举,作为「当前播放类型」的统一出口。
|
|
13713
|
+
*
|
|
13714
|
+
* @remarks 空串表示无法从地址判定(如 rtmp、webrtc、地址未设置)。
|
|
13715
|
+
* 此时控件支持性校验会整体跳过,避免对判不出类型的地址误报。
|
|
13716
|
+
* @since 3.1.7
|
|
13717
|
+
* ```ts
|
|
13718
|
+
* theme.playType // 'cloudRec'
|
|
13719
|
+
* ```
|
|
13720
|
+
*/ function get() {
|
|
13721
|
+
var _this_urlInfo;
|
|
13722
|
+
// 回放三类由 _getRecType 解析(含 busType=7 → cloudRecord 的区分)
|
|
13723
|
+
if (this.recType) return this.recType;
|
|
13724
|
+
if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'live') return 'live';
|
|
13725
|
+
// 标准流直播:http(s) 且不走回放路径 /openpb/
|
|
13726
|
+
if (this._url && distExports$3.isHttp(this._url) && !this._url.includes('/openpb/')) return 'live';
|
|
13727
|
+
return '';
|
|
13728
|
+
}
|
|
13729
|
+
},
|
|
13503
13730
|
{
|
|
13504
13731
|
key: "width",
|
|
13505
13732
|
get: /**
|
|
@@ -13986,7 +14213,7 @@
|
|
|
13986
14213
|
zh: zh,
|
|
13987
14214
|
en: en
|
|
13988
14215
|
};
|
|
13989
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.
|
|
14216
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.7-beta.1';
|
|
13990
14217
|
|
|
13991
14218
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13992
14219
|
|