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