@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.cjs
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
|
'use strict';
|
|
@@ -20,6 +20,16 @@ var controlDatePicker = require('@ezuikit/control-date-picker');
|
|
|
20
20
|
var controlTimeLine = require('@ezuikit/control-time-line');
|
|
21
21
|
var SegmentProgress = require('@ezuikit/control-segment-progress');
|
|
22
22
|
|
|
23
|
+
function _extends$z() {
|
|
24
|
+
_extends$z = Object.assign || function assign(target) {
|
|
25
|
+
for(var i = 1; i < arguments.length; i++){
|
|
26
|
+
var source = arguments[i];
|
|
27
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
return _extends$z.apply(this, arguments);
|
|
32
|
+
}
|
|
23
33
|
/**
|
|
24
34
|
* 播放器的类名前缀
|
|
25
35
|
*/ var PREFIX_CLASS = 'ezplayer';
|
|
@@ -99,6 +109,54 @@ var THEME_PROPS = [
|
|
|
99
109
|
'date',
|
|
100
110
|
'segmentProgress'
|
|
101
111
|
];
|
|
112
|
+
/**
|
|
113
|
+
* 全部播放类型:直播 + 三种回放
|
|
114
|
+
*
|
|
115
|
+
* 控件用静态属性 `supportedPlayTypes` 声明支持范围,默认取本数组(即全支持)。
|
|
116
|
+
* 与 {@link REC_GROUP} 的区别:REC_GROUP 是「回放类型切换控件的 iconId 分组」,
|
|
117
|
+
* 这里是「播放地址实际解析出的播放类型」,两者取值恰好在回放侧重合。
|
|
118
|
+
*/ var PLAY_TYPES = [
|
|
119
|
+
'live',
|
|
120
|
+
'rec',
|
|
121
|
+
'cloudRec',
|
|
122
|
+
'cloudRecord'
|
|
123
|
+
];
|
|
124
|
+
/**
|
|
125
|
+
* 控件初始化完成事件名
|
|
126
|
+
*
|
|
127
|
+
* 键与 `Controls`(`src/Controls/index.ts`)的键一一对应,值为 `Control.<键>ControlInit`,
|
|
128
|
+
* 在控件实例创建成功后由 `_renderTheme` 派发一次,无载荷。
|
|
129
|
+
*
|
|
130
|
+
* 这些成员会被展开进 {@link EVENTS}.control,因此既可以 `EVENTS.control.playControlInit`
|
|
131
|
+
* 这样按名取用,也可以在只拿到 `iconId` 的场合用 `CONTROL_INIT_EVENTS[iconId]` 查表。
|
|
132
|
+
*
|
|
133
|
+
* @remarks `changeTheme` 会先卸载旧控件并重置 `theme.controls`,因此切换主题时这些事件会再次派发;
|
|
134
|
+
* 同一次渲染内则由 `!theme.controls.xxxControl` 守卫保证只派发一次。
|
|
135
|
+
*/ var CONTROL_INIT_EVENTS = {
|
|
136
|
+
/** 播放/暂停控件初始化完成 */ playControlInit: 'Control.playControlInit',
|
|
137
|
+
/** 音量控件初始化完成 */ volumeControlInit: 'Control.volumeControlInit',
|
|
138
|
+
/** 设备信息控件初始化完成 */ deviceControlInit: 'Control.deviceControlInit',
|
|
139
|
+
/** 截图控件初始化完成 */ capturePictureControlInit: 'Control.capturePictureControlInit',
|
|
140
|
+
/** 云台控件初始化完成 */ ptzControlInit: 'Control.ptzControlInit',
|
|
141
|
+
/** 录制控件初始化完成 */ recordControlInit: 'Control.recordControlInit',
|
|
142
|
+
/** 对讲控件初始化完成 */ talkControlInit: 'Control.talkControlInit',
|
|
143
|
+
/** 语音广播控件初始化完成 */ broadcastControlInit: 'Control.broadcastControlInit',
|
|
144
|
+
/** AI 对话控件初始化完成 */ aiChatControlInit: 'Control.aiChatControlInit',
|
|
145
|
+
/** 直播按钮控件初始化完成 */ liveControlInit: 'Control.liveControlInit',
|
|
146
|
+
/** 回放下拉控件初始化完成 */ recDropdownControlInit: 'Control.recDropdownControlInit',
|
|
147
|
+
/** 录像列表控件初始化完成 */ recListControlInit: 'Control.recListControlInit',
|
|
148
|
+
/** 告警消息控件初始化完成 */ alarmMessageControlInit: 'Control.alarmMessageControlInit',
|
|
149
|
+
/** 电子放大控件初始化完成 */ zoomControlInit: 'Control.zoomControlInit',
|
|
150
|
+
/** 清晰度控件初始化完成 */ definitionControlInit: 'Control.definitionControlInit',
|
|
151
|
+
/** web 全屏控件初始化完成 */ fullscreenControlInit: 'Control.fullscreenControlInit',
|
|
152
|
+
/** 全局全屏控件初始化完成 */ globalFullscreenControlInit: 'Control.globalFullscreenControlInit',
|
|
153
|
+
/** 回放类型控件初始化完成 */ recControlInit: 'Control.recControlInit',
|
|
154
|
+
/** 倍速控件初始化完成 */ speedControlInit: 'Control.speedControlInit',
|
|
155
|
+
/** 日历控件初始化完成 */ dateControlInit: 'Control.dateControlInit',
|
|
156
|
+
/** 时间选择控件初始化完成 */ timeControlInit: 'Control.timeControlInit',
|
|
157
|
+
/** 时间轴控件初始化完成 */ timeLineControlInit: 'Control.timeLineControlInit',
|
|
158
|
+
/** 回放片段进度条控件初始化完成 */ segmentProgressControlInit: 'Control.segmentProgressControlInit'
|
|
159
|
+
};
|
|
102
160
|
/**
|
|
103
161
|
*
|
|
104
162
|
* 事件名
|
|
@@ -165,7 +223,7 @@ var EVENTS = {
|
|
|
165
223
|
/** 播放区间播放结束(SDK 层 playbackRange 特性) */ playbackEnd: 'playbackEnd',
|
|
166
224
|
/**
|
|
167
225
|
* 控件相关
|
|
168
|
-
*/ control: {
|
|
226
|
+
*/ control: _extends$z({}, CONTROL_INIT_EVENTS, {
|
|
169
227
|
/** 点击播放播放/暂停按钮 */ play: 'Control.play',
|
|
170
228
|
/** 播放控件销毁 */ playDestroy: 'Control.playDestroy',
|
|
171
229
|
/** 截图 */ capturePicture: 'Control.capturePicture',
|
|
@@ -221,12 +279,13 @@ var EVENTS = {
|
|
|
221
279
|
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
222
280
|
/** 日期面板展示的月份变化 */ datePanelMonthChange: 'Control.datePanelMonthChange',
|
|
223
281
|
/** 日期面板展示的年份变化 */ datePanelYearChange: 'Control.datePanelYearChange',
|
|
224
|
-
/** 日期销毁 */ dateDestroy: 'Control.
|
|
282
|
+
/** 日期销毁 */ dateDestroy: 'Control.dateDestroy',
|
|
225
283
|
/** 时间面板展示隐藏变换 */ timePanelOpenChange: 'Control.timePanelOpenChange',
|
|
226
284
|
/** 时间改变 */ timeChange: 'Control.timeChange',
|
|
227
285
|
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
228
286
|
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
229
287
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
288
|
+
/** 控件不支持当前播放类型(仅提示,控件仍会渲染) */ unsupportedPlayType: 'Control.unsupportedPlayType',
|
|
230
289
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
231
290
|
/** 主题控件挂载完成, 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ mountedControls: 'Control.mountedControls',
|
|
232
291
|
/** 主题控件卸载前, 已有控件卸载时才可触发 */ beforeUnmountControls: 'Control.beforeUnmountControls',
|
|
@@ -236,7 +295,7 @@ var EVENTS = {
|
|
|
236
295
|
/** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
|
|
237
296
|
/** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
|
|
238
297
|
/** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
|
|
239
|
-
},
|
|
298
|
+
}),
|
|
240
299
|
/**
|
|
241
300
|
* 主题控件相关
|
|
242
301
|
*/ theme: {
|
|
@@ -286,17 +345,17 @@ function _set_prototype_of$z(o, p) {
|
|
|
286
345
|
};
|
|
287
346
|
return _set_prototype_of$z(o, p);
|
|
288
347
|
}
|
|
289
|
-
/**
|
|
290
|
-
* 控件基类
|
|
291
|
-
* @category Control
|
|
292
|
-
* @example
|
|
293
|
-
* ```ts
|
|
294
|
-
* // 创建控件
|
|
295
|
-
* class MyControl extends Control {}
|
|
296
|
-
*
|
|
297
|
-
* // 使用控件
|
|
298
|
-
* const myControl = new MyControl({})
|
|
299
|
-
* ```
|
|
348
|
+
/**
|
|
349
|
+
* 控件基类
|
|
350
|
+
* @category Control
|
|
351
|
+
* @example
|
|
352
|
+
* ```ts
|
|
353
|
+
* // 创建控件
|
|
354
|
+
* class MyControl extends Control {}
|
|
355
|
+
*
|
|
356
|
+
* // 使用控件
|
|
357
|
+
* const myControl = new MyControl({})
|
|
358
|
+
* ```
|
|
300
359
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
301
360
|
_inherits$z(Control, EventEmitter);
|
|
302
361
|
function Control(options) {
|
|
@@ -338,22 +397,22 @@ function _set_prototype_of$z(o, p) {
|
|
|
338
397
|
return _this;
|
|
339
398
|
}
|
|
340
399
|
var _proto = Control.prototype;
|
|
341
|
-
/**
|
|
342
|
-
* 重置整个控件
|
|
400
|
+
/**
|
|
401
|
+
* 重置整个控件
|
|
343
402
|
*/ _proto.reset = function reset(hide) {
|
|
344
403
|
if (this._camelCaseName) {
|
|
345
404
|
this.emit("Control." + this._camelCaseName + "Reset", hide);
|
|
346
405
|
}
|
|
347
406
|
};
|
|
348
|
-
/**
|
|
349
|
-
* 重置控件挂载节点
|
|
350
|
-
* @param popupContainer 重新挂载的节点
|
|
351
|
-
* @param append 添加的方式, 默认 append
|
|
352
|
-
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
353
|
-
*
|
|
354
|
-
* | prepend | append |
|
|
355
|
-
* |:-------------:|:---------------:|
|
|
356
|
-
* | 插入第一个位置 | 追加在末尾 |
|
|
407
|
+
/**
|
|
408
|
+
* 重置控件挂载节点
|
|
409
|
+
* @param popupContainer 重新挂载的节点
|
|
410
|
+
* @param append 添加的方式, 默认 append
|
|
411
|
+
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
412
|
+
*
|
|
413
|
+
* | prepend | append |
|
|
414
|
+
* |:-------------:|:---------------:|
|
|
415
|
+
* | 插入第一个位置 | 追加在末尾 |
|
|
357
416
|
*/ _proto.resetPopupContainer = function resetPopupContainer(popupContainer, append, element) {
|
|
358
417
|
if (popupContainer !== this.$popupContainer) {
|
|
359
418
|
if (this.$popupContainer.contains(this.$container)) {
|
|
@@ -375,16 +434,16 @@ function _set_prototype_of$z(o, p) {
|
|
|
375
434
|
}
|
|
376
435
|
}
|
|
377
436
|
};
|
|
378
|
-
/**
|
|
379
|
-
* 隐藏整个控件
|
|
437
|
+
/**
|
|
438
|
+
* 隐藏整个控件
|
|
380
439
|
*/ _proto.hide = function hide() {
|
|
381
440
|
if (this.$container) {
|
|
382
441
|
this.$container.style.display = 'none';
|
|
383
442
|
this.$container.classList.add("" + PREFIX_CLASS + "-hide");
|
|
384
443
|
}
|
|
385
444
|
};
|
|
386
|
-
/**
|
|
387
|
-
* 销毁控件
|
|
445
|
+
/**
|
|
446
|
+
* 销毁控件
|
|
388
447
|
*/ _proto.destroy = function destroy() {
|
|
389
448
|
var _this___options, _this_$container_remove, _this_$container;
|
|
390
449
|
if (this._camelCaseName) {
|
|
@@ -421,8 +480,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
421
480
|
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS + "-active");
|
|
422
481
|
}
|
|
423
482
|
};
|
|
424
|
-
/**
|
|
425
|
-
* 当点击 Control 时 触发子类的 _onControlClick
|
|
483
|
+
/**
|
|
484
|
+
* 当点击 Control 时 触发子类的 _onControlClick
|
|
426
485
|
*/ _proto._onClick = function _onClick() {
|
|
427
486
|
var _this = this;
|
|
428
487
|
// 使用具名 handler 便于在 destroy 时精确移除,避免匿名监听残留
|
|
@@ -440,19 +499,29 @@ function _set_prototype_of$z(o, p) {
|
|
|
440
499
|
e.stopPropagation();
|
|
441
500
|
e.preventDefault();
|
|
442
501
|
};
|
|
443
|
-
/**
|
|
444
|
-
* 点击 Control 控件触发
|
|
445
|
-
* @param {Event} e
|
|
446
|
-
* @returns {void}
|
|
502
|
+
/**
|
|
503
|
+
* 点击 Control 控件触发
|
|
504
|
+
* @param {Event} e
|
|
505
|
+
* @returns {void}
|
|
447
506
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
448
507
|
// 这是一个空函数, 子类可以实现重新改方法
|
|
449
508
|
this.__options.onClick == null ? void 0 : this.__options.onClick.call(this.__options, e);
|
|
450
509
|
};
|
|
510
|
+
/**
|
|
511
|
+
* 判断某个播放类型是否被本控件支持
|
|
512
|
+
*
|
|
513
|
+
* @param playType 播放类型;传空串(无法从地址判定)时一律返回 `true`,避免误报
|
|
514
|
+
* @returns 是否支持
|
|
515
|
+
* @since 3.1.7
|
|
516
|
+
*/ Control.supportsPlayType = function supportsPlayType(playType) {
|
|
517
|
+
if (!playType) return true;
|
|
518
|
+
return this.supportedPlayTypes.includes(playType);
|
|
519
|
+
};
|
|
451
520
|
_create_class$9(Control, [
|
|
452
521
|
{
|
|
453
522
|
key: "active",
|
|
454
|
-
get: /**
|
|
455
|
-
* 是否激活
|
|
523
|
+
get: /**
|
|
524
|
+
* 是否激活
|
|
456
525
|
*/ function get() {
|
|
457
526
|
return this._active;
|
|
458
527
|
},
|
|
@@ -467,8 +536,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
467
536
|
},
|
|
468
537
|
{
|
|
469
538
|
key: "disabled",
|
|
470
|
-
get: /**
|
|
471
|
-
* 是否禁用
|
|
539
|
+
get: /**
|
|
540
|
+
* 是否禁用
|
|
472
541
|
*/ function get() {
|
|
473
542
|
return this._disabled;
|
|
474
543
|
},
|
|
@@ -480,6 +549,24 @@ function _set_prototype_of$z(o, p) {
|
|
|
480
549
|
]);
|
|
481
550
|
return Control;
|
|
482
551
|
}(EventEmitter);
|
|
552
|
+
/**
|
|
553
|
+
* 该控件支持的播放类型,默认全支持
|
|
554
|
+
*
|
|
555
|
+
* 子类用 `static supportedPlayTypes = [...]` 覆盖来收窄范围。声明是**静态**的,
|
|
556
|
+
* 因为渲染层需要在不实例化控件的前提下就能读到(`Controls[iconId].supportedPlayTypes`)。
|
|
557
|
+
*
|
|
558
|
+
* 渲染时会拿 `theme.playType` 与此比对,不匹配只发警告与 `Control.unsupportedPlayType`
|
|
559
|
+
* 事件,**不阻止渲染**,控件照常创建、照常可交互,行为是否生效由 SDK 层与设备能力决定。
|
|
560
|
+
*
|
|
561
|
+
* @since 3.1.7
|
|
562
|
+
* @example
|
|
563
|
+
* ```ts
|
|
564
|
+
* class MyControl extends Control {
|
|
565
|
+
* // 只在云存储回放下有意义
|
|
566
|
+
* static supportedPlayTypes: ThemePlayType[] = ['cloudRec'];
|
|
567
|
+
* }
|
|
568
|
+
* ```
|
|
569
|
+
*/ Control.supportedPlayTypes = [].concat(PLAY_TYPES);
|
|
483
570
|
|
|
484
571
|
function _extends$y() {
|
|
485
572
|
_extends$y = Object.assign || function assign(target) {
|
|
@@ -512,9 +599,9 @@ function _set_prototype_of$y(o, p) {
|
|
|
512
599
|
return _set_prototype_of$y(o, p);
|
|
513
600
|
}
|
|
514
601
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
515
|
-
/**
|
|
516
|
-
* 加载动画控件
|
|
517
|
-
* @category Control
|
|
602
|
+
/**
|
|
603
|
+
* 加载动画控件
|
|
604
|
+
* @category Control
|
|
518
605
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
519
606
|
_inherits$y(Loading, Control);
|
|
520
607
|
function Loading(options) {
|
|
@@ -539,9 +626,9 @@ var LOADING_DEFAULT_OPTIONS = {};
|
|
|
539
626
|
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + "-loading-dot " + PREFIX_CLASS + '-loading-dot-load">\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n </span>\n <div class="' + PREFIX_CLASS + '-loading-text">' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.LOADING) || 'loading...') + "</div>\n ";
|
|
540
627
|
}
|
|
541
628
|
};
|
|
542
|
-
/**
|
|
543
|
-
* 动画展示
|
|
544
|
-
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
629
|
+
/**
|
|
630
|
+
* 动画展示
|
|
631
|
+
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
545
632
|
*/ _proto.show = function show(html) {
|
|
546
633
|
if (html) this.$container.innerHTML = html;
|
|
547
634
|
// 初始化, 出流再等待中(回放出流结束不包括)
|
|
@@ -549,8 +636,8 @@ var LOADING_DEFAULT_OPTIONS = {};
|
|
|
549
636
|
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
550
637
|
this.$popupContainer.classList.add("" + PREFIX_CLASS + "-has-loading");
|
|
551
638
|
};
|
|
552
|
-
/**
|
|
553
|
-
* 隐藏动画
|
|
639
|
+
/**
|
|
640
|
+
* 隐藏动画
|
|
554
641
|
*/ _proto.hide = function hide() {
|
|
555
642
|
Control.prototype.hide.call(this);
|
|
556
643
|
this.$popupContainer.classList.remove("" + PREFIX_CLASS + "-has-loading");
|
|
@@ -594,9 +681,9 @@ var DEFAULT_POSTER = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29
|
|
|
594
681
|
var POSTER_OPTIONS = {
|
|
595
682
|
poster: DEFAULT_POSTER
|
|
596
683
|
};
|
|
597
|
-
/**
|
|
598
|
-
* 封面控件
|
|
599
|
-
* @category Control
|
|
684
|
+
/**
|
|
685
|
+
* 封面控件
|
|
686
|
+
* @category Control
|
|
600
687
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
601
688
|
_inherits$x(Poster, Control);
|
|
602
689
|
function Poster(options) {
|
|
@@ -616,18 +703,18 @@ var POSTER_OPTIONS = {
|
|
|
616
703
|
return _this;
|
|
617
704
|
}
|
|
618
705
|
var _proto = Poster.prototype;
|
|
619
|
-
/**
|
|
620
|
-
* 封面图片加载失败
|
|
621
|
-
* @param error
|
|
706
|
+
/**
|
|
707
|
+
* 封面图片加载失败
|
|
708
|
+
* @param error
|
|
622
709
|
*/ _proto._imgLoadErrorEvent = function _imgLoadErrorEvent(error) {
|
|
623
710
|
var _error_target;
|
|
624
711
|
// 封面加载失败, 一般只有自定义封面会出现这种情况
|
|
625
712
|
// 这里不做img src重置处理 防止无限循环
|
|
626
713
|
this._options.onLoadImgError == null ? void 0 : this._options.onLoadImgError.call(this._options, ((_error_target = error.target) == null ? void 0 : _error_target.getAttribute('src')) || '');
|
|
627
714
|
};
|
|
628
|
-
/**
|
|
629
|
-
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
630
|
-
* @param {string} poster 封面地址或 base64 数据
|
|
715
|
+
/**
|
|
716
|
+
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
717
|
+
* @param {string} poster 封面地址或 base64 数据
|
|
631
718
|
*/ _proto.setPoster = function setPoster(poster) {
|
|
632
719
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
633
720
|
// prettier-ignore
|
|
@@ -640,24 +727,24 @@ var POSTER_OPTIONS = {
|
|
|
640
727
|
this.$container.innerHTML = '<img class="' + PREFIX_CLASS + '-poster-img" src="' + poster + '" />';
|
|
641
728
|
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.addEventListener("error", this._imgLoadErrorEvent);
|
|
642
729
|
};
|
|
643
|
-
/**
|
|
644
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
730
|
+
/**
|
|
731
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
645
732
|
*/ _proto.show = function show() {
|
|
646
733
|
if (this.$container) {
|
|
647
734
|
this.$container.style.display = 'flex';
|
|
648
735
|
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
649
736
|
}
|
|
650
737
|
};
|
|
651
|
-
/**
|
|
652
|
-
* 隐藏封面
|
|
738
|
+
/**
|
|
739
|
+
* 隐藏封面
|
|
653
740
|
*/ _proto.hide = function hide() {
|
|
654
741
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
655
742
|
_this_$container_querySelector, _this_$container;
|
|
656
743
|
Control.prototype.hide.call(this);
|
|
657
744
|
(_this_$container = this.$container) == null ? void 0 : (_this_$container_querySelector = _this_$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.removeEventListener('error', this._imgLoadErrorEvent);
|
|
658
745
|
};
|
|
659
|
-
/**
|
|
660
|
-
* 销毁
|
|
746
|
+
/**
|
|
747
|
+
* 销毁
|
|
661
748
|
*/ _proto.destroy = function destroy() {
|
|
662
749
|
this.hide();
|
|
663
750
|
Control.prototype.destroy.call(this);
|
|
@@ -716,15 +803,15 @@ var Icons = {
|
|
|
716
803
|
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>'
|
|
717
804
|
};
|
|
718
805
|
|
|
719
|
-
/**
|
|
720
|
-
* 创建 icon 组件
|
|
721
|
-
* @param svg - svg 字符串
|
|
722
|
-
* @param type - icon 类型
|
|
723
|
-
* @returns icon 组件
|
|
724
|
-
* @example
|
|
725
|
-
* ```ts
|
|
726
|
-
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
727
|
-
* ```
|
|
806
|
+
/**
|
|
807
|
+
* 创建 icon 组件
|
|
808
|
+
* @param svg - svg 字符串
|
|
809
|
+
* @param type - icon 类型
|
|
810
|
+
* @returns icon 组件
|
|
811
|
+
* @example
|
|
812
|
+
* ```ts
|
|
813
|
+
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
814
|
+
* ```
|
|
728
815
|
*/ function createIcon(svg, type, attr) {
|
|
729
816
|
if (attr === void 0) attr = {};
|
|
730
817
|
var attrStr = '';
|
|
@@ -925,9 +1012,9 @@ function _set_prototype_of$w(o, p) {
|
|
|
925
1012
|
return _set_prototype_of$w(o, p);
|
|
926
1013
|
}
|
|
927
1014
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
928
|
-
/**
|
|
929
|
-
* 消息控件
|
|
930
|
-
* @category Control
|
|
1015
|
+
/**
|
|
1016
|
+
* 消息控件
|
|
1017
|
+
* @category Control
|
|
931
1018
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
932
1019
|
_inherits$w(Message, Control);
|
|
933
1020
|
function Message(options) {
|
|
@@ -942,34 +1029,34 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
942
1029
|
return _this;
|
|
943
1030
|
}
|
|
944
1031
|
var _proto = Message.prototype;
|
|
945
|
-
/**
|
|
946
|
-
* info 普通消息, 内容默认字体白色
|
|
947
|
-
* @param {string} msg 消息内容
|
|
948
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1032
|
+
/**
|
|
1033
|
+
* info 普通消息, 内容默认字体白色
|
|
1034
|
+
* @param {string} msg 消息内容
|
|
1035
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
949
1036
|
*/ _proto.info = function info(msg, duration) {
|
|
950
1037
|
if (duration === void 0) duration = 2;
|
|
951
1038
|
this._toast(msg, 'info', duration);
|
|
952
1039
|
};
|
|
953
|
-
/**
|
|
954
|
-
* warn 警告消息, 内容默认字体黄色
|
|
955
|
-
* @param {string} msg 消息内容
|
|
956
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1040
|
+
/**
|
|
1041
|
+
* warn 警告消息, 内容默认字体黄色
|
|
1042
|
+
* @param {string} msg 消息内容
|
|
1043
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
957
1044
|
*/ _proto.warn = function warn(msg, duration) {
|
|
958
1045
|
if (duration === void 0) duration = 2;
|
|
959
1046
|
this._toast(msg, 'warn', duration);
|
|
960
1047
|
};
|
|
961
|
-
/**
|
|
962
|
-
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
963
|
-
* @param {string} msg 消息内容
|
|
964
|
-
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
1048
|
+
/**
|
|
1049
|
+
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
1050
|
+
* @param {string} msg 消息内容
|
|
1051
|
+
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
965
1052
|
*/ _proto.toastError = function toastError(msg, duration) {
|
|
966
1053
|
if (duration === void 0) duration = 2;
|
|
967
1054
|
this._toast(msg, 'error', duration);
|
|
968
1055
|
};
|
|
969
|
-
/**
|
|
970
|
-
* error 错误消息, 内容默认字体红色
|
|
971
|
-
* @param {string} msg 消息内容
|
|
972
|
-
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
1056
|
+
/**
|
|
1057
|
+
* error 错误消息, 内容默认字体红色
|
|
1058
|
+
* @param {string} msg 消息内容
|
|
1059
|
+
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
973
1060
|
*/ _proto.error = function error(msg, duration) {
|
|
974
1061
|
if (duration === void 0) duration = 0;
|
|
975
1062
|
this._show(this._getIcon('error') + '<div class="' + PREFIX_CLASS + '-message-msg">' + (msg || '') + "</div>", duration, 'error');
|
|
@@ -998,11 +1085,11 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
998
1085
|
}
|
|
999
1086
|
}
|
|
1000
1087
|
};
|
|
1001
|
-
/**
|
|
1002
|
-
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1003
|
-
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1004
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1005
|
-
* @param {MessageType} type 消息类型
|
|
1088
|
+
/**
|
|
1089
|
+
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1090
|
+
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1091
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1092
|
+
* @param {MessageType} type 消息类型
|
|
1006
1093
|
*/ _proto._show = function _show(msg, duration, type) {
|
|
1007
1094
|
var _this = this;
|
|
1008
1095
|
if (duration === void 0) duration = 0;
|
|
@@ -1030,8 +1117,8 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
1030
1117
|
}, duration * 1000);
|
|
1031
1118
|
}
|
|
1032
1119
|
};
|
|
1033
|
-
/**
|
|
1034
|
-
* 销毁
|
|
1120
|
+
/**
|
|
1121
|
+
* 销毁
|
|
1035
1122
|
*/ _proto.destroy = function destroy() {
|
|
1036
1123
|
var _this__$toast;
|
|
1037
1124
|
if (this._timer) {
|
|
@@ -1046,8 +1133,8 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
1046
1133
|
this.hide();
|
|
1047
1134
|
Control.prototype.destroy.call(this);
|
|
1048
1135
|
};
|
|
1049
|
-
/**
|
|
1050
|
-
* 隐藏消息, 并清空消息内容
|
|
1136
|
+
/**
|
|
1137
|
+
* 隐藏消息, 并清空消息内容
|
|
1051
1138
|
*/ _proto.hide = function hide() {
|
|
1052
1139
|
var _this = this;
|
|
1053
1140
|
// 每次隐藏都清空内 消息内容
|
|
@@ -1120,9 +1207,9 @@ function _set_prototype_of$v(o, p) {
|
|
|
1120
1207
|
};
|
|
1121
1208
|
return _set_prototype_of$v(o, p);
|
|
1122
1209
|
}
|
|
1123
|
-
/**
|
|
1124
|
-
* 播放/暂停控件
|
|
1125
|
-
* @category Control
|
|
1210
|
+
/**
|
|
1211
|
+
* 播放/暂停控件
|
|
1212
|
+
* @category Control
|
|
1126
1213
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1127
1214
|
_inherits$v(Play, Control);
|
|
1128
1215
|
function Play(options) {
|
|
@@ -1144,8 +1231,8 @@ function _set_prototype_of$v(o, p) {
|
|
|
1144
1231
|
return _this;
|
|
1145
1232
|
}
|
|
1146
1233
|
var _proto = Play.prototype;
|
|
1147
|
-
/**
|
|
1148
|
-
* 点击 Control 会触发
|
|
1234
|
+
/**
|
|
1235
|
+
* 点击 Control 会触发
|
|
1149
1236
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
1150
1237
|
this._playing = !this._playing;
|
|
1151
1238
|
this.emit(EVENTS.control.play, this._playing);
|
|
@@ -1168,8 +1255,8 @@ function _set_prototype_of$v(o, p) {
|
|
|
1168
1255
|
_create_class$8(Play, [
|
|
1169
1256
|
{
|
|
1170
1257
|
key: "playing",
|
|
1171
|
-
get: /**
|
|
1172
|
-
* 播放状态
|
|
1258
|
+
get: /**
|
|
1259
|
+
* 播放状态
|
|
1173
1260
|
*/ function get() {
|
|
1174
1261
|
return this._playing;
|
|
1175
1262
|
}
|
|
@@ -1178,12 +1265,12 @@ function _set_prototype_of$v(o, p) {
|
|
|
1178
1265
|
return Play;
|
|
1179
1266
|
}(Control);
|
|
1180
1267
|
|
|
1181
|
-
/**
|
|
1182
|
-
* 节流函数
|
|
1183
|
-
* @param {Function} func
|
|
1184
|
-
* @param {number} wait
|
|
1185
|
-
* @typeParam T - 函数类型
|
|
1186
|
-
* @returns {Function}
|
|
1268
|
+
/**
|
|
1269
|
+
* 节流函数
|
|
1270
|
+
* @param {Function} func
|
|
1271
|
+
* @param {number} wait
|
|
1272
|
+
* @typeParam T - 函数类型
|
|
1273
|
+
* @returns {Function}
|
|
1187
1274
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
1188
1275
|
function throttle(func, wait) {
|
|
1189
1276
|
var timeout = null;
|
|
@@ -1239,28 +1326,28 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1239
1326
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1240
1327
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
1241
1328
|
}
|
|
1242
|
-
/**
|
|
1243
|
-
* 工具类
|
|
1244
|
-
* @category Util
|
|
1329
|
+
/**
|
|
1330
|
+
* 工具类
|
|
1331
|
+
* @category Util
|
|
1245
1332
|
*/ var Utils = /*#__PURE__*/ function() {
|
|
1246
1333
|
function Utils() {}
|
|
1247
1334
|
// /(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) ||
|
|
1248
1335
|
// (/Macintosh/i.test(navigator?.userAgent) && navigator?.maxTouchPoints > 1); // iPad 支持多点触控;
|
|
1249
|
-
/**
|
|
1250
|
-
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
1251
|
-
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
1252
|
-
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
1253
|
-
*
|
|
1254
|
-
* @example
|
|
1255
|
-
* ```ts
|
|
1256
|
-
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
1257
|
-
* console.log("orientation", orientation)
|
|
1258
|
-
* })
|
|
1259
|
-
*
|
|
1260
|
-
* console.log("orientation", orientation)
|
|
1261
|
-
* // 清除监听
|
|
1262
|
-
* cleanUp()
|
|
1263
|
-
* ```
|
|
1336
|
+
/**
|
|
1337
|
+
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
1338
|
+
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
1339
|
+
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1342
|
+
* ```ts
|
|
1343
|
+
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
1344
|
+
* console.log("orientation", orientation)
|
|
1345
|
+
* })
|
|
1346
|
+
*
|
|
1347
|
+
* console.log("orientation", orientation)
|
|
1348
|
+
* // 清除监听
|
|
1349
|
+
* cleanUp()
|
|
1350
|
+
* ```
|
|
1264
1351
|
*/ // prettier-ignore
|
|
1265
1352
|
Utils.orientationEventListener = function orientationEventListener(change) {
|
|
1266
1353
|
var _orientationTimer = null;
|
|
@@ -1350,18 +1437,18 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1350
1437
|
}
|
|
1351
1438
|
];
|
|
1352
1439
|
};
|
|
1353
|
-
/**
|
|
1354
|
-
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
1355
|
-
* @param {Element} node
|
|
1356
|
-
* @param callback
|
|
1357
|
-
* @returns {CleanUpResizeObserver}
|
|
1358
|
-
* @example
|
|
1359
|
-
* ```ts
|
|
1360
|
-
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
1361
|
-
*
|
|
1362
|
-
* // 移除监听
|
|
1363
|
-
* unobserve()
|
|
1364
|
-
* ```
|
|
1440
|
+
/**
|
|
1441
|
+
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
1442
|
+
* @param {Element} node
|
|
1443
|
+
* @param callback
|
|
1444
|
+
* @returns {CleanUpResizeObserver}
|
|
1445
|
+
* @example
|
|
1446
|
+
* ```ts
|
|
1447
|
+
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
1448
|
+
*
|
|
1449
|
+
* // 移除监听
|
|
1450
|
+
* unobserve()
|
|
1451
|
+
* ```
|
|
1365
1452
|
*/ // prettier-ignore
|
|
1366
1453
|
Utils.resizeObserver = function resizeObserver(node, callback) {
|
|
1367
1454
|
// prettier-ignore
|
|
@@ -1396,12 +1483,12 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1396
1483
|
return Utils;
|
|
1397
1484
|
}();
|
|
1398
1485
|
// 不要使用 window, 如果在 worker 中会报错
|
|
1399
|
-
/**
|
|
1400
|
-
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
1401
|
-
* @example
|
|
1402
|
-
* ```ts
|
|
1403
|
-
* Utils.isMobile // true | false
|
|
1404
|
-
* ```
|
|
1486
|
+
/**
|
|
1487
|
+
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
1488
|
+
* @example
|
|
1489
|
+
* ```ts
|
|
1490
|
+
* Utils.isMobile // true | false
|
|
1491
|
+
* ```
|
|
1405
1492
|
*/ Utils.isMobile = utilsTools.isMobile();
|
|
1406
1493
|
|
|
1407
1494
|
function _defineProperties$7(target, props) {
|
|
@@ -1435,23 +1522,23 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1435
1522
|
return (percent * 100).toFixed(0);
|
|
1436
1523
|
}
|
|
1437
1524
|
};
|
|
1438
|
-
/**
|
|
1439
|
-
* 进度条
|
|
1440
|
-
*
|
|
1441
|
-
* @category Control
|
|
1442
|
-
* @example
|
|
1443
|
-
* ```ts
|
|
1444
|
-
* const progress = new Progress({
|
|
1445
|
-
* container: document.getElementById('progress-container'),
|
|
1446
|
-
* step: 0.01,
|
|
1447
|
-
* range: [0, 1],
|
|
1448
|
-
* onChange: (value, range) => {
|
|
1449
|
-
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
1450
|
-
* },
|
|
1451
|
-
* defaultValue: 0.5,
|
|
1452
|
-
* draggable: true,
|
|
1453
|
-
* disabled: false,
|
|
1454
|
-
* })
|
|
1525
|
+
/**
|
|
1526
|
+
* 进度条
|
|
1527
|
+
*
|
|
1528
|
+
* @category Control
|
|
1529
|
+
* @example
|
|
1530
|
+
* ```ts
|
|
1531
|
+
* const progress = new Progress({
|
|
1532
|
+
* container: document.getElementById('progress-container'),
|
|
1533
|
+
* step: 0.01,
|
|
1534
|
+
* range: [0, 1],
|
|
1535
|
+
* onChange: (value, range) => {
|
|
1536
|
+
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
1537
|
+
* },
|
|
1538
|
+
* defaultValue: 0.5,
|
|
1539
|
+
* draggable: true,
|
|
1540
|
+
* disabled: false,
|
|
1541
|
+
* })
|
|
1455
1542
|
*/ var Progress = /*#__PURE__*/ function() {
|
|
1456
1543
|
function Progress(options) {
|
|
1457
1544
|
var _this_options_defaultValue;
|
|
@@ -1484,20 +1571,20 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1484
1571
|
this.disabled = this.options.disabled;
|
|
1485
1572
|
}
|
|
1486
1573
|
var _proto = Progress.prototype;
|
|
1487
|
-
/**
|
|
1488
|
-
* 是否旋转了
|
|
1489
|
-
* @param rotated
|
|
1574
|
+
/**
|
|
1575
|
+
* 是否旋转了
|
|
1576
|
+
* @param rotated
|
|
1490
1577
|
*/ _proto.isRotate = function isRotate(rotated) {
|
|
1491
1578
|
this._isRotated = rotated;
|
|
1492
1579
|
};
|
|
1493
|
-
/**
|
|
1494
|
-
* 销毁 Progress 实例,移除事件监听器
|
|
1495
|
-
* @returns {void}
|
|
1496
|
-
* @memberof Progress
|
|
1497
|
-
* @example
|
|
1498
|
-
* ```ts
|
|
1499
|
-
* progress.destroy();
|
|
1500
|
-
* ```
|
|
1580
|
+
/**
|
|
1581
|
+
* 销毁 Progress 实例,移除事件监听器
|
|
1582
|
+
* @returns {void}
|
|
1583
|
+
* @memberof Progress
|
|
1584
|
+
* @example
|
|
1585
|
+
* ```ts
|
|
1586
|
+
* progress.destroy();
|
|
1587
|
+
* ```
|
|
1501
1588
|
*/ _proto.destroy = function destroy() {
|
|
1502
1589
|
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;
|
|
1503
1590
|
(_this__delegateSliderMouseDown = this._delegateSliderMouseDown) == null ? void 0 : (_this__delegateSliderMouseDown_destroy = _this__delegateSliderMouseDown.destroy) == null ? void 0 : _this__delegateSliderMouseDown_destroy.call(_this__delegateSliderMouseDown);
|
|
@@ -1692,14 +1779,14 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1692
1779
|
},
|
|
1693
1780
|
{
|
|
1694
1781
|
key: "value",
|
|
1695
|
-
get: /**
|
|
1696
|
-
* 获取进度条值
|
|
1697
|
-
* @returns {number} 当前进度条值
|
|
1698
|
-
* @example
|
|
1699
|
-
* ```ts
|
|
1700
|
-
* const value = progress.value; // 获取当前进度条值
|
|
1701
|
-
* console.log(value); // 输出值
|
|
1702
|
-
* ```
|
|
1782
|
+
get: /**
|
|
1783
|
+
* 获取进度条值
|
|
1784
|
+
* @returns {number} 当前进度条值
|
|
1785
|
+
* @example
|
|
1786
|
+
* ```ts
|
|
1787
|
+
* const value = progress.value; // 获取当前进度条值
|
|
1788
|
+
* console.log(value); // 输出值
|
|
1789
|
+
* ```
|
|
1703
1790
|
*/ function get() {
|
|
1704
1791
|
return this._value; //
|
|
1705
1792
|
},
|
|
@@ -1709,14 +1796,14 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1709
1796
|
},
|
|
1710
1797
|
{
|
|
1711
1798
|
key: "percent",
|
|
1712
|
-
get: /**
|
|
1713
|
-
* 获取进度百分比
|
|
1714
|
-
* @returns {number} 当前进度条百分比
|
|
1715
|
-
* @example
|
|
1716
|
-
* ```ts
|
|
1717
|
-
* const percent = progress.percent; // 获取当前进度条百分比
|
|
1718
|
-
* console.log(percent); // 输出百分比
|
|
1719
|
-
* ```
|
|
1799
|
+
get: /**
|
|
1800
|
+
* 获取进度百分比
|
|
1801
|
+
* @returns {number} 当前进度条百分比
|
|
1802
|
+
* @example
|
|
1803
|
+
* ```ts
|
|
1804
|
+
* const percent = progress.percent; // 获取当前进度条百分比
|
|
1805
|
+
* console.log(percent); // 输出百分比
|
|
1806
|
+
* ```
|
|
1720
1807
|
*/ function get() {
|
|
1721
1808
|
return this._percent;
|
|
1722
1809
|
},
|
|
@@ -1779,9 +1866,9 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1779
1866
|
onOpenChange: function onOpenChange() {},
|
|
1780
1867
|
onChange: function onChange() {}
|
|
1781
1868
|
};
|
|
1782
|
-
/**
|
|
1783
|
-
* 音量调节控件
|
|
1784
|
-
* @category Control
|
|
1869
|
+
/**
|
|
1870
|
+
* 音量调节控件
|
|
1871
|
+
* @category Control
|
|
1785
1872
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
1786
1873
|
_inherits$u(Volume, Control);
|
|
1787
1874
|
function Volume(options) {
|
|
@@ -1855,8 +1942,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1855
1942
|
return _this;
|
|
1856
1943
|
}
|
|
1857
1944
|
var _proto = Volume.prototype;
|
|
1858
|
-
/**
|
|
1859
|
-
* 销毁
|
|
1945
|
+
/**
|
|
1946
|
+
* 销毁
|
|
1860
1947
|
*/ _proto.destroy = function destroy() {
|
|
1861
1948
|
var _this__progress_destroy, _this__progress, _this_picker;
|
|
1862
1949
|
(_this__progress = this._progress) == null ? void 0 : (_this__progress_destroy = _this__progress.destroy) == null ? void 0 : _this__progress_destroy.call(_this__progress);
|
|
@@ -1914,8 +2001,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1914
2001
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_VOLUME
|
|
1915
2002
|
});
|
|
1916
2003
|
};
|
|
1917
|
-
/**
|
|
1918
|
-
* 点击 Control 会触发
|
|
2004
|
+
/**
|
|
2005
|
+
* 点击 Control 会触发
|
|
1919
2006
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
1920
2007
|
// this._options.onClick?.(e);
|
|
1921
2008
|
};
|
|
@@ -1932,8 +2019,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1932
2019
|
_create_class$6(Volume, [
|
|
1933
2020
|
{
|
|
1934
2021
|
key: "muted",
|
|
1935
|
-
get: /**
|
|
1936
|
-
* 是否静音
|
|
2022
|
+
get: /**
|
|
2023
|
+
* 是否静音
|
|
1937
2024
|
*/ function get() {
|
|
1938
2025
|
return this._muted;
|
|
1939
2026
|
},
|
|
@@ -1957,8 +2044,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1957
2044
|
},
|
|
1958
2045
|
{
|
|
1959
2046
|
key: "volume",
|
|
1960
|
-
get: /**
|
|
1961
|
-
* 当前音量值(真实值 即使静音)
|
|
2047
|
+
get: /**
|
|
2048
|
+
* 当前音量值(真实值 即使静音)
|
|
1962
2049
|
*/ function get() {
|
|
1963
2050
|
return this._lastVolume;
|
|
1964
2051
|
},
|
|
@@ -1981,8 +2068,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1981
2068
|
},
|
|
1982
2069
|
{
|
|
1983
2070
|
key: "disabled",
|
|
1984
|
-
get: /**
|
|
1985
|
-
* 是否禁用
|
|
2071
|
+
get: /**
|
|
2072
|
+
* 是否禁用
|
|
1986
2073
|
*/ function get() {
|
|
1987
2074
|
return this._disabled;
|
|
1988
2075
|
},
|
|
@@ -2482,9 +2569,9 @@ function _set_prototype_of$t(o, p) {
|
|
|
2482
2569
|
};
|
|
2483
2570
|
return _set_prototype_of$t(o, p);
|
|
2484
2571
|
}
|
|
2485
|
-
/**
|
|
2486
|
-
* 全屏控件
|
|
2487
|
-
* @category Control
|
|
2572
|
+
/**
|
|
2573
|
+
* 全屏控件
|
|
2574
|
+
* @category Control
|
|
2488
2575
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
2489
2576
|
_inherits$t(Fullscreen, Control);
|
|
2490
2577
|
function Fullscreen(options) {
|
|
@@ -2511,8 +2598,8 @@ function _set_prototype_of$t(o, p) {
|
|
|
2511
2598
|
return _this;
|
|
2512
2599
|
}
|
|
2513
2600
|
var _proto = Fullscreen.prototype;
|
|
2514
|
-
/**
|
|
2515
|
-
* 销毁
|
|
2601
|
+
/**
|
|
2602
|
+
* 销毁
|
|
2516
2603
|
*/ _proto.destroy = function destroy() {
|
|
2517
2604
|
var _this__fullscreenUtil;
|
|
2518
2605
|
this.$container.innerHTML = '';
|
|
@@ -2540,8 +2627,8 @@ function _set_prototype_of$t(o, p) {
|
|
|
2540
2627
|
this._render();
|
|
2541
2628
|
this.options.onChange == null ? void 0 : this.options.onChange.call(this.options, info);
|
|
2542
2629
|
};
|
|
2543
|
-
/**
|
|
2544
|
-
* 点击 Control 会触发
|
|
2630
|
+
/**
|
|
2631
|
+
* 点击 Control 会触发
|
|
2545
2632
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
2546
2633
|
if (this.isCurrentFullscreen) {
|
|
2547
2634
|
var _this__fullscreenUtil;
|
|
@@ -2585,9 +2672,9 @@ function _set_prototype_of$s(o, p) {
|
|
|
2585
2672
|
};
|
|
2586
2673
|
return _set_prototype_of$s(o, p);
|
|
2587
2674
|
}
|
|
2588
|
-
/**
|
|
2589
|
-
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2590
|
-
* @category Control
|
|
2675
|
+
/**
|
|
2676
|
+
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2677
|
+
* @category Control
|
|
2591
2678
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
2592
2679
|
_inherits$s(Rec, Control);
|
|
2593
2680
|
function Rec(options) {
|
|
@@ -2606,8 +2693,8 @@ function _set_prototype_of$s(o, p) {
|
|
|
2606
2693
|
return _this;
|
|
2607
2694
|
}
|
|
2608
2695
|
var _proto = Rec.prototype;
|
|
2609
|
-
/**
|
|
2610
|
-
* 销毁
|
|
2696
|
+
/**
|
|
2697
|
+
* 销毁
|
|
2611
2698
|
*/ _proto.destroy = function destroy() {
|
|
2612
2699
|
var _this__delegation;
|
|
2613
2700
|
this.$container.removeEventListener('dblclick', this._onDBlClick);
|
|
@@ -2615,9 +2702,9 @@ function _set_prototype_of$s(o, p) {
|
|
|
2615
2702
|
this._delegation = null;
|
|
2616
2703
|
Control.prototype.destroy.call(this);
|
|
2617
2704
|
};
|
|
2618
|
-
/**
|
|
2619
|
-
* 添加回放类型图标
|
|
2620
|
-
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2705
|
+
/**
|
|
2706
|
+
* 添加回放类型图标
|
|
2707
|
+
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2621
2708
|
*/ _proto.addRecType = function addRecType(id) {
|
|
2622
2709
|
var spanIcon = '';
|
|
2623
2710
|
switch(id){
|
|
@@ -2684,11 +2771,16 @@ function _set_prototype_of$s(o, p) {
|
|
|
2684
2771
|
}
|
|
2685
2772
|
});
|
|
2686
2773
|
};
|
|
2687
|
-
/**
|
|
2688
|
-
* 点击 Control 会触发
|
|
2774
|
+
/**
|
|
2775
|
+
* 点击 Control 会触发
|
|
2689
2776
|
*/ _proto._onControlClick = function _onControlClick(e) {};
|
|
2690
2777
|
return Rec;
|
|
2691
2778
|
}(Control);
|
|
2779
|
+
/** 回放类型切换组,本身就是三种回放之间的切换入口,直播下无意义 */ Rec.supportedPlayTypes = [
|
|
2780
|
+
'rec',
|
|
2781
|
+
'cloudRec',
|
|
2782
|
+
'cloudRecord'
|
|
2783
|
+
];
|
|
2692
2784
|
|
|
2693
2785
|
var zh = {
|
|
2694
2786
|
391001: '取流地址或端口非法',
|
|
@@ -3371,8 +3463,8 @@ var en = {
|
|
|
3371
3463
|
}
|
|
3372
3464
|
};
|
|
3373
3465
|
|
|
3374
|
-
/**
|
|
3375
|
-
* flv 预览
|
|
3466
|
+
/**
|
|
3467
|
+
* flv 预览
|
|
3376
3468
|
*/ var hlsLiveTemplate = {
|
|
3377
3469
|
autoFocus: 3,
|
|
3378
3470
|
// poster:
|
|
@@ -3424,8 +3516,8 @@ var en = {
|
|
|
3424
3516
|
}
|
|
3425
3517
|
};
|
|
3426
3518
|
|
|
3427
|
-
/**
|
|
3428
|
-
* flv 预览
|
|
3519
|
+
/**
|
|
3520
|
+
* flv 预览
|
|
3429
3521
|
*/ var hlsRecTemplate = {
|
|
3430
3522
|
autoFocus: 3,
|
|
3431
3523
|
// poster:
|
|
@@ -3483,8 +3575,8 @@ var en = {
|
|
|
3483
3575
|
}
|
|
3484
3576
|
};
|
|
3485
3577
|
|
|
3486
|
-
/**
|
|
3487
|
-
* pc 预览
|
|
3578
|
+
/**
|
|
3579
|
+
* pc 预览
|
|
3488
3580
|
*/ var pcLive = {
|
|
3489
3581
|
autoFocus: 3,
|
|
3490
3582
|
header: {
|
|
@@ -3583,8 +3675,8 @@ var en = {
|
|
|
3583
3675
|
}
|
|
3584
3676
|
};
|
|
3585
3677
|
|
|
3586
|
-
/**
|
|
3587
|
-
* pc 回放
|
|
3678
|
+
/**
|
|
3679
|
+
* pc 回放
|
|
3588
3680
|
*/ var pcRec = {
|
|
3589
3681
|
header: {
|
|
3590
3682
|
// color: DEFAULT_COLOR,
|
|
@@ -3695,8 +3787,8 @@ var en = {
|
|
|
3695
3787
|
}
|
|
3696
3788
|
};
|
|
3697
3789
|
|
|
3698
|
-
/**
|
|
3699
|
-
* mobile 预览
|
|
3790
|
+
/**
|
|
3791
|
+
* mobile 预览
|
|
3700
3792
|
*/ var mobileLive = {
|
|
3701
3793
|
header: {
|
|
3702
3794
|
// color: DEFAULT_COLOR,
|
|
@@ -3784,8 +3876,8 @@ var en = {
|
|
|
3784
3876
|
}
|
|
3785
3877
|
};
|
|
3786
3878
|
|
|
3787
|
-
/**
|
|
3788
|
-
* mobile 回放
|
|
3879
|
+
/**
|
|
3880
|
+
* mobile 回放
|
|
3789
3881
|
*/ var mobileRec = {
|
|
3790
3882
|
header: {
|
|
3791
3883
|
// color: DEFAULT_COLOR,
|
|
@@ -3879,8 +3971,8 @@ var en = {
|
|
|
3879
3971
|
}
|
|
3880
3972
|
};
|
|
3881
3973
|
|
|
3882
|
-
/**
|
|
3883
|
-
* 安防版(预览/回放)
|
|
3974
|
+
/**
|
|
3975
|
+
* 安防版(预览/回放)
|
|
3884
3976
|
*/ var security = {
|
|
3885
3977
|
header: {
|
|
3886
3978
|
// color: DEFAULT_COLOR,
|
|
@@ -3956,8 +4048,8 @@ var en = {
|
|
|
3956
4048
|
}
|
|
3957
4049
|
};
|
|
3958
4050
|
|
|
3959
|
-
/**
|
|
3960
|
-
* 语音版(预览)
|
|
4051
|
+
/**
|
|
4052
|
+
* 语音版(预览)
|
|
3961
4053
|
*/ var voice = {
|
|
3962
4054
|
header: {
|
|
3963
4055
|
// color: DEFAULT_COLOR,
|
|
@@ -4009,11 +4101,11 @@ var en = {
|
|
|
4009
4101
|
}
|
|
4010
4102
|
};
|
|
4011
4103
|
|
|
4012
|
-
/**
|
|
4013
|
-
* standard 做特殊处理
|
|
4014
|
-
*
|
|
4015
|
-
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
4016
|
-
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
4104
|
+
/**
|
|
4105
|
+
* standard 做特殊处理
|
|
4106
|
+
*
|
|
4107
|
+
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
4108
|
+
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
4017
4109
|
*/ var TEMPLATES = {
|
|
4018
4110
|
pcLive: pcLive,
|
|
4019
4111
|
pcRec: pcRec,
|
|
@@ -4043,9 +4135,9 @@ function _set_prototype_of$r(o, p) {
|
|
|
4043
4135
|
};
|
|
4044
4136
|
return _set_prototype_of$r(o, p);
|
|
4045
4137
|
}
|
|
4046
|
-
/**
|
|
4047
|
-
* 截图控件
|
|
4048
|
-
* @category Content
|
|
4138
|
+
/**
|
|
4139
|
+
* 截图控件
|
|
4140
|
+
* @category Content
|
|
4049
4141
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
4050
4142
|
_inherits$r(Content, EventEmitter);
|
|
4051
4143
|
function Content(options) {
|
|
@@ -4075,11 +4167,11 @@ function _set_prototype_of$r(o, p) {
|
|
|
4075
4167
|
return _this;
|
|
4076
4168
|
}
|
|
4077
4169
|
var _proto = Content.prototype;
|
|
4078
|
-
/**
|
|
4079
|
-
* 重新画面区域
|
|
4080
|
-
* @param {number} originWidth 画面宽度
|
|
4081
|
-
* @param {number} originHeight 画面高度
|
|
4082
|
-
* @returns {void}
|
|
4170
|
+
/**
|
|
4171
|
+
* 重新画面区域
|
|
4172
|
+
* @param {number} originWidth 画面宽度
|
|
4173
|
+
* @param {number} originHeight 画面高度
|
|
4174
|
+
* @returns {void}
|
|
4083
4175
|
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
4084
4176
|
if (originWidth === void 0) originWidth = 0;
|
|
4085
4177
|
if (originHeight === void 0) originHeight = 0;
|
|
@@ -4192,9 +4284,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4192
4284
|
};
|
|
4193
4285
|
return _set_prototype_of$q(o, p);
|
|
4194
4286
|
}
|
|
4195
|
-
/**
|
|
4196
|
-
* 更多控件
|
|
4197
|
-
* @category Control
|
|
4287
|
+
/**
|
|
4288
|
+
* 更多控件
|
|
4289
|
+
* @category Control
|
|
4198
4290
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
4199
4291
|
_inherits$q(More, Control);
|
|
4200
4292
|
function More(options) {
|
|
@@ -4240,9 +4332,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4240
4332
|
}
|
|
4241
4333
|
// debug
|
|
4242
4334
|
};
|
|
4243
|
-
/**
|
|
4244
|
-
* 添加
|
|
4245
|
-
* @param control
|
|
4335
|
+
/**
|
|
4336
|
+
* 添加
|
|
4337
|
+
* @param control
|
|
4246
4338
|
*/ _proto.add = function add(key, part, control, props) {
|
|
4247
4339
|
this.list.unshift({
|
|
4248
4340
|
part: part,
|
|
@@ -4252,9 +4344,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4252
4344
|
height: props.height
|
|
4253
4345
|
});
|
|
4254
4346
|
};
|
|
4255
|
-
/**
|
|
4256
|
-
* 移除
|
|
4257
|
-
* @param control
|
|
4347
|
+
/**
|
|
4348
|
+
* 移除
|
|
4349
|
+
* @param control
|
|
4258
4350
|
*/ _proto.remove = function remove(control) {
|
|
4259
4351
|
var index = this.list.findIndex(function(item) {
|
|
4260
4352
|
return item.control === control;
|
|
@@ -4274,20 +4366,20 @@ function _set_prototype_of$q(o, p) {
|
|
|
4274
4366
|
}
|
|
4275
4367
|
Control.prototype.destroy.call(this);
|
|
4276
4368
|
};
|
|
4277
|
-
/**
|
|
4278
|
-
* 点击 Control 会触发
|
|
4369
|
+
/**
|
|
4370
|
+
* 点击 Control 会触发
|
|
4279
4371
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
4280
4372
|
// this._options.onClick?.(e);
|
|
4281
4373
|
};
|
|
4282
4374
|
return More;
|
|
4283
4375
|
}(Control);
|
|
4284
4376
|
|
|
4285
|
-
/**
|
|
4286
|
-
* 函数防抖
|
|
4287
|
-
* @param {Function} func
|
|
4288
|
-
* @param {number} wait
|
|
4289
|
-
* @typeParam T - 函数类型
|
|
4290
|
-
* @returns {Function}
|
|
4377
|
+
/**
|
|
4378
|
+
* 函数防抖
|
|
4379
|
+
* @param {Function} func
|
|
4380
|
+
* @param {number} wait
|
|
4381
|
+
* @typeParam T - 函数类型
|
|
4382
|
+
* @returns {Function}
|
|
4291
4383
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
4292
4384
|
function debounce(func, wait) {
|
|
4293
4385
|
var timeout;
|
|
@@ -4917,23 +5009,23 @@ var ignoreList = [
|
|
|
4917
5009
|
});
|
|
4918
5010
|
}
|
|
4919
5011
|
|
|
4920
|
-
/**
|
|
4921
|
-
* 重新调整播放器窗口大小
|
|
4922
|
-
*
|
|
4923
|
-
* Adjust the player window size
|
|
4924
|
-
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
4925
|
-
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
4926
|
-
* @since 0.0.1
|
|
4927
|
-
* @example
|
|
4928
|
-
* ```ts
|
|
4929
|
-
* theme.resize(600, 400) // 600px * 400px
|
|
4930
|
-
* theme.resize("600px", "400px") // 600px * 400px
|
|
4931
|
-
* theme.resize("50%", "1vh")
|
|
4932
|
-
* theme.resize("2em", "2rem")
|
|
4933
|
-
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
4934
|
-
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
4935
|
-
* ```
|
|
4936
|
-
* @returns {void}
|
|
5012
|
+
/**
|
|
5013
|
+
* 重新调整播放器窗口大小
|
|
5014
|
+
*
|
|
5015
|
+
* Adjust the player window size
|
|
5016
|
+
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
5017
|
+
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
5018
|
+
* @since 0.0.1
|
|
5019
|
+
* @example
|
|
5020
|
+
* ```ts
|
|
5021
|
+
* theme.resize(600, 400) // 600px * 400px
|
|
5022
|
+
* theme.resize("600px", "400px") // 600px * 400px
|
|
5023
|
+
* theme.resize("50%", "1vh")
|
|
5024
|
+
* theme.resize("2em", "2rem")
|
|
5025
|
+
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
5026
|
+
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
5027
|
+
* ```
|
|
5028
|
+
* @returns {void}
|
|
4937
5029
|
*/ function _resize(theme, width, height) {
|
|
4938
5030
|
var cssText = '';
|
|
4939
5031
|
if (/^\d+(\.\d+)?$/.test(width + '')) {
|
|
@@ -4996,9 +5088,9 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
4996
5088
|
open: false,
|
|
4997
5089
|
max: 8
|
|
4998
5090
|
};
|
|
4999
|
-
/**
|
|
5000
|
-
* 电子放大控件
|
|
5001
|
-
* @category Control
|
|
5091
|
+
/**
|
|
5092
|
+
* 电子放大控件
|
|
5093
|
+
* @category Control
|
|
5002
5094
|
*/ var Zoom = /*#__PURE__*/ function(Control) {
|
|
5003
5095
|
_inherits$p(Zoom, Control);
|
|
5004
5096
|
function Zoom(options) {
|
|
@@ -5075,8 +5167,8 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
5075
5167
|
}
|
|
5076
5168
|
Control.prototype.destroy.call(this);
|
|
5077
5169
|
};
|
|
5078
|
-
/**
|
|
5079
|
-
* 点击 Control 会触发
|
|
5170
|
+
/**
|
|
5171
|
+
* 点击 Control 会触发
|
|
5080
5172
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
5081
5173
|
this.active = !this.active;
|
|
5082
5174
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -5096,8 +5188,8 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
5096
5188
|
},
|
|
5097
5189
|
{
|
|
5098
5190
|
key: "active",
|
|
5099
|
-
get: /**
|
|
5100
|
-
* 是否激活
|
|
5191
|
+
get: /**
|
|
5192
|
+
* 是否激活
|
|
5101
5193
|
*/ function get() {
|
|
5102
5194
|
return this._active;
|
|
5103
5195
|
},
|
|
@@ -5746,8 +5838,8 @@ function rgbOrHexToRgbaWithOpacity(color, opacity) {
|
|
|
5746
5838
|
return '';
|
|
5747
5839
|
}
|
|
5748
5840
|
|
|
5749
|
-
/**
|
|
5750
|
-
* Header
|
|
5841
|
+
/**
|
|
5842
|
+
* Header
|
|
5751
5843
|
*/ var Component = /*#__PURE__*/ function() {
|
|
5752
5844
|
function Component(options) {
|
|
5753
5845
|
if (options === void 0) options = {};
|
|
@@ -5799,8 +5891,8 @@ function rgbOrHexToRgbaWithOpacity(color, opacity) {
|
|
|
5799
5891
|
this.$popupContainer.appendChild(this.$container);
|
|
5800
5892
|
}
|
|
5801
5893
|
var _proto = Component.prototype;
|
|
5802
|
-
/**
|
|
5803
|
-
* 销毁 header
|
|
5894
|
+
/**
|
|
5895
|
+
* 销毁 header
|
|
5804
5896
|
*/ _proto.destroy = function destroy() {
|
|
5805
5897
|
var _this_$popupContainer;
|
|
5806
5898
|
(_this_$popupContainer = this.$popupContainer) == null ? void 0 : _this_$popupContainer.removeChild(this.$container);
|
|
@@ -6076,10 +6168,10 @@ function _set_prototype_of$m(o, p) {
|
|
|
6076
6168
|
};
|
|
6077
6169
|
return _set_prototype_of$m(o, p);
|
|
6078
6170
|
}
|
|
6079
|
-
/**
|
|
6080
|
-
* 全局全屏
|
|
6081
|
-
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
6082
|
-
* @category Control
|
|
6171
|
+
/**
|
|
6172
|
+
* 全局全屏
|
|
6173
|
+
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
6174
|
+
* @category Control
|
|
6083
6175
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
6084
6176
|
_inherits$m(GlobalFullscreen, Fullscreen);
|
|
6085
6177
|
function GlobalFullscreen(options) {
|
|
@@ -6097,8 +6189,8 @@ function _set_prototype_of$m(o, p) {
|
|
|
6097
6189
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_GLOBAL_FULLSCREEN
|
|
6098
6190
|
});
|
|
6099
6191
|
};
|
|
6100
|
-
/**
|
|
6101
|
-
* 点击 Control 会触发
|
|
6192
|
+
/**
|
|
6193
|
+
* 点击 Control 会触发
|
|
6102
6194
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
6103
6195
|
// 网页全屏的情况下 还可以执行全局全屏
|
|
6104
6196
|
if (this.isCurrentFullscreen && this._$rootContainer.classList.contains("" + PREFIX_CLASS + "-global-fullscreen")) {
|
|
@@ -6144,9 +6236,9 @@ function _set_prototype_of$l(o, p) {
|
|
|
6144
6236
|
};
|
|
6145
6237
|
return _set_prototype_of$l(o, p);
|
|
6146
6238
|
}
|
|
6147
|
-
/**
|
|
6148
|
-
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
6149
|
-
* @category Control
|
|
6239
|
+
/**
|
|
6240
|
+
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
6241
|
+
* @category Control
|
|
6150
6242
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
6151
6243
|
_inherits$l(CapturePicture, Control);
|
|
6152
6244
|
function CapturePicture(options) {
|
|
@@ -6177,8 +6269,8 @@ function _set_prototype_of$l(o, p) {
|
|
|
6177
6269
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CAPTURE
|
|
6178
6270
|
});
|
|
6179
6271
|
};
|
|
6180
|
-
/**
|
|
6181
|
-
* 点击 Control 会触发
|
|
6272
|
+
/**
|
|
6273
|
+
* 点击 Control 会触发
|
|
6182
6274
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6183
6275
|
var _this = this;
|
|
6184
6276
|
var _this_options_type, _this_options_cloudRecUpload;
|
|
@@ -6247,9 +6339,9 @@ function _set_prototype_of$k(o, p) {
|
|
|
6247
6339
|
};
|
|
6248
6340
|
return _set_prototype_of$k(o, p);
|
|
6249
6341
|
}
|
|
6250
|
-
/**
|
|
6251
|
-
* 云台控件
|
|
6252
|
-
* @category Control
|
|
6342
|
+
/**
|
|
6343
|
+
* 云台控件
|
|
6344
|
+
* @category Control
|
|
6253
6345
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
6254
6346
|
_inherits$k(Ptz, Control);
|
|
6255
6347
|
function Ptz(options) {
|
|
@@ -6338,8 +6430,8 @@ function _set_prototype_of$k(o, p) {
|
|
|
6338
6430
|
}
|
|
6339
6431
|
};
|
|
6340
6432
|
};
|
|
6341
|
-
/**
|
|
6342
|
-
* 点击 Control 会触发
|
|
6433
|
+
/**
|
|
6434
|
+
* 点击 Control 会触发
|
|
6343
6435
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6344
6436
|
Control.prototype._onControlClick.call(this, e);
|
|
6345
6437
|
this.active = !this.active;
|
|
@@ -6384,6 +6476,14 @@ function _set_prototype_of$k(o, p) {
|
|
|
6384
6476
|
]);
|
|
6385
6477
|
return Ptz;
|
|
6386
6478
|
}(Control);
|
|
6479
|
+
/**
|
|
6480
|
+
* 云台是对设备的实时控制,回放场景下转动云台不影响已录制的画面。
|
|
6481
|
+
*
|
|
6482
|
+
* 依据是语义与 mobileRec 模板(不含云台)。`pcRec` 模板的配置里虽然还留着 `pantile`,
|
|
6483
|
+
* 但实测在回放地址下它不会被渲染出来,因此这里声明为 live-only 不会对内置模板误报。
|
|
6484
|
+
*/ Ptz.supportedPlayTypes = [
|
|
6485
|
+
'live'
|
|
6486
|
+
];
|
|
6387
6487
|
|
|
6388
6488
|
function formatTime(seconds, format) {
|
|
6389
6489
|
if (format === void 0) format = 'MM:SS';
|
|
@@ -6442,14 +6542,14 @@ function _set_prototype_of$j(o, p) {
|
|
|
6442
6542
|
var RECORD_DEFAULT_OPTIONS = {
|
|
6443
6543
|
maxDuration: 3600
|
|
6444
6544
|
};
|
|
6445
|
-
/**
|
|
6446
|
-
* 录制控件,点击开始录制,再次点击停止录制,
|
|
6447
|
-
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
6448
|
-
*
|
|
6449
|
-
* 注意:
|
|
6450
|
-
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
6451
|
-
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
6452
|
-
* @category Control
|
|
6545
|
+
/**
|
|
6546
|
+
* 录制控件,点击开始录制,再次点击停止录制,
|
|
6547
|
+
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
6548
|
+
*
|
|
6549
|
+
* 注意:
|
|
6550
|
+
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
6551
|
+
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
6552
|
+
* @category Control
|
|
6453
6553
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
6454
6554
|
_inherits$j(Record, Control);
|
|
6455
6555
|
function Record(options) {
|
|
@@ -6464,16 +6564,16 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6464
6564
|
return _this;
|
|
6465
6565
|
}
|
|
6466
6566
|
var _proto = Record.prototype;
|
|
6467
|
-
/**
|
|
6468
|
-
* 渲染图标
|
|
6567
|
+
/**
|
|
6568
|
+
* 渲染图标
|
|
6469
6569
|
*/ _proto._render = function _render() {
|
|
6470
6570
|
var _this_locale;
|
|
6471
6571
|
this.$container.innerHTML = IconComponents.record({
|
|
6472
6572
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_RECORDVIDEO
|
|
6473
6573
|
});
|
|
6474
6574
|
};
|
|
6475
|
-
/**
|
|
6476
|
-
* 渲染计时器
|
|
6575
|
+
/**
|
|
6576
|
+
* 渲染计时器
|
|
6477
6577
|
*/ _proto._renderTimer = function _renderTimer() {
|
|
6478
6578
|
var _this = this;
|
|
6479
6579
|
var _this__options_rootContainer, _this__options;
|
|
@@ -6502,8 +6602,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6502
6602
|
this._destroyTimer();
|
|
6503
6603
|
Control.prototype.destroy.call(this);
|
|
6504
6604
|
};
|
|
6505
|
-
/**
|
|
6506
|
-
* 销毁定时器和销毁节点
|
|
6605
|
+
/**
|
|
6606
|
+
* 销毁定时器和销毁节点
|
|
6507
6607
|
*/ _proto._destroyTimer = function _destroyTimer() {
|
|
6508
6608
|
this._seconds = 0;
|
|
6509
6609
|
if (this._timer) {
|
|
@@ -6518,8 +6618,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6518
6618
|
}
|
|
6519
6619
|
this._active = false;
|
|
6520
6620
|
};
|
|
6521
|
-
/**
|
|
6522
|
-
* 点击 Control 会触发
|
|
6621
|
+
/**
|
|
6622
|
+
* 点击 Control 会触发
|
|
6523
6623
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6524
6624
|
this.active = !this.active;
|
|
6525
6625
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -6527,8 +6627,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6527
6627
|
_create_class$3(Record, [
|
|
6528
6628
|
{
|
|
6529
6629
|
key: "active",
|
|
6530
|
-
get: /**
|
|
6531
|
-
* 是否激活
|
|
6630
|
+
get: /**
|
|
6631
|
+
* 是否激活
|
|
6532
6632
|
*/ function get() {
|
|
6533
6633
|
return this._active;
|
|
6534
6634
|
},
|
|
@@ -6721,14 +6821,14 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6721
6821
|
};
|
|
6722
6822
|
}
|
|
6723
6823
|
}
|
|
6724
|
-
/**
|
|
6725
|
-
* 对讲控件
|
|
6726
|
-
*
|
|
6727
|
-
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
6728
|
-
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
6729
|
-
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
6730
|
-
*
|
|
6731
|
-
* @category Control
|
|
6824
|
+
/**
|
|
6825
|
+
* 对讲控件
|
|
6826
|
+
*
|
|
6827
|
+
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
6828
|
+
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
6829
|
+
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
6830
|
+
*
|
|
6831
|
+
* @category Control
|
|
6732
6832
|
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
6733
6833
|
_inherits$i(Talk, Control);
|
|
6734
6834
|
function Talk(options) {
|
|
@@ -6771,16 +6871,16 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6771
6871
|
Control.prototype.reset.call(this, hide);
|
|
6772
6872
|
}
|
|
6773
6873
|
};
|
|
6774
|
-
/**
|
|
6775
|
-
* 销毁对讲
|
|
6874
|
+
/**
|
|
6875
|
+
* 销毁对讲
|
|
6776
6876
|
*/ _proto.destroy = function destroy() {
|
|
6777
6877
|
if (this.active) {
|
|
6778
6878
|
this.reset();
|
|
6779
6879
|
}
|
|
6780
6880
|
Control.prototype.destroy.call(this);
|
|
6781
6881
|
};
|
|
6782
|
-
/**
|
|
6783
|
-
* 点击 Control 会触发
|
|
6882
|
+
/**
|
|
6883
|
+
* 点击 Control 会触发
|
|
6784
6884
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6785
6885
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
6786
6886
|
return Control.prototype._onControlClick;
|
|
@@ -6800,13 +6900,13 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6800
6900
|
_create_class$2(Talk, [
|
|
6801
6901
|
{
|
|
6802
6902
|
key: "value",
|
|
6803
|
-
get: /**
|
|
6804
|
-
* 获取当前值
|
|
6903
|
+
get: /**
|
|
6904
|
+
* 获取当前值
|
|
6805
6905
|
*/ function get() {
|
|
6806
6906
|
return this._value;
|
|
6807
6907
|
},
|
|
6808
|
-
set: /**
|
|
6809
|
-
* 设置当前值 [0-1]
|
|
6908
|
+
set: /**
|
|
6909
|
+
* 设置当前值 [0-1]
|
|
6810
6910
|
*/ function set(value) {
|
|
6811
6911
|
// 没有激活状态,则不处理
|
|
6812
6912
|
if (!this.active) {
|
|
@@ -6836,6 +6936,9 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6836
6936
|
]);
|
|
6837
6937
|
return Talk;
|
|
6838
6938
|
}(Control);
|
|
6939
|
+
/** 对讲是实时上行通道,只有直播场景有意义 */ Talk.supportedPlayTypes = [
|
|
6940
|
+
'live'
|
|
6941
|
+
];
|
|
6839
6942
|
|
|
6840
6943
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
6841
6944
|
try {
|
|
@@ -6992,12 +7095,12 @@ function _ts_generator$3(thisArg, body) {
|
|
|
6992
7095
|
};
|
|
6993
7096
|
}
|
|
6994
7097
|
}
|
|
6995
|
-
/**
|
|
6996
|
-
* 语音广播控件
|
|
6997
|
-
*
|
|
6998
|
-
* 用于触发语音广播功能的按钮控件
|
|
6999
|
-
*
|
|
7000
|
-
* @category Control
|
|
7098
|
+
/**
|
|
7099
|
+
* 语音广播控件
|
|
7100
|
+
*
|
|
7101
|
+
* 用于触发语音广播功能的按钮控件
|
|
7102
|
+
*
|
|
7103
|
+
* @category Control
|
|
7001
7104
|
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
7002
7105
|
_inherits$h(Broadcast, Control);
|
|
7003
7106
|
function Broadcast(options) {
|
|
@@ -7037,16 +7140,16 @@ function _ts_generator$3(thisArg, body) {
|
|
|
7037
7140
|
Control.prototype.reset.call(this, hide);
|
|
7038
7141
|
}
|
|
7039
7142
|
};
|
|
7040
|
-
/**
|
|
7041
|
-
* 销毁语音广播控件
|
|
7143
|
+
/**
|
|
7144
|
+
* 销毁语音广播控件
|
|
7042
7145
|
*/ _proto.destroy = function destroy() {
|
|
7043
7146
|
if (this.active) {
|
|
7044
7147
|
this.reset();
|
|
7045
7148
|
}
|
|
7046
7149
|
Control.prototype.destroy.call(this);
|
|
7047
7150
|
};
|
|
7048
|
-
/**
|
|
7049
|
-
* 点击 Control 会触发
|
|
7151
|
+
/**
|
|
7152
|
+
* 点击 Control 会触发
|
|
7050
7153
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7051
7154
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
7052
7155
|
return Control.prototype._onControlClick;
|
|
@@ -7067,6 +7170,9 @@ function _ts_generator$3(thisArg, body) {
|
|
|
7067
7170
|
};
|
|
7068
7171
|
return Broadcast;
|
|
7069
7172
|
}(Control);
|
|
7173
|
+
/** 语音广播是实时上行通道,只有直播场景有意义(另需 `sdkType === 'base'`,见构造函数) */ Broadcast.supportedPlayTypes = [
|
|
7174
|
+
'live'
|
|
7175
|
+
];
|
|
7070
7176
|
|
|
7071
7177
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7072
7178
|
try {
|
|
@@ -7223,12 +7329,12 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7223
7329
|
};
|
|
7224
7330
|
}
|
|
7225
7331
|
}
|
|
7226
|
-
/**
|
|
7227
|
-
* AI对话框控件
|
|
7228
|
-
*
|
|
7229
|
-
* 用于触发AI对话框功能的按钮控件
|
|
7230
|
-
*
|
|
7231
|
-
* @category Control
|
|
7332
|
+
/**
|
|
7333
|
+
* AI对话框控件
|
|
7334
|
+
*
|
|
7335
|
+
* 用于触发AI对话框功能的按钮控件
|
|
7336
|
+
*
|
|
7337
|
+
* @category Control
|
|
7232
7338
|
*/ var AIChat = /*#__PURE__*/ function(Control) {
|
|
7233
7339
|
_inherits$g(AIChat, Control);
|
|
7234
7340
|
function AIChat(options) {
|
|
@@ -7269,16 +7375,16 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7269
7375
|
Control.prototype.reset.call(this, hide);
|
|
7270
7376
|
}
|
|
7271
7377
|
};
|
|
7272
|
-
/**
|
|
7273
|
-
* 销毁AI对话框控件
|
|
7378
|
+
/**
|
|
7379
|
+
* 销毁AI对话框控件
|
|
7274
7380
|
*/ _proto.destroy = function destroy() {
|
|
7275
7381
|
if (this.active) {
|
|
7276
7382
|
this.reset();
|
|
7277
7383
|
}
|
|
7278
7384
|
Control.prototype.destroy.call(this);
|
|
7279
7385
|
};
|
|
7280
|
-
/**
|
|
7281
|
-
* 点击 Control 会触发
|
|
7386
|
+
/**
|
|
7387
|
+
* 点击 Control 会触发
|
|
7282
7388
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7283
7389
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
7284
7390
|
return Control.prototype._onControlClick;
|
|
@@ -7299,6 +7405,14 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7299
7405
|
};
|
|
7300
7406
|
return AIChat;
|
|
7301
7407
|
}(Control);
|
|
7408
|
+
/**
|
|
7409
|
+
* 只在云存储回放下可用。
|
|
7410
|
+
*
|
|
7411
|
+
* 这是全部控件里证据最强的一条:构造函数里已显式要求 `recType === 'cloud'`
|
|
7412
|
+
* 且排除 `busType === '7'`(云录制),不满足时直接 `display: none`。
|
|
7413
|
+
*/ AIChat.supportedPlayTypes = [
|
|
7414
|
+
'cloudRec'
|
|
7415
|
+
];
|
|
7302
7416
|
|
|
7303
7417
|
function _extends$e() {
|
|
7304
7418
|
_extends$e = Object.assign || function assign(target) {
|
|
@@ -7330,12 +7444,12 @@ function _set_prototype_of$f(o, p) {
|
|
|
7330
7444
|
};
|
|
7331
7445
|
return _set_prototype_of$f(o, p);
|
|
7332
7446
|
}
|
|
7333
|
-
/**
|
|
7334
|
-
* 直播按钮控件
|
|
7335
|
-
*
|
|
7336
|
-
* 点击切换到直播模式
|
|
7337
|
-
*
|
|
7338
|
-
* @category Control
|
|
7447
|
+
/**
|
|
7448
|
+
* 直播按钮控件
|
|
7449
|
+
*
|
|
7450
|
+
* 点击切换到直播模式
|
|
7451
|
+
*
|
|
7452
|
+
* @category Control
|
|
7339
7453
|
*/ var Live = /*#__PURE__*/ function(Control) {
|
|
7340
7454
|
_inherits$f(Live, Control);
|
|
7341
7455
|
function Live(options) {
|
|
@@ -7357,9 +7471,9 @@ function _set_prototype_of$f(o, p) {
|
|
|
7357
7471
|
return _this;
|
|
7358
7472
|
}
|
|
7359
7473
|
var _proto = Live.prototype;
|
|
7360
|
-
/**
|
|
7361
|
-
* 根据 urlInfo 同步激活状态
|
|
7362
|
-
* 在初始化和播放地址切换后调用
|
|
7474
|
+
/**
|
|
7475
|
+
* 根据 urlInfo 同步激活状态
|
|
7476
|
+
* 在初始化和播放地址切换后调用
|
|
7363
7477
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
7364
7478
|
var shouldBeActive = !!(urlInfo && urlInfo.type === 'live');
|
|
7365
7479
|
this.active = shouldBeActive;
|
|
@@ -7370,13 +7484,13 @@ function _set_prototype_of$f(o, p) {
|
|
|
7370
7484
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_LIVE) || '直播'
|
|
7371
7485
|
});
|
|
7372
7486
|
};
|
|
7373
|
-
/**
|
|
7374
|
-
* 销毁
|
|
7487
|
+
/**
|
|
7488
|
+
* 销毁
|
|
7375
7489
|
*/ _proto.destroy = function destroy() {
|
|
7376
7490
|
Control.prototype.destroy.call(this);
|
|
7377
7491
|
};
|
|
7378
|
-
/**
|
|
7379
|
-
* 点击 Control 会触发
|
|
7492
|
+
/**
|
|
7493
|
+
* 点击 Control 会触发
|
|
7380
7494
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7381
7495
|
var _this__options_onChange, _this__options;
|
|
7382
7496
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -7421,12 +7535,12 @@ function _set_prototype_of$e(o, p) {
|
|
|
7421
7535
|
};
|
|
7422
7536
|
return _set_prototype_of$e(o, p);
|
|
7423
7537
|
}
|
|
7424
|
-
/**
|
|
7425
|
-
* 回放下拉控件
|
|
7426
|
-
*
|
|
7427
|
-
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
7428
|
-
*
|
|
7429
|
-
* @category Control
|
|
7538
|
+
/**
|
|
7539
|
+
* 回放下拉控件
|
|
7540
|
+
*
|
|
7541
|
+
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
7542
|
+
*
|
|
7543
|
+
* @category Control
|
|
7430
7544
|
*/ var RecDropdown = /*#__PURE__*/ function(Control) {
|
|
7431
7545
|
_inherits$e(RecDropdown, Control);
|
|
7432
7546
|
function RecDropdown(options) {
|
|
@@ -7443,16 +7557,16 @@ function _set_prototype_of$e(o, p) {
|
|
|
7443
7557
|
_this.$container.style.display = 'none';
|
|
7444
7558
|
}
|
|
7445
7559
|
// 初始化时根据 urlInfo 确定当前回放类型和激活状态
|
|
7446
|
-
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || '
|
|
7560
|
+
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || '';
|
|
7447
7561
|
_this._syncActiveByUrlInfo((_this___options_props1 = _this.__options.props) == null ? void 0 : _this___options_props1.urlInfo);
|
|
7448
7562
|
_this._render();
|
|
7449
7563
|
_this._initPicker();
|
|
7450
7564
|
return _this;
|
|
7451
7565
|
}
|
|
7452
7566
|
var _proto = RecDropdown.prototype;
|
|
7453
|
-
/**
|
|
7454
|
-
* 根据 urlInfo 同步激活状态和回放类型
|
|
7455
|
-
* 在初始化和播放地址切换后调用
|
|
7567
|
+
/**
|
|
7568
|
+
* 根据 urlInfo 同步激活状态和回放类型
|
|
7569
|
+
* 在初始化和播放地址切换后调用
|
|
7456
7570
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
7457
7571
|
if (urlInfo && urlInfo.type === 'rec') {
|
|
7458
7572
|
var _urlInfo_searchParams1;
|
|
@@ -7529,8 +7643,8 @@ function _set_prototype_of$e(o, p) {
|
|
|
7529
7643
|
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS + "-active");
|
|
7530
7644
|
}
|
|
7531
7645
|
};
|
|
7532
|
-
/**
|
|
7533
|
-
* 销毁
|
|
7646
|
+
/**
|
|
7647
|
+
* 销毁
|
|
7534
7648
|
*/ _proto.destroy = function destroy() {
|
|
7535
7649
|
var _this__delegation_destroy, _this__delegation;
|
|
7536
7650
|
(_this__delegation = this._delegation) == null ? void 0 : (_this__delegation_destroy = _this__delegation.destroy) == null ? void 0 : _this__delegation_destroy.call(_this__delegation);
|
|
@@ -7542,8 +7656,8 @@ function _set_prototype_of$e(o, p) {
|
|
|
7542
7656
|
}
|
|
7543
7657
|
Control.prototype.destroy.call(this);
|
|
7544
7658
|
};
|
|
7545
|
-
/**
|
|
7546
|
-
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
7659
|
+
/**
|
|
7660
|
+
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
7547
7661
|
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7548
7662
|
_proto._onControlClick = function _onControlClick(_e) {
|
|
7549
7663
|
// picker 自行处理 click/hover,这里不额外处理
|
|
@@ -7675,7 +7789,6 @@ function _set_prototype_of$d(o, p) {
|
|
|
7675
7789
|
if (this._panelOpen) {
|
|
7676
7790
|
this.emit(EVENTS.control.recListChange, false);
|
|
7677
7791
|
}
|
|
7678
|
-
this.emit(EVENTS.control.recListDestroy);
|
|
7679
7792
|
if (this._modal) {
|
|
7680
7793
|
this._modal.destroy();
|
|
7681
7794
|
this._modal = null;
|
|
@@ -7707,6 +7820,16 @@ function _set_prototype_of$d(o, p) {
|
|
|
7707
7820
|
};
|
|
7708
7821
|
return RecList;
|
|
7709
7822
|
}(Control);
|
|
7823
|
+
/**
|
|
7824
|
+
* 录像片段列表,只对回放有意义。
|
|
7825
|
+
*
|
|
7826
|
+
* 依据是内置模板分布(仅 pcRec 含 `recList`)与语义。若后续确认本地卡回放
|
|
7827
|
+
* 没有片段列表接口,把 `'rec'` 去掉即可。
|
|
7828
|
+
*/ RecList.supportedPlayTypes = [
|
|
7829
|
+
'rec',
|
|
7830
|
+
'cloudRec',
|
|
7831
|
+
'cloudRecord'
|
|
7832
|
+
];
|
|
7710
7833
|
|
|
7711
7834
|
function _extends$b() {
|
|
7712
7835
|
_extends$b = Object.assign || function assign(target) {
|
|
@@ -7738,12 +7861,12 @@ function _set_prototype_of$c(o, p) {
|
|
|
7738
7861
|
};
|
|
7739
7862
|
return _set_prototype_of$c(o, p);
|
|
7740
7863
|
}
|
|
7741
|
-
/**
|
|
7742
|
-
* 告警消息按钮控件
|
|
7743
|
-
*
|
|
7744
|
-
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
7745
|
-
*
|
|
7746
|
-
* @category Control
|
|
7864
|
+
/**
|
|
7865
|
+
* 告警消息按钮控件
|
|
7866
|
+
*
|
|
7867
|
+
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
7868
|
+
*
|
|
7869
|
+
* @category Control
|
|
7747
7870
|
*/ var AlarmMessage = /*#__PURE__*/ function(Control) {
|
|
7748
7871
|
_inherits$c(AlarmMessage, Control);
|
|
7749
7872
|
function AlarmMessage(options) {
|
|
@@ -7767,16 +7890,16 @@ function _set_prototype_of$c(o, p) {
|
|
|
7767
7890
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_ALARM_MESSAGE) || '消息'
|
|
7768
7891
|
});
|
|
7769
7892
|
};
|
|
7770
|
-
/**
|
|
7771
|
-
* 销毁
|
|
7893
|
+
/**
|
|
7894
|
+
* 销毁
|
|
7772
7895
|
*/ _proto.destroy = function destroy() {
|
|
7773
7896
|
if (this._panelOpen) {
|
|
7774
7897
|
this.emit(EVENTS.control.alarmMessageChange, false);
|
|
7775
7898
|
}
|
|
7776
7899
|
Control.prototype.destroy.call(this);
|
|
7777
7900
|
};
|
|
7778
|
-
/**
|
|
7779
|
-
* 点击 Control 会触发
|
|
7901
|
+
/**
|
|
7902
|
+
* 点击 Control 会触发
|
|
7780
7903
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7781
7904
|
var _this__options_onChange, _this__options;
|
|
7782
7905
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -7841,54 +7964,54 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
7841
7964
|
onChange: function onChange() {},
|
|
7842
7965
|
onOpenChange: function onOpenChange() {}
|
|
7843
7966
|
};
|
|
7844
|
-
/**
|
|
7845
|
-
* 选择器切换 (支持PC/Mobile)
|
|
7846
|
-
* @category Control
|
|
7847
|
-
* @example
|
|
7848
|
-
* ```ts
|
|
7849
|
-
* new Select({
|
|
7850
|
-
* title: '清晰度',
|
|
7851
|
-
* list: [
|
|
7852
|
-
* {
|
|
7853
|
-
* label: '高清',
|
|
7854
|
-
* value: 'hd',
|
|
7855
|
-
* streamTypeIn: 1,
|
|
7856
|
-
* },
|
|
7857
|
-
* {
|
|
7858
|
-
* label: '超清',
|
|
7859
|
-
* value: 'super',
|
|
7860
|
-
* streamTypeIn: 2,
|
|
7861
|
-
* }
|
|
7862
|
-
* ],
|
|
7863
|
-
* value: 'hd',
|
|
7864
|
-
* onChange: (value, item) => {
|
|
7865
|
-
* console.log('选择了', value, item);
|
|
7866
|
-
* }
|
|
7867
|
-
* })
|
|
7868
|
-
*
|
|
7869
|
-
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
7870
|
-
* // 例如清晰度切换组件
|
|
7871
|
-
* class Definition extends Select {
|
|
7872
|
-
* options: DefinitionOptions;
|
|
7873
|
-
* constructor(options: DefinitionOptions) {
|
|
7874
|
-
* super({
|
|
7875
|
-
* ...options,
|
|
7876
|
-
* fieldNames: { label: 'name', value: 'level',},
|
|
7877
|
-
* title: options?.locale?.definition,
|
|
7878
|
-
* controlType: 'button',
|
|
7879
|
-
* classNameSuffix: 'definition',
|
|
7880
|
-
* onChange: (value: SelectItem['value'], item) => {
|
|
7881
|
-
* options?.onChange?.(value, item);
|
|
7882
|
-
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
7883
|
-
* },
|
|
7884
|
-
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
7885
|
-
* options?.onOpenChange?.(open, value, item);
|
|
7886
|
-
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
7887
|
-
* }
|
|
7888
|
-
* });
|
|
7889
|
-
* }
|
|
7890
|
-
* }
|
|
7891
|
-
* ```
|
|
7967
|
+
/**
|
|
7968
|
+
* 选择器切换 (支持PC/Mobile)
|
|
7969
|
+
* @category Control
|
|
7970
|
+
* @example
|
|
7971
|
+
* ```ts
|
|
7972
|
+
* new Select({
|
|
7973
|
+
* title: '清晰度',
|
|
7974
|
+
* list: [
|
|
7975
|
+
* {
|
|
7976
|
+
* label: '高清',
|
|
7977
|
+
* value: 'hd',
|
|
7978
|
+
* streamTypeIn: 1,
|
|
7979
|
+
* },
|
|
7980
|
+
* {
|
|
7981
|
+
* label: '超清',
|
|
7982
|
+
* value: 'super',
|
|
7983
|
+
* streamTypeIn: 2,
|
|
7984
|
+
* }
|
|
7985
|
+
* ],
|
|
7986
|
+
* value: 'hd',
|
|
7987
|
+
* onChange: (value, item) => {
|
|
7988
|
+
* console.log('选择了', value, item);
|
|
7989
|
+
* }
|
|
7990
|
+
* })
|
|
7991
|
+
*
|
|
7992
|
+
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
7993
|
+
* // 例如清晰度切换组件
|
|
7994
|
+
* class Definition extends Select {
|
|
7995
|
+
* options: DefinitionOptions;
|
|
7996
|
+
* constructor(options: DefinitionOptions) {
|
|
7997
|
+
* super({
|
|
7998
|
+
* ...options,
|
|
7999
|
+
* fieldNames: { label: 'name', value: 'level',},
|
|
8000
|
+
* title: options?.locale?.definition,
|
|
8001
|
+
* controlType: 'button',
|
|
8002
|
+
* classNameSuffix: 'definition',
|
|
8003
|
+
* onChange: (value: SelectItem['value'], item) => {
|
|
8004
|
+
* options?.onChange?.(value, item);
|
|
8005
|
+
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
8006
|
+
* },
|
|
8007
|
+
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
8008
|
+
* options?.onOpenChange?.(open, value, item);
|
|
8009
|
+
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
8010
|
+
* }
|
|
8011
|
+
* });
|
|
8012
|
+
* }
|
|
8013
|
+
* }
|
|
8014
|
+
* ```
|
|
7892
8015
|
*/ var Select = /*#__PURE__*/ function(Control) {
|
|
7893
8016
|
_inherits$b(Select, Control);
|
|
7894
8017
|
function Select(options) {
|
|
@@ -7940,9 +8063,9 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
7940
8063
|
return _this;
|
|
7941
8064
|
}
|
|
7942
8065
|
var _proto = Select.prototype;
|
|
7943
|
-
/**
|
|
7944
|
-
* 更新选项列表
|
|
7945
|
-
* @param list - 选项列表
|
|
8066
|
+
/**
|
|
8067
|
+
* 更新选项列表
|
|
8068
|
+
* @param list - 选项列表
|
|
7946
8069
|
*/ _proto.updateOptions = function updateOptions(list) {
|
|
7947
8070
|
var _this = this;
|
|
7948
8071
|
if (list === void 0) list = [];
|
|
@@ -8027,8 +8150,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8027
8150
|
});
|
|
8028
8151
|
}
|
|
8029
8152
|
};
|
|
8030
|
-
/**
|
|
8031
|
-
* 销毁
|
|
8153
|
+
/**
|
|
8154
|
+
* 销毁
|
|
8032
8155
|
*/ _proto.destroy = function destroy() {
|
|
8033
8156
|
var _this__delegationOption_destroy, _this__delegationOption, _this__delegationClose_destroy, _this__delegationClose, _this__delegationCancel_destroy, _this__delegationCancel;
|
|
8034
8157
|
(_this__delegationOption = this._delegationOption) == null ? void 0 : (_this__delegationOption_destroy = _this__delegationOption.destroy) == null ? void 0 : _this__delegationOption_destroy.call(_this__delegationOption);
|
|
@@ -8050,8 +8173,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8050
8173
|
e.stopPropagation();
|
|
8051
8174
|
e.preventDefault();
|
|
8052
8175
|
};
|
|
8053
|
-
/**
|
|
8054
|
-
* 点击 Control 会触发
|
|
8176
|
+
/**
|
|
8177
|
+
* 点击 Control 会触发
|
|
8055
8178
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8056
8179
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
8057
8180
|
};
|
|
@@ -8070,8 +8193,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8070
8193
|
},
|
|
8071
8194
|
{
|
|
8072
8195
|
key: "disabled",
|
|
8073
|
-
get: /**
|
|
8074
|
-
* 是否禁用
|
|
8196
|
+
get: /**
|
|
8197
|
+
* 是否禁用
|
|
8075
8198
|
*/ function get() {
|
|
8076
8199
|
return this._disabled;
|
|
8077
8200
|
},
|
|
@@ -8157,15 +8280,15 @@ function __filter(list, locale) {
|
|
|
8157
8280
|
};
|
|
8158
8281
|
});
|
|
8159
8282
|
}
|
|
8160
|
-
/**
|
|
8161
|
-
* 清晰度切换控件
|
|
8162
|
-
*
|
|
8163
|
-
* 清晰度切换控件有三套UI
|
|
8164
|
-
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
8165
|
-
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
8166
|
-
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
8167
|
-
*
|
|
8168
|
-
* @category Control
|
|
8283
|
+
/**
|
|
8284
|
+
* 清晰度切换控件
|
|
8285
|
+
*
|
|
8286
|
+
* 清晰度切换控件有三套UI
|
|
8287
|
+
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
8288
|
+
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
8289
|
+
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
8290
|
+
*
|
|
8291
|
+
* @category Control
|
|
8169
8292
|
*/ var Definition = /*#__PURE__*/ function(Select) {
|
|
8170
8293
|
_inherits$a(Definition, Select);
|
|
8171
8294
|
function Definition(options) {
|
|
@@ -8231,14 +8354,22 @@ function __filter(list, locale) {
|
|
|
8231
8354
|
return _this;
|
|
8232
8355
|
}
|
|
8233
8356
|
var _proto = Definition.prototype;
|
|
8234
|
-
/**
|
|
8235
|
-
* 重置,恢复默认值
|
|
8236
|
-
* @param hide 默认不隐藏
|
|
8357
|
+
/**
|
|
8358
|
+
* 重置,恢复默认值
|
|
8359
|
+
* @param hide 默认不隐藏
|
|
8237
8360
|
*/ _proto.reset = function reset(hide) {
|
|
8238
8361
|
Select.prototype.reset.call(this, hide);
|
|
8239
8362
|
};
|
|
8240
8363
|
return Definition;
|
|
8241
8364
|
}(Select);
|
|
8365
|
+
/**
|
|
8366
|
+
* 清晰度切换只在直播下有意义:回放播的是已落盘的码流,清晰度由录制时决定。
|
|
8367
|
+
*
|
|
8368
|
+
* 依据是内置模板分布(`hd` 只出现在 pcLive / mobileLive / security),控件本身无硬约束。
|
|
8369
|
+
* 若后续确认本地卡回放支持主/子码流切换,把 `'rec'` 加进来即可。
|
|
8370
|
+
*/ Definition.supportedPlayTypes = [
|
|
8371
|
+
'live'
|
|
8372
|
+
];
|
|
8242
8373
|
|
|
8243
8374
|
function _assert_this_initialized(self) {
|
|
8244
8375
|
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -8284,13 +8415,13 @@ var SUPPORT_SPEED = [
|
|
|
8284
8415
|
16
|
|
8285
8416
|
]; // 8, 16
|
|
8286
8417
|
var SPEED_DEFAULT_OPTIONS = {
|
|
8287
|
-
/**
|
|
8288
|
-
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
8289
|
-
* 暂时不支持初始化时设置倍速
|
|
8418
|
+
/**
|
|
8419
|
+
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
8420
|
+
* 暂时不支持初始化时设置倍速
|
|
8290
8421
|
*/ // value: 1, // 对应list 中的 value
|
|
8291
8422
|
// 这里不要设置多语言, 比较麻烦
|
|
8292
|
-
/**
|
|
8293
|
-
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
8423
|
+
/**
|
|
8424
|
+
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
8294
8425
|
*/ list: SUPPORT_SPEED.reverse().map(function(speed) {
|
|
8295
8426
|
return {
|
|
8296
8427
|
label: "" + speed + "x",
|
|
@@ -8298,13 +8429,13 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8298
8429
|
};
|
|
8299
8430
|
})
|
|
8300
8431
|
};
|
|
8301
|
-
/**
|
|
8302
|
-
* 倍速切换控件, 不支持动态切换倍速列表
|
|
8303
|
-
*
|
|
8304
|
-
* 注意:
|
|
8305
|
-
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
8306
|
-
* 2. 标准流不支持;
|
|
8307
|
-
* @category Control
|
|
8432
|
+
/**
|
|
8433
|
+
* 倍速切换控件, 不支持动态切换倍速列表
|
|
8434
|
+
*
|
|
8435
|
+
* 注意:
|
|
8436
|
+
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
8437
|
+
* 2. 标准流不支持;
|
|
8438
|
+
* @category Control
|
|
8308
8439
|
*/ var Speed = /*#__PURE__*/ function(Select) {
|
|
8309
8440
|
_inherits$9(Speed, Select);
|
|
8310
8441
|
function Speed(options) {
|
|
@@ -8338,10 +8469,10 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8338
8469
|
return _this;
|
|
8339
8470
|
}
|
|
8340
8471
|
var _proto = Speed.prototype;
|
|
8341
|
-
/**
|
|
8342
|
-
* 滤掉本地回放不支持的倍速
|
|
8343
|
-
* @param optionsList 初始化配置倍速列表
|
|
8344
|
-
* @param type 回放类型
|
|
8472
|
+
/**
|
|
8473
|
+
* 滤掉本地回放不支持的倍速
|
|
8474
|
+
* @param optionsList 初始化配置倍速列表
|
|
8475
|
+
* @param type 回放类型
|
|
8345
8476
|
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
|
|
8346
8477
|
if (!optionsList) {
|
|
8347
8478
|
// 非用户自定义 /openpb/ 是标准流回放路径
|
|
@@ -8369,6 +8500,16 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8369
8500
|
};
|
|
8370
8501
|
return Speed;
|
|
8371
8502
|
}(Select);
|
|
8503
|
+
/**
|
|
8504
|
+
* 倍速只对回放有意义;直播是实时流,没有倍速语义。
|
|
8505
|
+
*
|
|
8506
|
+
* 三类回放都支持,但档位上限不同(见 `_filterSpeedList`):
|
|
8507
|
+
* 本地卡回放与标准流 ≤ 4x,云存储 / 云录制 ≤ 16x。
|
|
8508
|
+
*/ Speed.supportedPlayTypes = [
|
|
8509
|
+
'rec',
|
|
8510
|
+
'cloudRec',
|
|
8511
|
+
'cloudRecord'
|
|
8512
|
+
];
|
|
8372
8513
|
|
|
8373
8514
|
function _extends$7() {
|
|
8374
8515
|
_extends$7 = Object.assign || function assign(target) {
|
|
@@ -8576,6 +8717,11 @@ function _set_prototype_of$8(o, p) {
|
|
|
8576
8717
|
};
|
|
8577
8718
|
return DatePickerControl;
|
|
8578
8719
|
}(Control);
|
|
8720
|
+
/** 选日期是为了定位录像,只对回放有意义(初值取自 `urlInfo.searchParams.begin`) */ DatePickerControl.supportedPlayTypes = [
|
|
8721
|
+
'rec',
|
|
8722
|
+
'cloudRec',
|
|
8723
|
+
'cloudRecord'
|
|
8724
|
+
];
|
|
8579
8725
|
|
|
8580
8726
|
function _extends$6() {
|
|
8581
8727
|
_extends$6 = Object.assign || function assign(target) {
|
|
@@ -8608,9 +8754,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8608
8754
|
return _set_prototype_of$7(o, p);
|
|
8609
8755
|
}
|
|
8610
8756
|
/** 时间格式 HH:mm:ss */ var TIME_FORMAT = 'HH:mm:ss';
|
|
8611
|
-
/**
|
|
8612
|
-
* 时间选择器控件
|
|
8613
|
-
* @category Control
|
|
8757
|
+
/**
|
|
8758
|
+
* 时间选择器控件
|
|
8759
|
+
* @category Control
|
|
8614
8760
|
*/ var TimePickerControl = /*#__PURE__*/ function(Control) {
|
|
8615
8761
|
_inherits$7(TimePickerControl, Control);
|
|
8616
8762
|
function TimePickerControl(options) {
|
|
@@ -8671,9 +8817,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8671
8817
|
}
|
|
8672
8818
|
}));
|
|
8673
8819
|
};
|
|
8674
|
-
/**
|
|
8675
|
-
* 设置时间
|
|
8676
|
-
* @param time 设置的时间 HH:mm:ss
|
|
8820
|
+
/**
|
|
8821
|
+
* 设置时间
|
|
8822
|
+
* @param time 设置的时间 HH:mm:ss
|
|
8677
8823
|
*/ _proto.setTime = function setTime(time) {
|
|
8678
8824
|
var _this_timePicker;
|
|
8679
8825
|
(_this_timePicker = this.timePicker) == null ? void 0 : _this_timePicker.setCurrent(time);
|
|
@@ -8689,9 +8835,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8689
8835
|
if (this.timePicker) this.timePicker.open = false;
|
|
8690
8836
|
Control.prototype.reset.call(this);
|
|
8691
8837
|
};
|
|
8692
|
-
/**
|
|
8693
|
-
* 销毁控件
|
|
8694
|
-
* @override
|
|
8838
|
+
/**
|
|
8839
|
+
* 销毁控件
|
|
8840
|
+
* @override
|
|
8695
8841
|
*/ _proto.destroy = function destroy() {
|
|
8696
8842
|
if (this.timePicker) {
|
|
8697
8843
|
this.timePicker.destroy();
|
|
@@ -8703,14 +8849,19 @@ function _set_prototype_of$7(o, p) {
|
|
|
8703
8849
|
_proto._getTimeStr = function _getTimeStr() {
|
|
8704
8850
|
return this._value;
|
|
8705
8851
|
};
|
|
8706
|
-
/**
|
|
8707
|
-
* 点击 Control 会触发
|
|
8708
|
-
* @overload super._onControlClick(e: Event)
|
|
8852
|
+
/**
|
|
8853
|
+
* 点击 Control 会触发
|
|
8854
|
+
* @overload super._onControlClick(e: Event)
|
|
8709
8855
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8710
8856
|
Control.prototype._onControlClick.call(this, e);
|
|
8711
8857
|
};
|
|
8712
8858
|
return TimePickerControl;
|
|
8713
8859
|
}(Control);
|
|
8860
|
+
/** 选时间是为了定位录像,只对回放有意义(初值取自 `urlInfo.searchParams.begin`) */ TimePickerControl.supportedPlayTypes = [
|
|
8861
|
+
'rec',
|
|
8862
|
+
'cloudRec',
|
|
8863
|
+
'cloudRecord'
|
|
8864
|
+
];
|
|
8714
8865
|
|
|
8715
8866
|
function _extends$5() {
|
|
8716
8867
|
_extends$5 = Object.assign || function assign(target) {
|
|
@@ -8742,8 +8893,8 @@ function _set_prototype_of$6(o, p) {
|
|
|
8742
8893
|
};
|
|
8743
8894
|
return _set_prototype_of$6(o, p);
|
|
8744
8895
|
}
|
|
8745
|
-
/**
|
|
8746
|
-
* 回放时间轴控件
|
|
8896
|
+
/**
|
|
8897
|
+
* 回放时间轴控件
|
|
8747
8898
|
*/ var TimeLineControl = /*#__PURE__*/ function(Control) {
|
|
8748
8899
|
_inherits$6(TimeLineControl, Control);
|
|
8749
8900
|
function TimeLineControl(options) {
|
|
@@ -8903,13 +9054,18 @@ function _set_prototype_of$6(o, p) {
|
|
|
8903
9054
|
}
|
|
8904
9055
|
Control.prototype.destroy.call(this);
|
|
8905
9056
|
};
|
|
8906
|
-
/**
|
|
8907
|
-
* 点击 Control 会触发
|
|
9057
|
+
/**
|
|
9058
|
+
* 点击 Control 会触发
|
|
8908
9059
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8909
9060
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
8910
9061
|
};
|
|
8911
9062
|
return TimeLineControl;
|
|
8912
9063
|
}(Control);
|
|
9064
|
+
/** 时间轴展示的是录像片段,只对回放有意义(渲染层的 `_needTimeLine` 也要求 `urlInfo.type === 'rec'`) */ TimeLineControl.supportedPlayTypes = [
|
|
9065
|
+
'rec',
|
|
9066
|
+
'cloudRec',
|
|
9067
|
+
'cloudRecord'
|
|
9068
|
+
];
|
|
8913
9069
|
|
|
8914
9070
|
function _extends$4() {
|
|
8915
9071
|
_extends$4 = Object.assign || function assign(target) {
|
|
@@ -8941,24 +9097,24 @@ function _set_prototype_of$5(o, p) {
|
|
|
8941
9097
|
};
|
|
8942
9098
|
return _set_prototype_of$5(o, p);
|
|
8943
9099
|
}
|
|
8944
|
-
/**
|
|
8945
|
-
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
8946
|
-
*
|
|
8947
|
-
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
8948
|
-
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
8949
|
-
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
8950
|
-
*
|
|
8951
|
-
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
8952
|
-
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
9100
|
+
/**
|
|
9101
|
+
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
9102
|
+
*
|
|
9103
|
+
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
9104
|
+
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
9105
|
+
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
9106
|
+
*
|
|
9107
|
+
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
9108
|
+
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
8953
9109
|
*/ var PLAYBACK_END_SILENCE_MS = 3000;
|
|
8954
|
-
/**
|
|
8955
|
-
* 读取录像片段的起止时间(毫秒)
|
|
8956
|
-
*
|
|
8957
|
-
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
8958
|
-
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
8959
|
-
*
|
|
8960
|
-
* @param seg 录像片段
|
|
8961
|
-
* @param which 取起点还是终点
|
|
9110
|
+
/**
|
|
9111
|
+
* 读取录像片段的起止时间(毫秒)
|
|
9112
|
+
*
|
|
9113
|
+
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
9114
|
+
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
9115
|
+
*
|
|
9116
|
+
* @param seg 录像片段
|
|
9117
|
+
* @param which 取起点还是终点
|
|
8962
9118
|
*/ function segMs(seg, which) {
|
|
8963
9119
|
var _ref, _ref1;
|
|
8964
9120
|
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;
|
|
@@ -8966,12 +9122,12 @@ function _set_prototype_of$5(o, p) {
|
|
|
8966
9122
|
if (typeof value === 'number') return value < 1e12 ? value * 1000 : value;
|
|
8967
9123
|
return utilsTools.DateTime.toDate(value).getTime();
|
|
8968
9124
|
}
|
|
8969
|
-
/**
|
|
8970
|
-
* 回放片段进度条控件(移动端)
|
|
8971
|
-
*
|
|
8972
|
-
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
8973
|
-
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
8974
|
-
* @category Control
|
|
9125
|
+
/**
|
|
9126
|
+
* 回放片段进度条控件(移动端)
|
|
9127
|
+
*
|
|
9128
|
+
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
9129
|
+
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
9130
|
+
* @category Control
|
|
8975
9131
|
*/ var SegmentProgressControl = /*#__PURE__*/ function(Control) {
|
|
8976
9132
|
_inherits$5(SegmentProgressControl, Control);
|
|
8977
9133
|
function SegmentProgressControl(options) {
|
|
@@ -9038,9 +9194,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9038
9194
|
});
|
|
9039
9195
|
this._updateVisible();
|
|
9040
9196
|
};
|
|
9041
|
-
/**
|
|
9042
|
-
* 设置播放区间
|
|
9043
|
-
* @param range 区间;null 表示解除约束
|
|
9197
|
+
/**
|
|
9198
|
+
* 设置播放区间
|
|
9199
|
+
* @param range 区间;null 表示解除约束
|
|
9044
9200
|
*/ _proto._setRange = function _setRange(range) {
|
|
9045
9201
|
if ((range == null ? void 0 : range.begin) && (range == null ? void 0 : range.end)) {
|
|
9046
9202
|
this._rangeBeginMs = utilsTools.DateTime.toDate(range.begin).getTime();
|
|
@@ -9051,9 +9207,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9051
9207
|
}
|
|
9052
9208
|
this._updateVisible();
|
|
9053
9209
|
};
|
|
9054
|
-
/**
|
|
9055
|
-
* 用区间裁剪录像片段
|
|
9056
|
-
* @param records 全天录像片段
|
|
9210
|
+
/**
|
|
9211
|
+
* 用区间裁剪录像片段
|
|
9212
|
+
* @param records 全天录像片段
|
|
9057
9213
|
*/ _proto._setSegments = function _setSegments(records) {
|
|
9058
9214
|
var _this = this;
|
|
9059
9215
|
if (!this._hasRange() || !Array.isArray(records)) {
|
|
@@ -9081,9 +9237,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9081
9237
|
if (force) this._currentIndex = -1;
|
|
9082
9238
|
this._updateVisible();
|
|
9083
9239
|
};
|
|
9084
|
-
/**
|
|
9085
|
-
* 按播放进度更新片段与进度
|
|
9086
|
-
* @param currentMs 当前播放时间(毫秒)
|
|
9240
|
+
/**
|
|
9241
|
+
* 按播放进度更新片段与进度
|
|
9242
|
+
* @param currentMs 当前播放时间(毫秒)
|
|
9087
9243
|
*/ _proto._syncCurrent = function _syncCurrent(currentMs) {
|
|
9088
9244
|
if (!this._hasRange()) return;
|
|
9089
9245
|
var index = this._segments.findIndex(function(seg) {
|
|
@@ -9123,6 +9279,11 @@ function _set_prototype_of$5(o, p) {
|
|
|
9123
9279
|
};
|
|
9124
9280
|
return SegmentProgressControl;
|
|
9125
9281
|
}(Control);
|
|
9282
|
+
/** 片段进度条拖动的是录像片段内的位置,只对回放有意义(另需移动端 + 已设置播放区间) */ SegmentProgressControl.supportedPlayTypes = [
|
|
9283
|
+
'rec',
|
|
9284
|
+
'cloudRec',
|
|
9285
|
+
'cloudRecord'
|
|
9286
|
+
];
|
|
9126
9287
|
|
|
9127
9288
|
function _extends$3() {
|
|
9128
9289
|
_extends$3 = Object.assign || function assign(target) {
|
|
@@ -9154,9 +9315,9 @@ function _set_prototype_of$4(o, p) {
|
|
|
9154
9315
|
};
|
|
9155
9316
|
return _set_prototype_of$4(o, p);
|
|
9156
9317
|
}
|
|
9157
|
-
/**
|
|
9158
|
-
* 展示设备序列号控件
|
|
9159
|
-
* @category Control
|
|
9318
|
+
/**
|
|
9319
|
+
* 展示设备序列号控件
|
|
9320
|
+
* @category Control
|
|
9160
9321
|
*/ var Device = /*#__PURE__*/ function(Control) {
|
|
9161
9322
|
_inherits$4(Device, Control);
|
|
9162
9323
|
function Device(options) {
|
|
@@ -9174,10 +9335,10 @@ function _set_prototype_of$4(o, p) {
|
|
|
9174
9335
|
var _this___options_props_urlInfo, _this___options_props;
|
|
9175
9336
|
this.$container.innerHTML = '<span class="' + PREFIX_CLASS + "-text " + PREFIX_CLASS + '-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>";
|
|
9176
9337
|
};
|
|
9177
|
-
/**
|
|
9178
|
-
* 更新设备序列号
|
|
9179
|
-
* @param deviceSerial - 设备序列号
|
|
9180
|
-
* @param deviceName - 设备名称
|
|
9338
|
+
/**
|
|
9339
|
+
* 更新设备序列号
|
|
9340
|
+
* @param deviceSerial - 设备序列号
|
|
9341
|
+
* @param deviceName - 设备名称
|
|
9181
9342
|
*/ _proto.update = function update(deviceName, deviceSerial) {
|
|
9182
9343
|
if (this.$container.querySelector("." + PREFIX_CLASS + "-text-device")) {
|
|
9183
9344
|
var $span = this.$container.querySelector("." + PREFIX_CLASS + "-text-device");
|
|
@@ -9335,8 +9496,8 @@ function _set_prototype_of$2(o, p) {
|
|
|
9335
9496
|
// const MobileExtend_DEFAULT_Options = {
|
|
9336
9497
|
// controls: MOBILE_EXTENDS,
|
|
9337
9498
|
// };
|
|
9338
|
-
/**
|
|
9339
|
-
* 移动端扩展
|
|
9499
|
+
/**
|
|
9500
|
+
* 移动端扩展
|
|
9340
9501
|
*/ var MobileExtend = /*#__PURE__*/ function(EventEmitter) {
|
|
9341
9502
|
_inherits$2(MobileExtend, EventEmitter);
|
|
9342
9503
|
function MobileExtend($siblingContainer) {
|
|
@@ -9413,9 +9574,9 @@ function _set_prototype_of$1(o, p) {
|
|
|
9413
9574
|
return _set_prototype_of$1(o, p);
|
|
9414
9575
|
}
|
|
9415
9576
|
var PAUSE_DEFAULT_OPTIONS = {};
|
|
9416
|
-
/**
|
|
9417
|
-
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
9418
|
-
* @category Control
|
|
9577
|
+
/**
|
|
9578
|
+
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
9579
|
+
* @category Control
|
|
9419
9580
|
*/ var Pause = /*#__PURE__*/ function(Control) {
|
|
9420
9581
|
_inherits$1(Pause, Control);
|
|
9421
9582
|
function Pause(options) {
|
|
@@ -9431,8 +9592,8 @@ var PAUSE_DEFAULT_OPTIONS = {};
|
|
|
9431
9592
|
return _this;
|
|
9432
9593
|
}
|
|
9433
9594
|
var _proto = Pause.prototype;
|
|
9434
|
-
/**
|
|
9435
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
9595
|
+
/**
|
|
9596
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
9436
9597
|
*/ _proto.show = function show(playing, always) {
|
|
9437
9598
|
var _this = this;
|
|
9438
9599
|
var _this_$container_classList, _this_$container;
|
|
@@ -9477,8 +9638,8 @@ var PAUSE_DEFAULT_OPTIONS = {};
|
|
|
9477
9638
|
}, 300);
|
|
9478
9639
|
}, 10);
|
|
9479
9640
|
};
|
|
9480
|
-
/**
|
|
9481
|
-
* 销毁
|
|
9641
|
+
/**
|
|
9642
|
+
* 销毁
|
|
9482
9643
|
*/ _proto.destroy = function destroy() {
|
|
9483
9644
|
if (this._timer) {
|
|
9484
9645
|
clearTimeout(this._timer);
|
|
@@ -9766,10 +9927,30 @@ var AUTH_KEY = [
|
|
|
9766
9927
|
'recDropdown',
|
|
9767
9928
|
'alarmMessage'
|
|
9768
9929
|
];
|
|
9769
|
-
/**
|
|
9770
|
-
*
|
|
9771
|
-
*
|
|
9772
|
-
*
|
|
9930
|
+
/**
|
|
9931
|
+
* 校验控件是否支持当前播放类型,不支持只提示、**不阻止渲染**
|
|
9932
|
+
*
|
|
9933
|
+
* 之所以只提示:控件能否真正工作还取决于设备能力与 SDK 层实现,主题层没有足够信息
|
|
9934
|
+
* 直接判死;而模板可能来自开放平台配置(`getThemeData` 远程拉取)或开发者自定义的
|
|
9935
|
+
* `themeData`,直接隐藏会让人无从排查。
|
|
9936
|
+
*
|
|
9937
|
+
* `theme.playType` 为空串(地址判不出类型,如 rtmp / webrtc / 地址未设置)时整体跳过校验。
|
|
9938
|
+
*
|
|
9939
|
+
* @param theme - Theme
|
|
9940
|
+
* @param iconId - 控件 iconId
|
|
9941
|
+
* @param ControlClass - 控件类,读其静态 `supportedPlayTypes`
|
|
9942
|
+
*/ function _checkPlayTypeSupport(theme, iconId, ControlClass) {
|
|
9943
|
+
var playType = theme.playType;
|
|
9944
|
+
if (!playType || ControlClass.supportsPlayType(playType)) return;
|
|
9945
|
+
var supported = ControlClass.supportedPlayTypes;
|
|
9946
|
+
// prettier-ignore
|
|
9947
|
+
theme.logger.warn("[" + iconId + '] control does not support playType "' + playType + '" (supported: ' + supported.join(', ') + "). It is still rendered, but may not work as expected.");
|
|
9948
|
+
theme.emit(EVENTS.control.unsupportedPlayType, iconId, playType, supported);
|
|
9949
|
+
}
|
|
9950
|
+
/**
|
|
9951
|
+
* 渲染控件
|
|
9952
|
+
* @param $container - 控件渲染节点
|
|
9953
|
+
* @param btnList - 控件按钮列表
|
|
9773
9954
|
*/ // prettier-ignore
|
|
9774
9955
|
function _renderControls(theme, $container, btnList, props) {
|
|
9775
9956
|
if (props === void 0) props = {};
|
|
@@ -9808,6 +9989,8 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9808
9989
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
|
|
9809
9990
|
props: props
|
|
9810
9991
|
}));
|
|
9992
|
+
theme.emit(EVENTS.control.deviceControlInit);
|
|
9993
|
+
_checkPlayTypeSupport(theme, item.iconId, Controls["device"]);
|
|
9811
9994
|
}
|
|
9812
9995
|
}
|
|
9813
9996
|
continue;
|
|
@@ -9837,6 +10020,9 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9837
10020
|
}, ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["" + item.iconId + "Options"]) || {}, {
|
|
9838
10021
|
props: props
|
|
9839
10022
|
}));
|
|
10023
|
+
// iconId 已由 Controls 查表校验过,这里必然能取到对应的初始化事件名
|
|
10024
|
+
theme.emit(CONTROL_INIT_EVENTS["" + item.iconId + "ControlInit"]);
|
|
10025
|
+
_checkPlayTypeSupport(theme, item.iconId, Controls[item.iconId]);
|
|
9840
10026
|
}
|
|
9841
10027
|
} else {
|
|
9842
10028
|
theme.logger.warn("[" + item.iconId + "] control does not exist");
|
|
@@ -10045,7 +10231,7 @@ function _renderTheme(theme, data) {
|
|
|
10045
10231
|
});
|
|
10046
10232
|
}
|
|
10047
10233
|
// 移动端:在 rec 控件旁渲染 alarmMessage 按钮
|
|
10048
|
-
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl'])) {
|
|
10234
|
+
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl']) && theme.options.sdkType === 'base') {
|
|
10049
10235
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
10050
10236
|
theme.controls['alarmMessageControl'] = new Controls['alarmMessage'](_extends$1({
|
|
10051
10237
|
rootContainer: theme.$container,
|
|
@@ -10060,6 +10246,8 @@ function _renderTheme(theme, data) {
|
|
|
10060
10246
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options.alarmMessageOptions) || {}, {
|
|
10061
10247
|
props: props
|
|
10062
10248
|
}));
|
|
10249
|
+
theme.emit(EVENTS.control.alarmMessageControlInit);
|
|
10250
|
+
_checkPlayTypeSupport(theme, 'alarmMessage', Controls['alarmMessage']);
|
|
10063
10251
|
}
|
|
10064
10252
|
if ((theme.options.timeLineOptions !== null || !theme.options.disabledTimeLine) && ((_theme_options_mobileExtendOptions5 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions5.controls.includes('timeLine')) && _needTimeLine) {
|
|
10065
10253
|
_renderTimeLine(theme, theme._mobileExtend.$content, props);
|
|
@@ -10100,6 +10288,8 @@ var _renderTimeLine = function _renderTimeLine(theme, container, props) {
|
|
|
10100
10288
|
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,
|
|
10101
10289
|
props: props
|
|
10102
10290
|
}));
|
|
10291
|
+
theme.emit(EVENTS.control.timeLineControlInit);
|
|
10292
|
+
_checkPlayTypeSupport(theme, 'timeLine', Controls['timeLine']);
|
|
10103
10293
|
}
|
|
10104
10294
|
};
|
|
10105
10295
|
var _renderSegmentProgress = function _renderSegmentProgress(theme, container, props) {
|
|
@@ -10117,6 +10307,8 @@ var _renderSegmentProgress = function _renderSegmentProgress(theme, container, p
|
|
|
10117
10307
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["segmentProgressOptions"]) || {}, {
|
|
10118
10308
|
props: props
|
|
10119
10309
|
}));
|
|
10310
|
+
theme.emit(EVENTS.control.segmentProgressControlInit);
|
|
10311
|
+
_checkPlayTypeSupport(theme, 'segmentProgress', Controls['segmentProgress']);
|
|
10120
10312
|
}
|
|
10121
10313
|
};
|
|
10122
10314
|
var _renderDatePicker = function _renderDatePicker(theme, container, props) {
|
|
@@ -10133,6 +10325,8 @@ var _renderDatePicker = function _renderDatePicker(theme, container, props) {
|
|
|
10133
10325
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
|
|
10134
10326
|
props: props
|
|
10135
10327
|
}));
|
|
10328
|
+
theme.emit(EVENTS.control.dateControlInit);
|
|
10329
|
+
_checkPlayTypeSupport(theme, 'date', Controls['date']);
|
|
10136
10330
|
}
|
|
10137
10331
|
};
|
|
10138
10332
|
var _renderTimePicker = function _renderTimePicker(theme, container, props) {
|
|
@@ -10149,6 +10343,8 @@ var _renderTimePicker = function _renderTimePicker(theme, container, props) {
|
|
|
10149
10343
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeOptions"]) || {}, {
|
|
10150
10344
|
props: props
|
|
10151
10345
|
}));
|
|
10346
|
+
theme.emit(EVENTS.control.timeControlInit);
|
|
10347
|
+
_checkPlayTypeSupport(theme, 'time', Controls['time']);
|
|
10152
10348
|
}
|
|
10153
10349
|
};
|
|
10154
10350
|
var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
@@ -10167,31 +10363,33 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10167
10363
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["recOptions"]) || {}, {
|
|
10168
10364
|
props: props
|
|
10169
10365
|
}));
|
|
10366
|
+
theme.emit(EVENTS.control.recControlInit);
|
|
10367
|
+
_checkPlayTypeSupport(theme, 'rec', Controls['rec']);
|
|
10170
10368
|
}
|
|
10171
10369
|
if ((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1['recControl']) ((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['recControl']).addRecType(recType);
|
|
10172
10370
|
};
|
|
10173
10371
|
|
|
10174
|
-
/**
|
|
10175
|
-
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
10176
|
-
*
|
|
10177
|
-
* @remarks
|
|
10178
|
-
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
10179
|
-
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
10180
|
-
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
10181
|
-
*/ /**
|
|
10182
|
-
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
10183
|
-
*/ /**
|
|
10184
|
-
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
10185
|
-
*
|
|
10186
|
-
* 档位规则:
|
|
10187
|
-
* - `(280, 375]` → medium
|
|
10188
|
-
* - `(200, 280]` → small
|
|
10189
|
-
* - `<= 200` → mini
|
|
10190
|
-
* - 其它(> 375)→ 无档位(移除全部)
|
|
10191
|
-
*
|
|
10192
|
-
* @param size 尺寸(px)
|
|
10193
|
-
* @param axis `'width'` 或 `'height'`
|
|
10194
|
-
* @param prefix 类名前缀(如 `ezplayer`)
|
|
10372
|
+
/**
|
|
10373
|
+
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
10374
|
+
*
|
|
10375
|
+
* @remarks
|
|
10376
|
+
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
10377
|
+
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
10378
|
+
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
10379
|
+
*/ /**
|
|
10380
|
+
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
10381
|
+
*/ /**
|
|
10382
|
+
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
10383
|
+
*
|
|
10384
|
+
* 档位规则:
|
|
10385
|
+
* - `(280, 375]` → medium
|
|
10386
|
+
* - `(200, 280]` → small
|
|
10387
|
+
* - `<= 200` → mini
|
|
10388
|
+
* - 其它(> 375)→ 无档位(移除全部)
|
|
10389
|
+
*
|
|
10390
|
+
* @param size 尺寸(px)
|
|
10391
|
+
* @param axis `'width'` 或 `'height'`
|
|
10392
|
+
* @param prefix 类名前缀(如 `ezplayer`)
|
|
10195
10393
|
*/ function computeDimensionClasses(size, axis, prefix) {
|
|
10196
10394
|
var medium = prefix + "-medium-" + axis;
|
|
10197
10395
|
var small = prefix + "-small-" + axis;
|
|
@@ -10217,11 +10415,11 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10217
10415
|
remove: remove
|
|
10218
10416
|
};
|
|
10219
10417
|
}
|
|
10220
|
-
/**
|
|
10221
|
-
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
10222
|
-
* @param width 容器宽度(px)
|
|
10223
|
-
* @param height 容器高度(px)
|
|
10224
|
-
* @param prefix 类名前缀
|
|
10418
|
+
/**
|
|
10419
|
+
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
10420
|
+
* @param width 容器宽度(px)
|
|
10421
|
+
* @param height 容器高度(px)
|
|
10422
|
+
* @param prefix 类名前缀
|
|
10225
10423
|
*/ function computeSizeClasses(width, height, prefix) {
|
|
10226
10424
|
var w = computeDimensionClasses(width, 'width', prefix);
|
|
10227
10425
|
var h = computeDimensionClasses(height, 'height', prefix);
|
|
@@ -10230,34 +10428,34 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10230
10428
|
remove: [].concat(w.remove, h.remove)
|
|
10231
10429
|
};
|
|
10232
10430
|
}
|
|
10233
|
-
/**
|
|
10234
|
-
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
10431
|
+
/**
|
|
10432
|
+
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
10235
10433
|
*/ function shouldShowHeaderMore(width, leftWidth, rightWidth) {
|
|
10236
10434
|
return leftWidth + rightWidth + 30 > width;
|
|
10237
10435
|
}
|
|
10238
|
-
/**
|
|
10239
|
-
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
10436
|
+
/**
|
|
10437
|
+
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
10240
10438
|
*/ function shouldRemoveHeaderMore(width, leftWidth, rightWidth) {
|
|
10241
10439
|
return width - leftWidth - rightWidth > 100;
|
|
10242
10440
|
}
|
|
10243
|
-
/**
|
|
10244
|
-
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
10441
|
+
/**
|
|
10442
|
+
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
10245
10443
|
*/ function shouldCollapseFooter(width, leftWidth, rightWidth) {
|
|
10246
10444
|
return width - leftWidth - rightWidth < 16;
|
|
10247
10445
|
}
|
|
10248
|
-
/**
|
|
10249
|
-
* footer 从 More 中释放控件时的展开阈值。
|
|
10250
|
-
*
|
|
10251
|
-
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
10252
|
-
* `50 + firstItemWidth || 0`)。
|
|
10253
|
-
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
10446
|
+
/**
|
|
10447
|
+
* footer 从 More 中释放控件时的展开阈值。
|
|
10448
|
+
*
|
|
10449
|
+
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
10450
|
+
* `50 + firstItemWidth || 0`)。
|
|
10451
|
+
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
10254
10452
|
*/ function computeFooterExpandOffset(firstItemWidth) {
|
|
10255
10453
|
var base = 50;
|
|
10256
10454
|
if (firstItemWidth === undefined) return base;
|
|
10257
10455
|
return base + firstItemWidth || 0;
|
|
10258
10456
|
}
|
|
10259
|
-
/**
|
|
10260
|
-
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
10457
|
+
/**
|
|
10458
|
+
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
10261
10459
|
*/ function shouldExpandFooter(width, leftWidth, rightWidth, offset) {
|
|
10262
10460
|
return width - leftWidth - rightWidth > offset;
|
|
10263
10461
|
}
|
|
@@ -10888,14 +11086,14 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10888
11086
|
});
|
|
10889
11087
|
this.$container.classList.remove("" + PREFIX_CLASS);
|
|
10890
11088
|
this._themeData = null;
|
|
10891
|
-
if (this.i18n) this.i18n = null
|
|
11089
|
+
// if (this.i18n) this.i18n = null!; // 注释是为了防止出错
|
|
10892
11090
|
this.recType = '';
|
|
10893
11091
|
this.recMonth = []; // 清空数据
|
|
10894
11092
|
// 重置
|
|
10895
11093
|
this._videoInfo = {};
|
|
10896
11094
|
this.emit(EVENTS.theme.destroyed);
|
|
10897
11095
|
this.removeAllListeners();
|
|
10898
|
-
if (this.logger) this.logger = null
|
|
11096
|
+
// if (this.logger) this.logger = null!; // 注释是为了防止出错
|
|
10899
11097
|
// 销毁后,将 destroyed 设置为 true
|
|
10900
11098
|
this.destroyed = true;
|
|
10901
11099
|
};
|
|
@@ -11488,6 +11686,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11488
11686
|
},
|
|
11489
11687
|
set: function set(url) {
|
|
11490
11688
|
this._url = url;
|
|
11689
|
+
// 地址变了回放类型也要跟着变,否则 recType / playType 会停留在上一个地址的结果,
|
|
11690
|
+
// 进而影响倍速档位过滤、回放类型控件激活态与控件支持性校验
|
|
11691
|
+
this._getRecType(url);
|
|
11491
11692
|
}
|
|
11492
11693
|
},
|
|
11493
11694
|
{
|
|
@@ -11501,6 +11702,32 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11501
11702
|
return {};
|
|
11502
11703
|
}
|
|
11503
11704
|
},
|
|
11705
|
+
{
|
|
11706
|
+
key: "playType",
|
|
11707
|
+
get: /**
|
|
11708
|
+
* 当前播放类型,由播放地址解析得出
|
|
11709
|
+
*
|
|
11710
|
+
* 取值 `'live' | 'rec' | 'cloudRec' | 'cloudRecord'`,无法判定时为空字符串 `''`。
|
|
11711
|
+
*
|
|
11712
|
+
* 与 {@link recType} 的关系:`recType` 只覆盖三种回放,直播时为空串;
|
|
11713
|
+
* 本 getter 把直播也纳入同一个枚举,作为「当前播放类型」的统一出口。
|
|
11714
|
+
*
|
|
11715
|
+
* @remarks 空串表示无法从地址判定(如 rtmp、webrtc、地址未设置)。
|
|
11716
|
+
* 此时控件支持性校验会整体跳过,避免对判不出类型的地址误报。
|
|
11717
|
+
* @since 3.1.7
|
|
11718
|
+
* ```ts
|
|
11719
|
+
* theme.playType // 'cloudRec'
|
|
11720
|
+
* ```
|
|
11721
|
+
*/ function get() {
|
|
11722
|
+
var _this_urlInfo;
|
|
11723
|
+
// 回放三类由 _getRecType 解析(含 busType=7 → cloudRecord 的区分)
|
|
11724
|
+
if (this.recType) return this.recType;
|
|
11725
|
+
if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'live') return 'live';
|
|
11726
|
+
// 标准流直播:http(s) 且不走回放路径 /openpb/
|
|
11727
|
+
if (this._url && utilsTools.isHttp(this._url) && !this._url.includes('/openpb/')) return 'live';
|
|
11728
|
+
return '';
|
|
11729
|
+
}
|
|
11730
|
+
},
|
|
11504
11731
|
{
|
|
11505
11732
|
key: "width",
|
|
11506
11733
|
get: /**
|
|
@@ -11987,8 +12214,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11987
12214
|
zh: zh,
|
|
11988
12215
|
en: en
|
|
11989
12216
|
};
|
|
11990
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.
|
|
12217
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.7-beta.1';
|
|
11991
12218
|
|
|
12219
|
+
exports.CONTROL_INIT_EVENTS = CONTROL_INIT_EVENTS;
|
|
11992
12220
|
exports.Control = Control;
|
|
11993
12221
|
exports.EVENTS = EVENTS;
|
|
11994
12222
|
exports.Fullscreen = Fullscreen;
|