@ezuikit/player-theme 3.1.5-beta.3 → 3.1.6-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 +4 -2
- package/dist/index.cjs +665 -597
- package/dist/index.esm.js +665 -597
- package/dist/index.umd.js +676 -608
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +17 -4
- package/package.json +65 -65
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.6-beta.1
|
|
3
|
+
* Copyright (c) 2026-09-16 19:24:27 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import EventEmitter from 'eventemitter3';
|
|
@@ -217,6 +217,8 @@ var EVENTS = {
|
|
|
217
217
|
/** 日期面板展示隐藏变换 */ datePanelOpenChange: 'Control.datePanelOpenChange',
|
|
218
218
|
/** 日期改变 */ dateChange: 'Control.dateChange',
|
|
219
219
|
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
220
|
+
/** 日期面板展示的月份变化 */ datePanelMonthChange: 'Control.datePanelMonthChange',
|
|
221
|
+
/** 日期面板展示的年份变化 */ datePanelYearChange: 'Control.datePanelYearChange',
|
|
220
222
|
/** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
|
|
221
223
|
/** 时间面板展示隐藏变换 */ timePanelOpenChange: 'Control.timePanelOpenChange',
|
|
222
224
|
/** 时间改变 */ timeChange: 'Control.timeChange',
|
|
@@ -282,17 +284,17 @@ function _set_prototype_of$z(o, p) {
|
|
|
282
284
|
};
|
|
283
285
|
return _set_prototype_of$z(o, p);
|
|
284
286
|
}
|
|
285
|
-
/**
|
|
286
|
-
* 控件基类
|
|
287
|
-
* @category Control
|
|
288
|
-
* @example
|
|
289
|
-
* ```ts
|
|
290
|
-
* // 创建控件
|
|
291
|
-
* class MyControl extends Control {}
|
|
292
|
-
*
|
|
293
|
-
* // 使用控件
|
|
294
|
-
* const myControl = new MyControl({})
|
|
295
|
-
* ```
|
|
287
|
+
/**
|
|
288
|
+
* 控件基类
|
|
289
|
+
* @category Control
|
|
290
|
+
* @example
|
|
291
|
+
* ```ts
|
|
292
|
+
* // 创建控件
|
|
293
|
+
* class MyControl extends Control {}
|
|
294
|
+
*
|
|
295
|
+
* // 使用控件
|
|
296
|
+
* const myControl = new MyControl({})
|
|
297
|
+
* ```
|
|
296
298
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
297
299
|
_inherits$z(Control, EventEmitter);
|
|
298
300
|
function Control(options) {
|
|
@@ -334,22 +336,22 @@ function _set_prototype_of$z(o, p) {
|
|
|
334
336
|
return _this;
|
|
335
337
|
}
|
|
336
338
|
var _proto = Control.prototype;
|
|
337
|
-
/**
|
|
338
|
-
* 重置整个控件
|
|
339
|
+
/**
|
|
340
|
+
* 重置整个控件
|
|
339
341
|
*/ _proto.reset = function reset(hide) {
|
|
340
342
|
if (this._camelCaseName) {
|
|
341
343
|
this.emit("Control." + this._camelCaseName + "Reset", hide);
|
|
342
344
|
}
|
|
343
345
|
};
|
|
344
|
-
/**
|
|
345
|
-
* 重置控件挂载节点
|
|
346
|
-
* @param popupContainer 重新挂载的节点
|
|
347
|
-
* @param append 添加的方式, 默认 append
|
|
348
|
-
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
349
|
-
*
|
|
350
|
-
* | prepend | append |
|
|
351
|
-
* |:-------------:|:---------------:|
|
|
352
|
-
* | 插入第一个位置 | 追加在末尾 |
|
|
346
|
+
/**
|
|
347
|
+
* 重置控件挂载节点
|
|
348
|
+
* @param popupContainer 重新挂载的节点
|
|
349
|
+
* @param append 添加的方式, 默认 append
|
|
350
|
+
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
351
|
+
*
|
|
352
|
+
* | prepend | append |
|
|
353
|
+
* |:-------------:|:---------------:|
|
|
354
|
+
* | 插入第一个位置 | 追加在末尾 |
|
|
353
355
|
*/ _proto.resetPopupContainer = function resetPopupContainer(popupContainer, append, element) {
|
|
354
356
|
if (popupContainer !== this.$popupContainer) {
|
|
355
357
|
if (this.$popupContainer.contains(this.$container)) {
|
|
@@ -371,16 +373,16 @@ function _set_prototype_of$z(o, p) {
|
|
|
371
373
|
}
|
|
372
374
|
}
|
|
373
375
|
};
|
|
374
|
-
/**
|
|
375
|
-
* 隐藏整个控件
|
|
376
|
+
/**
|
|
377
|
+
* 隐藏整个控件
|
|
376
378
|
*/ _proto.hide = function hide() {
|
|
377
379
|
if (this.$container) {
|
|
378
380
|
this.$container.style.display = 'none';
|
|
379
381
|
this.$container.classList.add("" + PREFIX_CLASS + "-hide");
|
|
380
382
|
}
|
|
381
383
|
};
|
|
382
|
-
/**
|
|
383
|
-
* 销毁控件
|
|
384
|
+
/**
|
|
385
|
+
* 销毁控件
|
|
384
386
|
*/ _proto.destroy = function destroy() {
|
|
385
387
|
var _this___options, _this_$container_remove, _this_$container;
|
|
386
388
|
if (this._camelCaseName) {
|
|
@@ -417,8 +419,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
417
419
|
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS + "-active");
|
|
418
420
|
}
|
|
419
421
|
};
|
|
420
|
-
/**
|
|
421
|
-
* 当点击 Control 时 触发子类的 _onControlClick
|
|
422
|
+
/**
|
|
423
|
+
* 当点击 Control 时 触发子类的 _onControlClick
|
|
422
424
|
*/ _proto._onClick = function _onClick() {
|
|
423
425
|
var _this = this;
|
|
424
426
|
// 使用具名 handler 便于在 destroy 时精确移除,避免匿名监听残留
|
|
@@ -436,10 +438,10 @@ function _set_prototype_of$z(o, p) {
|
|
|
436
438
|
e.stopPropagation();
|
|
437
439
|
e.preventDefault();
|
|
438
440
|
};
|
|
439
|
-
/**
|
|
440
|
-
* 点击 Control 控件触发
|
|
441
|
-
* @param {Event} e
|
|
442
|
-
* @returns {void}
|
|
441
|
+
/**
|
|
442
|
+
* 点击 Control 控件触发
|
|
443
|
+
* @param {Event} e
|
|
444
|
+
* @returns {void}
|
|
443
445
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
444
446
|
// 这是一个空函数, 子类可以实现重新改方法
|
|
445
447
|
this.__options.onClick == null ? void 0 : this.__options.onClick.call(this.__options, e);
|
|
@@ -447,8 +449,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
447
449
|
_create_class$9(Control, [
|
|
448
450
|
{
|
|
449
451
|
key: "active",
|
|
450
|
-
get: /**
|
|
451
|
-
* 是否激活
|
|
452
|
+
get: /**
|
|
453
|
+
* 是否激活
|
|
452
454
|
*/ function get() {
|
|
453
455
|
return this._active;
|
|
454
456
|
},
|
|
@@ -463,8 +465,8 @@ function _set_prototype_of$z(o, p) {
|
|
|
463
465
|
},
|
|
464
466
|
{
|
|
465
467
|
key: "disabled",
|
|
466
|
-
get: /**
|
|
467
|
-
* 是否禁用
|
|
468
|
+
get: /**
|
|
469
|
+
* 是否禁用
|
|
468
470
|
*/ function get() {
|
|
469
471
|
return this._disabled;
|
|
470
472
|
},
|
|
@@ -508,9 +510,9 @@ function _set_prototype_of$y(o, p) {
|
|
|
508
510
|
return _set_prototype_of$y(o, p);
|
|
509
511
|
}
|
|
510
512
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
511
|
-
/**
|
|
512
|
-
* 加载动画控件
|
|
513
|
-
* @category Control
|
|
513
|
+
/**
|
|
514
|
+
* 加载动画控件
|
|
515
|
+
* @category Control
|
|
514
516
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
515
517
|
_inherits$y(Loading, Control);
|
|
516
518
|
function Loading(options) {
|
|
@@ -535,9 +537,9 @@ var LOADING_DEFAULT_OPTIONS = {};
|
|
|
535
537
|
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 ";
|
|
536
538
|
}
|
|
537
539
|
};
|
|
538
|
-
/**
|
|
539
|
-
* 动画展示
|
|
540
|
-
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
540
|
+
/**
|
|
541
|
+
* 动画展示
|
|
542
|
+
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
541
543
|
*/ _proto.show = function show(html) {
|
|
542
544
|
if (html) this.$container.innerHTML = html;
|
|
543
545
|
// 初始化, 出流再等待中(回放出流结束不包括)
|
|
@@ -545,8 +547,8 @@ var LOADING_DEFAULT_OPTIONS = {};
|
|
|
545
547
|
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
546
548
|
this.$popupContainer.classList.add("" + PREFIX_CLASS + "-has-loading");
|
|
547
549
|
};
|
|
548
|
-
/**
|
|
549
|
-
* 隐藏动画
|
|
550
|
+
/**
|
|
551
|
+
* 隐藏动画
|
|
550
552
|
*/ _proto.hide = function hide() {
|
|
551
553
|
Control.prototype.hide.call(this);
|
|
552
554
|
this.$popupContainer.classList.remove("" + PREFIX_CLASS + "-has-loading");
|
|
@@ -590,9 +592,9 @@ var DEFAULT_POSTER = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29
|
|
|
590
592
|
var POSTER_OPTIONS = {
|
|
591
593
|
poster: DEFAULT_POSTER
|
|
592
594
|
};
|
|
593
|
-
/**
|
|
594
|
-
* 封面控件
|
|
595
|
-
* @category Control
|
|
595
|
+
/**
|
|
596
|
+
* 封面控件
|
|
597
|
+
* @category Control
|
|
596
598
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
597
599
|
_inherits$x(Poster, Control);
|
|
598
600
|
function Poster(options) {
|
|
@@ -612,18 +614,18 @@ var POSTER_OPTIONS = {
|
|
|
612
614
|
return _this;
|
|
613
615
|
}
|
|
614
616
|
var _proto = Poster.prototype;
|
|
615
|
-
/**
|
|
616
|
-
* 封面图片加载失败
|
|
617
|
-
* @param error
|
|
617
|
+
/**
|
|
618
|
+
* 封面图片加载失败
|
|
619
|
+
* @param error
|
|
618
620
|
*/ _proto._imgLoadErrorEvent = function _imgLoadErrorEvent(error) {
|
|
619
621
|
var _error_target;
|
|
620
622
|
// 封面加载失败, 一般只有自定义封面会出现这种情况
|
|
621
623
|
// 这里不做img src重置处理 防止无限循环
|
|
622
624
|
this._options.onLoadImgError == null ? void 0 : this._options.onLoadImgError.call(this._options, ((_error_target = error.target) == null ? void 0 : _error_target.getAttribute('src')) || '');
|
|
623
625
|
};
|
|
624
|
-
/**
|
|
625
|
-
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
626
|
-
* @param {string} poster 封面地址或 base64 数据
|
|
626
|
+
/**
|
|
627
|
+
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
628
|
+
* @param {string} poster 封面地址或 base64 数据
|
|
627
629
|
*/ _proto.setPoster = function setPoster(poster) {
|
|
628
630
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
629
631
|
// prettier-ignore
|
|
@@ -636,24 +638,24 @@ var POSTER_OPTIONS = {
|
|
|
636
638
|
this.$container.innerHTML = '<img class="' + PREFIX_CLASS + '-poster-img" src="' + poster + '" />';
|
|
637
639
|
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.addEventListener("error", this._imgLoadErrorEvent);
|
|
638
640
|
};
|
|
639
|
-
/**
|
|
640
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
641
|
+
/**
|
|
642
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
641
643
|
*/ _proto.show = function show() {
|
|
642
644
|
if (this.$container) {
|
|
643
645
|
this.$container.style.display = 'flex';
|
|
644
646
|
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
645
647
|
}
|
|
646
648
|
};
|
|
647
|
-
/**
|
|
648
|
-
* 隐藏封面
|
|
649
|
+
/**
|
|
650
|
+
* 隐藏封面
|
|
649
651
|
*/ _proto.hide = function hide() {
|
|
650
652
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
651
653
|
_this_$container_querySelector, _this_$container;
|
|
652
654
|
Control.prototype.hide.call(this);
|
|
653
655
|
(_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);
|
|
654
656
|
};
|
|
655
|
-
/**
|
|
656
|
-
* 销毁
|
|
657
|
+
/**
|
|
658
|
+
* 销毁
|
|
657
659
|
*/ _proto.destroy = function destroy() {
|
|
658
660
|
this.hide();
|
|
659
661
|
Control.prototype.destroy.call(this);
|
|
@@ -712,15 +714,15 @@ var Icons = {
|
|
|
712
714
|
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>'
|
|
713
715
|
};
|
|
714
716
|
|
|
715
|
-
/**
|
|
716
|
-
* 创建 icon 组件
|
|
717
|
-
* @param svg - svg 字符串
|
|
718
|
-
* @param type - icon 类型
|
|
719
|
-
* @returns icon 组件
|
|
720
|
-
* @example
|
|
721
|
-
* ```ts
|
|
722
|
-
* createIcon('<svg>....</svg>', 'logo') // <span class="ezplayer-icon ezplayer-icon-logo"><svg>....</svg></span>
|
|
723
|
-
* ```
|
|
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
|
+
* ```
|
|
724
726
|
*/ function createIcon(svg, type, attr) {
|
|
725
727
|
if (attr === void 0) attr = {};
|
|
726
728
|
var attrStr = '';
|
|
@@ -921,9 +923,9 @@ function _set_prototype_of$w(o, p) {
|
|
|
921
923
|
return _set_prototype_of$w(o, p);
|
|
922
924
|
}
|
|
923
925
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
924
|
-
/**
|
|
925
|
-
* 消息控件
|
|
926
|
-
* @category Control
|
|
926
|
+
/**
|
|
927
|
+
* 消息控件
|
|
928
|
+
* @category Control
|
|
927
929
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
928
930
|
_inherits$w(Message, Control);
|
|
929
931
|
function Message(options) {
|
|
@@ -938,34 +940,34 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
938
940
|
return _this;
|
|
939
941
|
}
|
|
940
942
|
var _proto = Message.prototype;
|
|
941
|
-
/**
|
|
942
|
-
* info 普通消息, 内容默认字体白色
|
|
943
|
-
* @param {string} msg 消息内容
|
|
944
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
943
|
+
/**
|
|
944
|
+
* info 普通消息, 内容默认字体白色
|
|
945
|
+
* @param {string} msg 消息内容
|
|
946
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
945
947
|
*/ _proto.info = function info(msg, duration) {
|
|
946
948
|
if (duration === void 0) duration = 2;
|
|
947
949
|
this._toast(msg, 'info', duration);
|
|
948
950
|
};
|
|
949
|
-
/**
|
|
950
|
-
* warn 警告消息, 内容默认字体黄色
|
|
951
|
-
* @param {string} msg 消息内容
|
|
952
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
951
|
+
/**
|
|
952
|
+
* warn 警告消息, 内容默认字体黄色
|
|
953
|
+
* @param {string} msg 消息内容
|
|
954
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
953
955
|
*/ _proto.warn = function warn(msg, duration) {
|
|
954
956
|
if (duration === void 0) duration = 2;
|
|
955
957
|
this._toast(msg, 'warn', duration);
|
|
956
958
|
};
|
|
957
|
-
/**
|
|
958
|
-
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
959
|
-
* @param {string} msg 消息内容
|
|
960
|
-
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
959
|
+
/**
|
|
960
|
+
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
961
|
+
* @param {string} msg 消息内容
|
|
962
|
+
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
961
963
|
*/ _proto.toastError = function toastError(msg, duration) {
|
|
962
964
|
if (duration === void 0) duration = 2;
|
|
963
965
|
this._toast(msg, 'error', duration);
|
|
964
966
|
};
|
|
965
|
-
/**
|
|
966
|
-
* error 错误消息, 内容默认字体红色
|
|
967
|
-
* @param {string} msg 消息内容
|
|
968
|
-
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
967
|
+
/**
|
|
968
|
+
* error 错误消息, 内容默认字体红色
|
|
969
|
+
* @param {string} msg 消息内容
|
|
970
|
+
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
969
971
|
*/ _proto.error = function error(msg, duration) {
|
|
970
972
|
if (duration === void 0) duration = 0;
|
|
971
973
|
this._show(this._getIcon('error') + '<div class="' + PREFIX_CLASS + '-message-msg">' + (msg || '') + "</div>", duration, 'error');
|
|
@@ -994,11 +996,11 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
994
996
|
}
|
|
995
997
|
}
|
|
996
998
|
};
|
|
997
|
-
/**
|
|
998
|
-
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
999
|
-
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1000
|
-
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1001
|
-
* @param {MessageType} type 消息类型
|
|
999
|
+
/**
|
|
1000
|
+
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
1001
|
+
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
1002
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
1003
|
+
* @param {MessageType} type 消息类型
|
|
1002
1004
|
*/ _proto._show = function _show(msg, duration, type) {
|
|
1003
1005
|
var _this = this;
|
|
1004
1006
|
if (duration === void 0) duration = 0;
|
|
@@ -1026,8 +1028,8 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
1026
1028
|
}, duration * 1000);
|
|
1027
1029
|
}
|
|
1028
1030
|
};
|
|
1029
|
-
/**
|
|
1030
|
-
* 销毁
|
|
1031
|
+
/**
|
|
1032
|
+
* 销毁
|
|
1031
1033
|
*/ _proto.destroy = function destroy() {
|
|
1032
1034
|
var _this__$toast;
|
|
1033
1035
|
if (this._timer) {
|
|
@@ -1042,8 +1044,8 @@ var MESSAGE_DEFAULT_OPTIONS = {};
|
|
|
1042
1044
|
this.hide();
|
|
1043
1045
|
Control.prototype.destroy.call(this);
|
|
1044
1046
|
};
|
|
1045
|
-
/**
|
|
1046
|
-
* 隐藏消息, 并清空消息内容
|
|
1047
|
+
/**
|
|
1048
|
+
* 隐藏消息, 并清空消息内容
|
|
1047
1049
|
*/ _proto.hide = function hide() {
|
|
1048
1050
|
var _this = this;
|
|
1049
1051
|
// 每次隐藏都清空内 消息内容
|
|
@@ -1116,9 +1118,9 @@ function _set_prototype_of$v(o, p) {
|
|
|
1116
1118
|
};
|
|
1117
1119
|
return _set_prototype_of$v(o, p);
|
|
1118
1120
|
}
|
|
1119
|
-
/**
|
|
1120
|
-
* 播放/暂停控件
|
|
1121
|
-
* @category Control
|
|
1121
|
+
/**
|
|
1122
|
+
* 播放/暂停控件
|
|
1123
|
+
* @category Control
|
|
1122
1124
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1123
1125
|
_inherits$v(Play, Control);
|
|
1124
1126
|
function Play(options) {
|
|
@@ -1140,8 +1142,8 @@ function _set_prototype_of$v(o, p) {
|
|
|
1140
1142
|
return _this;
|
|
1141
1143
|
}
|
|
1142
1144
|
var _proto = Play.prototype;
|
|
1143
|
-
/**
|
|
1144
|
-
* 点击 Control 会触发
|
|
1145
|
+
/**
|
|
1146
|
+
* 点击 Control 会触发
|
|
1145
1147
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
1146
1148
|
this._playing = !this._playing;
|
|
1147
1149
|
this.emit(EVENTS.control.play, this._playing);
|
|
@@ -1164,8 +1166,8 @@ function _set_prototype_of$v(o, p) {
|
|
|
1164
1166
|
_create_class$8(Play, [
|
|
1165
1167
|
{
|
|
1166
1168
|
key: "playing",
|
|
1167
|
-
get: /**
|
|
1168
|
-
* 播放状态
|
|
1169
|
+
get: /**
|
|
1170
|
+
* 播放状态
|
|
1169
1171
|
*/ function get() {
|
|
1170
1172
|
return this._playing;
|
|
1171
1173
|
}
|
|
@@ -1174,12 +1176,12 @@ function _set_prototype_of$v(o, p) {
|
|
|
1174
1176
|
return Play;
|
|
1175
1177
|
}(Control);
|
|
1176
1178
|
|
|
1177
|
-
/**
|
|
1178
|
-
* 节流函数
|
|
1179
|
-
* @param {Function} func
|
|
1180
|
-
* @param {number} wait
|
|
1181
|
-
* @typeParam T - 函数类型
|
|
1182
|
-
* @returns {Function}
|
|
1179
|
+
/**
|
|
1180
|
+
* 节流函数
|
|
1181
|
+
* @param {Function} func
|
|
1182
|
+
* @param {number} wait
|
|
1183
|
+
* @typeParam T - 函数类型
|
|
1184
|
+
* @returns {Function}
|
|
1183
1185
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
1184
1186
|
function throttle(func, wait) {
|
|
1185
1187
|
var timeout = null;
|
|
@@ -1235,28 +1237,28 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1235
1237
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1236
1238
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
1237
1239
|
}
|
|
1238
|
-
/**
|
|
1239
|
-
* 工具类
|
|
1240
|
-
* @category Util
|
|
1240
|
+
/**
|
|
1241
|
+
* 工具类
|
|
1242
|
+
* @category Util
|
|
1241
1243
|
*/ var Utils = /*#__PURE__*/ function() {
|
|
1242
1244
|
function Utils() {}
|
|
1243
1245
|
// /(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) ||
|
|
1244
1246
|
// (/Macintosh/i.test(navigator?.userAgent) && navigator?.maxTouchPoints > 1); // iPad 支持多点触控;
|
|
1245
|
-
/**
|
|
1246
|
-
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
1247
|
-
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
1248
|
-
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
1249
|
-
*
|
|
1250
|
-
* @example
|
|
1251
|
-
* ```ts
|
|
1252
|
-
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
1253
|
-
* console.log("orientation", orientation)
|
|
1254
|
-
* })
|
|
1255
|
-
*
|
|
1256
|
-
* console.log("orientation", orientation)
|
|
1257
|
-
* // 清除监听
|
|
1258
|
-
* cleanUp()
|
|
1259
|
-
* ```
|
|
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
|
+
* ```
|
|
1260
1262
|
*/ // prettier-ignore
|
|
1261
1263
|
Utils.orientationEventListener = function orientationEventListener(change) {
|
|
1262
1264
|
var _orientationTimer = null;
|
|
@@ -1346,18 +1348,18 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1346
1348
|
}
|
|
1347
1349
|
];
|
|
1348
1350
|
};
|
|
1349
|
-
/**
|
|
1350
|
-
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
1351
|
-
* @param {Element} node
|
|
1352
|
-
* @param callback
|
|
1353
|
-
* @returns {CleanUpResizeObserver}
|
|
1354
|
-
* @example
|
|
1355
|
-
* ```ts
|
|
1356
|
-
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
1357
|
-
*
|
|
1358
|
-
* // 移除监听
|
|
1359
|
-
* unobserve()
|
|
1360
|
-
* ```
|
|
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
|
+
* ```
|
|
1361
1363
|
*/ // prettier-ignore
|
|
1362
1364
|
Utils.resizeObserver = function resizeObserver(node, callback) {
|
|
1363
1365
|
// prettier-ignore
|
|
@@ -1392,12 +1394,12 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
1392
1394
|
return Utils;
|
|
1393
1395
|
}();
|
|
1394
1396
|
// 不要使用 window, 如果在 worker 中会报错
|
|
1395
|
-
/**
|
|
1396
|
-
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
1397
|
-
* @example
|
|
1398
|
-
* ```ts
|
|
1399
|
-
* Utils.isMobile // true | false
|
|
1400
|
-
* ```
|
|
1397
|
+
/**
|
|
1398
|
+
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
1399
|
+
* @example
|
|
1400
|
+
* ```ts
|
|
1401
|
+
* Utils.isMobile // true | false
|
|
1402
|
+
* ```
|
|
1401
1403
|
*/ Utils.isMobile = isMobile();
|
|
1402
1404
|
|
|
1403
1405
|
function _defineProperties$7(target, props) {
|
|
@@ -1431,23 +1433,23 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1431
1433
|
return (percent * 100).toFixed(0);
|
|
1432
1434
|
}
|
|
1433
1435
|
};
|
|
1434
|
-
/**
|
|
1435
|
-
* 进度条
|
|
1436
|
-
*
|
|
1437
|
-
* @category Control
|
|
1438
|
-
* @example
|
|
1439
|
-
* ```ts
|
|
1440
|
-
* const progress = new Progress({
|
|
1441
|
-
* container: document.getElementById('progress-container'),
|
|
1442
|
-
* step: 0.01,
|
|
1443
|
-
* range: [0, 1],
|
|
1444
|
-
* onChange: (value, range) => {
|
|
1445
|
-
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
1446
|
-
* },
|
|
1447
|
-
* defaultValue: 0.5,
|
|
1448
|
-
* draggable: true,
|
|
1449
|
-
* disabled: false,
|
|
1450
|
-
* })
|
|
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
|
+
* })
|
|
1451
1453
|
*/ var Progress = /*#__PURE__*/ function() {
|
|
1452
1454
|
function Progress(options) {
|
|
1453
1455
|
var _this_options_defaultValue;
|
|
@@ -1480,20 +1482,20 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1480
1482
|
this.disabled = this.options.disabled;
|
|
1481
1483
|
}
|
|
1482
1484
|
var _proto = Progress.prototype;
|
|
1483
|
-
/**
|
|
1484
|
-
* 是否旋转了
|
|
1485
|
-
* @param rotated
|
|
1485
|
+
/**
|
|
1486
|
+
* 是否旋转了
|
|
1487
|
+
* @param rotated
|
|
1486
1488
|
*/ _proto.isRotate = function isRotate(rotated) {
|
|
1487
1489
|
this._isRotated = rotated;
|
|
1488
1490
|
};
|
|
1489
|
-
/**
|
|
1490
|
-
* 销毁 Progress 实例,移除事件监听器
|
|
1491
|
-
* @returns {void}
|
|
1492
|
-
* @memberof Progress
|
|
1493
|
-
* @example
|
|
1494
|
-
* ```ts
|
|
1495
|
-
* progress.destroy();
|
|
1496
|
-
* ```
|
|
1491
|
+
/**
|
|
1492
|
+
* 销毁 Progress 实例,移除事件监听器
|
|
1493
|
+
* @returns {void}
|
|
1494
|
+
* @memberof Progress
|
|
1495
|
+
* @example
|
|
1496
|
+
* ```ts
|
|
1497
|
+
* progress.destroy();
|
|
1498
|
+
* ```
|
|
1497
1499
|
*/ _proto.destroy = function destroy() {
|
|
1498
1500
|
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;
|
|
1499
1501
|
(_this__delegateSliderMouseDown = this._delegateSliderMouseDown) == null ? void 0 : (_this__delegateSliderMouseDown_destroy = _this__delegateSliderMouseDown.destroy) == null ? void 0 : _this__delegateSliderMouseDown_destroy.call(_this__delegateSliderMouseDown);
|
|
@@ -1688,14 +1690,14 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1688
1690
|
},
|
|
1689
1691
|
{
|
|
1690
1692
|
key: "value",
|
|
1691
|
-
get: /**
|
|
1692
|
-
* 获取进度条值
|
|
1693
|
-
* @returns {number} 当前进度条值
|
|
1694
|
-
* @example
|
|
1695
|
-
* ```ts
|
|
1696
|
-
* const value = progress.value; // 获取当前进度条值
|
|
1697
|
-
* console.log(value); // 输出值
|
|
1698
|
-
* ```
|
|
1693
|
+
get: /**
|
|
1694
|
+
* 获取进度条值
|
|
1695
|
+
* @returns {number} 当前进度条值
|
|
1696
|
+
* @example
|
|
1697
|
+
* ```ts
|
|
1698
|
+
* const value = progress.value; // 获取当前进度条值
|
|
1699
|
+
* console.log(value); // 输出值
|
|
1700
|
+
* ```
|
|
1699
1701
|
*/ function get() {
|
|
1700
1702
|
return this._value; //
|
|
1701
1703
|
},
|
|
@@ -1705,14 +1707,14 @@ var PROGRESS_DEFAULT_OPTIONS = {
|
|
|
1705
1707
|
},
|
|
1706
1708
|
{
|
|
1707
1709
|
key: "percent",
|
|
1708
|
-
get: /**
|
|
1709
|
-
* 获取进度百分比
|
|
1710
|
-
* @returns {number} 当前进度条百分比
|
|
1711
|
-
* @example
|
|
1712
|
-
* ```ts
|
|
1713
|
-
* const percent = progress.percent; // 获取当前进度条百分比
|
|
1714
|
-
* console.log(percent); // 输出百分比
|
|
1715
|
-
* ```
|
|
1710
|
+
get: /**
|
|
1711
|
+
* 获取进度百分比
|
|
1712
|
+
* @returns {number} 当前进度条百分比
|
|
1713
|
+
* @example
|
|
1714
|
+
* ```ts
|
|
1715
|
+
* const percent = progress.percent; // 获取当前进度条百分比
|
|
1716
|
+
* console.log(percent); // 输出百分比
|
|
1717
|
+
* ```
|
|
1716
1718
|
*/ function get() {
|
|
1717
1719
|
return this._percent;
|
|
1718
1720
|
},
|
|
@@ -1775,9 +1777,9 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1775
1777
|
onOpenChange: function onOpenChange() {},
|
|
1776
1778
|
onChange: function onChange() {}
|
|
1777
1779
|
};
|
|
1778
|
-
/**
|
|
1779
|
-
* 音量调节控件
|
|
1780
|
-
* @category Control
|
|
1780
|
+
/**
|
|
1781
|
+
* 音量调节控件
|
|
1782
|
+
* @category Control
|
|
1781
1783
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
1782
1784
|
_inherits$u(Volume, Control);
|
|
1783
1785
|
function Volume(options) {
|
|
@@ -1851,8 +1853,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1851
1853
|
return _this;
|
|
1852
1854
|
}
|
|
1853
1855
|
var _proto = Volume.prototype;
|
|
1854
|
-
/**
|
|
1855
|
-
* 销毁
|
|
1856
|
+
/**
|
|
1857
|
+
* 销毁
|
|
1856
1858
|
*/ _proto.destroy = function destroy() {
|
|
1857
1859
|
var _this__progress_destroy, _this__progress, _this_picker;
|
|
1858
1860
|
(_this__progress = this._progress) == null ? void 0 : (_this__progress_destroy = _this__progress.destroy) == null ? void 0 : _this__progress_destroy.call(_this__progress);
|
|
@@ -1910,8 +1912,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1910
1912
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_VOLUME
|
|
1911
1913
|
});
|
|
1912
1914
|
};
|
|
1913
|
-
/**
|
|
1914
|
-
* 点击 Control 会触发
|
|
1915
|
+
/**
|
|
1916
|
+
* 点击 Control 会触发
|
|
1915
1917
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
1916
1918
|
// this._options.onClick?.(e);
|
|
1917
1919
|
};
|
|
@@ -1928,8 +1930,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1928
1930
|
_create_class$6(Volume, [
|
|
1929
1931
|
{
|
|
1930
1932
|
key: "muted",
|
|
1931
|
-
get: /**
|
|
1932
|
-
* 是否静音
|
|
1933
|
+
get: /**
|
|
1934
|
+
* 是否静音
|
|
1933
1935
|
*/ function get() {
|
|
1934
1936
|
return this._muted;
|
|
1935
1937
|
},
|
|
@@ -1953,8 +1955,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1953
1955
|
},
|
|
1954
1956
|
{
|
|
1955
1957
|
key: "volume",
|
|
1956
|
-
get: /**
|
|
1957
|
-
* 当前音量值(真实值 即使静音)
|
|
1958
|
+
get: /**
|
|
1959
|
+
* 当前音量值(真实值 即使静音)
|
|
1958
1960
|
*/ function get() {
|
|
1959
1961
|
return this._lastVolume;
|
|
1960
1962
|
},
|
|
@@ -1977,8 +1979,8 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1977
1979
|
},
|
|
1978
1980
|
{
|
|
1979
1981
|
key: "disabled",
|
|
1980
|
-
get: /**
|
|
1981
|
-
* 是否禁用
|
|
1982
|
+
get: /**
|
|
1983
|
+
* 是否禁用
|
|
1982
1984
|
*/ function get() {
|
|
1983
1985
|
return this._disabled;
|
|
1984
1986
|
},
|
|
@@ -2478,9 +2480,9 @@ function _set_prototype_of$t(o, p) {
|
|
|
2478
2480
|
};
|
|
2479
2481
|
return _set_prototype_of$t(o, p);
|
|
2480
2482
|
}
|
|
2481
|
-
/**
|
|
2482
|
-
* 全屏控件
|
|
2483
|
-
* @category Control
|
|
2483
|
+
/**
|
|
2484
|
+
* 全屏控件
|
|
2485
|
+
* @category Control
|
|
2484
2486
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
2485
2487
|
_inherits$t(Fullscreen, Control);
|
|
2486
2488
|
function Fullscreen(options) {
|
|
@@ -2507,8 +2509,8 @@ function _set_prototype_of$t(o, p) {
|
|
|
2507
2509
|
return _this;
|
|
2508
2510
|
}
|
|
2509
2511
|
var _proto = Fullscreen.prototype;
|
|
2510
|
-
/**
|
|
2511
|
-
* 销毁
|
|
2512
|
+
/**
|
|
2513
|
+
* 销毁
|
|
2512
2514
|
*/ _proto.destroy = function destroy() {
|
|
2513
2515
|
var _this__fullscreenUtil;
|
|
2514
2516
|
this.$container.innerHTML = '';
|
|
@@ -2536,8 +2538,8 @@ function _set_prototype_of$t(o, p) {
|
|
|
2536
2538
|
this._render();
|
|
2537
2539
|
this.options.onChange == null ? void 0 : this.options.onChange.call(this.options, info);
|
|
2538
2540
|
};
|
|
2539
|
-
/**
|
|
2540
|
-
* 点击 Control 会触发
|
|
2541
|
+
/**
|
|
2542
|
+
* 点击 Control 会触发
|
|
2541
2543
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
2542
2544
|
if (this.isCurrentFullscreen) {
|
|
2543
2545
|
var _this__fullscreenUtil;
|
|
@@ -2581,9 +2583,9 @@ function _set_prototype_of$s(o, p) {
|
|
|
2581
2583
|
};
|
|
2582
2584
|
return _set_prototype_of$s(o, p);
|
|
2583
2585
|
}
|
|
2584
|
-
/**
|
|
2585
|
-
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2586
|
-
* @category Control
|
|
2586
|
+
/**
|
|
2587
|
+
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2588
|
+
* @category Control
|
|
2587
2589
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
2588
2590
|
_inherits$s(Rec, Control);
|
|
2589
2591
|
function Rec(options) {
|
|
@@ -2602,8 +2604,8 @@ function _set_prototype_of$s(o, p) {
|
|
|
2602
2604
|
return _this;
|
|
2603
2605
|
}
|
|
2604
2606
|
var _proto = Rec.prototype;
|
|
2605
|
-
/**
|
|
2606
|
-
* 销毁
|
|
2607
|
+
/**
|
|
2608
|
+
* 销毁
|
|
2607
2609
|
*/ _proto.destroy = function destroy() {
|
|
2608
2610
|
var _this__delegation;
|
|
2609
2611
|
this.$container.removeEventListener('dblclick', this._onDBlClick);
|
|
@@ -2611,9 +2613,9 @@ function _set_prototype_of$s(o, p) {
|
|
|
2611
2613
|
this._delegation = null;
|
|
2612
2614
|
Control.prototype.destroy.call(this);
|
|
2613
2615
|
};
|
|
2614
|
-
/**
|
|
2615
|
-
* 添加回放类型图标
|
|
2616
|
-
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2616
|
+
/**
|
|
2617
|
+
* 添加回放类型图标
|
|
2618
|
+
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2617
2619
|
*/ _proto.addRecType = function addRecType(id) {
|
|
2618
2620
|
var spanIcon = '';
|
|
2619
2621
|
switch(id){
|
|
@@ -2680,8 +2682,8 @@ function _set_prototype_of$s(o, p) {
|
|
|
2680
2682
|
}
|
|
2681
2683
|
});
|
|
2682
2684
|
};
|
|
2683
|
-
/**
|
|
2684
|
-
* 点击 Control 会触发
|
|
2685
|
+
/**
|
|
2686
|
+
* 点击 Control 会触发
|
|
2685
2687
|
*/ _proto._onControlClick = function _onControlClick(e) {};
|
|
2686
2688
|
return Rec;
|
|
2687
2689
|
}(Control);
|
|
@@ -3365,8 +3367,8 @@ var en = {
|
|
|
3365
3367
|
}
|
|
3366
3368
|
};
|
|
3367
3369
|
|
|
3368
|
-
/**
|
|
3369
|
-
* flv 预览
|
|
3370
|
+
/**
|
|
3371
|
+
* flv 预览
|
|
3370
3372
|
*/ var hlsLiveTemplate = {
|
|
3371
3373
|
autoFocus: 3,
|
|
3372
3374
|
// poster:
|
|
@@ -3418,8 +3420,8 @@ var en = {
|
|
|
3418
3420
|
}
|
|
3419
3421
|
};
|
|
3420
3422
|
|
|
3421
|
-
/**
|
|
3422
|
-
* flv 预览
|
|
3423
|
+
/**
|
|
3424
|
+
* flv 预览
|
|
3423
3425
|
*/ var hlsRecTemplate = {
|
|
3424
3426
|
autoFocus: 3,
|
|
3425
3427
|
// poster:
|
|
@@ -3477,8 +3479,8 @@ var en = {
|
|
|
3477
3479
|
}
|
|
3478
3480
|
};
|
|
3479
3481
|
|
|
3480
|
-
/**
|
|
3481
|
-
* pc 预览
|
|
3482
|
+
/**
|
|
3483
|
+
* pc 预览
|
|
3482
3484
|
*/ var pcLive = {
|
|
3483
3485
|
autoFocus: 3,
|
|
3484
3486
|
header: {
|
|
@@ -3577,8 +3579,8 @@ var en = {
|
|
|
3577
3579
|
}
|
|
3578
3580
|
};
|
|
3579
3581
|
|
|
3580
|
-
/**
|
|
3581
|
-
* pc 回放
|
|
3582
|
+
/**
|
|
3583
|
+
* pc 回放
|
|
3582
3584
|
*/ var pcRec = {
|
|
3583
3585
|
header: {
|
|
3584
3586
|
// color: DEFAULT_COLOR,
|
|
@@ -3689,8 +3691,8 @@ var en = {
|
|
|
3689
3691
|
}
|
|
3690
3692
|
};
|
|
3691
3693
|
|
|
3692
|
-
/**
|
|
3693
|
-
* mobile 预览
|
|
3694
|
+
/**
|
|
3695
|
+
* mobile 预览
|
|
3694
3696
|
*/ var mobileLive = {
|
|
3695
3697
|
header: {
|
|
3696
3698
|
// color: DEFAULT_COLOR,
|
|
@@ -3778,8 +3780,8 @@ var en = {
|
|
|
3778
3780
|
}
|
|
3779
3781
|
};
|
|
3780
3782
|
|
|
3781
|
-
/**
|
|
3782
|
-
* mobile 回放
|
|
3783
|
+
/**
|
|
3784
|
+
* mobile 回放
|
|
3783
3785
|
*/ var mobileRec = {
|
|
3784
3786
|
header: {
|
|
3785
3787
|
// color: DEFAULT_COLOR,
|
|
@@ -3873,8 +3875,8 @@ var en = {
|
|
|
3873
3875
|
}
|
|
3874
3876
|
};
|
|
3875
3877
|
|
|
3876
|
-
/**
|
|
3877
|
-
* 安防版(预览/回放)
|
|
3878
|
+
/**
|
|
3879
|
+
* 安防版(预览/回放)
|
|
3878
3880
|
*/ var security = {
|
|
3879
3881
|
header: {
|
|
3880
3882
|
// color: DEFAULT_COLOR,
|
|
@@ -3950,8 +3952,8 @@ var en = {
|
|
|
3950
3952
|
}
|
|
3951
3953
|
};
|
|
3952
3954
|
|
|
3953
|
-
/**
|
|
3954
|
-
* 语音版(预览)
|
|
3955
|
+
/**
|
|
3956
|
+
* 语音版(预览)
|
|
3955
3957
|
*/ var voice = {
|
|
3956
3958
|
header: {
|
|
3957
3959
|
// color: DEFAULT_COLOR,
|
|
@@ -4003,11 +4005,11 @@ var en = {
|
|
|
4003
4005
|
}
|
|
4004
4006
|
};
|
|
4005
4007
|
|
|
4006
|
-
/**
|
|
4007
|
-
* standard 做特殊处理
|
|
4008
|
-
*
|
|
4009
|
-
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
4010
|
-
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
4008
|
+
/**
|
|
4009
|
+
* standard 做特殊处理
|
|
4010
|
+
*
|
|
4011
|
+
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
4012
|
+
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
4011
4013
|
*/ var TEMPLATES = {
|
|
4012
4014
|
pcLive: pcLive,
|
|
4013
4015
|
pcRec: pcRec,
|
|
@@ -4037,9 +4039,9 @@ function _set_prototype_of$r(o, p) {
|
|
|
4037
4039
|
};
|
|
4038
4040
|
return _set_prototype_of$r(o, p);
|
|
4039
4041
|
}
|
|
4040
|
-
/**
|
|
4041
|
-
* 截图控件
|
|
4042
|
-
* @category Content
|
|
4042
|
+
/**
|
|
4043
|
+
* 截图控件
|
|
4044
|
+
* @category Content
|
|
4043
4045
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
4044
4046
|
_inherits$r(Content, EventEmitter);
|
|
4045
4047
|
function Content(options) {
|
|
@@ -4069,11 +4071,11 @@ function _set_prototype_of$r(o, p) {
|
|
|
4069
4071
|
return _this;
|
|
4070
4072
|
}
|
|
4071
4073
|
var _proto = Content.prototype;
|
|
4072
|
-
/**
|
|
4073
|
-
* 重新画面区域
|
|
4074
|
-
* @param {number} originWidth 画面宽度
|
|
4075
|
-
* @param {number} originHeight 画面高度
|
|
4076
|
-
* @returns {void}
|
|
4074
|
+
/**
|
|
4075
|
+
* 重新画面区域
|
|
4076
|
+
* @param {number} originWidth 画面宽度
|
|
4077
|
+
* @param {number} originHeight 画面高度
|
|
4078
|
+
* @returns {void}
|
|
4077
4079
|
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
4078
4080
|
if (originWidth === void 0) originWidth = 0;
|
|
4079
4081
|
if (originHeight === void 0) originHeight = 0;
|
|
@@ -4186,9 +4188,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4186
4188
|
};
|
|
4187
4189
|
return _set_prototype_of$q(o, p);
|
|
4188
4190
|
}
|
|
4189
|
-
/**
|
|
4190
|
-
* 更多控件
|
|
4191
|
-
* @category Control
|
|
4191
|
+
/**
|
|
4192
|
+
* 更多控件
|
|
4193
|
+
* @category Control
|
|
4192
4194
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
4193
4195
|
_inherits$q(More, Control);
|
|
4194
4196
|
function More(options) {
|
|
@@ -4234,9 +4236,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4234
4236
|
}
|
|
4235
4237
|
// debug
|
|
4236
4238
|
};
|
|
4237
|
-
/**
|
|
4238
|
-
* 添加
|
|
4239
|
-
* @param control
|
|
4239
|
+
/**
|
|
4240
|
+
* 添加
|
|
4241
|
+
* @param control
|
|
4240
4242
|
*/ _proto.add = function add(key, part, control, props) {
|
|
4241
4243
|
this.list.unshift({
|
|
4242
4244
|
part: part,
|
|
@@ -4246,9 +4248,9 @@ function _set_prototype_of$q(o, p) {
|
|
|
4246
4248
|
height: props.height
|
|
4247
4249
|
});
|
|
4248
4250
|
};
|
|
4249
|
-
/**
|
|
4250
|
-
* 移除
|
|
4251
|
-
* @param control
|
|
4251
|
+
/**
|
|
4252
|
+
* 移除
|
|
4253
|
+
* @param control
|
|
4252
4254
|
*/ _proto.remove = function remove(control) {
|
|
4253
4255
|
var index = this.list.findIndex(function(item) {
|
|
4254
4256
|
return item.control === control;
|
|
@@ -4268,20 +4270,20 @@ function _set_prototype_of$q(o, p) {
|
|
|
4268
4270
|
}
|
|
4269
4271
|
Control.prototype.destroy.call(this);
|
|
4270
4272
|
};
|
|
4271
|
-
/**
|
|
4272
|
-
* 点击 Control 会触发
|
|
4273
|
+
/**
|
|
4274
|
+
* 点击 Control 会触发
|
|
4273
4275
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
4274
4276
|
// this._options.onClick?.(e);
|
|
4275
4277
|
};
|
|
4276
4278
|
return More;
|
|
4277
4279
|
}(Control);
|
|
4278
4280
|
|
|
4279
|
-
/**
|
|
4280
|
-
* 函数防抖
|
|
4281
|
-
* @param {Function} func
|
|
4282
|
-
* @param {number} wait
|
|
4283
|
-
* @typeParam T - 函数类型
|
|
4284
|
-
* @returns {Function}
|
|
4281
|
+
/**
|
|
4282
|
+
* 函数防抖
|
|
4283
|
+
* @param {Function} func
|
|
4284
|
+
* @param {number} wait
|
|
4285
|
+
* @typeParam T - 函数类型
|
|
4286
|
+
* @returns {Function}
|
|
4285
4287
|
*/ // eslint-disable-next-line @typescript-eslint/ban-types
|
|
4286
4288
|
function debounce(func, wait) {
|
|
4287
4289
|
var timeout;
|
|
@@ -4846,6 +4848,12 @@ function debounce(func, wait) {
|
|
|
4846
4848
|
theme.controls.dateControl.on(EVENTS.control.dateChange, function(date) {
|
|
4847
4849
|
theme.emit(EVENTS.control.dateChange, date);
|
|
4848
4850
|
});
|
|
4851
|
+
theme.controls.dateControl.on(EVENTS.control.datePanelMonthChange, function(date, month) {
|
|
4852
|
+
theme.emit(EVENTS.control.datePanelMonthChange, date, month);
|
|
4853
|
+
});
|
|
4854
|
+
theme.controls.dateControl.on(EVENTS.control.datePanelYearChange, function(date, year) {
|
|
4855
|
+
theme.emit(EVENTS.control.datePanelYearChange, date, year);
|
|
4856
|
+
});
|
|
4849
4857
|
theme.controls.dateControl.on(EVENTS.control.dateDestroy, function() {
|
|
4850
4858
|
theme.emit(EVENTS.control.dateDestroy);
|
|
4851
4859
|
});
|
|
@@ -4905,23 +4913,23 @@ var ignoreList = [
|
|
|
4905
4913
|
});
|
|
4906
4914
|
}
|
|
4907
4915
|
|
|
4908
|
-
/**
|
|
4909
|
-
* 重新调整播放器窗口大小
|
|
4910
|
-
*
|
|
4911
|
-
* Adjust the player window size
|
|
4912
|
-
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
4913
|
-
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
4914
|
-
* @since 0.0.1
|
|
4915
|
-
* @example
|
|
4916
|
-
* ```ts
|
|
4917
|
-
* theme.resize(600, 400) // 600px * 400px
|
|
4918
|
-
* theme.resize("600px", "400px") // 600px * 400px
|
|
4919
|
-
* theme.resize("50%", "1vh")
|
|
4920
|
-
* theme.resize("2em", "2rem")
|
|
4921
|
-
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
4922
|
-
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
4923
|
-
* ```
|
|
4924
|
-
* @returns {void}
|
|
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}
|
|
4925
4933
|
*/ function _resize(theme, width, height) {
|
|
4926
4934
|
var cssText = '';
|
|
4927
4935
|
if (/^\d+(\.\d+)?$/.test(width + '')) {
|
|
@@ -4984,9 +4992,9 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
4984
4992
|
open: false,
|
|
4985
4993
|
max: 8
|
|
4986
4994
|
};
|
|
4987
|
-
/**
|
|
4988
|
-
* 电子放大控件
|
|
4989
|
-
* @category Control
|
|
4995
|
+
/**
|
|
4996
|
+
* 电子放大控件
|
|
4997
|
+
* @category Control
|
|
4990
4998
|
*/ var Zoom = /*#__PURE__*/ function(Control) {
|
|
4991
4999
|
_inherits$p(Zoom, Control);
|
|
4992
5000
|
function Zoom(options) {
|
|
@@ -5063,8 +5071,8 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
5063
5071
|
}
|
|
5064
5072
|
Control.prototype.destroy.call(this);
|
|
5065
5073
|
};
|
|
5066
|
-
/**
|
|
5067
|
-
* 点击 Control 会触发
|
|
5074
|
+
/**
|
|
5075
|
+
* 点击 Control 会触发
|
|
5068
5076
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
5069
5077
|
this.active = !this.active;
|
|
5070
5078
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -5084,8 +5092,8 @@ var ZOOM_DEFAULT_OPTIONS = {
|
|
|
5084
5092
|
},
|
|
5085
5093
|
{
|
|
5086
5094
|
key: "active",
|
|
5087
|
-
get: /**
|
|
5088
|
-
* 是否激活
|
|
5095
|
+
get: /**
|
|
5096
|
+
* 是否激活
|
|
5089
5097
|
*/ function get() {
|
|
5090
5098
|
return this._active;
|
|
5091
5099
|
},
|
|
@@ -5734,8 +5742,8 @@ function rgbOrHexToRgbaWithOpacity(color, opacity) {
|
|
|
5734
5742
|
return '';
|
|
5735
5743
|
}
|
|
5736
5744
|
|
|
5737
|
-
/**
|
|
5738
|
-
* Header
|
|
5745
|
+
/**
|
|
5746
|
+
* Header
|
|
5739
5747
|
*/ var Component = /*#__PURE__*/ function() {
|
|
5740
5748
|
function Component(options) {
|
|
5741
5749
|
if (options === void 0) options = {};
|
|
@@ -5787,8 +5795,8 @@ function rgbOrHexToRgbaWithOpacity(color, opacity) {
|
|
|
5787
5795
|
this.$popupContainer.appendChild(this.$container);
|
|
5788
5796
|
}
|
|
5789
5797
|
var _proto = Component.prototype;
|
|
5790
|
-
/**
|
|
5791
|
-
* 销毁 header
|
|
5798
|
+
/**
|
|
5799
|
+
* 销毁 header
|
|
5792
5800
|
*/ _proto.destroy = function destroy() {
|
|
5793
5801
|
var _this_$popupContainer;
|
|
5794
5802
|
(_this_$popupContainer = this.$popupContainer) == null ? void 0 : _this_$popupContainer.removeChild(this.$container);
|
|
@@ -6064,10 +6072,10 @@ function _set_prototype_of$m(o, p) {
|
|
|
6064
6072
|
};
|
|
6065
6073
|
return _set_prototype_of$m(o, p);
|
|
6066
6074
|
}
|
|
6067
|
-
/**
|
|
6068
|
-
* 全局全屏
|
|
6069
|
-
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
6070
|
-
* @category Control
|
|
6075
|
+
/**
|
|
6076
|
+
* 全局全屏
|
|
6077
|
+
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
6078
|
+
* @category Control
|
|
6071
6079
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
6072
6080
|
_inherits$m(GlobalFullscreen, Fullscreen);
|
|
6073
6081
|
function GlobalFullscreen(options) {
|
|
@@ -6085,8 +6093,8 @@ function _set_prototype_of$m(o, p) {
|
|
|
6085
6093
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_GLOBAL_FULLSCREEN
|
|
6086
6094
|
});
|
|
6087
6095
|
};
|
|
6088
|
-
/**
|
|
6089
|
-
* 点击 Control 会触发
|
|
6096
|
+
/**
|
|
6097
|
+
* 点击 Control 会触发
|
|
6090
6098
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
6091
6099
|
// 网页全屏的情况下 还可以执行全局全屏
|
|
6092
6100
|
if (this.isCurrentFullscreen && this._$rootContainer.classList.contains("" + PREFIX_CLASS + "-global-fullscreen")) {
|
|
@@ -6132,9 +6140,9 @@ function _set_prototype_of$l(o, p) {
|
|
|
6132
6140
|
};
|
|
6133
6141
|
return _set_prototype_of$l(o, p);
|
|
6134
6142
|
}
|
|
6135
|
-
/**
|
|
6136
|
-
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
6137
|
-
* @category Control
|
|
6143
|
+
/**
|
|
6144
|
+
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
6145
|
+
* @category Control
|
|
6138
6146
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
6139
6147
|
_inherits$l(CapturePicture, Control);
|
|
6140
6148
|
function CapturePicture(options) {
|
|
@@ -6165,8 +6173,8 @@ function _set_prototype_of$l(o, p) {
|
|
|
6165
6173
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CAPTURE
|
|
6166
6174
|
});
|
|
6167
6175
|
};
|
|
6168
|
-
/**
|
|
6169
|
-
* 点击 Control 会触发
|
|
6176
|
+
/**
|
|
6177
|
+
* 点击 Control 会触发
|
|
6170
6178
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6171
6179
|
var _this = this;
|
|
6172
6180
|
var _this_options_type, _this_options_cloudRecUpload;
|
|
@@ -6235,9 +6243,9 @@ function _set_prototype_of$k(o, p) {
|
|
|
6235
6243
|
};
|
|
6236
6244
|
return _set_prototype_of$k(o, p);
|
|
6237
6245
|
}
|
|
6238
|
-
/**
|
|
6239
|
-
* 云台控件
|
|
6240
|
-
* @category Control
|
|
6246
|
+
/**
|
|
6247
|
+
* 云台控件
|
|
6248
|
+
* @category Control
|
|
6241
6249
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
6242
6250
|
_inherits$k(Ptz, Control);
|
|
6243
6251
|
function Ptz(options) {
|
|
@@ -6326,8 +6334,8 @@ function _set_prototype_of$k(o, p) {
|
|
|
6326
6334
|
}
|
|
6327
6335
|
};
|
|
6328
6336
|
};
|
|
6329
|
-
/**
|
|
6330
|
-
* 点击 Control 会触发
|
|
6337
|
+
/**
|
|
6338
|
+
* 点击 Control 会触发
|
|
6331
6339
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6332
6340
|
Control.prototype._onControlClick.call(this, e);
|
|
6333
6341
|
this.active = !this.active;
|
|
@@ -6430,14 +6438,14 @@ function _set_prototype_of$j(o, p) {
|
|
|
6430
6438
|
var RECORD_DEFAULT_OPTIONS = {
|
|
6431
6439
|
maxDuration: 3600
|
|
6432
6440
|
};
|
|
6433
|
-
/**
|
|
6434
|
-
* 录制控件,点击开始录制,再次点击停止录制,
|
|
6435
|
-
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
6436
|
-
*
|
|
6437
|
-
* 注意:
|
|
6438
|
-
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
6439
|
-
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
6440
|
-
* @category Control
|
|
6441
|
+
/**
|
|
6442
|
+
* 录制控件,点击开始录制,再次点击停止录制,
|
|
6443
|
+
* 录制开始到结束会依次触发 `startRecord` 和 `stopRecord` 事件
|
|
6444
|
+
*
|
|
6445
|
+
* 注意:
|
|
6446
|
+
* 1. 录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
6447
|
+
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
6448
|
+
* @category Control
|
|
6441
6449
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
6442
6450
|
_inherits$j(Record, Control);
|
|
6443
6451
|
function Record(options) {
|
|
@@ -6452,16 +6460,16 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6452
6460
|
return _this;
|
|
6453
6461
|
}
|
|
6454
6462
|
var _proto = Record.prototype;
|
|
6455
|
-
/**
|
|
6456
|
-
* 渲染图标
|
|
6463
|
+
/**
|
|
6464
|
+
* 渲染图标
|
|
6457
6465
|
*/ _proto._render = function _render() {
|
|
6458
6466
|
var _this_locale;
|
|
6459
6467
|
this.$container.innerHTML = IconComponents.record({
|
|
6460
6468
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_RECORDVIDEO
|
|
6461
6469
|
});
|
|
6462
6470
|
};
|
|
6463
|
-
/**
|
|
6464
|
-
* 渲染计时器
|
|
6471
|
+
/**
|
|
6472
|
+
* 渲染计时器
|
|
6465
6473
|
*/ _proto._renderTimer = function _renderTimer() {
|
|
6466
6474
|
var _this = this;
|
|
6467
6475
|
var _this__options_rootContainer, _this__options;
|
|
@@ -6490,8 +6498,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6490
6498
|
this._destroyTimer();
|
|
6491
6499
|
Control.prototype.destroy.call(this);
|
|
6492
6500
|
};
|
|
6493
|
-
/**
|
|
6494
|
-
* 销毁定时器和销毁节点
|
|
6501
|
+
/**
|
|
6502
|
+
* 销毁定时器和销毁节点
|
|
6495
6503
|
*/ _proto._destroyTimer = function _destroyTimer() {
|
|
6496
6504
|
this._seconds = 0;
|
|
6497
6505
|
if (this._timer) {
|
|
@@ -6506,8 +6514,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6506
6514
|
}
|
|
6507
6515
|
this._active = false;
|
|
6508
6516
|
};
|
|
6509
|
-
/**
|
|
6510
|
-
* 点击 Control 会触发
|
|
6517
|
+
/**
|
|
6518
|
+
* 点击 Control 会触发
|
|
6511
6519
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6512
6520
|
this.active = !this.active;
|
|
6513
6521
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -6515,8 +6523,8 @@ var RECORD_DEFAULT_OPTIONS = {
|
|
|
6515
6523
|
_create_class$3(Record, [
|
|
6516
6524
|
{
|
|
6517
6525
|
key: "active",
|
|
6518
|
-
get: /**
|
|
6519
|
-
* 是否激活
|
|
6526
|
+
get: /**
|
|
6527
|
+
* 是否激活
|
|
6520
6528
|
*/ function get() {
|
|
6521
6529
|
return this._active;
|
|
6522
6530
|
},
|
|
@@ -6709,14 +6717,14 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6709
6717
|
};
|
|
6710
6718
|
}
|
|
6711
6719
|
}
|
|
6712
|
-
/**
|
|
6713
|
-
* 对讲控件
|
|
6714
|
-
*
|
|
6715
|
-
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
6716
|
-
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
6717
|
-
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
6718
|
-
*
|
|
6719
|
-
* @category Control
|
|
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
|
|
6720
6728
|
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
6721
6729
|
_inherits$i(Talk, Control);
|
|
6722
6730
|
function Talk(options) {
|
|
@@ -6759,16 +6767,16 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6759
6767
|
Control.prototype.reset.call(this, hide);
|
|
6760
6768
|
}
|
|
6761
6769
|
};
|
|
6762
|
-
/**
|
|
6763
|
-
* 销毁对讲
|
|
6770
|
+
/**
|
|
6771
|
+
* 销毁对讲
|
|
6764
6772
|
*/ _proto.destroy = function destroy() {
|
|
6765
6773
|
if (this.active) {
|
|
6766
6774
|
this.reset();
|
|
6767
6775
|
}
|
|
6768
6776
|
Control.prototype.destroy.call(this);
|
|
6769
6777
|
};
|
|
6770
|
-
/**
|
|
6771
|
-
* 点击 Control 会触发
|
|
6778
|
+
/**
|
|
6779
|
+
* 点击 Control 会触发
|
|
6772
6780
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
6773
6781
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
6774
6782
|
return Control.prototype._onControlClick;
|
|
@@ -6788,13 +6796,13 @@ function _ts_generator$4(thisArg, body) {
|
|
|
6788
6796
|
_create_class$2(Talk, [
|
|
6789
6797
|
{
|
|
6790
6798
|
key: "value",
|
|
6791
|
-
get: /**
|
|
6792
|
-
* 获取当前值
|
|
6799
|
+
get: /**
|
|
6800
|
+
* 获取当前值
|
|
6793
6801
|
*/ function get() {
|
|
6794
6802
|
return this._value;
|
|
6795
6803
|
},
|
|
6796
|
-
set: /**
|
|
6797
|
-
* 设置当前值 [0-1]
|
|
6804
|
+
set: /**
|
|
6805
|
+
* 设置当前值 [0-1]
|
|
6798
6806
|
*/ function set(value) {
|
|
6799
6807
|
// 没有激活状态,则不处理
|
|
6800
6808
|
if (!this.active) {
|
|
@@ -6980,12 +6988,12 @@ function _ts_generator$3(thisArg, body) {
|
|
|
6980
6988
|
};
|
|
6981
6989
|
}
|
|
6982
6990
|
}
|
|
6983
|
-
/**
|
|
6984
|
-
* 语音广播控件
|
|
6985
|
-
*
|
|
6986
|
-
* 用于触发语音广播功能的按钮控件
|
|
6987
|
-
*
|
|
6988
|
-
* @category Control
|
|
6991
|
+
/**
|
|
6992
|
+
* 语音广播控件
|
|
6993
|
+
*
|
|
6994
|
+
* 用于触发语音广播功能的按钮控件
|
|
6995
|
+
*
|
|
6996
|
+
* @category Control
|
|
6989
6997
|
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
6990
6998
|
_inherits$h(Broadcast, Control);
|
|
6991
6999
|
function Broadcast(options) {
|
|
@@ -7025,16 +7033,16 @@ function _ts_generator$3(thisArg, body) {
|
|
|
7025
7033
|
Control.prototype.reset.call(this, hide);
|
|
7026
7034
|
}
|
|
7027
7035
|
};
|
|
7028
|
-
/**
|
|
7029
|
-
* 销毁语音广播控件
|
|
7036
|
+
/**
|
|
7037
|
+
* 销毁语音广播控件
|
|
7030
7038
|
*/ _proto.destroy = function destroy() {
|
|
7031
7039
|
if (this.active) {
|
|
7032
7040
|
this.reset();
|
|
7033
7041
|
}
|
|
7034
7042
|
Control.prototype.destroy.call(this);
|
|
7035
7043
|
};
|
|
7036
|
-
/**
|
|
7037
|
-
* 点击 Control 会触发
|
|
7044
|
+
/**
|
|
7045
|
+
* 点击 Control 会触发
|
|
7038
7046
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7039
7047
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
7040
7048
|
return Control.prototype._onControlClick;
|
|
@@ -7211,12 +7219,12 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7211
7219
|
};
|
|
7212
7220
|
}
|
|
7213
7221
|
}
|
|
7214
|
-
/**
|
|
7215
|
-
* AI对话框控件
|
|
7216
|
-
*
|
|
7217
|
-
* 用于触发AI对话框功能的按钮控件
|
|
7218
|
-
*
|
|
7219
|
-
* @category Control
|
|
7222
|
+
/**
|
|
7223
|
+
* AI对话框控件
|
|
7224
|
+
*
|
|
7225
|
+
* 用于触发AI对话框功能的按钮控件
|
|
7226
|
+
*
|
|
7227
|
+
* @category Control
|
|
7220
7228
|
*/ var AIChat = /*#__PURE__*/ function(Control) {
|
|
7221
7229
|
_inherits$g(AIChat, Control);
|
|
7222
7230
|
function AIChat(options) {
|
|
@@ -7257,16 +7265,16 @@ function _ts_generator$2(thisArg, body) {
|
|
|
7257
7265
|
Control.prototype.reset.call(this, hide);
|
|
7258
7266
|
}
|
|
7259
7267
|
};
|
|
7260
|
-
/**
|
|
7261
|
-
* 销毁AI对话框控件
|
|
7268
|
+
/**
|
|
7269
|
+
* 销毁AI对话框控件
|
|
7262
7270
|
*/ _proto.destroy = function destroy() {
|
|
7263
7271
|
if (this.active) {
|
|
7264
7272
|
this.reset();
|
|
7265
7273
|
}
|
|
7266
7274
|
Control.prototype.destroy.call(this);
|
|
7267
7275
|
};
|
|
7268
|
-
/**
|
|
7269
|
-
* 点击 Control 会触发
|
|
7276
|
+
/**
|
|
7277
|
+
* 点击 Control 会触发
|
|
7270
7278
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7271
7279
|
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
7272
7280
|
return Control.prototype._onControlClick;
|
|
@@ -7318,12 +7326,12 @@ function _set_prototype_of$f(o, p) {
|
|
|
7318
7326
|
};
|
|
7319
7327
|
return _set_prototype_of$f(o, p);
|
|
7320
7328
|
}
|
|
7321
|
-
/**
|
|
7322
|
-
* 直播按钮控件
|
|
7323
|
-
*
|
|
7324
|
-
* 点击切换到直播模式
|
|
7325
|
-
*
|
|
7326
|
-
* @category Control
|
|
7329
|
+
/**
|
|
7330
|
+
* 直播按钮控件
|
|
7331
|
+
*
|
|
7332
|
+
* 点击切换到直播模式
|
|
7333
|
+
*
|
|
7334
|
+
* @category Control
|
|
7327
7335
|
*/ var Live = /*#__PURE__*/ function(Control) {
|
|
7328
7336
|
_inherits$f(Live, Control);
|
|
7329
7337
|
function Live(options) {
|
|
@@ -7345,9 +7353,9 @@ function _set_prototype_of$f(o, p) {
|
|
|
7345
7353
|
return _this;
|
|
7346
7354
|
}
|
|
7347
7355
|
var _proto = Live.prototype;
|
|
7348
|
-
/**
|
|
7349
|
-
* 根据 urlInfo 同步激活状态
|
|
7350
|
-
* 在初始化和播放地址切换后调用
|
|
7356
|
+
/**
|
|
7357
|
+
* 根据 urlInfo 同步激活状态
|
|
7358
|
+
* 在初始化和播放地址切换后调用
|
|
7351
7359
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
7352
7360
|
var shouldBeActive = !!(urlInfo && urlInfo.type === 'live');
|
|
7353
7361
|
this.active = shouldBeActive;
|
|
@@ -7358,13 +7366,13 @@ function _set_prototype_of$f(o, p) {
|
|
|
7358
7366
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_LIVE) || '直播'
|
|
7359
7367
|
});
|
|
7360
7368
|
};
|
|
7361
|
-
/**
|
|
7362
|
-
* 销毁
|
|
7369
|
+
/**
|
|
7370
|
+
* 销毁
|
|
7363
7371
|
*/ _proto.destroy = function destroy() {
|
|
7364
7372
|
Control.prototype.destroy.call(this);
|
|
7365
7373
|
};
|
|
7366
|
-
/**
|
|
7367
|
-
* 点击 Control 会触发
|
|
7374
|
+
/**
|
|
7375
|
+
* 点击 Control 会触发
|
|
7368
7376
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7369
7377
|
var _this__options_onChange, _this__options;
|
|
7370
7378
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -7409,12 +7417,12 @@ function _set_prototype_of$e(o, p) {
|
|
|
7409
7417
|
};
|
|
7410
7418
|
return _set_prototype_of$e(o, p);
|
|
7411
7419
|
}
|
|
7412
|
-
/**
|
|
7413
|
-
* 回放下拉控件
|
|
7414
|
-
*
|
|
7415
|
-
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
7416
|
-
*
|
|
7417
|
-
* @category Control
|
|
7420
|
+
/**
|
|
7421
|
+
* 回放下拉控件
|
|
7422
|
+
*
|
|
7423
|
+
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
7424
|
+
*
|
|
7425
|
+
* @category Control
|
|
7418
7426
|
*/ var RecDropdown = /*#__PURE__*/ function(Control) {
|
|
7419
7427
|
_inherits$e(RecDropdown, Control);
|
|
7420
7428
|
function RecDropdown(options) {
|
|
@@ -7438,9 +7446,9 @@ function _set_prototype_of$e(o, p) {
|
|
|
7438
7446
|
return _this;
|
|
7439
7447
|
}
|
|
7440
7448
|
var _proto = RecDropdown.prototype;
|
|
7441
|
-
/**
|
|
7442
|
-
* 根据 urlInfo 同步激活状态和回放类型
|
|
7443
|
-
* 在初始化和播放地址切换后调用
|
|
7449
|
+
/**
|
|
7450
|
+
* 根据 urlInfo 同步激活状态和回放类型
|
|
7451
|
+
* 在初始化和播放地址切换后调用
|
|
7444
7452
|
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
7445
7453
|
if (urlInfo && urlInfo.type === 'rec') {
|
|
7446
7454
|
var _urlInfo_searchParams1;
|
|
@@ -7517,8 +7525,8 @@ function _set_prototype_of$e(o, p) {
|
|
|
7517
7525
|
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS + "-active");
|
|
7518
7526
|
}
|
|
7519
7527
|
};
|
|
7520
|
-
/**
|
|
7521
|
-
* 销毁
|
|
7528
|
+
/**
|
|
7529
|
+
* 销毁
|
|
7522
7530
|
*/ _proto.destroy = function destroy() {
|
|
7523
7531
|
var _this__delegation_destroy, _this__delegation;
|
|
7524
7532
|
(_this__delegation = this._delegation) == null ? void 0 : (_this__delegation_destroy = _this__delegation.destroy) == null ? void 0 : _this__delegation_destroy.call(_this__delegation);
|
|
@@ -7530,8 +7538,8 @@ function _set_prototype_of$e(o, p) {
|
|
|
7530
7538
|
}
|
|
7531
7539
|
Control.prototype.destroy.call(this);
|
|
7532
7540
|
};
|
|
7533
|
-
/**
|
|
7534
|
-
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
7541
|
+
/**
|
|
7542
|
+
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
7535
7543
|
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7536
7544
|
_proto._onControlClick = function _onControlClick(_e) {
|
|
7537
7545
|
// picker 自行处理 click/hover,这里不额外处理
|
|
@@ -7608,11 +7616,20 @@ function _set_prototype_of$d(o, p) {
|
|
|
7608
7616
|
}
|
|
7609
7617
|
}));
|
|
7610
7618
|
_this.on(EVENTS.setAllDayRecTimes, function(records) {
|
|
7611
|
-
var // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7619
|
+
var _this__options_props_urlInfo, _this__options_props, _this__options, // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7612
7620
|
_this__modal;
|
|
7613
7621
|
_this.disabled = records.length === 0;
|
|
7614
7622
|
_this.records = records;
|
|
7615
|
-
(
|
|
7623
|
+
if ((_this__options = _this._options) == null ? void 0 : (_this__options_props = _this__options.props) == null ? void 0 : (_this__options_props_urlInfo = _this__options_props.urlInfo) == null ? void 0 : _this__options_props_urlInfo.validateCode) {
|
|
7624
|
+
_this.records = records.map(function(item) {
|
|
7625
|
+
var _this__options_props_urlInfo, _this__options_props, _this__options;
|
|
7626
|
+
return _extends$c({}, item, {
|
|
7627
|
+
// 加密图片的地址是有时效的
|
|
7628
|
+
coverPic: item.coverPic + "&decodekey=" + ((_this__options = _this._options) == null ? void 0 : (_this__options_props = _this__options.props) == null ? void 0 : (_this__options_props_urlInfo = _this__options_props.urlInfo) == null ? void 0 : _this__options_props_urlInfo.validateCode)
|
|
7629
|
+
});
|
|
7630
|
+
});
|
|
7631
|
+
}
|
|
7632
|
+
(_this__modal = _this._modal) == null ? void 0 : _this__modal.setSections(_this.records);
|
|
7616
7633
|
// this._modal?.showEventFilter(this._options.showEventFilter ?? true);
|
|
7617
7634
|
});
|
|
7618
7635
|
_this.on(EVENTS.getOSDTime, function(time) {
|
|
@@ -7717,12 +7734,12 @@ function _set_prototype_of$c(o, p) {
|
|
|
7717
7734
|
};
|
|
7718
7735
|
return _set_prototype_of$c(o, p);
|
|
7719
7736
|
}
|
|
7720
|
-
/**
|
|
7721
|
-
* 告警消息按钮控件
|
|
7722
|
-
*
|
|
7723
|
-
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
7724
|
-
*
|
|
7725
|
-
* @category Control
|
|
7737
|
+
/**
|
|
7738
|
+
* 告警消息按钮控件
|
|
7739
|
+
*
|
|
7740
|
+
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
7741
|
+
*
|
|
7742
|
+
* @category Control
|
|
7726
7743
|
*/ var AlarmMessage = /*#__PURE__*/ function(Control) {
|
|
7727
7744
|
_inherits$c(AlarmMessage, Control);
|
|
7728
7745
|
function AlarmMessage(options) {
|
|
@@ -7746,16 +7763,16 @@ function _set_prototype_of$c(o, p) {
|
|
|
7746
7763
|
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_ALARM_MESSAGE) || '消息'
|
|
7747
7764
|
});
|
|
7748
7765
|
};
|
|
7749
|
-
/**
|
|
7750
|
-
* 销毁
|
|
7766
|
+
/**
|
|
7767
|
+
* 销毁
|
|
7751
7768
|
*/ _proto.destroy = function destroy() {
|
|
7752
7769
|
if (this._panelOpen) {
|
|
7753
7770
|
this.emit(EVENTS.control.alarmMessageChange, false);
|
|
7754
7771
|
}
|
|
7755
7772
|
Control.prototype.destroy.call(this);
|
|
7756
7773
|
};
|
|
7757
|
-
/**
|
|
7758
|
-
* 点击 Control 会触发
|
|
7774
|
+
/**
|
|
7775
|
+
* 点击 Control 会触发
|
|
7759
7776
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7760
7777
|
var _this__options_onChange, _this__options;
|
|
7761
7778
|
Control.prototype._onControlClick.call(this, e);
|
|
@@ -7820,54 +7837,54 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
7820
7837
|
onChange: function onChange() {},
|
|
7821
7838
|
onOpenChange: function onOpenChange() {}
|
|
7822
7839
|
};
|
|
7823
|
-
/**
|
|
7824
|
-
* 选择器切换 (支持PC/Mobile)
|
|
7825
|
-
* @category Control
|
|
7826
|
-
* @example
|
|
7827
|
-
* ```ts
|
|
7828
|
-
* new Select({
|
|
7829
|
-
* title: '清晰度',
|
|
7830
|
-
* list: [
|
|
7831
|
-
* {
|
|
7832
|
-
* label: '高清',
|
|
7833
|
-
* value: 'hd',
|
|
7834
|
-
* streamTypeIn: 1,
|
|
7835
|
-
* },
|
|
7836
|
-
* {
|
|
7837
|
-
* label: '超清',
|
|
7838
|
-
* value: 'super',
|
|
7839
|
-
* streamTypeIn: 2,
|
|
7840
|
-
* }
|
|
7841
|
-
* ],
|
|
7842
|
-
* value: 'hd',
|
|
7843
|
-
* onChange: (value, item) => {
|
|
7844
|
-
* console.log('选择了', value, item);
|
|
7845
|
-
* }
|
|
7846
|
-
* })
|
|
7847
|
-
*
|
|
7848
|
-
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
7849
|
-
* // 例如清晰度切换组件
|
|
7850
|
-
* class Definition extends Select {
|
|
7851
|
-
* options: DefinitionOptions;
|
|
7852
|
-
* constructor(options: DefinitionOptions) {
|
|
7853
|
-
* super({
|
|
7854
|
-
* ...options,
|
|
7855
|
-
* fieldNames: { label: 'name', value: 'level',},
|
|
7856
|
-
* title: options?.locale?.definition,
|
|
7857
|
-
* controlType: 'button',
|
|
7858
|
-
* classNameSuffix: 'definition',
|
|
7859
|
-
* onChange: (value: SelectItem['value'], item) => {
|
|
7860
|
-
* options?.onChange?.(value, item);
|
|
7861
|
-
* this.emit(EVENTS.control.definitionChange, value, item);
|
|
7862
|
-
* },
|
|
7863
|
-
* onOpenChange: (open: boolean, value: SelectItem['value'], item) => {
|
|
7864
|
-
* options?.onOpenChange?.(open, value, item);
|
|
7865
|
-
* this.emit(EVENTS.control.definitionPanelOpenChange, open, value, item);
|
|
7866
|
-
* }
|
|
7867
|
-
* });
|
|
7868
|
-
* }
|
|
7869
|
-
* }
|
|
7870
|
-
* ```
|
|
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
|
+
* ```
|
|
7871
7888
|
*/ var Select = /*#__PURE__*/ function(Control) {
|
|
7872
7889
|
_inherits$b(Select, Control);
|
|
7873
7890
|
function Select(options) {
|
|
@@ -7919,9 +7936,9 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
7919
7936
|
return _this;
|
|
7920
7937
|
}
|
|
7921
7938
|
var _proto = Select.prototype;
|
|
7922
|
-
/**
|
|
7923
|
-
* 更新选项列表
|
|
7924
|
-
* @param list - 选项列表
|
|
7939
|
+
/**
|
|
7940
|
+
* 更新选项列表
|
|
7941
|
+
* @param list - 选项列表
|
|
7925
7942
|
*/ _proto.updateOptions = function updateOptions(list) {
|
|
7926
7943
|
var _this = this;
|
|
7927
7944
|
if (list === void 0) list = [];
|
|
@@ -8006,8 +8023,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8006
8023
|
});
|
|
8007
8024
|
}
|
|
8008
8025
|
};
|
|
8009
|
-
/**
|
|
8010
|
-
* 销毁
|
|
8026
|
+
/**
|
|
8027
|
+
* 销毁
|
|
8011
8028
|
*/ _proto.destroy = function destroy() {
|
|
8012
8029
|
var _this__delegationOption_destroy, _this__delegationOption, _this__delegationClose_destroy, _this__delegationClose, _this__delegationCancel_destroy, _this__delegationCancel;
|
|
8013
8030
|
(_this__delegationOption = this._delegationOption) == null ? void 0 : (_this__delegationOption_destroy = _this__delegationOption.destroy) == null ? void 0 : _this__delegationOption_destroy.call(_this__delegationOption);
|
|
@@ -8029,8 +8046,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8029
8046
|
e.stopPropagation();
|
|
8030
8047
|
e.preventDefault();
|
|
8031
8048
|
};
|
|
8032
|
-
/**
|
|
8033
|
-
* 点击 Control 会触发
|
|
8049
|
+
/**
|
|
8050
|
+
* 点击 Control 会触发
|
|
8034
8051
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8035
8052
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
8036
8053
|
};
|
|
@@ -8049,8 +8066,8 @@ var SELECT_DEFAULT_OPTIONS = {
|
|
|
8049
8066
|
},
|
|
8050
8067
|
{
|
|
8051
8068
|
key: "disabled",
|
|
8052
|
-
get: /**
|
|
8053
|
-
* 是否禁用
|
|
8069
|
+
get: /**
|
|
8070
|
+
* 是否禁用
|
|
8054
8071
|
*/ function get() {
|
|
8055
8072
|
return this._disabled;
|
|
8056
8073
|
},
|
|
@@ -8136,15 +8153,15 @@ function __filter(list, locale) {
|
|
|
8136
8153
|
};
|
|
8137
8154
|
});
|
|
8138
8155
|
}
|
|
8139
|
-
/**
|
|
8140
|
-
* 清晰度切换控件
|
|
8141
|
-
*
|
|
8142
|
-
* 清晰度切换控件有三套UI
|
|
8143
|
-
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
8144
|
-
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
8145
|
-
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
8146
|
-
*
|
|
8147
|
-
* @category Control
|
|
8156
|
+
/**
|
|
8157
|
+
* 清晰度切换控件
|
|
8158
|
+
*
|
|
8159
|
+
* 清晰度切换控件有三套UI
|
|
8160
|
+
* 1. PC 端默认UI,hover 展示清晰度切换面板
|
|
8161
|
+
* 2. 移动端 picker选择器清晰度切换面板 + 取消按钮
|
|
8162
|
+
* 3. 移动端全屏模式右侧菜单清晰度切换面板
|
|
8163
|
+
*
|
|
8164
|
+
* @category Control
|
|
8148
8165
|
*/ var Definition = /*#__PURE__*/ function(Select) {
|
|
8149
8166
|
_inherits$a(Definition, Select);
|
|
8150
8167
|
function Definition(options) {
|
|
@@ -8210,9 +8227,9 @@ function __filter(list, locale) {
|
|
|
8210
8227
|
return _this;
|
|
8211
8228
|
}
|
|
8212
8229
|
var _proto = Definition.prototype;
|
|
8213
|
-
/**
|
|
8214
|
-
* 重置,恢复默认值
|
|
8215
|
-
* @param hide 默认不隐藏
|
|
8230
|
+
/**
|
|
8231
|
+
* 重置,恢复默认值
|
|
8232
|
+
* @param hide 默认不隐藏
|
|
8216
8233
|
*/ _proto.reset = function reset(hide) {
|
|
8217
8234
|
Select.prototype.reset.call(this, hide);
|
|
8218
8235
|
};
|
|
@@ -8263,13 +8280,13 @@ var SUPPORT_SPEED = [
|
|
|
8263
8280
|
16
|
|
8264
8281
|
]; // 8, 16
|
|
8265
8282
|
var SPEED_DEFAULT_OPTIONS = {
|
|
8266
|
-
/**
|
|
8267
|
-
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
8268
|
-
* 暂时不支持初始化时设置倍速
|
|
8283
|
+
/**
|
|
8284
|
+
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
8285
|
+
* 暂时不支持初始化时设置倍速
|
|
8269
8286
|
*/ // value: 1, // 对应list 中的 value
|
|
8270
8287
|
// 这里不要设置多语言, 比较麻烦
|
|
8271
|
-
/**
|
|
8272
|
-
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
8288
|
+
/**
|
|
8289
|
+
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
8273
8290
|
*/ list: SUPPORT_SPEED.reverse().map(function(speed) {
|
|
8274
8291
|
return {
|
|
8275
8292
|
label: "" + speed + "x",
|
|
@@ -8277,13 +8294,13 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8277
8294
|
};
|
|
8278
8295
|
})
|
|
8279
8296
|
};
|
|
8280
|
-
/**
|
|
8281
|
-
* 倍速切换控件, 不支持动态切换倍速列表
|
|
8282
|
-
*
|
|
8283
|
-
* 注意:
|
|
8284
|
-
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
8285
|
-
* 2. 标准流不支持;
|
|
8286
|
-
* @category Control
|
|
8297
|
+
/**
|
|
8298
|
+
* 倍速切换控件, 不支持动态切换倍速列表
|
|
8299
|
+
*
|
|
8300
|
+
* 注意:
|
|
8301
|
+
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
8302
|
+
* 2. 标准流不支持;
|
|
8303
|
+
* @category Control
|
|
8287
8304
|
*/ var Speed = /*#__PURE__*/ function(Select) {
|
|
8288
8305
|
_inherits$9(Speed, Select);
|
|
8289
8306
|
function Speed(options) {
|
|
@@ -8317,10 +8334,10 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8317
8334
|
return _this;
|
|
8318
8335
|
}
|
|
8319
8336
|
var _proto = Speed.prototype;
|
|
8320
|
-
/**
|
|
8321
|
-
* 滤掉本地回放不支持的倍速
|
|
8322
|
-
* @param optionsList 初始化配置倍速列表
|
|
8323
|
-
* @param type 回放类型
|
|
8337
|
+
/**
|
|
8338
|
+
* 滤掉本地回放不支持的倍速
|
|
8339
|
+
* @param optionsList 初始化配置倍速列表
|
|
8340
|
+
* @param type 回放类型
|
|
8324
8341
|
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
|
|
8325
8342
|
if (!optionsList) {
|
|
8326
8343
|
// 非用户自定义 /openpb/ 是标准流回放路径
|
|
@@ -8396,6 +8413,8 @@ function _set_prototype_of$8(o, p) {
|
|
|
8396
8413
|
})) || this;
|
|
8397
8414
|
_this.options = options;
|
|
8398
8415
|
_this._value = DateTime.format(((_this_options_props = _this.options.props) == null ? void 0 : (_this_options_props_urlInfo = _this_options_props.urlInfo) == null ? void 0 : (_this_options_props_urlInfo_searchParams = _this_options_props_urlInfo.searchParams) == null ? void 0 : _this_options_props_urlInfo_searchParams.begin) || new Date(), 'YYYY-MM-DD');
|
|
8416
|
+
// 面板首次展示的就是选中日期所在月份,初始化后不应触发年 / 月变化
|
|
8417
|
+
_this._renderMonth = _this._value.slice(0, 7);
|
|
8399
8418
|
_this._render();
|
|
8400
8419
|
// 日期上的点
|
|
8401
8420
|
_this.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
@@ -8456,9 +8475,26 @@ function _set_prototype_of$8(o, p) {
|
|
|
8456
8475
|
_this.emit(EVENTS.control.dateChange, date);
|
|
8457
8476
|
}
|
|
8458
8477
|
},
|
|
8478
|
+
// 日历面板「上一月 / 上一年」,底层两种翻页都回调 onPrevMonth
|
|
8479
|
+
onPrevMonth: function onPrevMonth(current, prev) {
|
|
8480
|
+
_this.options.onPrevMonth == null ? void 0 : _this.options.onPrevMonth.call(_this.options, current, prev);
|
|
8481
|
+
_this._onPanelDateChange(prev);
|
|
8482
|
+
},
|
|
8483
|
+
// 日历面板「下一月 / 下一年」,底层两种翻页都回调 onNextMonth
|
|
8484
|
+
onNextMonth: function onNextMonth(current, next) {
|
|
8485
|
+
_this.options.onNextMonth == null ? void 0 : _this.options.onNextMonth.call(_this.options, current, next);
|
|
8486
|
+
_this._onPanelDateChange(next);
|
|
8487
|
+
},
|
|
8488
|
+
// 月 / 年面板中点选单元格同样会改变日历展示的年月,但底层不回调翻页钩子
|
|
8489
|
+
onCell: function onCell(date, mode) {
|
|
8490
|
+
_this.options.onCell == null ? void 0 : _this.options.onCell.call(_this.options, date, mode);
|
|
8491
|
+
if (mode !== 'date' && !_this._isPanelCellDisabled(date, mode)) _this._onPanelDateChange(date);
|
|
8492
|
+
},
|
|
8459
8493
|
onOpenChange: function onOpenChange(open) {
|
|
8460
8494
|
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
|
|
8461
8495
|
_this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
|
|
8496
|
+
// 面板重新打开会跳回选中日期所在月份,且底层不会回调翻页钩子,这里补齐
|
|
8497
|
+
if (open) _this._onPanelDateChange(_this.datePicker.current);
|
|
8462
8498
|
}
|
|
8463
8499
|
}));
|
|
8464
8500
|
};
|
|
@@ -8470,6 +8506,8 @@ function _set_prototype_of$8(o, p) {
|
|
|
8470
8506
|
if (change === void 0) change = true;
|
|
8471
8507
|
var _this_datePicker;
|
|
8472
8508
|
(_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
|
|
8509
|
+
// 主动设值由调用方发起,同步展示月份但不触发年 / 月变化回调
|
|
8510
|
+
if (date) this._renderMonth = DateTime.format(date, 'YYYY-MM');
|
|
8473
8511
|
if (date && !change && this._value !== DateTime.format(date, 'YYYY-MM-DD')) {
|
|
8474
8512
|
this._value = DateTime.format(date, 'YYYY-MM-DD');
|
|
8475
8513
|
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
@@ -8497,6 +8535,36 @@ function _set_prototype_of$8(o, p) {
|
|
|
8497
8535
|
return arr[1] + "." + arr[2];
|
|
8498
8536
|
};
|
|
8499
8537
|
/**
|
|
8538
|
+
* 月 / 年面板中被点选的单元格是否已被调用方禁用
|
|
8539
|
+
*
|
|
8540
|
+
* 禁用的单元格底层不会切换展示的年月,因此不应派发变化
|
|
8541
|
+
* @param date 单元格日期
|
|
8542
|
+
* @param mode 当前面板模式
|
|
8543
|
+
*/ _proto._isPanelCellDisabled = function _isPanelCellDisabled(date, mode) {
|
|
8544
|
+
if (mode === 'month') return !!(this.options.disabledMonth == null ? void 0 : this.options.disabledMonth.call(this.options, date, DateTime.format(date, 'YYYY-MM')));
|
|
8545
|
+
if (mode === 'year') return !!(this.options.disabledYear == null ? void 0 : this.options.disabledYear.call(this.options, date, date.getFullYear()));
|
|
8546
|
+
return false;
|
|
8547
|
+
};
|
|
8548
|
+
/**
|
|
8549
|
+
* 日历面板展示的年月发生变化时,派发年份 / 月份变化
|
|
8550
|
+
*
|
|
8551
|
+
* 年份变化会先于月份变化派发;跨年翻页(如 2026-01 -> 2025-12)两者都会触发
|
|
8552
|
+
* @param renderDate 面板当前展示的日期
|
|
8553
|
+
*/ _proto._onPanelDateChange = function _onPanelDateChange(renderDate) {
|
|
8554
|
+
if (!renderDate) return;
|
|
8555
|
+
var month = DateTime.format(renderDate, 'YYYY-MM');
|
|
8556
|
+
if (!month || month === this._renderMonth) return;
|
|
8557
|
+
var prevYear = this._renderMonth.slice(0, 4);
|
|
8558
|
+
var year = month.slice(0, 4);
|
|
8559
|
+
this._renderMonth = month;
|
|
8560
|
+
if (year !== prevYear) {
|
|
8561
|
+
this.options.onYearChange == null ? void 0 : this.options.onYearChange.call(this.options, renderDate, year);
|
|
8562
|
+
this.emit(EVENTS.control.datePanelYearChange, renderDate, year);
|
|
8563
|
+
}
|
|
8564
|
+
this.options.onMonthChange == null ? void 0 : this.options.onMonthChange.call(this.options, renderDate, month);
|
|
8565
|
+
this.emit(EVENTS.control.datePanelMonthChange, renderDate, month);
|
|
8566
|
+
};
|
|
8567
|
+
/**
|
|
8500
8568
|
* 点击 Control 会触发
|
|
8501
8569
|
* @overload super._onControlClick(e: Event)
|
|
8502
8570
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
@@ -8536,9 +8604,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8536
8604
|
return _set_prototype_of$7(o, p);
|
|
8537
8605
|
}
|
|
8538
8606
|
/** 时间格式 HH:mm:ss */ var TIME_FORMAT = 'HH:mm:ss';
|
|
8539
|
-
/**
|
|
8540
|
-
* 时间选择器控件
|
|
8541
|
-
* @category Control
|
|
8607
|
+
/**
|
|
8608
|
+
* 时间选择器控件
|
|
8609
|
+
* @category Control
|
|
8542
8610
|
*/ var TimePickerControl = /*#__PURE__*/ function(Control) {
|
|
8543
8611
|
_inherits$7(TimePickerControl, Control);
|
|
8544
8612
|
function TimePickerControl(options) {
|
|
@@ -8599,9 +8667,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8599
8667
|
}
|
|
8600
8668
|
}));
|
|
8601
8669
|
};
|
|
8602
|
-
/**
|
|
8603
|
-
* 设置时间
|
|
8604
|
-
* @param time 设置的时间 HH:mm:ss
|
|
8670
|
+
/**
|
|
8671
|
+
* 设置时间
|
|
8672
|
+
* @param time 设置的时间 HH:mm:ss
|
|
8605
8673
|
*/ _proto.setTime = function setTime(time) {
|
|
8606
8674
|
var _this_timePicker;
|
|
8607
8675
|
(_this_timePicker = this.timePicker) == null ? void 0 : _this_timePicker.setCurrent(time);
|
|
@@ -8617,9 +8685,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8617
8685
|
if (this.timePicker) this.timePicker.open = false;
|
|
8618
8686
|
Control.prototype.reset.call(this);
|
|
8619
8687
|
};
|
|
8620
|
-
/**
|
|
8621
|
-
* 销毁控件
|
|
8622
|
-
* @override
|
|
8688
|
+
/**
|
|
8689
|
+
* 销毁控件
|
|
8690
|
+
* @override
|
|
8623
8691
|
*/ _proto.destroy = function destroy() {
|
|
8624
8692
|
if (this.timePicker) {
|
|
8625
8693
|
this.timePicker.destroy();
|
|
@@ -8631,9 +8699,9 @@ function _set_prototype_of$7(o, p) {
|
|
|
8631
8699
|
_proto._getTimeStr = function _getTimeStr() {
|
|
8632
8700
|
return this._value;
|
|
8633
8701
|
};
|
|
8634
|
-
/**
|
|
8635
|
-
* 点击 Control 会触发
|
|
8636
|
-
* @overload super._onControlClick(e: Event)
|
|
8702
|
+
/**
|
|
8703
|
+
* 点击 Control 会触发
|
|
8704
|
+
* @overload super._onControlClick(e: Event)
|
|
8637
8705
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8638
8706
|
Control.prototype._onControlClick.call(this, e);
|
|
8639
8707
|
};
|
|
@@ -8670,8 +8738,8 @@ function _set_prototype_of$6(o, p) {
|
|
|
8670
8738
|
};
|
|
8671
8739
|
return _set_prototype_of$6(o, p);
|
|
8672
8740
|
}
|
|
8673
|
-
/**
|
|
8674
|
-
* 回放时间轴控件
|
|
8741
|
+
/**
|
|
8742
|
+
* 回放时间轴控件
|
|
8675
8743
|
*/ var TimeLineControl = /*#__PURE__*/ function(Control) {
|
|
8676
8744
|
_inherits$6(TimeLineControl, Control);
|
|
8677
8745
|
function TimeLineControl(options) {
|
|
@@ -8831,8 +8899,8 @@ function _set_prototype_of$6(o, p) {
|
|
|
8831
8899
|
}
|
|
8832
8900
|
Control.prototype.destroy.call(this);
|
|
8833
8901
|
};
|
|
8834
|
-
/**
|
|
8835
|
-
* 点击 Control 会触发
|
|
8902
|
+
/**
|
|
8903
|
+
* 点击 Control 会触发
|
|
8836
8904
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8837
8905
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
8838
8906
|
};
|
|
@@ -8869,24 +8937,24 @@ function _set_prototype_of$5(o, p) {
|
|
|
8869
8937
|
};
|
|
8870
8938
|
return _set_prototype_of$5(o, p);
|
|
8871
8939
|
}
|
|
8872
|
-
/**
|
|
8873
|
-
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
8874
|
-
*
|
|
8875
|
-
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
8876
|
-
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
8877
|
-
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
8878
|
-
*
|
|
8879
|
-
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
8880
|
-
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
8940
|
+
/**
|
|
8941
|
+
* 播放结束后忽略 OSD 回写的静默期(毫秒)
|
|
8942
|
+
*
|
|
8943
|
+
* 断流结束时 SDK 不会立刻停掉 OSD 轮询(要让时间轴光标跟到画面最后一帧,见
|
|
8944
|
+
* api/_playbackRange.ts 的 OSD_SETTLE_MS = 2500),这些回写的时间早于区间末端,
|
|
8945
|
+
* 会把刚补满的进度拉回去。取值需覆盖该窗口。
|
|
8946
|
+
*
|
|
8947
|
+
* 用静默期而不是永久忽略:用户可能从时间轴点回区间内继续看,那条 seek 不经过
|
|
8948
|
+
* 进度条的 onChange,永久忽略会让进度条卡死不再更新。
|
|
8881
8949
|
*/ var PLAYBACK_END_SILENCE_MS = 3000;
|
|
8882
|
-
/**
|
|
8883
|
-
* 读取录像片段的起止时间(毫秒)
|
|
8884
|
-
*
|
|
8885
|
-
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
8886
|
-
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
8887
|
-
*
|
|
8888
|
-
* @param seg 录像片段
|
|
8889
|
-
* @param which 取起点还是终点
|
|
8950
|
+
/**
|
|
8951
|
+
* 读取录像片段的起止时间(毫秒)
|
|
8952
|
+
*
|
|
8953
|
+
* 录像列表是服务端原始返回、未做字段归一化,`begin/end` 与 `startTime/endTime`
|
|
8954
|
+
* 两套字段名在不同回放类型下都出现过,这里统一兼容。
|
|
8955
|
+
*
|
|
8956
|
+
* @param seg 录像片段
|
|
8957
|
+
* @param which 取起点还是终点
|
|
8890
8958
|
*/ function segMs(seg, which) {
|
|
8891
8959
|
var _ref, _ref1;
|
|
8892
8960
|
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;
|
|
@@ -8894,12 +8962,12 @@ function _set_prototype_of$5(o, p) {
|
|
|
8894
8962
|
if (typeof value === 'number') return value < 1e12 ? value * 1000 : value;
|
|
8895
8963
|
return DateTime.toDate(value).getTime();
|
|
8896
8964
|
}
|
|
8897
|
-
/**
|
|
8898
|
-
* 回放片段进度条控件(移动端)
|
|
8899
|
-
*
|
|
8900
|
-
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
8901
|
-
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
8902
|
-
* @category Control
|
|
8965
|
+
/**
|
|
8966
|
+
* 回放片段进度条控件(移动端)
|
|
8967
|
+
*
|
|
8968
|
+
* 只在设置了播放区间时渲染,范围是「当前录像片段 ∩ 播放区间」。
|
|
8969
|
+
* 区间内跨片段的定位由时间轴承担,这里只负责当前片段的精细拖动。
|
|
8970
|
+
* @category Control
|
|
8903
8971
|
*/ var SegmentProgressControl = /*#__PURE__*/ function(Control) {
|
|
8904
8972
|
_inherits$5(SegmentProgressControl, Control);
|
|
8905
8973
|
function SegmentProgressControl(options) {
|
|
@@ -8966,9 +9034,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
8966
9034
|
});
|
|
8967
9035
|
this._updateVisible();
|
|
8968
9036
|
};
|
|
8969
|
-
/**
|
|
8970
|
-
* 设置播放区间
|
|
8971
|
-
* @param range 区间;null 表示解除约束
|
|
9037
|
+
/**
|
|
9038
|
+
* 设置播放区间
|
|
9039
|
+
* @param range 区间;null 表示解除约束
|
|
8972
9040
|
*/ _proto._setRange = function _setRange(range) {
|
|
8973
9041
|
if ((range == null ? void 0 : range.begin) && (range == null ? void 0 : range.end)) {
|
|
8974
9042
|
this._rangeBeginMs = DateTime.toDate(range.begin).getTime();
|
|
@@ -8979,9 +9047,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
8979
9047
|
}
|
|
8980
9048
|
this._updateVisible();
|
|
8981
9049
|
};
|
|
8982
|
-
/**
|
|
8983
|
-
* 用区间裁剪录像片段
|
|
8984
|
-
* @param records 全天录像片段
|
|
9050
|
+
/**
|
|
9051
|
+
* 用区间裁剪录像片段
|
|
9052
|
+
* @param records 全天录像片段
|
|
8985
9053
|
*/ _proto._setSegments = function _setSegments(records) {
|
|
8986
9054
|
var _this = this;
|
|
8987
9055
|
if (!this._hasRange() || !Array.isArray(records)) {
|
|
@@ -9009,9 +9077,9 @@ function _set_prototype_of$5(o, p) {
|
|
|
9009
9077
|
if (force) this._currentIndex = -1;
|
|
9010
9078
|
this._updateVisible();
|
|
9011
9079
|
};
|
|
9012
|
-
/**
|
|
9013
|
-
* 按播放进度更新片段与进度
|
|
9014
|
-
* @param currentMs 当前播放时间(毫秒)
|
|
9080
|
+
/**
|
|
9081
|
+
* 按播放进度更新片段与进度
|
|
9082
|
+
* @param currentMs 当前播放时间(毫秒)
|
|
9015
9083
|
*/ _proto._syncCurrent = function _syncCurrent(currentMs) {
|
|
9016
9084
|
if (!this._hasRange()) return;
|
|
9017
9085
|
var index = this._segments.findIndex(function(seg) {
|
|
@@ -9082,9 +9150,9 @@ function _set_prototype_of$4(o, p) {
|
|
|
9082
9150
|
};
|
|
9083
9151
|
return _set_prototype_of$4(o, p);
|
|
9084
9152
|
}
|
|
9085
|
-
/**
|
|
9086
|
-
* 展示设备序列号控件
|
|
9087
|
-
* @category Control
|
|
9153
|
+
/**
|
|
9154
|
+
* 展示设备序列号控件
|
|
9155
|
+
* @category Control
|
|
9088
9156
|
*/ var Device = /*#__PURE__*/ function(Control) {
|
|
9089
9157
|
_inherits$4(Device, Control);
|
|
9090
9158
|
function Device(options) {
|
|
@@ -9102,10 +9170,10 @@ function _set_prototype_of$4(o, p) {
|
|
|
9102
9170
|
var _this___options_props_urlInfo, _this___options_props;
|
|
9103
9171
|
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>";
|
|
9104
9172
|
};
|
|
9105
|
-
/**
|
|
9106
|
-
* 更新设备序列号
|
|
9107
|
-
* @param deviceSerial - 设备序列号
|
|
9108
|
-
* @param deviceName - 设备名称
|
|
9173
|
+
/**
|
|
9174
|
+
* 更新设备序列号
|
|
9175
|
+
* @param deviceSerial - 设备序列号
|
|
9176
|
+
* @param deviceName - 设备名称
|
|
9109
9177
|
*/ _proto.update = function update(deviceName, deviceSerial) {
|
|
9110
9178
|
if (this.$container.querySelector("." + PREFIX_CLASS + "-text-device")) {
|
|
9111
9179
|
var $span = this.$container.querySelector("." + PREFIX_CLASS + "-text-device");
|
|
@@ -9263,8 +9331,8 @@ function _set_prototype_of$2(o, p) {
|
|
|
9263
9331
|
// const MobileExtend_DEFAULT_Options = {
|
|
9264
9332
|
// controls: MOBILE_EXTENDS,
|
|
9265
9333
|
// };
|
|
9266
|
-
/**
|
|
9267
|
-
* 移动端扩展
|
|
9334
|
+
/**
|
|
9335
|
+
* 移动端扩展
|
|
9268
9336
|
*/ var MobileExtend = /*#__PURE__*/ function(EventEmitter) {
|
|
9269
9337
|
_inherits$2(MobileExtend, EventEmitter);
|
|
9270
9338
|
function MobileExtend($siblingContainer) {
|
|
@@ -9341,9 +9409,9 @@ function _set_prototype_of$1(o, p) {
|
|
|
9341
9409
|
return _set_prototype_of$1(o, p);
|
|
9342
9410
|
}
|
|
9343
9411
|
var PAUSE_DEFAULT_OPTIONS = {};
|
|
9344
|
-
/**
|
|
9345
|
-
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
9346
|
-
* @category Control
|
|
9412
|
+
/**
|
|
9413
|
+
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
9414
|
+
* @category Control
|
|
9347
9415
|
*/ var Pause = /*#__PURE__*/ function(Control) {
|
|
9348
9416
|
_inherits$1(Pause, Control);
|
|
9349
9417
|
function Pause(options) {
|
|
@@ -9359,8 +9427,8 @@ var PAUSE_DEFAULT_OPTIONS = {};
|
|
|
9359
9427
|
return _this;
|
|
9360
9428
|
}
|
|
9361
9429
|
var _proto = Pause.prototype;
|
|
9362
|
-
/**
|
|
9363
|
-
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
9430
|
+
/**
|
|
9431
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
9364
9432
|
*/ _proto.show = function show(playing, always) {
|
|
9365
9433
|
var _this = this;
|
|
9366
9434
|
var _this_$container_classList, _this_$container;
|
|
@@ -9405,8 +9473,8 @@ var PAUSE_DEFAULT_OPTIONS = {};
|
|
|
9405
9473
|
}, 300);
|
|
9406
9474
|
}, 10);
|
|
9407
9475
|
};
|
|
9408
|
-
/**
|
|
9409
|
-
* 销毁
|
|
9476
|
+
/**
|
|
9477
|
+
* 销毁
|
|
9410
9478
|
*/ _proto.destroy = function destroy() {
|
|
9411
9479
|
if (this._timer) {
|
|
9412
9480
|
clearTimeout(this._timer);
|
|
@@ -9694,10 +9762,10 @@ var AUTH_KEY = [
|
|
|
9694
9762
|
'recDropdown',
|
|
9695
9763
|
'alarmMessage'
|
|
9696
9764
|
];
|
|
9697
|
-
/**
|
|
9698
|
-
* 渲染控件
|
|
9699
|
-
* @param $container - 控件渲染节点
|
|
9700
|
-
* @param btnList - 控件按钮列表
|
|
9765
|
+
/**
|
|
9766
|
+
* 渲染控件
|
|
9767
|
+
* @param $container - 控件渲染节点
|
|
9768
|
+
* @param btnList - 控件按钮列表
|
|
9701
9769
|
*/ // prettier-ignore
|
|
9702
9770
|
function _renderControls(theme, $container, btnList, props) {
|
|
9703
9771
|
if (props === void 0) props = {};
|
|
@@ -10099,27 +10167,27 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10099
10167
|
if ((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1['recControl']) ((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['recControl']).addRecType(recType);
|
|
10100
10168
|
};
|
|
10101
10169
|
|
|
10102
|
-
/**
|
|
10103
|
-
* 布局溢出(More 收纳)与响应式尺寸分档的**纯函数**模块。
|
|
10104
|
-
*
|
|
10105
|
-
* @remarks
|
|
10106
|
-
* 这些函数只做「计算 / 判定」,不含任何 DOM 副作用,因此可以在没有布局引擎的环境(如 jsdom)
|
|
10107
|
-
* 中被完整单元测试。`theme.ts` 中的命令式外壳(读取 `clientWidth`、增删 class、创建 More、
|
|
10108
|
-
* 搬移控件)负责副作用,具体的判定逻辑全部下沉到这里。
|
|
10109
|
-
*/ /**
|
|
10110
|
-
* 一次 classList 变更集合:需要添加与需要移除的类名。
|
|
10111
|
-
*/ /**
|
|
10112
|
-
* 根据尺寸计算某一维度(宽或高)需要增删的响应式档位类名。
|
|
10113
|
-
*
|
|
10114
|
-
* 档位规则:
|
|
10115
|
-
* - `(280, 375]` → medium
|
|
10116
|
-
* - `(200, 280]` → small
|
|
10117
|
-
* - `<= 200` → mini
|
|
10118
|
-
* - 其它(> 375)→ 无档位(移除全部)
|
|
10119
|
-
*
|
|
10120
|
-
* @param size 尺寸(px)
|
|
10121
|
-
* @param axis `'width'` 或 `'height'`
|
|
10122
|
-
* @param prefix 类名前缀(如 `ezplayer`)
|
|
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`)
|
|
10123
10191
|
*/ function computeDimensionClasses(size, axis, prefix) {
|
|
10124
10192
|
var medium = prefix + "-medium-" + axis;
|
|
10125
10193
|
var small = prefix + "-small-" + axis;
|
|
@@ -10145,11 +10213,11 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10145
10213
|
remove: remove
|
|
10146
10214
|
};
|
|
10147
10215
|
}
|
|
10148
|
-
/**
|
|
10149
|
-
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
10150
|
-
* @param width 容器宽度(px)
|
|
10151
|
-
* @param height 容器高度(px)
|
|
10152
|
-
* @param prefix 类名前缀
|
|
10216
|
+
/**
|
|
10217
|
+
* 计算宽、高两个维度的响应式档位类名增删集合。
|
|
10218
|
+
* @param width 容器宽度(px)
|
|
10219
|
+
* @param height 容器高度(px)
|
|
10220
|
+
* @param prefix 类名前缀
|
|
10153
10221
|
*/ function computeSizeClasses(width, height, prefix) {
|
|
10154
10222
|
var w = computeDimensionClasses(width, 'width', prefix);
|
|
10155
10223
|
var h = computeDimensionClasses(height, 'height', prefix);
|
|
@@ -10158,34 +10226,34 @@ var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
|
10158
10226
|
remove: [].concat(w.remove, h.remove)
|
|
10159
10227
|
};
|
|
10160
10228
|
}
|
|
10161
|
-
/**
|
|
10162
|
-
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
10229
|
+
/**
|
|
10230
|
+
* header 左右控件宽度之和 + 30 是否超过容器宽度 —— 超过则需要显示 More。
|
|
10163
10231
|
*/ function shouldShowHeaderMore(width, leftWidth, rightWidth) {
|
|
10164
10232
|
return leftWidth + rightWidth + 30 > width;
|
|
10165
10233
|
}
|
|
10166
|
-
/**
|
|
10167
|
-
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
10234
|
+
/**
|
|
10235
|
+
* header 剩余空间是否 > 100 —— 足够则可以移除 More,把控件放回工具栏。
|
|
10168
10236
|
*/ function shouldRemoveHeaderMore(width, leftWidth, rightWidth) {
|
|
10169
10237
|
return width - leftWidth - rightWidth > 100;
|
|
10170
10238
|
}
|
|
10171
|
-
/**
|
|
10172
|
-
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
10239
|
+
/**
|
|
10240
|
+
* footer 剩余空间是否 < 16 —— 不足则需要把控件收拢进 More。
|
|
10173
10241
|
*/ function shouldCollapseFooter(width, leftWidth, rightWidth) {
|
|
10174
10242
|
return width - leftWidth - rightWidth < 16;
|
|
10175
10243
|
}
|
|
10176
|
-
/**
|
|
10177
|
-
* footer 从 More 中释放控件时的展开阈值。
|
|
10178
|
-
*
|
|
10179
|
-
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
10180
|
-
* `50 + firstItemWidth || 0`)。
|
|
10181
|
-
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
10244
|
+
/**
|
|
10245
|
+
* footer 从 More 中释放控件时的展开阈值。
|
|
10246
|
+
*
|
|
10247
|
+
* 基准为 50;当 More 中已有控件时,加上首个控件宽度(保持与历史实现一致的运算与兜底:
|
|
10248
|
+
* `50 + firstItemWidth || 0`)。
|
|
10249
|
+
* @param firstItemWidth More 列表中第一个控件的宽度;未提供表示 More 为空。
|
|
10182
10250
|
*/ function computeFooterExpandOffset(firstItemWidth) {
|
|
10183
10251
|
var base = 50;
|
|
10184
10252
|
if (firstItemWidth === undefined) return base;
|
|
10185
10253
|
return base + firstItemWidth || 0;
|
|
10186
10254
|
}
|
|
10187
|
-
/**
|
|
10188
|
-
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
10255
|
+
/**
|
|
10256
|
+
* footer 剩余空间是否足够把一个控件从 More 释放回工具栏。
|
|
10189
10257
|
*/ function shouldExpandFooter(width, leftWidth, rightWidth, offset) {
|
|
10190
10258
|
return width - leftWidth - rightWidth > offset;
|
|
10191
10259
|
}
|
|
@@ -11859,6 +11927,6 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11859
11927
|
zh: zh,
|
|
11860
11928
|
en: en
|
|
11861
11929
|
};
|
|
11862
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.
|
|
11930
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6-beta.1';
|
|
11863
11931
|
|
|
11864
11932
|
export { Control, EVENTS, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };
|