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