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