@ezuikit/player-theme 3.1.6 → 3.1.7-beta.2
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 +880 -604
- package/dist/index.esm.js +880 -605
- package/dist/index.umd.js +879 -604
- package/dist/style.css +1 -1
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +643 -423
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.
|
|
3
|
-
* Copyright (c) 2026-09-
|
|
2
|
+
* @ezuikit/player-theme v3.1.7-beta.2
|
|
3
|
+
* Copyright (c) 2026-09-24 13:42:47 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
@@ -20,6 +20,16 @@ var controlDatePicker = require('@ezuikit/control-date-picker');
|
|
|
20
20
|
var controlTimeLine = require('@ezuikit/control-time-line');
|
|
21
21
|
var SegmentProgress = require('@ezuikit/control-segment-progress');
|
|
22
22
|
|
|
23
|
+
function _extends$z() {
|
|
24
|
+
_extends$z = Object.assign || function assign(target) {
|
|
25
|
+
for(var i = 1; i < arguments.length; i++){
|
|
26
|
+
var source = arguments[i];
|
|
27
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
return _extends$z.apply(this, arguments);
|
|
32
|
+
}
|
|
23
33
|
/**
|
|
24
34
|
* 播放器的类名前缀
|
|
25
35
|
*/ var PREFIX_CLASS = 'ezplayer';
|
|
@@ -99,6 +109,54 @@ var THEME_PROPS = [
|
|
|
99
109
|
'date',
|
|
100
110
|
'segmentProgress'
|
|
101
111
|
];
|
|
112
|
+
/**
|
|
113
|
+
* 全部播放类型:直播 + 三种回放
|
|
114
|
+
*
|
|
115
|
+
* 控件用静态属性 `supportedPlayTypes` 声明支持范围,默认取本数组(即全支持)。
|
|
116
|
+
* 与 {@link REC_GROUP} 的区别:REC_GROUP 是「回放类型切换控件的 iconId 分组」,
|
|
117
|
+
* 这里是「播放地址实际解析出的播放类型」,两者取值恰好在回放侧重合。
|
|
118
|
+
*/ var PLAY_TYPES = [
|
|
119
|
+
'live',
|
|
120
|
+
'rec',
|
|
121
|
+
'cloudRec',
|
|
122
|
+
'cloudRecord'
|
|
123
|
+
];
|
|
124
|
+
/**
|
|
125
|
+
* 控件初始化完成事件名
|
|
126
|
+
*
|
|
127
|
+
* 键与 `Controls`(`src/Controls/index.ts`)的键一一对应,值为 `Control.<键>ControlInit`,
|
|
128
|
+
* 在控件实例创建成功后由 `_renderTheme` 派发一次,无载荷。
|
|
129
|
+
*
|
|
130
|
+
* 这些成员会被展开进 {@link EVENTS}.control,因此既可以 `EVENTS.control.playControlInit`
|
|
131
|
+
* 这样按名取用,也可以在只拿到 `iconId` 的场合用 `CONTROL_INIT_EVENTS[iconId]` 查表。
|
|
132
|
+
*
|
|
133
|
+
* @remarks `changeTheme` 会先卸载旧控件并重置 `theme.controls`,因此切换主题时这些事件会再次派发;
|
|
134
|
+
* 同一次渲染内则由 `!theme.controls.xxxControl` 守卫保证只派发一次。
|
|
135
|
+
*/ var CONTROL_INIT_EVENTS = {
|
|
136
|
+
/** 播放/暂停控件初始化完成 */ playControlInit: 'Control.playControlInit',
|
|
137
|
+
/** 音量控件初始化完成 */ volumeControlInit: 'Control.volumeControlInit',
|
|
138
|
+
/** 设备信息控件初始化完成 */ deviceControlInit: 'Control.deviceControlInit',
|
|
139
|
+
/** 截图控件初始化完成 */ capturePictureControlInit: 'Control.capturePictureControlInit',
|
|
140
|
+
/** 云台控件初始化完成 */ ptzControlInit: 'Control.ptzControlInit',
|
|
141
|
+
/** 录制控件初始化完成 */ recordControlInit: 'Control.recordControlInit',
|
|
142
|
+
/** 对讲控件初始化完成 */ talkControlInit: 'Control.talkControlInit',
|
|
143
|
+
/** 语音广播控件初始化完成 */ broadcastControlInit: 'Control.broadcastControlInit',
|
|
144
|
+
/** AI 对话控件初始化完成 */ aiChatControlInit: 'Control.aiChatControlInit',
|
|
145
|
+
/** 直播按钮控件初始化完成 */ liveControlInit: 'Control.liveControlInit',
|
|
146
|
+
/** 回放下拉控件初始化完成 */ recDropdownControlInit: 'Control.recDropdownControlInit',
|
|
147
|
+
/** 录像列表控件初始化完成 */ recListControlInit: 'Control.recListControlInit',
|
|
148
|
+
/** 告警消息控件初始化完成 */ alarmMessageControlInit: 'Control.alarmMessageControlInit',
|
|
149
|
+
/** 电子放大控件初始化完成 */ zoomControlInit: 'Control.zoomControlInit',
|
|
150
|
+
/** 清晰度控件初始化完成 */ definitionControlInit: 'Control.definitionControlInit',
|
|
151
|
+
/** web 全屏控件初始化完成 */ fullscreenControlInit: 'Control.fullscreenControlInit',
|
|
152
|
+
/** 全局全屏控件初始化完成 */ globalFullscreenControlInit: 'Control.globalFullscreenControlInit',
|
|
153
|
+
/** 回放类型控件初始化完成 */ recControlInit: 'Control.recControlInit',
|
|
154
|
+
/** 倍速控件初始化完成 */ speedControlInit: 'Control.speedControlInit',
|
|
155
|
+
/** 日历控件初始化完成 */ dateControlInit: 'Control.dateControlInit',
|
|
156
|
+
/** 时间选择控件初始化完成 */ timeControlInit: 'Control.timeControlInit',
|
|
157
|
+
/** 时间轴控件初始化完成 */ timeLineControlInit: 'Control.timeLineControlInit',
|
|
158
|
+
/** 回放片段进度条控件初始化完成 */ segmentProgressControlInit: 'Control.segmentProgressControlInit'
|
|
159
|
+
};
|
|
102
160
|
/**
|
|
103
161
|
*
|
|
104
162
|
* 事件名
|
|
@@ -165,7 +223,7 @@ var EVENTS = {
|
|
|
165
223
|
/** 播放区间播放结束(SDK 层 playbackRange 特性) */ playbackEnd: 'playbackEnd',
|
|
166
224
|
/**
|
|
167
225
|
* 控件相关
|
|
168
|
-
*/ control: {
|
|
226
|
+
*/ control: _extends$z({}, CONTROL_INIT_EVENTS, {
|
|
169
227
|
/** 点击播放播放/暂停按钮 */ play: 'Control.play',
|
|
170
228
|
/** 播放控件销毁 */ playDestroy: 'Control.playDestroy',
|
|
171
229
|
/** 截图 */ capturePicture: 'Control.capturePicture',
|
|
@@ -221,12 +279,13 @@ var EVENTS = {
|
|
|
221
279
|
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
222
280
|
/** 日期面板展示的月份变化 */ datePanelMonthChange: 'Control.datePanelMonthChange',
|
|
223
281
|
/** 日期面板展示的年份变化 */ datePanelYearChange: 'Control.datePanelYearChange',
|
|
224
|
-
/** 日期销毁 */ dateDestroy: 'Control.
|
|
282
|
+
/** 日期销毁 */ dateDestroy: 'Control.dateDestroy',
|
|
225
283
|
/** 时间面板展示隐藏变换 */ timePanelOpenChange: 'Control.timePanelOpenChange',
|
|
226
284
|
/** 时间改变 */ timeChange: 'Control.timeChange',
|
|
227
285
|
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
228
286
|
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
229
287
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
288
|
+
/** 控件不支持当前播放类型(仅提示,控件仍会渲染) */ unsupportedPlayType: 'Control.unsupportedPlayType',
|
|
230
289
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
231
290
|
/** 主题控件挂载完成, 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ mountedControls: 'Control.mountedControls',
|
|
232
291
|
/** 主题控件卸载前, 已有控件卸载时才可触发 */ beforeUnmountControls: 'Control.beforeUnmountControls',
|
|
@@ -236,7 +295,7 @@ var EVENTS = {
|
|
|
236
295
|
/** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
|
|
237
296
|
/** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
|
|
238
297
|
/** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
|
|
239
|
-
},
|
|
298
|
+
}),
|
|
240
299
|
/**
|
|
241
300
|
* 主题控件相关
|
|
242
301
|
*/ theme: {
|
|
@@ -286,17 +345,17 @@ function _set_prototype_of$z(o, p) {
|
|
|
286
345
|
};
|
|
287
346
|
return _set_prototype_of$z(o, p);
|
|
288
347
|
}
|
|
289
|
-
/**
|
|
290
|
-
* 控件基类
|
|
291
|
-
* @category Control
|
|
292
|
-
* @example
|
|
293
|
-
* ```ts
|
|
294
|
-
* // 创建控件
|
|
295
|
-
* class MyControl extends Control {}
|
|
296
|
-
*
|
|
297
|
-
* // 使用控件
|
|
298
|
-
* const myControl = new MyControl({})
|
|
299
|
-
* ```
|
|
348
|
+
/**
|
|
349
|
+
* 控件基类
|
|
350
|
+
* @category Control
|
|
351
|
+
* @example
|
|
352
|
+
* ```ts
|
|
353
|
+
* // 创建控件
|
|
354
|
+
* class MyControl extends Control {}
|
|
355
|
+
*
|
|
356
|
+
* // 使用控件
|
|
357
|
+
* const myControl = new MyControl({})
|
|
358
|
+
* ```
|
|
300
359
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
301
360
|
_inherits$z(Control, EventEmitter);
|
|
302
361
|
function Control(options) {
|
|
@@ -338,22 +397,22 @@ function _set_prototype_of$z(o, p) {
|
|
|
338
397
|
return _this;
|
|
339
398
|
}
|
|
340
399
|
var _proto = Control.prototype;
|
|
341
|
-
/**
|
|
342
|
-
* 重置整个控件
|
|
400
|
+
/**
|
|
401
|
+
* 重置整个控件
|
|
343
402
|
*/ _proto.reset = function reset(hide) {
|
|
344
403
|
if (this._camelCaseName) {
|
|
345
404
|
this.emit("Control." + this._camelCaseName + "Reset", hide);
|
|
346
405
|
}
|
|
347
406
|
};
|
|
348
|
-
/**
|
|
349
|
-
* 重置控件挂载节点
|
|
350
|
-
* @param popupContainer 重新挂载的节点
|
|
351
|
-
* @param append 添加的方式, 默认 append
|
|
352
|
-
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
353
|
-
*
|
|
354
|
-
* | prepend | append |
|
|
355
|
-
* |:-------------:|:---------------:|
|
|
356
|
-
* | 插入第一个位置 | 追加在末尾 |
|
|
407
|
+
/**
|
|
408
|
+
* 重置控件挂载节点
|
|
409
|
+
* @param popupContainer 重新挂载的节点
|
|
410
|
+
* @param append 添加的方式, 默认 append
|
|
411
|
+
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
412
|
+
*
|
|
413
|
+
* | prepend | append |
|
|
414
|
+
* |:-------------:|:---------------:|
|
|
415
|
+
* | 插入第一个位置 | 追加在末尾 |
|
|
357
416
|
*/ _proto.resetPopupContainer = function resetPopupContainer(popupContainer, append, element) {
|
|
358
417
|
if (popupContainer !== this.$popupContainer) {
|
|
359
418
|
if (this.$popupContainer.contains(this.$container)) {
|
|
@@ -375,16 +434,16 @@ function _set_prototype_of$z(o, p) {
|
|
|
375
434
|
}
|
|
376
435
|
}
|
|
377
436
|
};
|
|
378
|
-
/**
|
|
379
|
-
* 隐藏整个控件
|
|
437
|
+
/**
|
|
438
|
+
* 隐藏整个控件
|
|
380
439
|
*/ _proto.hide = function hide() {
|
|
381
440
|
if (this.$container) {
|
|
382
441
|
this.$container.style.display = 'none';
|
|
383
442
|
this.$container.classList.add("" + PREFIX_CLASS + "-hide");
|
|
384
443
|
}
|
|
385
444
|
};
|
|
386
|
-
/**
|
|
387
|
-
* 销毁控件
|
|
445
|
+
/**
|
|
446
|
+
* 销毁控件
|
|
388
447
|
*/ _proto.destroy = function destroy() {
|
|
389
448
|
var _this___options, _this_$container_remove, _this_$container;
|
|
390
449
|
if (this._camelCaseName) {
|
|
@@ -421,8 +480,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
421
480
|
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS + "-active");
|
|
422
481
|
}
|
|
423
482
|
};
|
|
424
|
-
/**
|
|
425
|
-
* 当点击 Control 时 触发子类的 _onControlClick
|
|
483
|
+
/**
|
|
484
|
+
* 当点击 Control 时 触发子类的 _onControlClick
|
|
426
485
|
*/ _proto._onClick = function _onClick() {
|
|
427
486
|
var _this = this;
|
|
428
487
|
// 使用具名 handler 便于在 destroy 时精确移除,避免匿名监听残留
|
|
@@ -440,19 +499,29 @@ function _set_prototype_of$z(o, p) {
|
|
|
440
499
|
e.stopPropagation();
|
|
441
500
|
e.preventDefault();
|
|
442
501
|
};
|
|
443
|
-
/**
|
|
444
|
-
* 点击 Control 控件触发
|
|
445
|
-
* @param {Event} e
|
|
446
|
-
* @returns {void}
|
|
502
|
+
/**
|
|
503
|
+
* 点击 Control 控件触发
|
|
504
|
+
* @param {Event} e
|
|
505
|
+
* @returns {void}
|
|
447
506
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
448
507
|
// 这是一个空函数, 子类可以实现重新改方法
|
|
449
508
|
this.__options.onClick == null ? void 0 : this.__options.onClick.call(this.__options, e);
|
|
450
509
|
};
|
|
510
|
+
/**
|
|
511
|
+
* 判断某个播放类型是否被本控件支持
|
|
512
|
+
*
|
|
513
|
+
* @param playType 播放类型;传空串(无法从地址判定)时一律返回 `true`,避免误报
|
|
514
|
+
* @returns 是否支持
|
|
515
|
+
* @since 3.1.7
|
|
516
|
+
*/ Control.supportsPlayType = function supportsPlayType(playType) {
|
|
517
|
+
if (!playType) return true;
|
|
518
|
+
return this.supportedPlayTypes.includes(playType);
|
|
519
|
+
};
|
|
451
520
|
_create_class$9(Control, [
|
|
452
521
|
{
|
|
453
522
|
key: "active",
|
|
454
|
-
get: /**
|
|
455
|
-
* 是否激活
|
|
523
|
+
get: /**
|
|
524
|
+
* 是否激活
|
|
456
525
|
*/ function get() {
|
|
457
526
|
return this._active;
|
|
458
527
|
},
|
|
@@ -467,8 +536,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
467
536
|
},
|
|
468
537
|
{
|
|
469
538
|
key: "disabled",
|
|
470
|
-
get: /**
|
|
471
|
-
* 是否禁用
|
|
539
|
+
get: /**
|
|
540
|
+
* 是否禁用
|
|
472
541
|
*/ function get() {
|
|
473
542
|
return this._disabled;
|
|
474
543
|
},
|
|
@@ -480,6 +549,24 @@ function _set_prototype_of$z(o, p) {
|
|
|
480
549
|
]);
|
|
481
550
|
return Control;
|
|
482
551
|
}(EventEmitter);
|
|
552
|
+
/**
|
|
553
|
+
* 该控件支持的播放类型,默认全支持
|
|
554
|
+
*
|
|
555
|
+
* 子类用 `static supportedPlayTypes = [...]` 覆盖来收窄范围。声明是**静态**的,
|
|
556
|
+
* 因为渲染层需要在不实例化控件的前提下就能读到(`Controls[iconId].supportedPlayTypes`)。
|
|
557
|
+
*
|
|
558
|
+
* 渲染时会拿 `theme.playType` 与此比对,不匹配只发警告与 `Control.unsupportedPlayType`
|
|
559
|
+
* 事件,**不阻止渲染**,控件照常创建、照常可交互,行为是否生效由 SDK 层与设备能力决定。
|
|
560
|
+
*
|
|
561
|
+
* @since 3.1.7
|
|
562
|
+
* @example
|
|
563
|
+
* ```ts
|
|
564
|
+
* class MyControl extends Control {
|
|
565
|
+
* // 只在云存储回放下有意义
|
|
566
|
+
* static supportedPlayTypes: ThemePlayType[] = ['cloudRec'];
|
|
567
|
+
* }
|
|
568
|
+
* ```
|
|
569
|
+
*/ Control.supportedPlayTypes = [].concat(PLAY_TYPES);
|
|
483
570
|
|
|
484
571
|
function _extends$y() {
|
|
485
572
|
_extends$y = Object.assign || function assign(target) {
|
|
@@ -512,9 +599,9 @@ function _set_prototype_of$y(o, p) {
|
|
|
512
599
|
return _set_prototype_of$y(o, p);
|
|
513
600
|
}
|
|
514
601
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
515
|
-
/**
|
|
516
|
-
* 加载动画控件
|
|
517
|
-
* @category Control
|
|
602
|
+
/**
|
|
603
|
+
* 加载动画控件
|
|
604
|
+
* @category Control
|
|
518
605
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
519
606
|
_inherits$y(Loading, Control);
|
|
520
607
|
function Loading(options) {
|
|
@@ -539,9 +626,9 @@ var LOADING_DEFAULT_OPTIONS = {};
|
|
|
539
626
|
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + "-loading-dot " + PREFIX_CLASS + '-loading-dot-load">\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n </span>\n <div class="' + PREFIX_CLASS + '-loading-text">' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.LOADING) || 'loading...') + "</div>\n ";
|
|
540
627
|
}
|
|
541
628
|
};
|
|
542
|
-
/**
|
|
543
|
-
* 动画展示
|
|
544
|
-
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
629
|
+
/**
|
|
630
|
+
* 动画展示
|
|
631
|
+
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
545
632
|
*/ _proto.show = function show(html) {
|
|
546
633
|
if (html) this.$container.innerHTML = html;
|
|
547
634
|
// 初始化, 出流再等待中(回放出流结束不包括)
|
|
@@ -549,8 +636,8 @@ var LOADING_DEFAULT_OPTIONS = {};
|
|
|
549
636
|
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
550
637
|
this.$popupContainer.classList.add("" + PREFIX_CLASS + "-has-loading");
|
|
551
638
|
};
|
|
552
|
-
/**
|
|
553
|
-
* 隐藏动画
|
|
639
|
+
/**
|
|
640
|
+
* 隐藏动画
|
|
554
641
|
*/ _proto.hide = function hide() {
|
|
555
642
|
Control.prototype.hide.call(this);
|
|
556
643
|
this.$popupContainer.classList.remove("" + PREFIX_CLASS + "-has-loading");
|
|
@@ -594,9 +681,9 @@ var DEFAULT_POSTER = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29
|
|
|
594
681
|
var POSTER_OPTIONS = {
|
|
595
682
|
poster: DEFAULT_POSTER
|
|
596
683
|
};
|
|
597
|
-
/**
|
|
598
|
-
* 封面控件
|
|
599
|
-
* @category Control
|
|
684
|
+
/**
|
|
685
|
+
* 封面控件
|
|
686
|
+
* @category Control
|
|
600
687
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
601
688
|
_inherits$x(Poster, Control);
|
|
602
689
|
function Poster(options) {
|
|
@@ -616,18 +703,18 @@ var POSTER_OPTIONS = {
|
|
|
616
703
|
return _this;
|
|
617
704
|
}
|
|
618
705
|
var _proto = Poster.prototype;
|
|
619
|
-
/**
|
|
620
|
-
* 封面图片加载失败
|
|
621
|
-
* @param error
|
|
706
|
+
/**
|
|
707
|
+
* 封面图片加载失败
|
|
708
|
+
* @param error
|
|
622
709
|
*/ _proto._imgLoadErrorEvent = function _imgLoadErrorEvent(error) {
|
|
623
710
|
var _error_target;
|
|
624
711
|
// 封面加载失败, 一般只有自定义封面会出现这种情况
|
|
625
712
|
// 这里不做img src重置处理 防止无限循环
|
|
626
713
|
this._options.onLoadImgError == null ? void 0 : this._options.onLoadImgError.call(this._options, ((_error_target = error.target) == null ? void 0 : _error_target.getAttribute('src')) || '');
|
|
627
714
|
};
|
|
628
|
-
/**
|
|
629
|
-
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
630
|
-
* @param {string} poster 封面地址或 base64 数据
|
|
715
|
+
/**
|
|
716
|
+
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
717
|
+
* @param {string} poster 封面地址或 base64 数据
|
|
631
718
|
*/ _proto.setPoster = function setPoster(poster) {
|
|
632
719
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
633
720
|
// prettier-ignore
|
|
@@ -640,24 +727,24 @@ var POSTER_OPTIONS = {
|
|
|
640
727
|
this.$container.innerHTML = '<img class="' + PREFIX_CLASS + '-poster-img" src="' + poster + '" />';
|
|
641
728
|
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.addEventListener("error", this._imgLoadErrorEvent);
|
|
642
729
|
};
|
|
643
|
-
/**
|
|
644
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
730
|
+
/**
|
|
731
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
645
732
|
*/ _proto.show = function show() {
|
|
646
733
|
if (this.$container) {
|
|
647
734
|
this.$container.style.display = 'flex';
|
|
648
735
|
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
649
736
|
}
|
|
650
737
|
};
|
|
651
|
-
/**
|
|
652
|
-
* 隐藏封面
|
|
738
|
+
/**
|
|
739
|
+
* 隐藏封面
|
|
653
740
|
*/ _proto.hide = function hide() {
|
|
654
741
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
655
742
|
_this_$container_querySelector, _this_$container;
|
|
656
743
|
Control.prototype.hide.call(this);
|
|
657
744
|
(_this_$container = this.$container) == null ? void 0 : (_this_$container_querySelector = _this_$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.removeEventListener('error', this._imgLoadErrorEvent);
|
|
658
745
|
};
|
|
659
|
-
/**
|
|
660
|
-
* 销毁
|
|
746
|
+
/**
|
|
747
|
+
* 销毁
|
|
661
748
|
*/ _proto.destroy = function destroy() {
|
|
662
749
|
this.hide();
|
|
663
750
|
Control.prototype.destroy.call(this);
|
|
@@ -716,15 +803,15 @@ var Icons = {
|
|
|
716
803
|
list: '<svg stroke="currentColor" fill="none" width="1em" height="1em" viewBox="0 0 24 24" focusable="false" aria-hidden="true" data-icon="list">\n <path d="M10.9995 5H21.0005" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M10.9995 12H21.0005" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M10.9995 19H21.0005" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 5C6.99951 3.896 6.10351 3 4.99951 3C3.89551 3 2.99951 3.896 2.99951 5C2.99951 6.105 3.89551 7 4.99951 7C6.10351 7 6.99951 6.105 6.99951 5V5Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 12C6.99951 10.896 6.10351 10 4.99951 10C3.89551 10 2.99951 10.896 2.99951 12C2.99951 13.105 3.89551 14 4.99951 14C6.10351 14 6.99951 13.105 6.99951 12V12Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 12C6.99951 10.896 6.10351 10 4.99951 10C3.89551 10 2.99951 10.896 2.99951 12C2.99951 13.105 3.89551 14 4.99951 14C6.10351 14 6.99951 13.105 6.99951 12V12Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.99951 19C6.99951 17.896 6.10351 17 4.99951 17C3.89551 17 2.99951 17.896 2.99951 19C2.99951 20.105 3.89551 21 4.99951 21C6.10351 21 6.99951 20.105 6.99951 19V19Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'
|
|
717
804
|
};
|
|
718
805
|
|
|
719
|
-
/**
|
|
720
|
-
* 创建 icon 组件
|
|
721
|
-
* @param svg - svg 字符串
|
|
722
|
-
* @param type - icon 类型
|
|
723
|
-
* @returns icon 组件
|
|
724
|
-
* @example
|
|
725
|
-
* ```ts
|
|
726
|
-
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
727
|
-
* ```
|
|
806
|
+
/**
|
|
807
|
+
* 创建 icon 组件
|
|
808
|
+
* @param svg - svg 字符串
|
|
809
|
+
* @param type - icon 类型
|
|
810
|
+
* @returns icon 组件
|
|
811
|
+
* @example
|
|
812
|
+
* ```ts
|
|
813
|
+
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
814
|
+
* ```
|
|
728
815
|
*/ function createIcon(svg, type, attr) {
|
|
729
816
|
if (attr === void 0) attr = {};
|
|
730
817
|
var attrStr = '';
|
|
@@ -925,9 +1012,9 @@ function _set_prototype_of$w(o, p) {
|
|
|
925
1012
|
return _set_prototype_of$w(o, p);
|
|
926
1013
|
}
|
|
927
1014
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
928
|
-
/**
|
|
929
|
-
* 消息控件
|
|
930
|
-
* @category Control
|
|
1015
|
+
/**
|
|
1016
|
+
* 消息控件
|
|
1017
|
+
* @category Control
|
|
931
1018
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
932
1019
|
_inherits$w(Message, Control);
|
|
933
1020
|
function Message(options) {
|
|
@@ -942,34 +1029,34 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
942
1029
|
return _this;
|
|
943
1030
|
}
|
|
944
1031
|
var _proto = Message.prototype;
|
|
945
|
-
/**
|
|
946
|
-
* info 普通消息, 内容默认字体白色
|
|
947
|
-
* @param {string} msg 消息内容
|
|
948
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1032
|
+
/**
|
|
1033
|
+
* info 普通消息, 内容默认字体白色
|
|
1034
|
+
* @param {string} msg 消息内容
|
|
1035
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
949
1036
|
*/ _proto.info = function info(msg, duration) {
|
|
950
1037
|
if (duration === void 0) duration = 2;
|
|
951
1038
|
this._toast(msg, 'info', duration);
|
|
952
1039
|
};
|
|
953
|
-
/**
|
|
954
|
-
* warn 警告消息, 内容默认字体黄色
|
|
955
|
-
* @param {string} msg 消息内容
|
|
956
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
1040
|
+
/**
|
|
1041
|
+
* warn 警告消息, 内容默认字体黄色
|
|
1042
|
+
* @param {string} msg 消息内容
|
|
1043
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
957
1044
|
*/ _proto.warn = function warn(msg, duration) {
|
|
958
1045
|
if (duration === void 0) duration = 2;
|
|
959
1046
|
this._toast(msg, 'warn', duration);
|
|
960
1047
|
};
|
|
961
|
-
/**
|
|
962
|
-
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
963
|
-
* @param {string} msg 消息内容
|
|
964
|
-
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
1048
|
+
/**
|
|
1049
|
+
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
1050
|
+
* @param {string} msg 消息内容
|
|
1051
|
+
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
965
1052
|
*/ _proto.toastError = function toastError(msg, duration) {
|
|
966
1053
|
if (duration === void 0) duration = 2;
|
|
967
1054
|
this._toast(msg, 'error', duration);
|
|
968
1055
|
};
|
|
969
|
-
/**
|
|
970
|
-
* error 错误消息, 内容默认字体红色
|
|
971
|
-
* @param {string} msg 消息内容
|
|
972
|
-
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
1056
|
+
/**
|
|
1057
|
+
* error 错误消息, 内容默认字体红色
|
|
1058
|
+
* @param {string} msg 消息内容
|
|
1059
|
+
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
973
1060
|
*/ _proto.error = function error(msg, duration) {
|
|
974
1061
|
if (duration === void 0) duration = 0;
|
|
975
1062
|
this._show(this._getIcon('error') + '<div class="' + PREFIX_CLASS + '-message-msg">' + (msg || '') + "</div>", duration, 'error');
|
|
@@ -998,11 +1085,11 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
998
1085
|
}
|
|
999
1086
|
}
|
|
1000
1087
|
};
|
|
1001
|
-
/**
|
|
1002
|
-
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1003
|
-
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1004
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1005
|
-
* @param {MessageType} type 消息类型
|
|
1088
|
+
/**
|
|
1089
|
+
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1090
|
+
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1091
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1092
|
+
* @param {MessageType} type 消息类型
|
|
1006
1093
|
*/ _proto._show = function _show(msg, duration, type) {
|
|
1007
1094
|
var _this = this;
|
|
1008
1095
|
if (duration === void 0) duration = 0;
|
|
@@ -1030,8 +1117,8 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
1030
1117
|
}, duration * 1000);
|
|
1031
1118
|
}
|
|
1032
1119
|
};
|
|
1033
|
-
/**
|
|
1034
|
-
* 销毁
|
|
1120
|
+
/**
|
|
1121
|
+
* 销毁
|
|
1035
1122
|
*/ _proto.destroy = function destroy() {
|
|
1036
1123
|
var _this__$toast;
|
|
1037
1124
|
if (this._timer) {
|
|
@@ -1046,8 +1133,8 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
1046
1133
|
this.hide();
|
|
1047
1134
|
Control.prototype.destroy.call(this);
|
|
1048
1135
|
};
|
|
1049
|
-
/**
|
|
1050
|
-
* 隐藏消息, 并清空消息内容
|
|
1136
|
+
/**
|
|
1137
|
+
* 隐藏消息, 并清空消息内容
|
|
1051
1138
|
*/ _proto.hide = function hide() {
|
|
1052
1139
|
var _this = this;
|
|
1053
1140
|
// 每次隐藏都清空内 消息内容
|
|
@@ -1120,9 +1207,9 @@ function _set_prototype_of$v(o, p) {
|
|
|
1120
1207
|
};
|
|
1121
1208
|
return _set_prototype_of$v(o, p);
|
|
1122
1209
|
}
|
|
1123
|
-
/**
|
|
1124
|
-
* 播放/暂停控件
|
|
1125
|
-
* @category Control
|
|
1210
|
+
/**
|
|
1211
|
+
* 播放/暂停控件
|
|
1212
|
+
* @category Control
|
|
1126
1213
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1127
1214
|
_inherits$v(Play, Control);
|
|
1128
1215
|
function Play(options) {
|
|
@@ -1144,8 +1231,8 @@ function _set_prototype_of$v(o, p) {
|
|
|
1144
1231
|
return _this;
|
|
1145
1232
|
}
|
|
1146
1233
|
var _proto = Play.prototype;
|
|
1147
|
-
/**
|
|
1148
|
-
* 点击 Control 会触发
|
|
1234
|
+
/**
|
|
1235
|
+
* 点击 Control 会触发
|
|
1149
1236
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
1150
1237
|
this._playing = !this._playing;
|
|
1151
1238
|
this.emit(EVENTS.control.play, this._playing);
|
|
@@ -1168,8 +1255,8 @@ function _set_prototype_of$v(o, p) {
|
|
|
1168
1255
|
_create_class$8(Play, [
|
|
1169
1256
|
{
|
|
1170
1257
|
key: "playing",
|
|
1171
|
-
get: /**
|
|
1172
|
-
* 播放状态
|
|
1258
|
+
get: /**
|
|
1259
|
+
* 播放状态
|
|
1173
1260
|
*/ function get() {
|
|
1174
1261
|
return this._playing;
|
|
1175
1262
|
}
|
|
@@ -1178,12 +1265,12 @@ function _set_prototype_of$v(o, p) {
|
|
|
1178
1265
|
return Play;
|
|
1179
1266
|
}(Control);
|
|
1180
1267
|
|
|
1181
|
-
/**
|
|
1182
|
-
* 节流函数
|
|
1183
|
-
* @param {Function} func
|
|
1184
|
-
* @param {number} wait
|
|
1185
|
-
* @typeParam T - 函数类型
|
|
1186
|
-
* @returns {Function}
|
|
1268
|
+
/**
|
|
1269
|
+
* 节流函数
|
|
1270
|
+
* @param {Function} func
|
|
1271
|
+
* @param {number} wait
|
|
1272
|
+
* @typeParam T - 函数类型
|
|
1273
|
+
* @returns {Function}
|
|
1187
1274
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
1188
1275
|
function throttle(func, wait) {
|
|
1189
1276
|
var timeout = null;
|
|
@@ -1239,28 +1326,28 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1239
1326
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1240
1327
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
1241
1328
|
}
|
|
1242
|
-
/**
|
|
1243
|
-
* 工具类
|
|
1244
|
-
* @category Util
|
|
1329
|
+
/**
|
|
1330
|
+
* 工具类
|
|
1331
|
+
* @category Util
|
|
1245
1332
|
*/ var Utils = /*#__PURE__*/ function() {
|
|
1246
1333
|
function Utils() {}
|
|
1247
1334
|
// /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(navigator?.userAgent) ||
|
|
1248
1335
|
// (/Macintosh/i.test(navigator?.userAgent) && navigator?.maxTouchPoints > 1); // iPad 支持多点触控;
|
|
1249
|
-
/**
|
|
1250
|
-
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
1251
|
-
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
1252
|
-
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
1253
|
-
*
|
|
1254
|
-
* @example
|
|
1255
|
-
* ```ts
|
|
1256
|
-
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
1257
|
-
* console.log("orientation", orientation)
|
|
1258
|
-
* })
|
|
1259
|
-
*
|
|
1260
|
-
* console.log("orientation", orientation)
|
|
1261
|
-
* // 清除监听
|
|
1262
|
-
* cleanUp()
|
|
1263
|
-
* ```
|
|
1336
|
+
/**
|
|
1337
|
+
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
1338
|
+
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
1339
|
+
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1342
|
+
* ```ts
|
|
1343
|
+
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
1344
|
+
* console.log("orientation", orientation)
|
|
1345
|
+
* })
|
|
1346
|
+
*
|
|
1347
|
+
* console.log("orientation", orientation)
|
|
1348
|
+
* // 清除监听
|
|
1349
|
+
* cleanUp()
|
|
1350
|
+
* ```
|
|
1264
1351
|
*/ // prettier-ignore
|
|
1265
1352
|
Utils.orientationEventListener = function orientationEventListener(change) {
|
|
1266
1353
|
var _orientationTimer = null;
|
|
@@ -1350,18 +1437,18 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1350
1437
|
}
|
|
1351
1438
|
];
|
|
1352
1439
|
};
|
|
1353
|
-
/**
|
|
1354
|
-
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
1355
|
-
* @param {Element} node
|
|
1356
|
-
* @param callback
|
|
1357
|
-
* @returns {CleanUpResizeObserver}
|
|
1358
|
-
* @example
|
|
1359
|
-
* ```ts
|
|
1360
|
-
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
1361
|
-
*
|
|
1362
|
-
* // 移除监听
|
|
1363
|
-
* unobserve()
|
|
1364
|
-
* ```
|
|
1440
|
+
/**
|
|
1441
|
+
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
1442
|
+
* @param {Element} node
|
|
1443
|
+
* @param callback
|
|
1444
|
+
* @returns {CleanUpResizeObserver}
|
|
1445
|
+
* @example
|
|
1446
|
+
* ```ts
|
|
1447
|
+
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
1448
|
+
*
|
|
1449
|
+
* // 移除监听
|
|
1450
|
+
* unobserve()
|
|
1451
|
+
* ```
|
|
1365
1452
|
*/ // prettier-ignore
|
|
1366
1453
|
Utils.resizeObserver = function resizeObserver(node, callback) {
|
|
1367
1454
|
// prettier-ignore
|
|
@@ -1396,12 +1483,12 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1396
1483
|
return Utils;
|
|
1397
1484
|
}();
|
|
1398
1485
|
// 不要使用 window, 如果在 worker 中会报错
|
|
1399
|
-
/**
|
|
1400
|
-
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
1401
|
-
* @example
|
|
1402
|
-
* ```ts
|
|
1403
|
-
* Utils.isMobile // true | false
|
|
1404
|
-
* ```
|
|
1486
|
+
/**
|
|
1487
|
+
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
1488
|
+
* @example
|
|
1489
|
+
* ```ts
|
|
1490
|
+
* Utils.isMobile // true | false
|
|
1491
|
+
* ```
|
|
1405
1492
|
*/ Utils.isMobile = utilsTools.isMobile();
|
|
1406
1493
|
|
|
1407
1494
|
function _defineProperties$7(target, props) {
|
|
@@ -1435,23 +1522,23 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1435
1522
|
return (percent * 100).toFixed(0);
|
|
1436
1523
|
}
|
|
1437
1524
|
};
|
|
1438
|
-
/**
|
|
1439
|
-
* 进度条
|
|
1440
|
-
*
|
|
1441
|
-
* @category Control
|
|
1442
|
-
* @example
|
|
1443
|
-
* ```ts
|
|
1444
|
-
* const progress = new Progress({
|
|
1445
|
-
* container: document.getElementById('progress-container'),
|
|
1446
|
-
* step: 0.01,
|
|
1447
|
-
* range: [0, 1],
|
|
1448
|
-
* onChange: (value, range) => {
|
|
1449
|
-
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
1450
|
-
* },
|
|
1451
|
-
* defaultValue: 0.5,
|
|
1452
|
-
* draggable: true,
|
|
1453
|
-
* disabled: false,
|
|
1454
|
-
* })
|
|
1525
|
+
/**
|
|
1526
|
+
* 进度条
|
|
1527
|
+
*
|
|
1528
|
+
* @category Control
|
|
1529
|
+
* @example
|
|
1530
|
+
* ```ts
|
|
1531
|
+
* const progress = new Progress({
|
|
1532
|
+
* container: document.getElementById('progress-container'),
|
|
1533
|
+
* step: 0.01,
|
|
1534
|
+
* range: [0, 1],
|
|
1535
|
+
* onChange: (value, range) => {
|
|
1536
|
+
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
1537
|
+
* },
|
|
1538
|
+
* defaultValue: 0.5,
|
|
1539
|
+
* draggable: true,
|
|
1540
|
+
* disabled: false,
|
|
1541
|
+
* })
|
|
1455
1542
|
*/ var Progress = /*#__PURE__*/ function() {
|
|
1456
1543
|
function Progress(options) {
|
|
1457
1544
|
var _this_options_defaultValue;
|
|
@@ -1484,20 +1571,20 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1484
1571
|
this.disabled = this.options.disabled;
|
|
1485
1572
|
}
|
|
1486
1573
|
var _proto = Progress.prototype;
|
|
1487
|
-
/**
|
|
1488
|
-
* 是否旋转了
|
|
1489
|
-
* @param rotated
|
|
1574
|
+
/**
|
|
1575
|
+
* 是否旋转了
|
|
1576
|
+
* @param rotated
|
|
1490
1577
|
*/ _proto.isRotate = function isRotate(rotated) {
|
|
1491
1578
|
this._isRotated = rotated;
|
|
1492
1579
|
};
|
|
1493
|
-
/**
|
|
1494
|
-
* 销毁 Progress 实例,移除事件监听器
|
|
1495
|
-
* @returns {void}
|
|
1496
|
-
* @memberof Progress
|
|
1497
|
-
* @example
|
|
1498
|
-
* ```ts
|
|
1499
|
-
* progress.destroy();
|
|
1500
|
-
* ```
|
|
1580
|
+
/**
|
|
1581
|
+
* 销毁 Progress 实例,移除事件监听器
|
|
1582
|
+
* @returns {void}
|
|
1583
|
+
* @memberof Progress
|
|
1584
|
+
* @example
|
|
1585
|
+
* ```ts
|
|
1586
|
+
* progress.destroy();
|
|
1587
|
+
* ```
|
|
1501
1588
|
*/ _proto.destroy = function destroy() {
|
|
1502
1589
|
var _this__delegateSliderMouseDown_destroy, _this__delegateSliderMouseDown, _this__delegateSliderHandleMouseDown_destroy, _this__delegateSliderHandleMouseDown, _this__delegateProgressMouseDown_destroy, _this__delegateProgressMouseDown, _this__delegatePlusClick_destroy, _this__delegatePlusClick, _this__delegateMinusClick_destroy, _this__delegateMinusClick;
|
|
1503
1590
|
(_this__delegateSliderMouseDown = this._delegateSliderMouseDown) == null ? void 0 : (_this__delegateSliderMouseDown_destroy = _this__delegateSliderMouseDown.destroy) == null ? void 0 : _this__delegateSliderMouseDown_destroy.call(_this__delegateSliderMouseDown);
|
|
@@ -1692,14 +1779,14 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1692
1779
|
},
|
|
1693
1780
|
{
|
|
1694
1781
|
key: "value",
|
|
1695
|
-
get: /**
|
|
1696
|
-
* 获取进度条值
|
|
1697
|
-
* @returns {number} 当前进度条值
|
|
1698
|
-
* @example
|
|
1699
|
-
* ```ts
|
|
1700
|
-
* const value = progress.value; // 获取当前进度条值
|
|
1701
|
-
* console.log(value); // 输出值
|
|
1702
|
-
* ```
|
|
1782
|
+
get: /**
|
|
1783
|
+
* 获取进度条值
|
|
1784
|
+
* @returns {number} 当前进度条值
|
|
1785
|
+
* @example
|
|
1786
|
+
* ```ts
|
|
1787
|
+
* const value = progress.value; // 获取当前进度条值
|
|
1788
|
+
* console.log(value); // 输出值
|
|
1789
|
+
* ```
|
|
1703
1790
|
*/ function get() {
|
|
1704
1791
|
return this._value; //
|
|
1705
1792
|
},
|
|
@@ -1709,14 +1796,14 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1709
1796
|
},
|
|
1710
1797
|
{
|
|
1711
1798
|
key: "percent",
|
|
1712
|
-
get: /**
|
|
1713
|
-
* 获取进度百分比
|
|
1714
|
-
* @returns {number} 当前进度条百分比
|
|
1715
|
-
* @example
|
|
1716
|
-
* ```ts
|
|
1717
|
-
* const percent = progress.percent; // 获取当前进度条百分比
|
|
1718
|
-
* console.log(percent); // 输出百分比
|
|
1719
|
-
* ```
|
|
1799
|
+
get: /**
|
|
1800
|
+
* 获取进度百分比
|
|
1801
|
+
* @returns {number} 当前进度条百分比
|
|
1802
|
+
* @example
|
|
1803
|
+
* ```ts
|
|
1804
|
+
* const percent = progress.percent; // 获取当前进度条百分比
|
|
1805
|
+
* console.log(percent); // 输出百分比
|
|
1806
|
+
* ```
|
|
1720
1807
|
*/ function get() {
|
|
1721
1808
|
return this._percent;
|
|
1722
1809
|
},
|
|
@@ -1779,9 +1866,9 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1779
1866
|
onOpenChange: function onOpenChange() {},
|
|
1780
1867
|
onChange: function onChange() {}
|
|
1781
1868
|
};
|
|
1782
|
-
/**
|
|
1783
|
-
* 音量调节控件
|
|
1784
|
-
* @category Control
|
|
1869
|
+
/**
|
|
1870
|
+
* 音量调节控件
|
|
1871
|
+
* @category Control
|
|
1785
1872
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
1786
1873
|
_inherits$u(Volume, Control);
|
|
1787
1874
|
function Volume(options) {
|
|
@@ -1855,8 +1942,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1855
1942
|
return _this;
|
|
1856
1943
|
}
|
|
1857
1944
|
var _proto = Volume.prototype;
|
|
1858
|
-
/**
|
|
1859
|
-
* 销毁
|
|
1945
|
+
/**
|
|
1946
|
+
* 销毁
|
|
1860
1947
|
*/ _proto.destroy = function destroy() {
|
|
1861
1948
|
var _this__progress_destroy, _this__progress, _this_picker;
|
|
1862
1949
|
(_this__progress = this._progress) == null ? void 0 : (_this__progress_destroy = _this__progress.destroy) == null ? void 0 : _this__progress_destroy.call(_this__progress);
|
|
@@ -1914,8 +2001,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1914
2001
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_VOLUME
|
|
1915
2002
|
});
|
|
1916
2003
|
};
|
|
1917
|
-
/**
|
|
1918
|
-
* 点击 Control 会触发
|
|
2004
|
+
/**
|
|
2005
|
+
* 点击 Control 会触发
|
|
1919
2006
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
1920
2007
|
// this._options.onClick?.(e);
|
|
1921
2008
|
};
|
|
@@ -1932,8 +2019,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1932
2019
|
_create_class$6(Volume, [
|
|
1933
2020
|
{
|
|
1934
2021
|
key: "muted",
|
|
1935
|
-
get: /**
|
|
1936
|
-
* 是否静音
|
|
2022
|
+
get: /**
|
|
2023
|
+
* 是否静音
|
|
1937
2024
|
*/ function get() {
|
|
1938
2025
|
return this._muted;
|
|
1939
2026
|
},
|
|
@@ -1957,8 +2044,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1957
2044
|
},
|
|
1958
2045
|
{
|
|
1959
2046
|
key: "volume",
|
|
1960
|
-
get: /**
|
|
1961
|
-
* 当前音量值(真实值 即使静音)
|
|
2047
|
+
get: /**
|
|
2048
|
+
* 当前音量值(真实值 即使静音)
|
|
1962
2049
|
*/ function get() {
|
|
1963
2050
|
return this._lastVolume;
|
|
1964
2051
|
},
|
|
@@ -1981,8 +2068,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1981
2068
|
},
|
|
1982
2069
|
{
|
|
1983
2070
|
key: "disabled",
|
|
1984
|
-
get: /**
|
|
1985
|
-
* 是否禁用
|
|
2071
|
+
get: /**
|
|
2072
|
+
* 是否禁用
|
|
1986
2073
|
*/ function get() {
|
|
1987
2074
|
return this._disabled;
|
|
1988
2075
|
},
|
|
@@ -2482,9 +2569,9 @@ function _set_prototype_of$t(o, p) {
|
|
|
2482
2569
|
};
|
|
2483
2570
|
return _set_prototype_of$t(o, p);
|
|
2484
2571
|
}
|
|
2485
|
-
/**
|
|
2486
|
-
* 全屏控件
|
|
2487
|
-
* @category Control
|
|
2572
|
+
/**
|
|
2573
|
+
* 全屏控件
|
|
2574
|
+
* @category Control
|
|
2488
2575
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
2489
2576
|
_inherits$t(Fullscreen, Control);
|
|
2490
2577
|
function Fullscreen(options) {
|
|
@@ -2511,8 +2598,8 @@ function _set_prototype_of$t(o, p) {
|
|
|
2511
2598
|
return _this;
|
|
2512
2599
|
}
|
|
2513
2600
|
var _proto = Fullscreen.prototype;
|
|
2514
|
-
/**
|
|
2515
|
-
* 销毁
|
|
2601
|
+
/**
|
|
2602
|
+
* 销毁
|
|
2516
2603
|
*/ _proto.destroy = function destroy() {
|
|
2517
2604
|
var _this__fullscreenUtil;
|
|
2518
2605
|
this.$container.innerHTML = '';
|
|
@@ -2540,8 +2627,8 @@ function _set_prototype_of$t(o, p) {
|
|
|
2540
2627
|
this._render();
|
|
2541
2628
|
this.options.onChange == null ? void 0 : this.options.onChange.call(this.options, info);
|
|
2542
2629
|
};
|
|
2543
|
-
/**
|
|
2544
|
-
* 点击 Control 会触发
|
|
2630
|
+
/**
|
|
2631
|
+
* 点击 Control 会触发
|
|
2545
2632
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
2546
2633
|
if (this.isCurrentFullscreen) {
|
|
2547
2634
|
var _this__fullscreenUtil;
|
|
@@ -2585,9 +2672,9 @@ function _set_prototype_of$s(o, p) {
|
|
|
2585
2672
|
};
|
|
2586
2673
|
return _set_prototype_of$s(o, p);
|
|
2587
2674
|
}
|
|
2588
|
-
/**
|
|
2589
|
-
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2590
|
-
* @category Control
|
|
2675
|
+
/**
|
|
2676
|
+
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2677
|
+
* @category Control
|
|
2591
2678
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
2592
2679
|
_inherits$s(Rec, Control);
|
|
2593
2680
|
function Rec(options) {
|
|
@@ -2606,8 +2693,8 @@ function _set_prototype_of$s(o, p) {
|
|
|
2606
2693
|
return _this;
|
|
2607
2694
|
}
|
|
2608
2695
|
var _proto = Rec.prototype;
|
|
2609
|
-
/**
|
|
2610
|
-
* 销毁
|
|
2696
|
+
/**
|
|
2697
|
+
* 销毁
|
|
2611
2698
|
*/ _proto.destroy = function destroy() {
|
|
2612
2699
|
var _this__delegation;
|
|
2613
2700
|
this.$container.removeEventListener('dblclick', this._onDBlClick);
|
|
@@ -2615,9 +2702,9 @@ function _set_prototype_of$s(o, p) {
|
|
|
2615
2702
|
this._delegation = null;
|
|
2616
2703
|
Control.prototype.destroy.call(this);
|
|
2617
2704
|
};
|
|
2618
|
-
/**
|
|
2619
|
-
* 添加回放类型图标
|
|
2620
|
-
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2705
|
+
/**
|
|
2706
|
+
* 添加回放类型图标
|
|
2707
|
+
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2621
2708
|
*/ _proto.addRecType = function addRecType(id) {
|
|
2622
2709
|
var spanIcon = '';
|
|
2623
2710
|
switch(id){
|
|
@@ -2684,11 +2771,16 @@ function _set_prototype_of$s(o, p) {
|
|
|
2684
2771
|
}
|
|
2685
2772
|
});
|
|
2686
2773
|
};
|
|
2687
|
-
/**
|
|
2688
|
-
* 点击 Control 会触发
|
|
2774
|
+
/**
|
|
2775
|
+
* 点击 Control 会触发
|
|
2689
2776
|
*/ _proto._onControlClick = function _onControlClick(e) {};
|
|
2690
2777
|
return Rec;
|
|
2691
2778
|
}(Control);
|
|
2779
|
+
/** 回放类型切换组,本身就是三种回放之间的切换入口,直播下无意义 */ Rec.supportedPlayTypes = [
|
|
2780
|
+
'rec',
|
|
2781
|
+
'cloudRec',
|
|
2782
|
+
'cloudRecord'
|
|
2783
|
+
];
|
|
2692
2784
|
|
|
2693
2785
|
var zh = {
|
|
2694
2786
|
391001: '取流地址或端口非法',
|
|
@@ -3371,8 +3463,8 @@ var en = {
|
|
|
3371
3463
|
}
|
|
3372
3464
|
};
|
|
3373
3465
|
|
|
3374
|
-
/**
|
|
3375
|
-
* flv 预览
|
|
3466
|
+
/**
|
|
3467
|
+
* flv 预览
|
|
3376
3468
|
*/ var hlsLiveTemplate = {
|
|
3377
3469
|
autoFocus: 3,
|
|
3378
3470
|
// poster:
|
|
@@ -3424,8 +3516,8 @@ var en = {
|
|
|
3424
3516
|
}
|
|
3425
3517
|
};
|
|
3426
3518
|
|
|
3427
|
-
/**
|
|
3428
|
-
* flv 预览
|
|
3519
|
+
/**
|
|
3520
|
+
* flv 预览
|
|
3429
3521
|
*/ var hlsRecTemplate = {
|
|
3430
3522
|
autoFocus: 3,
|
|
3431
3523
|
// poster:
|
|
@@ -3483,8 +3575,8 @@ var en = {
|
|
|
3483
3575
|
}
|
|
3484
3576
|
};
|
|
3485
3577
|
|
|
3486
|
-
/**
|
|
3487
|
-
* pc 预览
|
|
3578
|
+
/**
|
|
3579
|
+
* pc 预览
|
|
3488
3580
|
*/ var pcLive = {
|
|
3489
3581
|
autoFocus: 3,
|
|
3490
3582
|
header: {
|
|
@@ -3583,8 +3675,8 @@ var en = {
|
|
|
3583
3675
|
}
|
|
3584
3676
|
};
|
|
3585
3677
|
|
|
3586
|
-
/**
|
|
3587
|
-
* pc 回放
|
|
3678
|
+
/**
|
|
3679
|
+
* pc 回放
|
|
3588
3680
|
*/ var pcRec = {
|
|
3589
3681
|
header: {
|
|
3590
3682
|
// color: DEFAULT_COLOR,
|
|
@@ -3695,8 +3787,8 @@ var en = {
|
|
|
3695
3787
|
}
|
|
3696
3788
|
};
|
|
3697
3789
|
|
|
3698
|
-
/**
|
|
3699
|
-
* mobile 预览
|
|
3790
|
+
/**
|
|
3791
|
+
* mobile 预览
|
|
3700
3792
|
*/ var mobileLive = {
|
|
3701
3793
|
header: {
|
|
3702
3794
|
// color: DEFAULT_COLOR,
|
|
@@ -3784,8 +3876,8 @@ var en = {
|
|
|
3784
3876
|
}
|
|
3785
3877
|
};
|
|
3786
3878
|
|
|
3787
|
-
/**
|
|
3788
|
-
* mobile 回放
|
|
3879
|
+
/**
|
|
3880
|
+
* mobile 回放
|
|
3789
3881
|
*/ var mobileRec = {
|
|
3790
3882
|
header: {
|
|
3791
3883
|
// color: DEFAULT_COLOR,
|
|
@@ -3879,8 +3971,8 @@ var en = {
|
|
|
3879
3971
|
}
|
|
3880
3972
|
};
|
|
3881
3973
|
|
|
3882
|
-
/**
|
|
3883
|
-
* 安防版(预览/回放)
|
|
3974
|
+
/**
|
|
3975
|
+
* 安防版(预览/回放)
|
|
3884
3976
|
*/ var security = {
|
|
3885
3977
|
header: {
|
|
3886
3978
|
// color: DEFAULT_COLOR,
|
|
@@ -3956,8 +4048,8 @@ var en = {
|
|
|
3956
4048
|
}
|
|
3957
4049
|
};
|
|
3958
4050
|
|
|
3959
|
-
/**
|
|
3960
|
-
* 语音版(预览)
|
|
4051
|
+
/**
|
|
4052
|
+
* 语音版(预览)
|
|
3961
4053
|
*/ var voice = {
|
|
3962
4054
|
header: {
|
|
3963
4055
|
// color: DEFAULT_COLOR,
|
|
@@ -4009,11 +4101,11 @@ var en = {
|
|
|
4009
4101
|
}
|
|
4010
4102
|
};
|
|
4011
4103
|
|
|
4012
|
-
/**
|
|
4013
|
-
* standard 做特殊处理
|
|
4014
|
-
*
|
|
4015
|
-
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
4016
|
-
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
4104
|
+
/**
|
|
4105
|
+
* standard 做特殊处理
|
|
4106
|
+
*
|
|
4107
|
+
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
4108
|
+
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
4017
4109
|
*/ var TEMPLATES = {
|
|
4018
4110
|
pcLive: pcLive,
|
|
4019
4111
|
pcRec: pcRec,
|
|
@@ -4043,9 +4135,9 @@ function _set_prototype_of$r(o, p) {
|
|
|
4043
4135
|
};
|
|
4044
4136
|
return _set_prototype_of$r(o, p);
|
|
4045
4137
|
}
|
|
4046
|
-
/**
|
|
4047
|
-
* 截图控件
|
|
4048
|
-
* @category Content
|
|
4138
|
+
/**
|
|
4139
|
+
* 截图控件
|
|
4140
|
+
* @category Content
|
|
4049
4141
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
4050
4142
|
_inherits$r(Content, EventEmitter);
|
|
4051
4143
|
function Content(options) {
|
|
@@ -4075,11 +4167,11 @@ function _set_prototype_of$r(o, p) {
|
|
|
4075
4167
|
return _this;
|
|
4076
4168
|
}
|
|
4077
4169
|
var _proto = Content.prototype;
|
|
4078
|
-
/**
|
|
4079
|
-
* 重新画面区域
|
|
4080
|
-
* @param {number} originWidth 画面宽度
|
|
4081
|
-
* @param {number} originHeight 画面高度
|
|
4082
|
-
* @returns {void}
|
|
4170
|
+
/**
|
|
4171
|
+
* 重新画面区域
|
|
4172
|
+
* @param {number} originWidth 画面宽度
|
|
4173
|
+
* @param {number} originHeight 画面高度
|
|
4174
|
+
* @returns {void}
|
|
4083
4175
|
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
4084
4176
|
if (originWidth === void 0) originWidth = 0;
|
|
4085
4177
|
if (originHeight === void 0) originHeight = 0;
|
|
@@ -4192,9 +4284,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4192
4284
|
};
|
|
4193
4285
|
return _set_prototype_of$q(o, p);
|
|
4194
4286
|
}
|
|
4195
|
-
/**
|
|
4196
|
-
* 更多控件
|
|
4197
|
-
* @category Control
|
|
4287
|
+
/**
|
|
4288
|
+
* 更多控件
|
|
4289
|
+
* @category Control
|
|
4198
4290
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
4199
4291
|
_inherits$q(More, Control);
|
|
4200
4292
|
function More(options) {
|
|
@@ -4240,9 +4332,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4240
4332
|
}
|
|
4241
4333
|
// debug
|
|
4242
4334
|
};
|
|
4243
|
-
/**
|
|
4244
|
-
* 添加
|
|
4245
|
-
* @param control
|
|
4335
|
+
/**
|
|
4336
|
+
* 添加
|
|
4337
|
+
* @param control
|
|
4246
4338
|
*/ _proto.add = function add(key, part, control, props) {
|
|
4247
4339
|
this.list.unshift({
|
|
4248
4340
|
part: part,
|
|
@@ -4252,9 +4344,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4252
4344
|
height: props.height
|
|
4253
4345
|
});
|
|
4254
4346
|
};
|
|
4255
|
-
/**
|
|
4256
|
-
* 移除
|
|
4257
|
-
* @param control
|
|
4347
|
+
/**
|
|
4348
|
+
* 移除
|
|
4349
|
+
* @param control
|
|
4258
4350
|
*/ _proto.remove = function remove(control) {
|
|
4259
4351
|
var index = this.list.findIndex(function(item) {
|
|
4260
4352
|
return item.control === control;
|
|
@@ -4274,20 +4366,20 @@ function _set_prototype_of$q(o, p) {
|
|
|
4274
4366
|
}
|
|
4275
4367
|
Control.prototype.destroy.call(this);
|
|
4276
4368
|
};
|
|
4277
|
-
/**
|
|
4278
|
-
* 点击 Control 会触发
|
|
4369
|
+
/**
|
|
4370
|
+
* 点击 Control 会触发
|
|
4279
4371
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
4280
4372
|
// this._options.onClick?.(e);
|
|
4281
4373
|
};
|
|
4282
4374
|
return More;
|
|
4283
4375
|
}(Control);
|
|
4284
4376
|
|
|
4285
|
-
/**
|
|
4286
|
-
* 函数防抖
|
|
4287
|
-
* @param {Function} func
|
|
4288
|
-
* @param {number} wait
|
|
4289
|
-
* @typeParam T - 函数类型
|
|
4290
|
-
* @returns {Function}
|
|
4377
|
+
/**
|
|
4378
|
+
* 函数防抖
|
|
4379
|
+
* @param {Function} func
|
|
4380
|
+
* @param {number} wait
|
|
4381
|
+
* @typeParam T - 函数类型
|
|
4382
|
+
* @returns {Function}
|
|
4291
4383
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
4292
4384
|
function debounce(func, wait) {
|
|
4293
4385
|
var timeout;
|
|
@@ -4917,23 +5009,23 @@ var ignoreList = [
|
|
|
4917
5009
|
});
|
|
4918
5010
|
}
|
|
4919
5011
|
|
|
4920
|
-
/**
|
|
4921
|
-
* 重新调整播放器窗口大小
|
|
4922
|
-
*
|
|
4923
|
-
* Adjust the player window size
|
|
4924
|
-
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
4925
|
-
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
4926
|
-
* @since 0.0.1
|
|
4927
|
-
* @example
|
|
4928
|
-
* ```ts
|
|
4929
|
-
* theme.resize(600, 400) // 600px * 400px
|
|
4930
|
-
* theme.resize("600px", "400px") // 600px * 400px
|
|
4931
|
-
* theme.resize("50%", "1vh")
|
|
4932
|
-
* theme.resize("2em", "2rem")
|
|
4933
|
-
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
4934
|
-
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
4935
|
-
* ```
|
|
4936
|
-
* @returns {void}
|
|
5012
|
+
/**
|
|
5013
|
+
* 重新调整播放器窗口大小
|
|
5014
|
+
*
|
|
5015
|
+
* Adjust the player window size
|
|
5016
|
+
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
5017
|
+
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
5018
|
+
* @since 0.0.1
|
|
5019
|
+
* @example
|
|
5020
|
+
* ```ts
|
|
5021
|
+
* theme.resize(600, 400) // 600px * 400px
|
|
5022
|
+
* theme.resize("600px", "400px") // 600px * 400px
|
|
5023
|
+
* theme.resize("50%", "1vh")
|
|
5024
|
+
* theme.resize("2em", "2rem")
|
|
5025
|
+
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
5026
|
+
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
5027
|
+
* ```
|
|
5028
|
+
* @returns {void}
|
|
4937
5029
|
*/ function _resize(theme, width, height) {
|
|
4938
5030
|
var cssText = '';
|
|
4939
5031
|
if (/^\d+(\.\d+)?$/.test(width + '')) {
|
|
@@ -4996,9 +5088,9 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
4996
5088
|
open: false,
|
|
4997
5089
|
max: 8
|
|
4998
5090
|
};
|
|
4999
|
-
/**
|
|
5000
|
-
* 电子放大控件
|
|
5001
|
-
* @category Control
|
|
5091
|
+
/**
|
|
5092
|
+
* 电子放大控件
|
|
5093
|
+
* @category Control
|
|
5002
5094
|
*/ var Zoom = /*#__PURE__*/ function(Control) {
|
|
5003
5095
|
_inherits$p(Zoom, Control);
|
|
5004
5096
|
function Zoom(options) {
|
|
@@ -5075,8 +5167,8 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
5075
5167
|
}
|
|
5076
5168
|
Control.prototype.destroy.call(this);
|
|
5077
5169
|
};
|
|
5078
|
-
/**
|
|
5079
|
-
* 点击 Control 会触发
|
|
5170
|
+
/**
|
|
5171
|
+
* 点击 Control 会触发
|
|
5080
5172
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
5081
5173
|
this.active = !this.active;
|
|
5082
5174
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -5096,8 +5188,8 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
5096
5188
|
},
|
|
5097
5189
|
{
|
|
5098
5190
|
key: "active",
|
|
5099
|
-
get: /**
|
|
5100
|
-
* 是否激活
|
|
5191
|
+
get: /**
|
|
5192
|
+
* 是否激活
|
|
5101
5193
|
*/ function get() {
|
|
5102
5194
|
return this._active;
|
|
5103
5195
|
},
|
|
@@ -5746,8 +5838,8 @@ function rgbOrHexToRgbaWithOpacity(color, opacity) {
|
|
|
5746
5838
|
return '';
|
|
5747
5839
|
}
|
|
5748
5840
|
|
|
5749
|
-
/**
|
|
5750
|
-
* Header
|
|
5841
|
+
/**
|
|
5842
|
+
* Header
|
|
5751
5843
|
*/ var Component = /*#__PURE__*/ function() {
|
|
5752
5844
|
function Component(options) {
|
|
5753
5845
|
if (options === void 0) options = {};
|
|
@@ -5799,8 +5891,8 @@ function rgbOrHexToRgbaWithOpacity(color, opacity) {
|
|
|
5799
5891
|
this.$popupContainer.appendChild(this.$container);
|
|
5800
5892
|
}
|
|
5801
5893
|
var _proto = Component.prototype;
|
|
5802
|
-
/**
|
|
5803
|
-
* 销毁 header
|
|
5894
|
+
/**
|
|
5895
|
+
* 销毁 header
|
|
5804
5896
|
*/ _proto.destroy = function destroy() {
|
|
5805
5897
|
var _this_$popupContainer;
|
|
5806
5898
|
(_this_$popupContainer = this.$popupContainer) == null ? void 0 : _this_$popupContainer.removeChild(this.$container);
|
|
@@ -6076,10 +6168,10 @@ function _set_prototype_of$m(o, p) {
|
|
|
6076
6168
|
};
|
|
6077
6169
|
return _set_prototype_of$m(o, p);
|
|
6078
6170
|
}
|
|
6079
|
-
/**
|
|
6080
|
-
* 全局全屏
|
|
6081
|
-
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
6082
|
-
* @category Control
|
|
6171
|
+
/**
|
|
6172
|
+
* 全局全屏
|
|
6173
|
+
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
6174
|
+
* @category Control
|
|
6083
6175
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
6084
6176
|
_inherits$m(GlobalFullscreen, Fullscreen);
|
|
6085
6177
|
function GlobalFullscreen(options) {
|
|
@@ -6097,8 +6189,8 @@ function _set_prototype_of$m(o, p) {
|
|
|
6097
6189
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_GLOBAL_FULLSCREEN
|
|
6098
6190
|
});
|
|
6099
6191
|
};
|
|
6100
|
-
/**
|
|
6101
|
-
* 点击 Control 会触发
|
|
6192
|
+
/**
|
|
6193
|
+
* 点击 Control 会触发
|
|
6102
6194
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
6103
6195
|
// 网页全屏的情况下 还可以执行全局全屏
|
|
6104
6196
|
if (this.isCurrentFullscreen && this._$rootContainer.classList.contains("" + PREFIX_CLASS + "-global-fullscreen")) {
|
|
@@ -6144,9 +6236,9 @@ function _set_prototype_of$l(o, p) {
|
|
|
6144
6236
|
};
|
|
6145
6237
|
return _set_prototype_of$l(o, p);
|
|
6146
6238
|
}
|
|
6147
|
-
/**
|
|
6148
|
-
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
6149
|
-
* @category Control
|
|
6239
|
+
/**
|
|
6240
|
+
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
6241
|
+
* @category Control
|
|
6150
6242
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
6151
6243
|
_inherits$l(CapturePicture, Control);
|
|
6152
6244
|
function CapturePicture(options) {
|
|
@@ -6177,8 +6269,8 @@ function _set_prototype_of$l(o, p) {
|
|
|
6177
6269
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CAPTURE
|
|
6178
6270
|
});
|
|
6179
6271
|
};
|
|
6180
|
-
/**
|
|
6181
|
-
* 点击 Control 会触发
|
|
6272
|
+
/**
|
|
6273
|
+
* 点击 Control 会触发
|
|
6182
6274
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6183
6275
|
var _this = this;
|
|
6184
6276
|
var _this_options_type, _this_options_cloudRecUpload;
|
|
@@ -6247,9 +6339,9 @@ function _set_prototype_of$k(o, p) {
|
|
|
6247
6339
|
};
|
|
6248
6340
|
return _set_prototype_of$k(o, p);
|
|
6249
6341
|
}
|
|
6250
|
-
/**
|
|
6251
|
-
* 云台控件
|
|
6252
|
-
* @category Control
|
|
6342
|
+
/**
|
|
6343
|
+
* 云台控件
|
|
6344
|
+
* @category Control
|
|
6253
6345
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
6254
6346
|
_inherits$k(Ptz, Control);
|
|
6255
6347
|
function Ptz(options) {
|
|
@@ -6338,8 +6430,8 @@ function _set_prototype_of$k(o, p) {
|
|
|
6338
6430
|
}
|
|
6339
6431
|
};
|
|
6340
6432
|
};
|
|
6341
|
-
/**
|
|
6342
|
-
* 点击 Control 会触发
|
|
6433
|
+
/**
|
|
6434
|
+
* 点击 Control 会触发
|
|
6343
6435
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6344
6436
|
Control.prototype._onControlClick.call(this, e);
|
|
6345
6437
|
this.active = !this.active;
|
|
@@ -6384,6 +6476,14 @@ function _set_prototype_of$k(o, p) {
|
|
|
6384
6476
|
]);
|
|
6385
6477
|
return Ptz;
|
|
6386
6478
|
}(Control);
|
|
6479
|
+
/**
|
|
6480
|
+
* 云台是对设备的实时控制,回放场景下转动云台不影响已录制的画面。
|
|
6481
|
+
*
|
|
6482
|
+
* 依据是语义与 mobileRec 模板(不含云台)。`pcRec` 模板的配置里虽然还留着 `pantile`,
|
|
6483
|
+
* 但实测在回放地址下它不会被渲染出来,因此这里声明为 live-only 不会对内置模板误报。
|
|
6484
|
+
*/ Ptz.supportedPlayTypes = [
|
|
6485
|
+
'live'
|
|
6486
|
+
];
|
|
6387
6487
|
|
|
6388
6488
|
function formatTime(seconds, format) {
|
|
6389
6489
|
if (format === void 0) format = 'MM:SS';
|
|
@@ -6442,14 +6542,14 @@ function _set_prototype_of$j(o, p) {
|
|
|
6442
6542
|
var RECORD_DEFAULT_OPTIONS = {
|
|
6443
6543
|
maxDuration: 3600
|
|
6444
6544
|
};
|
|
6445
|
-
/**
|
|
6446
|
-
* 录制控件,点击开始录制,再次点击停止录制,
|
|
6447
|
-
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
6448
|
-
*
|
|
6449
|
-
* 注意:
|
|
6450
|
-
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
6451
|
-
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
6452
|
-
* @category Control
|
|
6545
|
+
/**
|
|
6546
|
+
* 录制控件,点击开始录制,再次点击停止录制,
|
|
6547
|
+
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
6548
|
+
*
|
|
6549
|
+
* 注意:
|
|
6550
|
+
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
6551
|
+
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
6552
|
+
* @category Control
|
|
6453
6553
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
6454
6554
|
_inherits$j(Record, Control);
|
|
6455
6555
|
function Record(options) {
|
|
@@ -6464,16 +6564,16 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6464
6564
|
return _this;
|
|
6465
6565
|
}
|
|
6466
6566
|
var _proto = Record.prototype;
|
|
6467
|
-
/**
|
|
6468
|
-
* 渲染图标
|
|
6567
|
+
/**
|
|
6568
|
+
* 渲染图标
|
|
6469
6569
|
*/ _proto._render = function _render() {
|
|
6470
6570
|
var _this_locale;
|
|
6471
6571
|
this.$container.innerHTML = IconComponents.record({
|
|
6472
6572
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_RECORDVIDEO
|
|
6473
6573
|
});
|
|
6474
6574
|
};
|
|
6475
|
-
/**
|
|
6476
|
-
* 渲染计时器
|
|
6575
|
+
/**
|
|
6576
|
+
* 渲染计时器
|
|
6477
6577
|
*/ _proto._renderTimer = function _renderTimer() {
|
|
6478
6578
|
var _this = this;
|
|
6479
6579
|
var _this__options_rootContainer, _this__options;
|
|
@@ -6502,8 +6602,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6502
6602
|
this._destroyTimer();
|
|
6503
6603
|
Control.prototype.destroy.call(this);
|
|
6504
6604
|
};
|
|
6505
|
-
/**
|
|
6506
|
-
* 销毁定时器和销毁节点
|
|
6605
|
+
/**
|
|
6606
|
+
* 销毁定时器和销毁节点
|
|
6507
6607
|
*/ _proto._destroyTimer = function _destroyTimer() {
|
|
6508
6608
|
this._seconds = 0;
|
|
6509
6609
|
if (this._timer) {
|
|
@@ -6518,8 +6618,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6518
6618
|
}
|
|
6519
6619
|
this._active = false;
|
|
6520
6620
|
};
|
|
6521
|
-
/**
|
|
6522
|
-
* 点击 Control 会触发
|
|
6621
|
+
/**
|
|
6622
|
+
* 点击 Control 会触发
|
|
6523
6623
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6524
6624
|
this.active = !this.active;
|
|
6525
6625
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -6527,8 +6627,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6527
6627
|
_create_class$3(Record, [
|
|
6528
6628
|
{
|
|
6529
6629
|
key: "active",
|
|
6530
|
-
get: /**
|
|
6531
|
-
* 是否激活
|
|
6630
|
+
get: /**
|
|
6631
|
+
* 是否激活
|
|
6532
6632
|
*/ function get() {
|
|
6533
6633
|
return this._active;
|
|
6534
6634
|
},
|
|
@@ -6721,14 +6821,14 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6721
6821
|
};
|
|
6722
6822
|
}
|
|
6723
6823
|
}
|
|
6724
|
-
/**
|
|
6725
|
-
* 对讲控件
|
|
6726
|
-
*
|
|
6727
|
-
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
6728
|
-
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
6729
|
-
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
6730
|
-
*
|
|
6731
|
-
* @category Control
|
|
6824
|
+
/**
|
|
6825
|
+
* 对讲控件
|
|
6826
|
+
*
|
|
6827
|
+
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
6828
|
+
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
6829
|
+
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
6830
|
+
*
|
|
6831
|
+
* @category Control
|
|
6732
6832
|
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
6733
6833
|
_inherits$i(Talk, Control);
|
|
6734
6834
|
function Talk(options) {
|
|
@@ -6771,16 +6871,16 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6771
6871
|
Control.prototype.reset.call(this, hide);
|
|
6772
6872
|
}
|
|
6773
6873
|
};
|
|
6774
|
-
/**
|
|
6775
|
-
* 销毁对讲
|
|
6874
|
+
/**
|
|
6875
|
+
* 销毁对讲
|
|
6776
6876
|
*/ _proto.destroy = function destroy() {
|
|
6777
6877
|
if (this.active) {
|
|
6778
6878
|
this.reset();
|
|
6779
6879
|
}
|
|
6780
6880
|
Control.prototype.destroy.call(this);
|
|
6781
6881
|
};
|
|
6782
|
-
/**
|
|
6783
|
-
* 点击 Control 会触发
|
|
6882
|
+
/**
|
|
6883
|
+
* 点击 Control 会触发
|
|
6784
6884
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6785
6885
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
6786
6886
|
return Control.prototype._onControlClick;
|
|
@@ -6800,13 +6900,13 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6800
6900
|
_create_class$2(Talk, [
|
|
6801
6901
|
{
|
|
6802
6902
|
key: "value",
|
|
6803
|
-
get: /**
|
|
6804
|
-
* 获取当前值
|
|
6903
|
+
get: /**
|
|
6904
|
+
* 获取当前值
|
|
6805
6905
|
*/ function get() {
|
|
6806
6906
|
return this._value;
|
|
6807
6907
|
},
|
|
6808
|
-
set: /**
|
|
6809
|
-
* 设置当前值 [0-1]
|
|
6908
|
+
set: /**
|
|
6909
|
+
* 设置当前值 [0-1]
|
|
6810
6910
|
*/ function set(value) {
|
|
6811
6911
|
// 没有激活状态,则不处理
|
|
6812
6912
|
if (!this.active) {
|
|
@@ -6836,6 +6936,9 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6836
6936
|
]);
|
|
6837
6937
|
return Talk;
|
|
6838
6938
|
}(Control);
|
|
6939
|
+
/** 对讲是实时上行通道,只有直播场景有意义 */ Talk.supportedPlayTypes = [
|
|
6940
|
+
'live'
|
|
6941
|
+
];
|
|
6839
6942
|
|
|
6840
6943
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
6841
6944
|
try {
|
|
@@ -6992,12 +7095,12 @@ function _ts_generator$3(thisArg, body) {
|
|
|
6992
7095
|
};
|
|
6993
7096
|
}
|
|
6994
7097
|
}
|
|
6995
|
-
/**
|
|
6996
|
-
* 语音广播控件
|
|
6997
|
-
*
|
|
6998
|
-
* 用于触发语音广播功能的按钮控件
|
|
6999
|
-
*
|
|
7000
|
-
* @category Control
|
|
7098
|
+
/**
|
|
7099
|
+
* 语音广播控件
|
|
7100
|
+
*
|
|
7101
|
+
* 用于触发语音广播功能的按钮控件
|
|
7102
|
+
*
|
|
7103
|
+
* @category Control
|
|
7001
7104
|
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
7002
7105
|
_inherits$h(Broadcast, Control);
|
|
7003
7106
|
function Broadcast(options) {
|
|
@@ -7037,16 +7140,16 @@ function _ts_generator$3(thisArg, body) {
|
|
|
7037
7140
|
Control.prototype.reset.call(this, hide);
|
|
7038
7141
|
}
|
|
7039
7142
|
};
|
|
7040
|
-
/**
|
|
7041
|
-
* 销毁语音广播控件
|
|
7143
|
+
/**
|
|
7144
|
+
* 销毁语音广播控件
|
|
7042
7145
|
*/ _proto.destroy = function destroy() {
|
|
7043
7146
|
if (this.active) {
|
|
7044
7147
|
this.reset();
|
|
7045
7148
|
}
|
|
7046
7149
|
Control.prototype.destroy.call(this);
|
|
7047
7150
|
};
|
|
7048
|
-
/**
|
|
7049
|
-
* 点击 Control 会触发
|
|
7151
|
+
/**
|
|
7152
|
+
* 点击 Control 会触发
|
|
7050
7153
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7051
7154
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
7052
7155
|
return Control.prototype._onControlClick;
|
|
@@ -7067,6 +7170,9 @@ function _ts_generator$3(thisArg, body) {
|
|
|
7067
7170
|
};
|
|
7068
7171
|
return Broadcast;
|
|
7069
7172
|
}(Control);
|
|
7173
|
+
/** 语音广播是实时上行通道,只有直播场景有意义(另需 `sdkType === 'base'`,见构造函数) */ Broadcast.supportedPlayTypes = [
|
|
7174
|
+
'live'
|
|
7175
|
+
];
|
|
7070
7176
|
|
|
7071
7177
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7072
7178
|
try {
|
|
@@ -7223,12 +7329,12 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7223
7329
|
};
|
|
7224
7330
|
}
|
|
7225
7331
|
}
|
|
7226
|
-
/**
|
|
7227
|
-
* AI对话框控件
|
|
7228
|
-
*
|
|
7229
|
-
* 用于触发AI对话框功能的按钮控件
|
|
7230
|
-
*
|
|
7231
|
-
* @category Control
|
|
7332
|
+
/**
|
|
7333
|
+
* AI对话框控件
|
|
7334
|
+
*
|
|
7335
|
+
* 用于触发AI对话框功能的按钮控件
|
|
7336
|
+
*
|
|
7337
|
+
* @category Control
|
|
7232
7338
|
*/ var AIChat = /*#__PURE__*/ function(Control) {
|
|
7233
7339
|
_inherits$g(AIChat, Control);
|
|
7234
7340
|
function AIChat(options) {
|
|
@@ -7269,16 +7375,16 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7269
7375
|
Control.prototype.reset.call(this, hide);
|
|
7270
7376
|
}
|
|
7271
7377
|
};
|
|
7272
|
-
/**
|
|
7273
|
-
* 销毁AI对话框控件
|
|
7378
|
+
/**
|
|
7379
|
+
* 销毁AI对话框控件
|
|
7274
7380
|
*/ _proto.destroy = function destroy() {
|
|
7275
7381
|
if (this.active) {
|
|
7276
7382
|
this.reset();
|
|
7277
7383
|
}
|
|
7278
7384
|
Control.prototype.destroy.call(this);
|
|
7279
7385
|
};
|
|
7280
|
-
/**
|
|
7281
|
-
* 点击 Control 会触发
|
|
7386
|
+
/**
|
|
7387
|
+
* 点击 Control 会触发
|
|
7282
7388
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7283
7389
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
7284
7390
|
return Control.prototype._onControlClick;
|
|
@@ -7299,6 +7405,14 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7299
7405
|
};
|
|
7300
7406
|
return AIChat;
|
|
7301
7407
|
}(Control);
|
|
7408
|
+
/**
|
|
7409
|
+
* 只在云存储回放下可用。
|
|
7410
|
+
*
|
|
7411
|
+
* 这是全部控件里证据最强的一条:构造函数里已显式要求 `recType === 'cloud'`
|
|
7412
|
+
* 且排除 `busType === '7'`(云录制),不满足时直接 `display: none`。
|
|
7413
|
+
*/ AIChat.supportedPlayTypes = [
|
|
7414
|
+
'cloudRec'
|
|
7415
|
+
];
|
|
7302
7416
|
|
|
7303
7417
|
function _extends$e() {
|
|
7304
7418
|
_extends$e = Object.assign || function assign(target) {
|
|
@@ -7330,12 +7444,12 @@ function _set_prototype_of$f(o, p) {
|
|
|
7330
7444
|
};
|
|
7331
7445
|
return _set_prototype_of$f(o, p);
|
|
7332
7446
|
}
|
|
7333
|
-
/**
|
|
7334
|
-
* 直播按钮控件
|
|
7335
|
-
*
|
|
7336
|
-
* 点击切换到直播模式
|
|
7337
|
-
*
|
|
7338
|
-
* @category Control
|
|
7447
|
+
/**
|
|
7448
|
+
* 直播按钮控件
|
|
7449
|
+
*
|
|
7450
|
+
* 点击切换到直播模式
|
|
7451
|
+
*
|
|
7452
|
+
* @category Control
|
|
7339
7453
|
*/ var Live = /*#__PURE__*/ function(Control) {
|
|
7340
7454
|
_inherits$f(Live, Control);
|
|
7341
7455
|
function Live(options) {
|
|
@@ -7357,9 +7471,9 @@ function _set_prototype_of$f(o, p) {
|
|
|
7357
7471
|
return _this;
|
|
7358
7472
|
}
|
|
7359
7473
|
var _proto = Live.prototype;
|
|
7360
|
-
/**
|
|
7361
|
-
* 根据 urlInfo 同步激活状态
|
|
7362
|
-
* 在初始化和播放地址切换后调用
|
|
7474
|
+
/**
|
|
7475
|
+
* 根据 urlInfo 同步激活状态
|
|
7476
|
+
* 在初始化和播放地址切换后调用
|
|
7363
7477
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
7364
7478
|
var shouldBeActive = !!(urlInfo && urlInfo.type === 'live');
|
|
7365
7479
|
this.active = shouldBeActive;
|
|
@@ -7370,13 +7484,13 @@ function _set_prototype_of$f(o, p) {
|
|
|
7370
7484
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_LIVE) || '直播'
|
|
7371
7485
|
});
|
|
7372
7486
|
};
|
|
7373
|
-
/**
|
|
7374
|
-
* 销毁
|
|
7487
|
+
/**
|
|
7488
|
+
* 销毁
|
|
7375
7489
|
*/ _proto.destroy = function destroy() {
|
|
7376
7490
|
Control.prototype.destroy.call(this);
|
|
7377
7491
|
};
|
|
7378
|
-
/**
|
|
7379
|
-
* 点击 Control 会触发
|
|
7492
|
+
/**
|
|
7493
|
+
* 点击 Control 会触发
|
|
7380
7494
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7381
7495
|
var _this__options_onChange, _this__options;
|
|
7382
7496
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -7421,12 +7535,13 @@ function _set_prototype_of$e(o, p) {
|
|
|
7421
7535
|
};
|
|
7422
7536
|
return _set_prototype_of$e(o, p);
|
|
7423
7537
|
}
|
|
7424
|
-
/**
|
|
7425
|
-
|
|
7426
|
-
*
|
|
7427
|
-
*
|
|
7428
|
-
*
|
|
7429
|
-
*
|
|
7538
|
+
/** 判定「贴近边缘」的安全距离(CSS px),弹窗右边缘与播放器右侧的间距小于它就换对齐方式 */ var REC_DROPDOWN_EDGE_GAP = 10;
|
|
7539
|
+
/**
|
|
7540
|
+
* 回放下拉控件
|
|
7541
|
+
*
|
|
7542
|
+
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
7543
|
+
*
|
|
7544
|
+
* @category Control
|
|
7430
7545
|
*/ var RecDropdown = /*#__PURE__*/ function(Control) {
|
|
7431
7546
|
_inherits$e(RecDropdown, Control);
|
|
7432
7547
|
function RecDropdown(options) {
|
|
@@ -7443,16 +7558,16 @@ function _set_prototype_of$e(o, p) {
|
|
|
7443
7558
|
_this.$container.style.display = 'none';
|
|
7444
7559
|
}
|
|
7445
7560
|
// 初始化时根据 urlInfo 确定当前回放类型和激活状态
|
|
7446
|
-
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || '
|
|
7561
|
+
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || '';
|
|
7447
7562
|
_this._syncActiveByUrlInfo((_this___options_props1 = _this.__options.props) == null ? void 0 : _this___options_props1.urlInfo);
|
|
7448
7563
|
_this._render();
|
|
7449
7564
|
_this._initPicker();
|
|
7450
7565
|
return _this;
|
|
7451
7566
|
}
|
|
7452
7567
|
var _proto = RecDropdown.prototype;
|
|
7453
|
-
/**
|
|
7454
|
-
* 根据 urlInfo 同步激活状态和回放类型
|
|
7455
|
-
* 在初始化和播放地址切换后调用
|
|
7568
|
+
/**
|
|
7569
|
+
* 根据 urlInfo 同步激活状态和回放类型
|
|
7570
|
+
* 在初始化和播放地址切换后调用
|
|
7456
7571
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
7457
7572
|
if (urlInfo && urlInfo.type === 'rec') {
|
|
7458
7573
|
var _urlInfo_searchParams1;
|
|
@@ -7488,12 +7603,53 @@ function _set_prototype_of$e(o, p) {
|
|
|
7488
7603
|
offset: [
|
|
7489
7604
|
0,
|
|
7490
7605
|
4
|
|
7491
|
-
]
|
|
7606
|
+
],
|
|
7607
|
+
onOpenChange: function onOpenChange(open) {
|
|
7608
|
+
// 打开时按控件在视口中的位置决定对齐方式。
|
|
7609
|
+
// 此时 picker 已把 $wrapperContent 设为 inline-flex(可测量宽度),
|
|
7610
|
+
// 而它内部的定位计算还在 requestAnimationFrame 里,改 placement 来得及生效。
|
|
7611
|
+
// 移动端 placement 不生效(弹窗固定在窗口底部)
|
|
7612
|
+
if (open && !Utils.isMobile) _this._adjustPlacement();
|
|
7613
|
+
}
|
|
7492
7614
|
});
|
|
7493
7615
|
this._picker.innerHTML(this._getPanelHTML());
|
|
7494
7616
|
this._activeOption(this._recType);
|
|
7495
7617
|
this._bindPanelEvents();
|
|
7496
7618
|
};
|
|
7619
|
+
/**
|
|
7620
|
+
* 按控件在播放器实例窗口中的位置调整弹窗对齐方式
|
|
7621
|
+
*
|
|
7622
|
+
* 默认 `bottom` 是相对控件水平居中,弹窗比控件宽,控件靠近右边缘时弹窗会探出边界。
|
|
7623
|
+
* 这种情况改用 `br`(弹窗右边缘与控件右边缘对齐、向左展开),控件本身在边界内,
|
|
7624
|
+
* 因此右侧一定不会溢出。
|
|
7625
|
+
*
|
|
7626
|
+
* 边界取的是**播放器实例窗口**(`rootContainer`)而非浏览器窗口:播放器通常只占页面一部分,
|
|
7627
|
+
* 弹窗一旦超出播放器就会画到播放器外面去,按浏览器窗口判断会漏掉这种情况。
|
|
7628
|
+
* 拿不到 `rootContainer` 时退回按浏览器窗口判断。
|
|
7629
|
+
*
|
|
7630
|
+
* 每次打开都重新判断:resize、全屏切换、控件栏溢出收纳都会改变控件的相对位置,
|
|
7631
|
+
* 一次性设定会在位置变化后失效。
|
|
7632
|
+
*/ _proto._adjustPlacement = function _adjustPlacement() {
|
|
7633
|
+
var _this__picker;
|
|
7634
|
+
// 移动端 placement 不生效(弹窗固定在窗口底部铺满)
|
|
7635
|
+
if (Utils.isMobile) return;
|
|
7636
|
+
if (!this.$container || !((_this__picker = this._picker) == null ? void 0 : _this__picker.$wrapperContent)) return;
|
|
7637
|
+
var panelWidth = this._picker.$wrapperContent.getBoundingClientRect().width;
|
|
7638
|
+
// 还没渲染出宽度,无法判断,保持当前对齐方式
|
|
7639
|
+
if (!panelWidth) return;
|
|
7640
|
+
var containerRect = this.$container.getBoundingClientRect();
|
|
7641
|
+
var $root = this.__options.rootContainer;
|
|
7642
|
+
var boundaryRight = ($root == null ? void 0 : $root.getBoundingClientRect) ? $root.getBoundingClientRect().right : window.innerWidth;
|
|
7643
|
+
// 居中对齐时弹窗的右边缘位置
|
|
7644
|
+
var centeredRight = Math.ceil(containerRect.left + (containerRect.width + panelWidth) / 2);
|
|
7645
|
+
var willOverflowRight = centeredRight > boundaryRight - REC_DROPDOWN_EDGE_GAP;
|
|
7646
|
+
if (willOverflowRight) {
|
|
7647
|
+
this._picker.$wrapperContent.classList.add('epicker-br');
|
|
7648
|
+
} else {
|
|
7649
|
+
this._picker.$wrapperContent.classList.remove('epicker-br');
|
|
7650
|
+
}
|
|
7651
|
+
this._picker.setPlacement(willOverflowRight ? 'br' : 'bottom');
|
|
7652
|
+
};
|
|
7497
7653
|
_proto._getPanelHTML = function _getPanelHTML() {
|
|
7498
7654
|
var _this_locale, _this_locale1, _this_locale2;
|
|
7499
7655
|
var cloudRecLabel = ((_this_locale = this.locale) == null ? void 0 : _this_locale.REC_DROPDOWN_CLOUD_REC) || '云存储';
|
|
@@ -7529,8 +7685,8 @@ function _set_prototype_of$e(o, p) {
|
|
|
7529
7685
|
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS + "-active");
|
|
7530
7686
|
}
|
|
7531
7687
|
};
|
|
7532
|
-
/**
|
|
7533
|
-
* 销毁
|
|
7688
|
+
/**
|
|
7689
|
+
* 销毁
|
|
7534
7690
|
*/ _proto.destroy = function destroy() {
|
|
7535
7691
|
var _this__delegation_destroy, _this__delegation;
|
|
7536
7692
|
(_this__delegation = this._delegation) == null ? void 0 : (_this__delegation_destroy = _this__delegation.destroy) == null ? void 0 : _this__delegation_destroy.call(_this__delegation);
|
|
@@ -7542,8 +7698,8 @@ function _set_prototype_of$e(o, p) {
|
|
|
7542
7698
|
}
|
|
7543
7699
|
Control.prototype.destroy.call(this);
|
|
7544
7700
|
};
|
|
7545
|
-
/**
|
|
7546
|
-
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
7701
|
+
/**
|
|
7702
|
+
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
7547
7703
|
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7548
7704
|
_proto._onControlClick = function _onControlClick(_e) {
|
|
7549
7705
|
// picker 自行处理 click/hover,这里不额外处理
|
|
@@ -7675,7 +7831,6 @@ function _set_prototype_of$d(o, p) {
|
|
|
7675
7831
|
if (this._panelOpen) {
|
|
7676
7832
|
this.emit(EVENTS.control.recListChange, false);
|
|
7677
7833
|
}
|
|
7678
|
-
this.emit(EVENTS.control.recListDestroy);
|
|
7679
7834
|
if (this._modal) {
|
|
7680
7835
|
this._modal.destroy();
|
|
7681
7836
|
this._modal = null;
|
|
@@ -7707,6 +7862,16 @@ function _set_prototype_of$d(o, p) {
|
|
|
7707
7862
|
};
|
|
7708
7863
|
return RecList;
|
|
7709
7864
|
}(Control);
|
|
7865
|
+
/**
|
|
7866
|
+
* 录像片段列表,只对回放有意义。
|
|
7867
|
+
*
|
|
7868
|
+
* 依据是内置模板分布(仅 pcRec 含 `recList`)与语义。若后续确认本地卡回放
|
|
7869
|
+
* 没有片段列表接口,把 `'rec'` 去掉即可。
|
|
7870
|
+
*/ RecList.supportedPlayTypes = [
|
|
7871
|
+
'rec',
|
|
7872
|
+
'cloudRec',
|
|
7873
|
+
'cloudRecord'
|
|
7874
|
+
];
|
|
7710
7875
|
|
|
7711
7876
|
function _extends$b() {
|
|
7712
7877
|
_extends$b = Object.assign || function assign(target) {
|
|
@@ -7738,12 +7903,12 @@ function _set_prototype_of$c(o, p) {
|
|
|
7738
7903
|
};
|
|
7739
7904
|
return _set_prototype_of$c(o, p);
|
|
7740
7905
|
}
|
|
7741
|
-
/**
|
|
7742
|
-
* 告警消息按钮控件
|
|
7743
|
-
*
|
|
7744
|
-
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
7745
|
-
*
|
|
7746
|
-
* @category Control
|
|
7906
|
+
/**
|
|
7907
|
+
* 告警消息按钮控件
|
|
7908
|
+
*
|
|
7909
|
+
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
7910
|
+
*
|
|
7911
|
+
* @category Control
|
|
7747
7912
|
*/ var AlarmMessage = /*#__PURE__*/ function(Control) {
|
|
7748
7913
|
_inherits$c(AlarmMessage, Control);
|
|
7749
7914
|
function AlarmMessage(options) {
|
|
@@ -7767,16 +7932,16 @@ function _set_prototype_of$c(o, p) {
|
|
|
7767
7932
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_ALARM_MESSAGE) || '消息'
|
|
7768
7933
|
});
|
|
7769
7934
|
};
|
|
7770
|
-
/**
|
|
7771
|
-
* 销毁
|
|
7935
|
+
/**
|
|
7936
|
+
* 销毁
|
|
7772
7937
|
*/ _proto.destroy = function destroy() {
|
|
7773
7938
|
if (this._panelOpen) {
|
|
7774
7939
|
this.emit(EVENTS.control.alarmMessageChange, false);
|
|
7775
7940
|
}
|
|
7776
7941
|
Control.prototype.destroy.call(this);
|
|
7777
7942
|
};
|
|
7778
|
-
/**
|
|
7779
|
-
* 点击 Control 会触发
|
|
7943
|
+
/**
|
|
7944
|
+
* 点击 Control 会触发
|
|
7780
7945
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7781
7946
|
var _this__options_onChange, _this__options;
|
|
7782
7947
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -7841,54 +8006,54 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
7841
8006
|
onChange: function onChange() {},
|
|
7842
8007
|
onOpenChange: function onOpenChange() {}
|
|
7843
8008
|
};
|
|
7844
|
-
/**
|
|
7845
|
-
* 选择器切换 (支持PC/Mobile)
|
|
7846
|
-
* @category Control
|
|
7847
|
-
* @example
|
|
7848
|
-
* ```ts
|
|
7849
|
-
* new Select({
|
|
7850
|
-
* title: '清晰度',
|
|
7851
|
-
* list: [
|
|
7852
|
-
* {
|
|
7853
|
-
* label: '高清',
|
|
7854
|
-
* value: 'hd',
|
|
7855
|
-
* streamTypeIn: 1,
|
|
7856
|
-
* },
|
|
7857
|
-
* {
|
|
7858
|
-
* label: '超清',
|
|
7859
|
-
* value: 'super',
|
|
7860
|
-
* streamTypeIn: 2,
|
|
7861
|
-
* }
|
|
7862
|
-
* ],
|
|
7863
|
-
* value: 'hd',
|
|
7864
|
-
* onChange: (value, item) => {
|
|
7865
|
-
* console.log('选择了', value, item);
|
|
7866
|
-
* }
|
|
7867
|
-
* })
|
|
7868
|
-
*
|
|
7869
|
-
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
7870
|
-
* // 例如清晰度切换组件
|
|
7871
|
-
* class Definition extends Select {
|
|
7872
|
-
* options: DefinitionOptions;
|
|
7873
|
-
* constructor(options: DefinitionOptions) {
|
|
7874
|
-
* super({
|
|
7875
|
-
* ...options,
|
|
7876
|
-
* fieldNames: { label: 'name', value: 'level',},
|
|
7877
|
-
* title: options?.locale?.definition,
|
|
7878
|
-
* controlType: 'button',
|
|
7879
|
-
* classNameSuffix: 'definition',
|
|
7880
|
-
* onChange: (value: SelectItem['value'], item) => {
|
|
7881
|
-
* options?.onChange?.(value, item);
|
|
7882
|
-
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
7883
|
-
* },
|
|
7884
|
-
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
7885
|
-
* options?.onOpenChange?.(open, value, item);
|
|
7886
|
-
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
7887
|
-
* }
|
|
7888
|
-
* });
|
|
7889
|
-
* }
|
|
7890
|
-
* }
|
|
7891
|
-
* ```
|
|
8009
|
+
/**
|
|
8010
|
+
* 选择器切换 (支持PC/Mobile)
|
|
8011
|
+
* @category Control
|
|
8012
|
+
* @example
|
|
8013
|
+
* ```ts
|
|
8014
|
+
* new Select({
|
|
8015
|
+
* title: '清晰度',
|
|
8016
|
+
* list: [
|
|
8017
|
+
* {
|
|
8018
|
+
* label: '高清',
|
|
8019
|
+
* value: 'hd',
|
|
8020
|
+
* streamTypeIn: 1,
|
|
8021
|
+
* },
|
|
8022
|
+
* {
|
|
8023
|
+
* label: '超清',
|
|
8024
|
+
* value: 'super',
|
|
8025
|
+
* streamTypeIn: 2,
|
|
8026
|
+
* }
|
|
8027
|
+
* ],
|
|
8028
|
+
* value: 'hd',
|
|
8029
|
+
* onChange: (value, item) => {
|
|
8030
|
+
* console.log('选择了', value, item);
|
|
8031
|
+
* }
|
|
8032
|
+
* })
|
|
8033
|
+
*
|
|
8034
|
+
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
8035
|
+
* // 例如清晰度切换组件
|
|
8036
|
+
* class Definition extends Select {
|
|
8037
|
+
* options: DefinitionOptions;
|
|
8038
|
+
* constructor(options: DefinitionOptions) {
|
|
8039
|
+
* super({
|
|
8040
|
+
* ...options,
|
|
8041
|
+
* fieldNames: { label: 'name', value: 'level',},
|
|
8042
|
+
* title: options?.locale?.definition,
|
|
8043
|
+
* controlType: 'button',
|
|
8044
|
+
* classNameSuffix: 'definition',
|
|
8045
|
+
* onChange: (value: SelectItem['value'], item) => {
|
|
8046
|
+
* options?.onChange?.(value, item);
|
|
8047
|
+
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
8048
|
+
* },
|
|
8049
|
+
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
8050
|
+
* options?.onOpenChange?.(open, value, item);
|
|
8051
|
+
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
8052
|
+
* }
|
|
8053
|
+
* });
|
|
8054
|
+
* }
|
|
8055
|
+
* }
|
|
8056
|
+
* ```
|
|
7892
8057
|
*/ var Select = /*#__PURE__*/ function(Control) {
|
|
7893
8058
|
_inherits$b(Select, Control);
|
|
7894
8059
|
function Select(options) {
|
|
@@ -7940,9 +8105,9 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
7940
8105
|
return _this;
|
|
7941
8106
|
}
|
|
7942
8107
|
var _proto = Select.prototype;
|
|
7943
|
-
/**
|
|
7944
|
-
* 更新选项列表
|
|
7945
|
-
* @param list - 选项列表
|
|
8108
|
+
/**
|
|
8109
|
+
* 更新选项列表
|
|
8110
|
+
* @param list - 选项列表
|
|
7946
8111
|
*/ _proto.updateOptions = function updateOptions(list) {
|
|
7947
8112
|
var _this = this;
|
|
7948
8113
|
if (list === void 0) list = [];
|
|
@@ -8027,8 +8192,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8027
8192
|
});
|
|
8028
8193
|
}
|
|
8029
8194
|
};
|
|
8030
|
-
/**
|
|
8031
|
-
* 销毁
|
|
8195
|
+
/**
|
|
8196
|
+
* 销毁
|
|
8032
8197
|
*/ _proto.destroy = function destroy() {
|
|
8033
8198
|
var _this__delegationOption_destroy, _this__delegationOption, _this__delegationClose_destroy, _this__delegationClose, _this__delegationCancel_destroy, _this__delegationCancel;
|
|
8034
8199
|
(_this__delegationOption = this._delegationOption) == null ? void 0 : (_this__delegationOption_destroy = _this__delegationOption.destroy) == null ? void 0 : _this__delegationOption_destroy.call(_this__delegationOption);
|
|
@@ -8050,8 +8215,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8050
8215
|
e.stopPropagation();
|
|
8051
8216
|
e.preventDefault();
|
|
8052
8217
|
};
|
|
8053
|
-
/**
|
|
8054
|
-
* 点击 Control 会触发
|
|
8218
|
+
/**
|
|
8219
|
+
* 点击 Control 会触发
|
|
8055
8220
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8056
8221
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
8057
8222
|
};
|
|
@@ -8070,8 +8235,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8070
8235
|
},
|
|
8071
8236
|
{
|
|
8072
8237
|
key: "disabled",
|
|
8073
|
-
get: /**
|
|
8074
|
-
* 是否禁用
|
|
8238
|
+
get: /**
|
|
8239
|
+
* 是否禁用
|
|
8075
8240
|
*/ function get() {
|
|
8076
8241
|
return this._disabled;
|
|
8077
8242
|
},
|
|
@@ -8157,15 +8322,15 @@ function __filter(list, locale) {
|
|
|
8157
8322
|
};
|
|
8158
8323
|
});
|
|
8159
8324
|
}
|
|
8160
|
-
/**
|
|
8161
|
-
* 清晰度切换控件
|
|
8162
|
-
*
|
|
8163
|
-
* 清晰度切换控件有三套UI
|
|
8164
|
-
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
8165
|
-
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
8166
|
-
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
8167
|
-
*
|
|
8168
|
-
* @category Control
|
|
8325
|
+
/**
|
|
8326
|
+
* 清晰度切换控件
|
|
8327
|
+
*
|
|
8328
|
+
* 清晰度切换控件有三套UI
|
|
8329
|
+
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
8330
|
+
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
8331
|
+
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
8332
|
+
*
|
|
8333
|
+
* @category Control
|
|
8169
8334
|
*/ var Definition = /*#__PURE__*/ function(Select) {
|
|
8170
8335
|
_inherits$a(Definition, Select);
|
|
8171
8336
|
function Definition(options) {
|
|
@@ -8231,14 +8396,22 @@ function __filter(list, locale) {
|
|
|
8231
8396
|
return _this;
|
|
8232
8397
|
}
|
|
8233
8398
|
var _proto = Definition.prototype;
|
|
8234
|
-
/**
|
|
8235
|
-
* 重置,恢复默认值
|
|
8236
|
-
* @param hide 默认不隐藏
|
|
8399
|
+
/**
|
|
8400
|
+
* 重置,恢复默认值
|
|
8401
|
+
* @param hide 默认不隐藏
|
|
8237
8402
|
*/ _proto.reset = function reset(hide) {
|
|
8238
8403
|
Select.prototype.reset.call(this, hide);
|
|
8239
8404
|
};
|
|
8240
8405
|
return Definition;
|
|
8241
8406
|
}(Select);
|
|
8407
|
+
/**
|
|
8408
|
+
* 清晰度切换只在直播下有意义:回放播的是已落盘的码流,清晰度由录制时决定。
|
|
8409
|
+
*
|
|
8410
|
+
* 依据是内置模板分布(`hd` 只出现在 pcLive / mobileLive / security),控件本身无硬约束。
|
|
8411
|
+
* 若后续确认本地卡回放支持主/子码流切换,把 `'rec'` 加进来即可。
|
|
8412
|
+
*/ Definition.supportedPlayTypes = [
|
|
8413
|
+
'live'
|
|
8414
|
+
];
|
|
8242
8415
|
|
|
8243
8416
|
function _assert_this_initialized(self) {
|
|
8244
8417
|
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -8284,13 +8457,13 @@ var SUPPORT_SPEED = [
|
|
|
8284
8457
|
16
|
|
8285
8458
|
]; // 8, 16
|
|
8286
8459
|
var SPEED_DEFAULT_OPTIONS = {
|
|
8287
|
-
/**
|
|
8288
|
-
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
8289
|
-
* 暂时不支持初始化时设置倍速
|
|
8460
|
+
/**
|
|
8461
|
+
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
8462
|
+
* 暂时不支持初始化时设置倍速
|
|
8290
8463
|
*/ // value: 1, // 对应list 中的 value
|
|
8291
8464
|
// 这里不要设置多语言, 比较麻烦
|
|
8292
|
-
/**
|
|
8293
|
-
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
8465
|
+
/**
|
|
8466
|
+
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
8294
8467
|
*/ list: SUPPORT_SPEED.reverse().map(function(speed) {
|
|
8295
8468
|
return {
|
|
8296
8469
|
label: "" + speed + "x",
|
|
@@ -8298,13 +8471,13 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8298
8471
|
};
|
|
8299
8472
|
})
|
|
8300
8473
|
};
|
|
8301
|
-
/**
|
|
8302
|
-
* 倍速切换控件, 不支持动态切换倍速列表
|
|
8303
|
-
*
|
|
8304
|
-
* 注意:
|
|
8305
|
-
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
8306
|
-
* 2. 标准流不支持;
|
|
8307
|
-
* @category Control
|
|
8474
|
+
/**
|
|
8475
|
+
* 倍速切换控件, 不支持动态切换倍速列表
|
|
8476
|
+
*
|
|
8477
|
+
* 注意:
|
|
8478
|
+
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
8479
|
+
* 2. 标准流不支持;
|
|
8480
|
+
* @category Control
|
|
8308
8481
|
*/ var Speed = /*#__PURE__*/ function(Select) {
|
|
8309
8482
|
_inherits$9(Speed, Select);
|
|
8310
8483
|
function Speed(options) {
|
|
@@ -8338,10 +8511,10 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8338
8511
|
return _this;
|
|
8339
8512
|
}
|
|
8340
8513
|
var _proto = Speed.prototype;
|
|
8341
|
-
/**
|
|
8342
|
-
* 滤掉本地回放不支持的倍速
|
|
8343
|
-
* @param optionsList 初始化配置倍速列表
|
|
8344
|
-
* @param type 回放类型
|
|
8514
|
+
/**
|
|
8515
|
+
* 滤掉本地回放不支持的倍速
|
|
8516
|
+
* @param optionsList 初始化配置倍速列表
|
|
8517
|
+
* @param type 回放类型
|
|
8345
8518
|
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
|
|
8346
8519
|
if (!optionsList) {
|
|
8347
8520
|
// 非用户自定义 /openpb/ 是标准流回放路径
|
|
@@ -8369,6 +8542,16 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8369
8542
|
};
|
|
8370
8543
|
return Speed;
|
|
8371
8544
|
}(Select);
|
|
8545
|
+
/**
|
|
8546
|
+
* 倍速只对回放有意义;直播是实时流,没有倍速语义。
|
|
8547
|
+
*
|
|
8548
|
+
* 三类回放都支持,但档位上限不同(见 `_filterSpeedList`):
|
|
8549
|
+
* 本地卡回放与标准流 ≤ 4x,云存储 / 云录制 ≤ 16x。
|
|
8550
|
+
*/ Speed.supportedPlayTypes = [
|
|
8551
|
+
'rec',
|
|
8552
|
+
'cloudRec',
|
|
8553
|
+
'cloudRecord'
|
|
8554
|
+
];
|
|
8372
8555
|
|
|
8373
8556
|
function _extends$7() {
|
|
8374
8557
|
_extends$7 = Object.assign || function assign(target) {
|
|
@@ -8576,6 +8759,11 @@ function _set_prototype_of$8(o, p) {
|
|
|
8576
8759
|
};
|
|
8577
8760
|
return DatePickerControl;
|
|
8578
8761
|
}(Control);
|
|
8762
|
+
/** 选日期是为了定位录像,只对回放有意义(初值取自 `urlInfo.searchParams.begin`) */ DatePickerControl.supportedPlayTypes = [
|
|
8763
|
+
'rec',
|
|
8764
|
+
'cloudRec',
|
|
8765
|
+
'cloudRecord'
|
|
8766
|
+
];
|
|
8579
8767
|
|
|
8580
8768
|
function _extends$6() {
|
|
8581
8769
|
_extends$6 = Object.assign || function assign(target) {
|
|
@@ -8608,9 +8796,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8608
8796
|
return _set_prototype_of$7(o, p);
|
|
8609
8797
|
}
|
|
8610
8798
|
/** 时间格式 HH:mm:ss */ var TIME_FORMAT = 'HH:mm:ss';
|
|
8611
|
-
/**
|
|
8612
|
-
* 时间选择器控件
|
|
8613
|
-
* @category Control
|
|
8799
|
+
/**
|
|
8800
|
+
* 时间选择器控件
|
|
8801
|
+
* @category Control
|
|
8614
8802
|
*/ var TimePickerControl = /*#__PURE__*/ function(Control) {
|
|
8615
8803
|
_inherits$7(TimePickerControl, Control);
|
|
8616
8804
|
function TimePickerControl(options) {
|
|
@@ -8671,9 +8859,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8671
8859
|
}
|
|
8672
8860
|
}));
|
|
8673
8861
|
};
|
|
8674
|
-
/**
|
|
8675
|
-
* 设置时间
|
|
8676
|
-
* @param time 设置的时间 HH:mm:ss
|
|
8862
|
+
/**
|
|
8863
|
+
* 设置时间
|
|
8864
|
+
* @param time 设置的时间 HH:mm:ss
|
|
8677
8865
|
*/ _proto.setTime = function setTime(time) {
|
|
8678
8866
|
var _this_timePicker;
|
|
8679
8867
|
(_this_timePicker = this.timePicker) == null ? void 0 : _this_timePicker.setCurrent(time);
|
|
@@ -8689,9 +8877,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8689
8877
|
if (this.timePicker) this.timePicker.open = false;
|
|
8690
8878
|
Control.prototype.reset.call(this);
|
|
8691
8879
|
};
|
|
8692
|
-
/**
|
|
8693
|
-
* 销毁控件
|
|
8694
|
-
* @override
|
|
8880
|
+
/**
|
|
8881
|
+
* 销毁控件
|
|
8882
|
+
* @override
|
|
8695
8883
|
*/ _proto.destroy = function destroy() {
|
|
8696
8884
|
if (this.timePicker) {
|
|
8697
8885
|
this.timePicker.destroy();
|
|
@@ -8703,14 +8891,19 @@ function _set_prototype_of$7(o, p) {
|
|
|
8703
8891
|
_proto._getTimeStr = function _getTimeStr() {
|
|
8704
8892
|
return this._value;
|
|
8705
8893
|
};
|
|
8706
|
-
/**
|
|
8707
|
-
* 点击 Control 会触发
|
|
8708
|
-
* @overload super._onControlClick(e: Event)
|
|
8894
|
+
/**
|
|
8895
|
+
* 点击 Control 会触发
|
|
8896
|
+
* @overload super._onControlClick(e: Event)
|
|
8709
8897
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8710
8898
|
Control.prototype._onControlClick.call(this, e);
|
|
8711
8899
|
};
|
|
8712
8900
|
return TimePickerControl;
|
|
8713
8901
|
}(Control);
|
|
8902
|
+
/** 选时间是为了定位录像,只对回放有意义(初值取自 `urlInfo.searchParams.begin`) */ TimePickerControl.supportedPlayTypes = [
|
|
8903
|
+
'rec',
|
|
8904
|
+
'cloudRec',
|
|
8905
|
+
'cloudRecord'
|
|
8906
|
+
];
|
|
8714
8907
|
|
|
8715
8908
|
function _extends$5() {
|
|
8716
8909
|
_extends$5 = Object.assign || function assign(target) {
|
|
@@ -8742,8 +8935,8 @@ function _set_prototype_of$6(o, p) {
|
|
|
8742
8935
|
};
|
|
8743
8936
|
return _set_prototype_of$6(o, p);
|
|
8744
8937
|
}
|
|
8745
|
-
/**
|
|
8746
|
-
* 回放时间轴控件
|
|
8938
|
+
/**
|
|
8939
|
+
* 回放时间轴控件
|
|
8747
8940
|
*/ var TimeLineControl = /*#__PURE__*/ function(Control) {
|
|
8748
8941
|
_inherits$6(TimeLineControl, Control);
|
|
8749
8942
|
function TimeLineControl(options) {
|
|
@@ -8903,13 +9096,18 @@ function _set_prototype_of$6(o, p) {
|
|
|
8903
9096
|
}
|
|
8904
9097
|
Control.prototype.destroy.call(this);
|
|
8905
9098
|
};
|
|
8906
|
-
/**
|
|
8907
|
-
* 点击 Control 会触发
|
|
9099
|
+
/**
|
|
9100
|
+
* 点击 Control 会触发
|
|
8908
9101
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8909
9102
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
8910
9103
|
};
|
|
8911
9104
|
return TimeLineControl;
|
|
8912
9105
|
}(Control);
|
|
9106
|
+
/** 时间轴展示的是录像片段,只对回放有意义(渲染层的 `_needTimeLine` 也要求 `urlInfo.type === 'rec'`) */ TimeLineControl.supportedPlayTypes = [
|
|
9107
|
+
'rec',
|
|
9108
|
+
'cloudRec',
|
|
9109
|
+
'cloudRecord'
|
|
9110
|
+
];
|
|
8913
9111
|
|
|
8914
9112
|
function _extends$4() {
|
|
8915
9113
|
_extends$4 = Object.assign || function assign(target) {
|
|
@@ -8941,24 +9139,24 @@ function _set_prototype_of$5(o, p) {
|
|
|
8941
9139
|
};
|
|
8942
9140
|
return _set_prototype_of$5(o, p);
|
|
8943
9141
|
}
|
|
8944
|
-
/**
|
|
8945
|
-
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
8946
|
-
*
|
|
8947
|
-
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
8948
|
-
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
8949
|
-
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
8950
|
-
*
|
|
8951
|
-
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
8952
|
-
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
9142
|
+
/**
|
|
9143
|
+
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
9144
|
+
*
|
|
9145
|
+
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
9146
|
+
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
9147
|
+
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
9148
|
+
*
|
|
9149
|
+
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
9150
|
+
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
8953
9151
|
*/ var PLAYBACK_END_SILENCE_MS = 3000;
|
|
8954
|
-
/**
|
|
8955
|
-
* 读取录像片段的起止时间(毫秒)
|
|
8956
|
-
*
|
|
8957
|
-
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
8958
|
-
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
8959
|
-
*
|
|
8960
|
-
* @param seg 录像片段
|
|
8961
|
-
* @param which 取起点还是终点
|
|
9152
|
+
/**
|
|
9153
|
+
* 读取录像片段的起止时间(毫秒)
|
|
9154
|
+
*
|
|
9155
|
+
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
9156
|
+
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
9157
|
+
*
|
|
9158
|
+
* @param seg 录像片段
|
|
9159
|
+
* @param which 取起点还是终点
|
|
8962
9160
|
*/ function segMs(seg, which) {
|
|
8963
9161
|
var _ref, _ref1;
|
|
8964
9162
|
var value = which === 'start' ? (_ref = seg == null ? void 0 : seg.startTime) != null ? _ref : seg == null ? void 0 : seg.begin : (_ref1 = seg == null ? void 0 : seg.endTime) != null ? _ref1 : seg == null ? void 0 : seg.end;
|
|
@@ -8966,12 +9164,12 @@ function _set_prototype_of$5(o, p) {
|
|
|
8966
9164
|
if (typeof value === 'number') return value < 1e12 ? value * 1000 : value;
|
|
8967
9165
|
return utilsTools.DateTime.toDate(value).getTime();
|
|
8968
9166
|
}
|
|
8969
|
-
/**
|
|
8970
|
-
* 回放片段进度条控件(移动端)
|
|
8971
|
-
*
|
|
8972
|
-
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
8973
|
-
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
8974
|
-
* @category Control
|
|
9167
|
+
/**
|
|
9168
|
+
* 回放片段进度条控件(移动端)
|
|
9169
|
+
*
|
|
9170
|
+
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
9171
|
+
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
9172
|
+
* @category Control
|
|
8975
9173
|
*/ var SegmentProgressControl = /*#__PURE__*/ function(Control) {
|
|
8976
9174
|
_inherits$5(SegmentProgressControl, Control);
|
|
8977
9175
|
function SegmentProgressControl(options) {
|
|
@@ -9038,9 +9236,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9038
9236
|
});
|
|
9039
9237
|
this._updateVisible();
|
|
9040
9238
|
};
|
|
9041
|
-
/**
|
|
9042
|
-
* 设置播放区间
|
|
9043
|
-
* @param range 区间;null 表示解除约束
|
|
9239
|
+
/**
|
|
9240
|
+
* 设置播放区间
|
|
9241
|
+
* @param range 区间;null 表示解除约束
|
|
9044
9242
|
*/ _proto._setRange = function _setRange(range) {
|
|
9045
9243
|
if ((range == null ? void 0 : range.begin) && (range == null ? void 0 : range.end)) {
|
|
9046
9244
|
this._rangeBeginMs = utilsTools.DateTime.toDate(range.begin).getTime();
|
|
@@ -9051,9 +9249,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9051
9249
|
}
|
|
9052
9250
|
this._updateVisible();
|
|
9053
9251
|
};
|
|
9054
|
-
/**
|
|
9055
|
-
* 用区间裁剪录像片段
|
|
9056
|
-
* @param records 全天录像片段
|
|
9252
|
+
/**
|
|
9253
|
+
* 用区间裁剪录像片段
|
|
9254
|
+
* @param records 全天录像片段
|
|
9057
9255
|
*/ _proto._setSegments = function _setSegments(records) {
|
|
9058
9256
|
var _this = this;
|
|
9059
9257
|
if (!this._hasRange() || !Array.isArray(records)) {
|
|
@@ -9081,9 +9279,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9081
9279
|
if (force) this._currentIndex = -1;
|
|
9082
9280
|
this._updateVisible();
|
|
9083
9281
|
};
|
|
9084
|
-
/**
|
|
9085
|
-
* 按播放进度更新片段与进度
|
|
9086
|
-
* @param currentMs 当前播放时间(毫秒)
|
|
9282
|
+
/**
|
|
9283
|
+
* 按播放进度更新片段与进度
|
|
9284
|
+
* @param currentMs 当前播放时间(毫秒)
|
|
9087
9285
|
*/ _proto._syncCurrent = function _syncCurrent(currentMs) {
|
|
9088
9286
|
if (!this._hasRange()) return;
|
|
9089
9287
|
var index = this._segments.findIndex(function(seg) {
|
|
@@ -9123,6 +9321,11 @@ function _set_prototype_of$5(o, p) {
|
|
|
9123
9321
|
};
|
|
9124
9322
|
return SegmentProgressControl;
|
|
9125
9323
|
}(Control);
|
|
9324
|
+
/** 片段进度条拖动的是录像片段内的位置,只对回放有意义(另需移动端 + 已设置播放区间) */ SegmentProgressControl.supportedPlayTypes = [
|
|
9325
|
+
'rec',
|
|
9326
|
+
'cloudRec',
|
|
9327
|
+
'cloudRecord'
|
|
9328
|
+
];
|
|
9126
9329
|
|
|
9127
9330
|
function _extends$3() {
|
|
9128
9331
|
_extends$3 = Object.assign || function assign(target) {
|
|
@@ -9154,9 +9357,9 @@ function _set_prototype_of$4(o, p) {
|
|
|
9154
9357
|
};
|
|
9155
9358
|
return _set_prototype_of$4(o, p);
|
|
9156
9359
|
}
|
|
9157
|
-
/**
|
|
9158
|
-
* 展示设备序列号控件
|
|
9159
|
-
* @category Control
|
|
9360
|
+
/**
|
|
9361
|
+
* 展示设备序列号控件
|
|
9362
|
+
* @category Control
|
|
9160
9363
|
*/ var Device = /*#__PURE__*/ function(Control) {
|
|
9161
9364
|
_inherits$4(Device, Control);
|
|
9162
9365
|
function Device(options) {
|
|
@@ -9174,10 +9377,10 @@ function _set_prototype_of$4(o, p) {
|
|
|
9174
9377
|
var _this___options_props_urlInfo, _this___options_props;
|
|
9175
9378
|
this.$container.innerHTML = '<span class="' + PREFIX_CLASS + "-text " + PREFIX_CLASS + '-text-device">' + this._splicingString(this.__options.deviceName, (_this___options_props = this.__options.props) == null ? void 0 : (_this___options_props_urlInfo = _this___options_props.urlInfo) == null ? void 0 : _this___options_props_urlInfo.deviceSerial) + "</span>";
|
|
9176
9379
|
};
|
|
9177
|
-
/**
|
|
9178
|
-
* 更新设备序列号
|
|
9179
|
-
* @param deviceSerial - 设备序列号
|
|
9180
|
-
* @param deviceName - 设备名称
|
|
9380
|
+
/**
|
|
9381
|
+
* 更新设备序列号
|
|
9382
|
+
* @param deviceSerial - 设备序列号
|
|
9383
|
+
* @param deviceName - 设备名称
|
|
9181
9384
|
*/ _proto.update = function update(deviceName, deviceSerial) {
|
|
9182
9385
|
if (this.$container.querySelector("." + PREFIX_CLASS + "-text-device")) {
|
|
9183
9386
|
var $span = this.$container.querySelector("." + PREFIX_CLASS + "-text-device");
|
|
@@ -9335,8 +9538,8 @@ function _set_prototype_of$2(o, p) {
|
|
|
9335
9538
|
// const MobileExtend_DEFAULT_Options = {
|
|
9336
9539
|
// controls: MOBILE_EXTENDS,
|
|
9337
9540
|
// };
|
|
9338
|
-
/**
|
|
9339
|
-
* 移动端扩展
|
|
9541
|
+
/**
|
|
9542
|
+
* 移动端扩展
|
|
9340
9543
|
*/ var MobileExtend = /*#__PURE__*/ function(EventEmitter) {
|
|
9341
9544
|
_inherits$2(MobileExtend, EventEmitter);
|
|
9342
9545
|
function MobileExtend($siblingContainer) {
|
|
@@ -9413,9 +9616,9 @@ function _set_prototype_of$1(o, p) {
|
|
|
9413
9616
|
return _set_prototype_of$1(o, p);
|
|
9414
9617
|
}
|
|
9415
9618
|
var PAUSE_DEFAULT_OPTIONS = {};
|
|
9416
|
-
/**
|
|
9417
|
-
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
9418
|
-
* @category Control
|
|
9619
|
+
/**
|
|
9620
|
+
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
9621
|
+
* @category Control
|
|
9419
9622
|
*/ var Pause = /*#__PURE__*/ function(Control) {
|
|
9420
9623
|
_inherits$1(Pause, Control);
|
|
9421
9624
|
function Pause(options) {
|
|
@@ -9431,8 +9634,8 @@ var PAUSE_DEFAULT_OPTIONS = {};
|
|
|
9431
9634
|
return _this;
|
|
9432
9635
|
}
|
|
9433
9636
|
var _proto = Pause.prototype;
|
|
9434
|
-
/**
|
|
9435
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
9637
|
+
/**
|
|
9638
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
9436
9639
|
*/ _proto.show = function show(playing, always) {
|
|
9437
9640
|
var _this = this;
|
|
9438
9641
|
var _this_$container_classList, _this_$container;
|
|
@@ -9477,8 +9680,8 @@ var PAUSE_DEFAULT_OPTIONS = {};
|
|
|
9477
9680
|
}, 300);
|
|
9478
9681
|
}, 10);
|
|
9479
9682
|
};
|
|
9480
|
-
/**
|
|
9481
|
-
* 销毁
|
|
9683
|
+
/**
|
|
9684
|
+
* 销毁
|
|
9482
9685
|
*/ _proto.destroy = function destroy() {
|
|
9483
9686
|
if (this._timer) {
|
|
9484
9687
|
clearTimeout(this._timer);
|
|
@@ -9766,10 +9969,30 @@ var AUTH_KEY = [
|
|
|
9766
9969
|
'recDropdown',
|
|
9767
9970
|
'alarmMessage'
|
|
9768
9971
|
];
|
|
9769
|
-
/**
|
|
9770
|
-
*
|
|
9771
|
-
*
|
|
9772
|
-
*
|
|
9972
|
+
/**
|
|
9973
|
+
* 校验控件是否支持当前播放类型,不支持只提示、**不阻止渲染**
|
|
9974
|
+
*
|
|
9975
|
+
* 之所以只提示:控件能否真正工作还取决于设备能力与 SDK 层实现,主题层没有足够信息
|
|
9976
|
+
* 直接判死;而模板可能来自开放平台配置(`getThemeData` 远程拉取)或开发者自定义的
|
|
9977
|
+
* `themeData`,直接隐藏会让人无从排查。
|
|
9978
|
+
*
|
|
9979
|
+
* `theme.playType` 为空串(地址判不出类型,如 rtmp / webrtc / 地址未设置)时整体跳过校验。
|
|
9980
|
+
*
|
|
9981
|
+
* @param theme - Theme
|
|
9982
|
+
* @param iconId - 控件 iconId
|
|
9983
|
+
* @param ControlClass - 控件类,读其静态 `supportedPlayTypes`
|
|
9984
|
+
*/ function _checkPlayTypeSupport(theme, iconId, ControlClass) {
|
|
9985
|
+
var playType = theme.playType;
|
|
9986
|
+
if (!playType || ControlClass.supportsPlayType(playType)) return;
|
|
9987
|
+
var supported = ControlClass.supportedPlayTypes;
|
|
9988
|
+
// prettier-ignore
|
|
9989
|
+
theme.logger.warn("[" + iconId + '] control does not support playType "' + playType + '" (supported: ' + supported.join(', ') + "). It is still rendered, but may not work as expected.");
|
|
9990
|
+
theme.emit(EVENTS.control.unsupportedPlayType, iconId, playType, supported);
|
|
9991
|
+
}
|
|
9992
|
+
/**
|
|
9993
|
+
* 渲染控件
|
|
9994
|
+
* @param $container - 控件渲染节点
|
|
9995
|
+
* @param btnList - 控件按钮列表
|
|
9773
9996
|
*/ // prettier-ignore
|
|
9774
9997
|
function _renderControls(theme, $container, btnList, props) {
|
|
9775
9998
|
if (props === void 0) props = {};
|
|
@@ -9808,6 +10031,8 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9808
10031
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
|
|
9809
10032
|
props: props
|
|
9810
10033
|
}));
|
|
10034
|
+
theme.emit(EVENTS.control.deviceControlInit);
|
|
10035
|
+
_checkPlayTypeSupport(theme, item.iconId, Controls["device"]);
|
|
9811
10036
|
}
|
|
9812
10037
|
}
|
|
9813
10038
|
continue;
|
|
@@ -9816,6 +10041,12 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9816
10041
|
if (Controls[item.iconId]) {
|
|
9817
10042
|
if (theme.options["" + item.iconId + "Options"] !== null) {
|
|
9818
10043
|
var _theme_urlInfo2, _theme_urlInfo3, _theme_options1;
|
|
10044
|
+
if (theme.options.sdkType === 'custom' && [
|
|
10045
|
+
"alarmMessage",
|
|
10046
|
+
"broadcast"
|
|
10047
|
+
].includes(item.iconId)) {
|
|
10048
|
+
continue;
|
|
10049
|
+
}
|
|
9819
10050
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9820
10051
|
theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
|
|
9821
10052
|
rootContainer: theme.$container,
|
|
@@ -9837,6 +10068,9 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9837
10068
|
}, ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["" + item.iconId + "Options"]) || {}, {
|
|
9838
10069
|
props: props
|
|
9839
10070
|
}));
|
|
10071
|
+
// iconId 已由 Controls 查表校验过,这里必然能取到对应的初始化事件名
|
|
10072
|
+
theme.emit(CONTROL_INIT_EVENTS["" + item.iconId + "ControlInit"]);
|
|
10073
|
+
_checkPlayTypeSupport(theme, item.iconId, Controls[item.iconId]);
|
|
9840
10074
|
}
|
|
9841
10075
|
} else {
|
|
9842
10076
|
theme.logger.warn("[" + item.iconId + "] control does not exist");
|
|
@@ -10045,7 +10279,7 @@ function _renderTheme(theme, data) {
|
|
|
10045
10279
|
});
|
|
10046
10280
|
}
|
|
10047
10281
|
// 移动端:在 rec 控件旁渲染 alarmMessage 按钮
|
|
10048
|
-
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl'])) {
|
|
10282
|
+
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl']) && theme.options.sdkType === 'base') {
|
|
10049
10283
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
10050
10284
|
theme.controls['alarmMessageControl'] = new Controls['alarmMessage'](_extends$1({
|
|
10051
10285
|
rootContainer: theme.$container,
|
|
@@ -10060,6 +10294,8 @@ function _renderTheme(theme, data) {
|
|
|
10060
10294
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options.alarmMessageOptions) || {}, {
|
|
10061
10295
|
props: props
|
|
10062
10296
|
}));
|
|
10297
|
+
theme.emit(EVENTS.control.alarmMessageControlInit);
|
|
10298
|
+
_checkPlayTypeSupport(theme, 'alarmMessage', Controls['alarmMessage']);
|
|
10063
10299
|
}
|
|
10064
10300
|
if ((theme.options.timeLineOptions !== null || !theme.options.disabledTimeLine) && ((_theme_options_mobileExtendOptions5 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions5.controls.includes('timeLine')) && _needTimeLine) {
|
|
10065
10301
|
_renderTimeLine(theme, theme._mobileExtend.$content, props);
|
|
@@ -10100,6 +10336,8 @@ var _renderTimeLine = function _renderTimeLine(theme, container, props) {
|
|
|
10100
10336
|
showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_ref = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _ref : true : true,
|
|
10101
10337
|
props: props
|
|
10102
10338
|
}));
|
|
10339
|
+
theme.emit(EVENTS.control.timeLineControlInit);
|
|
10340
|
+
_checkPlayTypeSupport(theme, 'timeLine', Controls['timeLine']);
|
|
10103
10341
|
}
|
|
10104
10342
|
};
|
|
10105
10343
|
var _renderSegmentProgress = function _renderSegmentProgress(theme, container, props) {
|
|
@@ -10117,6 +10355,8 @@ var _renderSegmentProgress = function _renderSegmentProgress(theme, container, p
|
|
|
10117
10355
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["segmentProgressOptions"]) || {}, {
|
|
10118
10356
|
props: props
|
|
10119
10357
|
}));
|
|
10358
|
+
theme.emit(EVENTS.control.segmentProgressControlInit);
|
|
10359
|
+
_checkPlayTypeSupport(theme, 'segmentProgress', Controls['segmentProgress']);
|
|
10120
10360
|
}
|
|
10121
10361
|
};
|
|
10122
10362
|
var _renderDatePicker = function _renderDatePicker(theme, container, props) {
|
|
@@ -10133,6 +10373,8 @@ var _renderDatePicker = function _renderDatePicker(theme, container, props) {
|
|
|
10133
10373
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
|
|
10134
10374
|
props: props
|
|
10135
10375
|
}));
|
|
10376
|
+
theme.emit(EVENTS.control.dateControlInit);
|
|
10377
|
+
_checkPlayTypeSupport(theme, 'date', Controls['date']);
|
|
10136
10378
|
}
|
|
10137
10379
|
};
|
|
10138
10380
|
var _renderTimePicker = function _renderTimePicker(theme, container, props) {
|
|
@@ -10149,6 +10391,8 @@ var _renderTimePicker = function _renderTimePicker(theme, container, props) {
|
|
|
10149
10391
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeOptions"]) || {}, {
|
|
10150
10392
|
props: props
|
|
10151
10393
|
}));
|
|
10394
|
+
theme.emit(EVENTS.control.timeControlInit);
|
|
10395
|
+
_checkPlayTypeSupport(theme, 'time', Controls['time']);
|
|
10152
10396
|
}
|
|
10153
10397
|
};
|
|
10154
10398
|
var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
@@ -10167,31 +10411,33 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10167
10411
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["recOptions"]) || {}, {
|
|
10168
10412
|
props: props
|
|
10169
10413
|
}));
|
|
10414
|
+
theme.emit(EVENTS.control.recControlInit);
|
|
10415
|
+
_checkPlayTypeSupport(theme, 'rec', Controls['rec']);
|
|
10170
10416
|
}
|
|
10171
10417
|
if ((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1['recControl']) ((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['recControl']).addRecType(recType);
|
|
10172
10418
|
};
|
|
10173
10419
|
|
|
10174
|
-
/**
|
|
10175
|
-
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
10176
|
-
*
|
|
10177
|
-
* @remarks
|
|
10178
|
-
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
10179
|
-
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
10180
|
-
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
10181
|
-
*/ /**
|
|
10182
|
-
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
10183
|
-
*/ /**
|
|
10184
|
-
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
10185
|
-
*
|
|
10186
|
-
* 档位规则:
|
|
10187
|
-
* - `(280, 375]` → medium
|
|
10188
|
-
* - `(200, 280]` → small
|
|
10189
|
-
* - `<= 200` → mini
|
|
10190
|
-
* - 其它(> 375)→ 无档位(移除全部)
|
|
10191
|
-
*
|
|
10192
|
-
* @param size 尺寸(px)
|
|
10193
|
-
* @param axis `'width'` 或 `'height'`
|
|
10194
|
-
* @param prefix 类名前缀(如 `ezplayer`)
|
|
10420
|
+
/**
|
|
10421
|
+
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
10422
|
+
*
|
|
10423
|
+
* @remarks
|
|
10424
|
+
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
10425
|
+
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
10426
|
+
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
10427
|
+
*/ /**
|
|
10428
|
+
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
10429
|
+
*/ /**
|
|
10430
|
+
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
10431
|
+
*
|
|
10432
|
+
* 档位规则:
|
|
10433
|
+
* - `(280, 375]` → medium
|
|
10434
|
+
* - `(200, 280]` → small
|
|
10435
|
+
* - `<= 200` → mini
|
|
10436
|
+
* - 其它(> 375)→ 无档位(移除全部)
|
|
10437
|
+
*
|
|
10438
|
+
* @param size 尺寸(px)
|
|
10439
|
+
* @param axis `'width'` 或 `'height'`
|
|
10440
|
+
* @param prefix 类名前缀(如 `ezplayer`)
|
|
10195
10441
|
*/ function computeDimensionClasses(size, axis, prefix) {
|
|
10196
10442
|
var medium = prefix + "-medium-" + axis;
|
|
10197
10443
|
var small = prefix + "-small-" + axis;
|
|
@@ -10217,11 +10463,11 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10217
10463
|
remove: remove
|
|
10218
10464
|
};
|
|
10219
10465
|
}
|
|
10220
|
-
/**
|
|
10221
|
-
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
10222
|
-
* @param width 容器宽度(px)
|
|
10223
|
-
* @param height 容器高度(px)
|
|
10224
|
-
* @param prefix 类名前缀
|
|
10466
|
+
/**
|
|
10467
|
+
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
10468
|
+
* @param width 容器宽度(px)
|
|
10469
|
+
* @param height 容器高度(px)
|
|
10470
|
+
* @param prefix 类名前缀
|
|
10225
10471
|
*/ function computeSizeClasses(width, height, prefix) {
|
|
10226
10472
|
var w = computeDimensionClasses(width, 'width', prefix);
|
|
10227
10473
|
var h = computeDimensionClasses(height, 'height', prefix);
|
|
@@ -10230,34 +10476,34 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10230
10476
|
remove: [].concat(w.remove, h.remove)
|
|
10231
10477
|
};
|
|
10232
10478
|
}
|
|
10233
|
-
/**
|
|
10234
|
-
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
10479
|
+
/**
|
|
10480
|
+
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
10235
10481
|
*/ function shouldShowHeaderMore(width, leftWidth, rightWidth) {
|
|
10236
10482
|
return leftWidth + rightWidth + 30 > width;
|
|
10237
10483
|
}
|
|
10238
|
-
/**
|
|
10239
|
-
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
10484
|
+
/**
|
|
10485
|
+
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
10240
10486
|
*/ function shouldRemoveHeaderMore(width, leftWidth, rightWidth) {
|
|
10241
10487
|
return width - leftWidth - rightWidth > 100;
|
|
10242
10488
|
}
|
|
10243
|
-
/**
|
|
10244
|
-
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
10489
|
+
/**
|
|
10490
|
+
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
10245
10491
|
*/ function shouldCollapseFooter(width, leftWidth, rightWidth) {
|
|
10246
10492
|
return width - leftWidth - rightWidth < 16;
|
|
10247
10493
|
}
|
|
10248
|
-
/**
|
|
10249
|
-
* footer 从 More 中释放控件时的展开阈值。
|
|
10250
|
-
*
|
|
10251
|
-
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
10252
|
-
* `50 + firstItemWidth || 0`)。
|
|
10253
|
-
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
10494
|
+
/**
|
|
10495
|
+
* footer 从 More 中释放控件时的展开阈值。
|
|
10496
|
+
*
|
|
10497
|
+
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
10498
|
+
* `50 + firstItemWidth || 0`)。
|
|
10499
|
+
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
10254
10500
|
*/ function computeFooterExpandOffset(firstItemWidth) {
|
|
10255
10501
|
var base = 50;
|
|
10256
10502
|
if (firstItemWidth === undefined) return base;
|
|
10257
10503
|
return base + firstItemWidth || 0;
|
|
10258
10504
|
}
|
|
10259
|
-
/**
|
|
10260
|
-
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
10505
|
+
/**
|
|
10506
|
+
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
10261
10507
|
*/ function shouldExpandFooter(width, leftWidth, rightWidth, offset) {
|
|
10262
10508
|
return width - leftWidth - rightWidth > offset;
|
|
10263
10509
|
}
|
|
@@ -10888,14 +11134,14 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10888
11134
|
});
|
|
10889
11135
|
this.$container.classList.remove("" + PREFIX_CLASS);
|
|
10890
11136
|
this._themeData = null;
|
|
10891
|
-
if (this.i18n) this.i18n = null
|
|
11137
|
+
// if (this.i18n) this.i18n = null!; // 注释是为了防止出错
|
|
10892
11138
|
this.recType = '';
|
|
10893
11139
|
this.recMonth = []; // 清空数据
|
|
10894
11140
|
// 重置
|
|
10895
11141
|
this._videoInfo = {};
|
|
10896
11142
|
this.emit(EVENTS.theme.destroyed);
|
|
10897
11143
|
this.removeAllListeners();
|
|
10898
|
-
if (this.logger) this.logger = null
|
|
11144
|
+
// if (this.logger) this.logger = null!; // 注释是为了防止出错
|
|
10899
11145
|
// 销毁后,将 destroyed 设置为 true
|
|
10900
11146
|
this.destroyed = true;
|
|
10901
11147
|
};
|
|
@@ -11488,6 +11734,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11488
11734
|
},
|
|
11489
11735
|
set: function set(url) {
|
|
11490
11736
|
this._url = url;
|
|
11737
|
+
// 地址变了回放类型也要跟着变,否则 recType / playType 会停留在上一个地址的结果,
|
|
11738
|
+
// 进而影响倍速档位过滤、回放类型控件激活态与控件支持性校验
|
|
11739
|
+
this._getRecType(url);
|
|
11491
11740
|
}
|
|
11492
11741
|
},
|
|
11493
11742
|
{
|
|
@@ -11501,6 +11750,32 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11501
11750
|
return {};
|
|
11502
11751
|
}
|
|
11503
11752
|
},
|
|
11753
|
+
{
|
|
11754
|
+
key: "playType",
|
|
11755
|
+
get: /**
|
|
11756
|
+
* 当前播放类型,由播放地址解析得出
|
|
11757
|
+
*
|
|
11758
|
+
* 取值 `'live' | 'rec' | 'cloudRec' | 'cloudRecord'`,无法判定时为空字符串 `''`。
|
|
11759
|
+
*
|
|
11760
|
+
* 与 {@link recType} 的关系:`recType` 只覆盖三种回放,直播时为空串;
|
|
11761
|
+
* 本 getter 把直播也纳入同一个枚举,作为「当前播放类型」的统一出口。
|
|
11762
|
+
*
|
|
11763
|
+
* @remarks 空串表示无法从地址判定(如 rtmp、webrtc、地址未设置)。
|
|
11764
|
+
* 此时控件支持性校验会整体跳过,避免对判不出类型的地址误报。
|
|
11765
|
+
* @since 3.1.7
|
|
11766
|
+
* ```ts
|
|
11767
|
+
* theme.playType // 'cloudRec'
|
|
11768
|
+
* ```
|
|
11769
|
+
*/ function get() {
|
|
11770
|
+
var _this_urlInfo;
|
|
11771
|
+
// 回放三类由 _getRecType 解析(含 busType=7 → cloudRecord 的区分)
|
|
11772
|
+
if (this.recType) return this.recType;
|
|
11773
|
+
if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'live') return 'live';
|
|
11774
|
+
// 标准流直播:http(s) 且不走回放路径 /openpb/
|
|
11775
|
+
if (this._url && utilsTools.isHttp(this._url) && !this._url.includes('/openpb/')) return 'live';
|
|
11776
|
+
return '';
|
|
11777
|
+
}
|
|
11778
|
+
},
|
|
11504
11779
|
{
|
|
11505
11780
|
key: "width",
|
|
11506
11781
|
get: /**
|
|
@@ -11987,8 +12262,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11987
12262
|
zh: zh,
|
|
11988
12263
|
en: en
|
|
11989
12264
|
};
|
|
11990
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.
|
|
12265
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.7-beta.2';
|
|
11991
12266
|
|
|
12267
|
+
exports.CONTROL_INIT_EVENTS = CONTROL_INIT_EVENTS;
|
|
11992
12268
|
exports.Control = Control;
|
|
11993
12269
|
exports.EVENTS = EVENTS;
|
|
11994
12270
|
exports.Fullscreen = Fullscreen;
|