@ezuikit/player-theme 3.0.0-beta.4 → 3.0.1-beta.3
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 +11 -2
- package/dist/index.cjs +697 -233
- package/dist/index.esm.js +697 -233
- package/dist/index.umd.js +697 -233
- package/dist/style.css +3 -0
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +87 -36
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.0.
|
|
3
|
-
* Copyright (c) 2026-05-
|
|
2
|
+
* @ezuikit/player-theme v3.0.1-beta.3
|
|
3
|
+
* Copyright (c) 2026-05-13 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -492,6 +492,9 @@
|
|
|
492
492
|
/** 麦克风音量变化 */ talkVolumeChange: 'talkVolumeChange',
|
|
493
493
|
/** 语音广播状态变化 */ broadcastChange: 'broadcastChange',
|
|
494
494
|
/** AI对话框状态变化 */ aichatChange: 'aichatChange',
|
|
495
|
+
/** 直播模式切换 */ liveChange: 'liveChange',
|
|
496
|
+
/** 回放下拉选择变化 */ recDropdownChange: 'recDropdownChange',
|
|
497
|
+
/** 告警消息面板状态变化 */ alarmMessageChange: 'alarmMessageChange',
|
|
495
498
|
/** 动态切换日志配置 */ setLoggerOptions: 'setLoggerOptions',
|
|
496
499
|
records: 'records',
|
|
497
500
|
ptzSpeedChange: 'ptzSpeedChange',
|
|
@@ -539,6 +542,12 @@
|
|
|
539
542
|
/** 语音广播控件销毁 */ broadcastDestroy: 'Control.broadcastDestroy',
|
|
540
543
|
/** AI对话框状态变化 */ aichatChange: 'Control.aichatChange',
|
|
541
544
|
/** AI对话框控件销毁 */ aichatDestroy: 'Control.aichatDestroy',
|
|
545
|
+
/** 直播按钮点击 */ liveChange: 'Control.liveChange',
|
|
546
|
+
/** 直播控件销毁 */ liveDestroy: 'Control.liveDestroy',
|
|
547
|
+
/** 回放下拉选择变化 */ recDropdownChange: 'Control.recDropdownChange',
|
|
548
|
+
/** 回放下拉控件销毁 */ recDropdownDestroy: 'Control.recDropdownDestroy',
|
|
549
|
+
/** 告警消息面板开关 */ alarmMessageChange: 'Control.alarmMessageChange',
|
|
550
|
+
/** 告警消息面板销毁 */ alarmMessageDestroy: 'Control.alarmMessageDestroy',
|
|
542
551
|
/** 缩放比例改变 */ zoomChange: 'Control.zoomChange',
|
|
543
552
|
/** 音量调节面板 展示隐藏变换 */ zoomPanelOpenChange: 'Control.zoomPanelOpenChange',
|
|
544
553
|
/** 缩放控件销毁 */ zoomDestroy: 'Control.zoomDestroy',
|
|
@@ -590,7 +599,7 @@
|
|
|
590
599
|
if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
|
|
591
600
|
return Constructor;
|
|
592
601
|
}
|
|
593
|
-
function _inherits$
|
|
602
|
+
function _inherits$w(subClass, superClass) {
|
|
594
603
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
595
604
|
throw new TypeError("Super expression must either be null or a function");
|
|
596
605
|
}
|
|
@@ -601,14 +610,14 @@
|
|
|
601
610
|
configurable: true
|
|
602
611
|
}
|
|
603
612
|
});
|
|
604
|
-
if (superClass) _set_prototype_of$
|
|
613
|
+
if (superClass) _set_prototype_of$z(subClass, superClass);
|
|
605
614
|
}
|
|
606
|
-
function _set_prototype_of$
|
|
607
|
-
_set_prototype_of$
|
|
615
|
+
function _set_prototype_of$z(o, p) {
|
|
616
|
+
_set_prototype_of$z = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
608
617
|
o.__proto__ = p;
|
|
609
618
|
return o;
|
|
610
619
|
};
|
|
611
|
-
return _set_prototype_of$
|
|
620
|
+
return _set_prototype_of$z(o, p);
|
|
612
621
|
}
|
|
613
622
|
/**
|
|
614
623
|
* 控件基类
|
|
@@ -622,7 +631,7 @@
|
|
|
622
631
|
* const myControl = new MyControl({})
|
|
623
632
|
* ```
|
|
624
633
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
625
|
-
_inherits$
|
|
634
|
+
_inherits$w(Control, EventEmitter);
|
|
626
635
|
function Control(options) {
|
|
627
636
|
var _this;
|
|
628
637
|
var _this___options;
|
|
@@ -797,8 +806,8 @@
|
|
|
797
806
|
return Control;
|
|
798
807
|
}(EventEmitter);
|
|
799
808
|
|
|
800
|
-
function _extends$
|
|
801
|
-
_extends$
|
|
809
|
+
function _extends$x() {
|
|
810
|
+
_extends$x = Object.assign || function(target) {
|
|
802
811
|
for(var i = 1; i < arguments.length; i++){
|
|
803
812
|
var source = arguments[i];
|
|
804
813
|
for(var key in source){
|
|
@@ -809,9 +818,9 @@
|
|
|
809
818
|
}
|
|
810
819
|
return target;
|
|
811
820
|
};
|
|
812
|
-
return _extends$
|
|
821
|
+
return _extends$x.apply(this, arguments);
|
|
813
822
|
}
|
|
814
|
-
function _inherits$
|
|
823
|
+
function _inherits$v(subClass, superClass) {
|
|
815
824
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
816
825
|
throw new TypeError("Super expression must either be null or a function");
|
|
817
826
|
}
|
|
@@ -822,25 +831,25 @@
|
|
|
822
831
|
configurable: true
|
|
823
832
|
}
|
|
824
833
|
});
|
|
825
|
-
if (superClass) _set_prototype_of$
|
|
834
|
+
if (superClass) _set_prototype_of$y(subClass, superClass);
|
|
826
835
|
}
|
|
827
|
-
function _set_prototype_of$
|
|
828
|
-
_set_prototype_of$
|
|
836
|
+
function _set_prototype_of$y(o, p) {
|
|
837
|
+
_set_prototype_of$y = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
829
838
|
o.__proto__ = p;
|
|
830
839
|
return o;
|
|
831
840
|
};
|
|
832
|
-
return _set_prototype_of$
|
|
841
|
+
return _set_prototype_of$y(o, p);
|
|
833
842
|
}
|
|
834
843
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
835
844
|
/**
|
|
836
845
|
* 加载动画控件
|
|
837
846
|
* @category Control
|
|
838
847
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
839
|
-
_inherits$
|
|
848
|
+
_inherits$v(Loading, Control);
|
|
840
849
|
function Loading(options) {
|
|
841
850
|
if (options === void 0) options = {};
|
|
842
851
|
var _this;
|
|
843
|
-
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$
|
|
852
|
+
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$x({}, options, {
|
|
844
853
|
tagName: 'div',
|
|
845
854
|
controlType: 'block',
|
|
846
855
|
classNameSuffix: 'loading'
|
|
@@ -878,8 +887,8 @@
|
|
|
878
887
|
return Loading;
|
|
879
888
|
}(Control);
|
|
880
889
|
|
|
881
|
-
function _extends$
|
|
882
|
-
_extends$
|
|
890
|
+
function _extends$w() {
|
|
891
|
+
_extends$w = Object.assign || function(target) {
|
|
883
892
|
for(var i = 1; i < arguments.length; i++){
|
|
884
893
|
var source = arguments[i];
|
|
885
894
|
for(var key in source){
|
|
@@ -890,9 +899,9 @@
|
|
|
890
899
|
}
|
|
891
900
|
return target;
|
|
892
901
|
};
|
|
893
|
-
return _extends$
|
|
902
|
+
return _extends$w.apply(this, arguments);
|
|
894
903
|
}
|
|
895
|
-
function _inherits$
|
|
904
|
+
function _inherits$u(subClass, superClass) {
|
|
896
905
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
897
906
|
throw new TypeError("Super expression must either be null or a function");
|
|
898
907
|
}
|
|
@@ -903,14 +912,14 @@
|
|
|
903
912
|
configurable: true
|
|
904
913
|
}
|
|
905
914
|
});
|
|
906
|
-
if (superClass) _set_prototype_of$
|
|
915
|
+
if (superClass) _set_prototype_of$x(subClass, superClass);
|
|
907
916
|
}
|
|
908
|
-
function _set_prototype_of$
|
|
909
|
-
_set_prototype_of$
|
|
917
|
+
function _set_prototype_of$x(o, p) {
|
|
918
|
+
_set_prototype_of$x = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
910
919
|
o.__proto__ = p;
|
|
911
920
|
return o;
|
|
912
921
|
};
|
|
913
|
-
return _set_prototype_of$
|
|
922
|
+
return _set_prototype_of$x(o, p);
|
|
914
923
|
}
|
|
915
924
|
// 不放在服务器上 是因为有可能http加载失败
|
|
916
925
|
// prettier-ignore
|
|
@@ -922,11 +931,11 @@
|
|
|
922
931
|
* 封面控件
|
|
923
932
|
* @category Control
|
|
924
933
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
925
|
-
_inherits$
|
|
934
|
+
_inherits$u(Poster, Control);
|
|
926
935
|
function Poster(options) {
|
|
927
936
|
if (options === void 0) options = {};
|
|
928
937
|
var _this;
|
|
929
|
-
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$
|
|
938
|
+
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$w({}, options, {
|
|
930
939
|
tagName: 'div',
|
|
931
940
|
controlType: 'block',
|
|
932
941
|
classNameSuffix: 'poster'
|
|
@@ -1032,7 +1041,10 @@
|
|
|
1032
1041
|
warnCircleOutLined: '<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="info-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM7.5 8.875C7.5 8.94375 7.55625 9 7.625 9L8.375 9C8.44375 9 8.5 8.94375 8.5 8.875L8.5 4.625C8.5 4.55625 8.44375 4.5 8.375 4.5L7.625 4.5C7.55625 4.5 7.5 4.55625 7.5 4.625L7.5 8.875ZM7.25 10.75C7.25 11.1642 7.58579 11.5 8 11.5C8.41421 11.5 8.75 11.1642 8.75 10.75C8.75 10.3358 8.41421 10 8 10C7.58579 10 7.25 10.3358 7.25 10.75Z" fill-rule="evenodd" />\n </svg>',
|
|
1033
1042
|
date: '<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="date">\n <g>\n <path d="m13.35,5.9c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-3.3c0,-0.3 0.2,-0.5 0.5,-0.5s0.5,0.2 0.5,0.5l0,3.3c0,0.3 -0.3,0.5 -0.5,0.5z" />\n <path d="m6.65,5.9c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-3.3c0,-0.3 0.2,-0.5 0.5,-0.5s0.5,0.2 0.5,0.5l0,3.3c0,0.3 -0.2,0.5 -0.5,0.5z" />\n <path d="m17.45,8.4l-15,0c-0.3,0 -0.5,-0.2 -0.5,-0.5s0.2,-0.5 0.5,-0.5l15,0c0.3,0 0.5,0.2 0.5,0.5s-0.2,0.5 -0.5,0.5z" />\n <path d="m15.85,18.4l-11.7,0c-1.2,0 -2.2,-1 -2.2,-2.2l0,-10.8c0,-1.2 1,-2.2 2.2,-2.2l11.7,0c1.2,0 2.2,1 2.2,2.2l0,10.8c-0.1,1.3 -1,2.2 -2.2,2.2zm-11.7,-14.1c-0.6,0 -1.2,0.5 -1.2,1.2l0,10.8c0,0.6 0.5,1.2 1.2,1.2l11.7,0c0.6,0 1.2,-0.5 1.2,-1.2l0,-10.9c0,-0.6 -0.5,-1.2 -1.2,-1.2l-11.7,0l0,0.1z" />\n <path d="m9.95,12c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5s0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7s-0.3,0.7 -0.7,0.7z" />\n <path d="m14.15,12c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2c0.4,0 0.7,0.3 0.7,0.7s-0.3,0.7 -0.7,0.7zm0,-1c-0.2,0 -0.3,0.1 -0.3,0.3c0,0.2 0.3,0.4 0.5,0.2c0.1,-0.1 0.1,-0.1 0.1,-0.2c0,-0.2 -0.1,-0.3 -0.3,-0.3z" />\n <path d="m5.85,15.3c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7c0,0.4 -0.3,0.7 -0.7,0.7z" />\n <path d="m9.95,15.3c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7c0.1,0.4 -0.3,0.7 -0.7,0.7z" />\n </g>\n </svg>',
|
|
1034
1043
|
add: '<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="add">\n <path d="M10.5859 2.96875L9.41406 2.96875C9.3099 2.96875 9.25781 3.02083 9.25781 3.125L9.25781 9.25781L3.4375 9.25781C3.38542 9.25781 3.34635 9.27083 3.32031 9.29688C3.29427 9.32292 3.28125 9.36198 3.28125 9.41406L3.28125 10.5859C3.28125 10.6901 3.33333 10.7422 3.4375 10.7422L9.25781 10.7422L9.25781 16.875C9.25781 16.9792 9.3099 17.0312 9.41406 17.0312L10.5859 17.0312C10.6901 17.0312 10.7422 16.9792 10.7422 16.875L10.7422 10.7422L16.5625 10.7422C16.6667 10.7422 16.7188 10.6901 16.7188 10.5859L16.7188 9.41406C16.7188 9.3099 16.6667 9.25781 16.5625 9.25781L10.7422 9.25781L10.7422 3.125C10.7422 3.07292 10.7292 3.03385 10.7031 3.00781C10.6771 2.98177 10.638 2.96875 10.5859 2.96875Z" fill-rule="evenodd" /></svg>',
|
|
1035
|
-
reduce: '<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="reduce">\n <path d="M3.4375 9.25781L16.5625 9.25781C16.6667 9.25781 16.7188 9.3099 16.7188 9.41406L16.7188 10.5859C16.7188 10.6901 16.6667 10.7422 16.5625 10.7422L3.4375 10.7422C3.33333 10.7422 3.28125 10.6901 3.28125 10.5859L3.28125 9.41406C3.28125 9.3099 3.33333 9.25781 3.4375 9.25781Z" fill-rule="evenodd" />\n </svg>'
|
|
1044
|
+
reduce: '<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="reduce">\n <path d="M3.4375 9.25781L16.5625 9.25781C16.6667 9.25781 16.7188 9.3099 16.7188 9.41406L16.7188 10.5859C16.7188 10.6901 16.6667 10.7422 16.5625 10.7422L3.4375 10.7422C3.33333 10.7422 3.28125 10.6901 3.28125 10.5859L3.28125 9.41406C3.28125 9.3099 3.33333 9.25781 3.4375 9.25781Z" fill-rule="evenodd" />\n </svg>',
|
|
1045
|
+
/** 直播 */ live: '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="live">\n <rect width="18" height="13" x="3" y="7" rx="1.6" stroke-linejoin="round" stroke-width="1.5"/>\n <path d="M8.26636 4.8L10.466 7" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n <path d="M15.996 4.8L13.796 7" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n <path d="M9.8 17L15.4 13.354L9.8 10L9.8 17Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n </svg>',
|
|
1046
|
+
/** 回放 */ recDropdown: '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="rec-dropdown">\n <path d="M9.168 2.556C9.168 2.556 12.51 4.445 12 4.445C7.306 4.445 3.5 8.251 3.5 12.945C3.5 17.64 7.306 21.445 12 21.445C16.695 21.445 20.5 17.64 20.5 12.945C20.5 10.622 19.568 8.517 18.058 6.982" stroke-linecap="round" stroke-width="1.5"/>\n <path d="M11.61 9.829L11.61 13.731L16.064 13.731" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n </svg>',
|
|
1047
|
+
/** 消息/告警 */ alarmMessage: '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="alarm-message">\n <path d="M9.708 18.344L9.708 18.709C9.708 19.974 10.734 21 12 21C13.266 21 14.292 19.974 14.292 18.709L14.292 18.343" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n <path d="M13.833 5.751L13.833 4.833C13.833 3.821 13.013 3 12 3C10.987 3 10.167 3.821 10.167 4.833L10.167 5.751" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n <path d="M6.563 10.189C6.563 7.686 8.592 5.657 11.094 5.657L12.907 5.657C15.41 5.657 17.438 7.686 17.438 10.189L17.438 12.986C17.438 13.516 17.649 14.025 18.024 14.4L18.665 15.04C19.04 15.416 19.251 15.925 19.251 16.455C19.251 17.499 18.405 18.345 17.361 18.345L6.64 18.345C5.596 18.345 4.75 17.499 4.75 16.455C4.75 15.925 4.961 15.416 5.336 15.04L5.977 14.4C6.352 14.025 6.563 13.516 6.563 12.986L6.563 10.189Z" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>\n </svg>'
|
|
1036
1048
|
};
|
|
1037
1049
|
|
|
1038
1050
|
/**
|
|
@@ -1190,11 +1202,23 @@
|
|
|
1190
1202
|
reduce: function(attr) {
|
|
1191
1203
|
if (attr === void 0) attr = {};
|
|
1192
1204
|
return createIcon(Icons.reduce, 'reduce', attr);
|
|
1205
|
+
},
|
|
1206
|
+
/** 直播 */ live: function(attr) {
|
|
1207
|
+
if (attr === void 0) attr = {};
|
|
1208
|
+
return createIcon(Icons.live, 'live', attr);
|
|
1209
|
+
},
|
|
1210
|
+
/** 回放 */ recDropdown: function(attr) {
|
|
1211
|
+
if (attr === void 0) attr = {};
|
|
1212
|
+
return createIcon(Icons.recDropdown, 'rec-dropdown', attr);
|
|
1213
|
+
},
|
|
1214
|
+
/** 消息 */ alarmMessage: function(attr) {
|
|
1215
|
+
if (attr === void 0) attr = {};
|
|
1216
|
+
return createIcon(Icons.alarmMessage, 'alarm-message', attr);
|
|
1193
1217
|
}
|
|
1194
1218
|
};
|
|
1195
1219
|
|
|
1196
|
-
function _extends$
|
|
1197
|
-
_extends$
|
|
1220
|
+
function _extends$v() {
|
|
1221
|
+
_extends$v = Object.assign || function(target) {
|
|
1198
1222
|
for(var i = 1; i < arguments.length; i++){
|
|
1199
1223
|
var source = arguments[i];
|
|
1200
1224
|
for(var key in source){
|
|
@@ -1205,9 +1229,9 @@
|
|
|
1205
1229
|
}
|
|
1206
1230
|
return target;
|
|
1207
1231
|
};
|
|
1208
|
-
return _extends$
|
|
1232
|
+
return _extends$v.apply(this, arguments);
|
|
1209
1233
|
}
|
|
1210
|
-
function _inherits$
|
|
1234
|
+
function _inherits$t(subClass, superClass) {
|
|
1211
1235
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
1212
1236
|
throw new TypeError("Super expression must either be null or a function");
|
|
1213
1237
|
}
|
|
@@ -1218,28 +1242,28 @@
|
|
|
1218
1242
|
configurable: true
|
|
1219
1243
|
}
|
|
1220
1244
|
});
|
|
1221
|
-
if (superClass) _set_prototype_of$
|
|
1245
|
+
if (superClass) _set_prototype_of$w(subClass, superClass);
|
|
1222
1246
|
}
|
|
1223
|
-
function _set_prototype_of$
|
|
1224
|
-
_set_prototype_of$
|
|
1247
|
+
function _set_prototype_of$w(o, p) {
|
|
1248
|
+
_set_prototype_of$w = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1225
1249
|
o.__proto__ = p;
|
|
1226
1250
|
return o;
|
|
1227
1251
|
};
|
|
1228
|
-
return _set_prototype_of$
|
|
1252
|
+
return _set_prototype_of$w(o, p);
|
|
1229
1253
|
}
|
|
1230
1254
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
1231
1255
|
/**
|
|
1232
1256
|
* 消息控件
|
|
1233
1257
|
* @category Control
|
|
1234
1258
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
1235
|
-
_inherits$
|
|
1259
|
+
_inherits$t(Message, Control);
|
|
1236
1260
|
function Message(options) {
|
|
1237
1261
|
if (options === void 0) options = {};
|
|
1238
1262
|
var _this;
|
|
1239
|
-
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$
|
|
1263
|
+
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$v({}, options, {
|
|
1240
1264
|
tagName: 'div',
|
|
1241
1265
|
controlType: 'block'
|
|
1242
|
-
}))) || this;
|
|
1266
|
+
}))) || this, _this._$toast = null;
|
|
1243
1267
|
_this.options = Object.assign({}, MESSAGE_DEFAULT_OPTIONS, options);
|
|
1244
1268
|
_this.$container.classList.add("" + PREFIX_CLASS + "-message", "" + PREFIX_CLASS + "-hide"); // 默认隐藏 `${PREFIX_CLASS}-hide`
|
|
1245
1269
|
return _this;
|
|
@@ -1389,8 +1413,8 @@
|
|
|
1389
1413
|
if (protoProps) _defineProperties$8(Constructor.prototype, protoProps);
|
|
1390
1414
|
return Constructor;
|
|
1391
1415
|
}
|
|
1392
|
-
function _extends$
|
|
1393
|
-
_extends$
|
|
1416
|
+
function _extends$u() {
|
|
1417
|
+
_extends$u = Object.assign || function(target) {
|
|
1394
1418
|
for(var i = 1; i < arguments.length; i++){
|
|
1395
1419
|
var source = arguments[i];
|
|
1396
1420
|
for(var key in source){
|
|
@@ -1401,9 +1425,9 @@
|
|
|
1401
1425
|
}
|
|
1402
1426
|
return target;
|
|
1403
1427
|
};
|
|
1404
|
-
return _extends$
|
|
1428
|
+
return _extends$u.apply(this, arguments);
|
|
1405
1429
|
}
|
|
1406
|
-
function _inherits$
|
|
1430
|
+
function _inherits$s(subClass, superClass) {
|
|
1407
1431
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
1408
1432
|
throw new TypeError("Super expression must either be null or a function");
|
|
1409
1433
|
}
|
|
@@ -1414,23 +1438,23 @@
|
|
|
1414
1438
|
configurable: true
|
|
1415
1439
|
}
|
|
1416
1440
|
});
|
|
1417
|
-
if (superClass) _set_prototype_of$
|
|
1441
|
+
if (superClass) _set_prototype_of$v(subClass, superClass);
|
|
1418
1442
|
}
|
|
1419
|
-
function _set_prototype_of$
|
|
1420
|
-
_set_prototype_of$
|
|
1443
|
+
function _set_prototype_of$v(o, p) {
|
|
1444
|
+
_set_prototype_of$v = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1421
1445
|
o.__proto__ = p;
|
|
1422
1446
|
return o;
|
|
1423
1447
|
};
|
|
1424
|
-
return _set_prototype_of$
|
|
1448
|
+
return _set_prototype_of$v(o, p);
|
|
1425
1449
|
}
|
|
1426
1450
|
/**
|
|
1427
1451
|
* 播放/暂停控件
|
|
1428
1452
|
* @category Control
|
|
1429
1453
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1430
|
-
_inherits$
|
|
1454
|
+
_inherits$s(Play, Control);
|
|
1431
1455
|
function Play(options) {
|
|
1432
1456
|
var _this;
|
|
1433
|
-
_this = Control.call(this, _extends$
|
|
1457
|
+
_this = Control.call(this, _extends$u({}, options, {
|
|
1434
1458
|
tagName: 'span',
|
|
1435
1459
|
controlType: 'button',
|
|
1436
1460
|
classNameSuffix: 'play'
|
|
@@ -2948,8 +2972,8 @@
|
|
|
2948
2972
|
if (protoProps) _defineProperties$6(Constructor.prototype, protoProps);
|
|
2949
2973
|
return Constructor;
|
|
2950
2974
|
}
|
|
2951
|
-
function _extends$
|
|
2952
|
-
_extends$
|
|
2975
|
+
function _extends$t() {
|
|
2976
|
+
_extends$t = Object.assign || function(target) {
|
|
2953
2977
|
for(var i = 1; i < arguments.length; i++){
|
|
2954
2978
|
var source = arguments[i];
|
|
2955
2979
|
for(var key in source){
|
|
@@ -2960,9 +2984,9 @@
|
|
|
2960
2984
|
}
|
|
2961
2985
|
return target;
|
|
2962
2986
|
};
|
|
2963
|
-
return _extends$
|
|
2987
|
+
return _extends$t.apply(this, arguments);
|
|
2964
2988
|
}
|
|
2965
|
-
function _inherits$
|
|
2989
|
+
function _inherits$r(subClass, superClass) {
|
|
2966
2990
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
2967
2991
|
throw new TypeError("Super expression must either be null or a function");
|
|
2968
2992
|
}
|
|
@@ -2973,14 +2997,14 @@
|
|
|
2973
2997
|
configurable: true
|
|
2974
2998
|
}
|
|
2975
2999
|
});
|
|
2976
|
-
if (superClass) _set_prototype_of$
|
|
3000
|
+
if (superClass) _set_prototype_of$u(subClass, superClass);
|
|
2977
3001
|
}
|
|
2978
|
-
function _set_prototype_of$
|
|
2979
|
-
_set_prototype_of$
|
|
3002
|
+
function _set_prototype_of$u(o, p) {
|
|
3003
|
+
_set_prototype_of$u = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
2980
3004
|
o.__proto__ = p;
|
|
2981
3005
|
return o;
|
|
2982
3006
|
};
|
|
2983
|
-
return _set_prototype_of$
|
|
3007
|
+
return _set_prototype_of$u(o, p);
|
|
2984
3008
|
}
|
|
2985
3009
|
var VOLUME_DEFAULT_OPTIONS = {
|
|
2986
3010
|
volume: 0.8,
|
|
@@ -2994,12 +3018,12 @@
|
|
|
2994
3018
|
* 音量调节控件
|
|
2995
3019
|
* @category Control
|
|
2996
3020
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
2997
|
-
_inherits$
|
|
3021
|
+
_inherits$r(Volume, Control);
|
|
2998
3022
|
function Volume(options) {
|
|
2999
3023
|
if (options === void 0) options = {};
|
|
3000
3024
|
var _this;
|
|
3001
3025
|
var _this__options_props, _this__options_props1, _this__options_props2, _this__options_props3;
|
|
3002
|
-
_this = Control.call(this, _extends$
|
|
3026
|
+
_this = Control.call(this, _extends$t({}, options, {
|
|
3003
3027
|
tagName: 'span',
|
|
3004
3028
|
classNameSuffix: 'volume',
|
|
3005
3029
|
controlType: 'button'
|
|
@@ -3013,7 +3037,7 @@
|
|
|
3013
3037
|
_this._lastVolume = _this._volume;
|
|
3014
3038
|
_this._muted = !!((_this__options_props3 = _this._options.props) == null ? void 0 : _this__options_props3.muted) || false;
|
|
3015
3039
|
// 轻应用私有暂时不支持调节音量
|
|
3016
|
-
if (!(Utils.isMobile || _this._options.PLAY_TYPE === 'ezopen' || _this._options.PLAY_TYPE === '
|
|
3040
|
+
if (!(Utils.isMobile || _this._options.PLAY_TYPE === 'ezopen' || _this._options.PLAY_TYPE === 'ezhls')) {
|
|
3017
3041
|
var _this__options_props4, _this__options_props5;
|
|
3018
3042
|
_this.picker = new Picker(_this.$container, {
|
|
3019
3043
|
getPopupContainer: function() {
|
|
@@ -3054,8 +3078,9 @@
|
|
|
3054
3078
|
}
|
|
3055
3079
|
_this._updateUI();
|
|
3056
3080
|
_this._addEventListener();
|
|
3057
|
-
_this.on(EVENTS.audioCodecUnsupported, function() {
|
|
3058
|
-
|
|
3081
|
+
_this.on(EVENTS.audioCodecUnsupported, function(flag) {
|
|
3082
|
+
flag = flag != null ? flag : true;
|
|
3083
|
+
_this.disabled = flag;
|
|
3059
3084
|
});
|
|
3060
3085
|
_this.on(EVENTS.volumechange, function(volume, muted) {
|
|
3061
3086
|
// 接收
|
|
@@ -3857,8 +3882,8 @@
|
|
|
3857
3882
|
return Fullscreen;
|
|
3858
3883
|
}();
|
|
3859
3884
|
|
|
3860
|
-
function _extends$
|
|
3861
|
-
_extends$
|
|
3885
|
+
function _extends$s() {
|
|
3886
|
+
_extends$s = Object.assign || function(target) {
|
|
3862
3887
|
for(var i = 1; i < arguments.length; i++){
|
|
3863
3888
|
var source = arguments[i];
|
|
3864
3889
|
for(var key in source){
|
|
@@ -3869,9 +3894,9 @@
|
|
|
3869
3894
|
}
|
|
3870
3895
|
return target;
|
|
3871
3896
|
};
|
|
3872
|
-
return _extends$
|
|
3897
|
+
return _extends$s.apply(this, arguments);
|
|
3873
3898
|
}
|
|
3874
|
-
function _inherits$
|
|
3899
|
+
function _inherits$q(subClass, superClass) {
|
|
3875
3900
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
3876
3901
|
throw new TypeError("Super expression must either be null or a function");
|
|
3877
3902
|
}
|
|
@@ -3882,24 +3907,24 @@
|
|
|
3882
3907
|
configurable: true
|
|
3883
3908
|
}
|
|
3884
3909
|
});
|
|
3885
|
-
if (superClass) _set_prototype_of$
|
|
3910
|
+
if (superClass) _set_prototype_of$t(subClass, superClass);
|
|
3886
3911
|
}
|
|
3887
|
-
function _set_prototype_of$
|
|
3888
|
-
_set_prototype_of$
|
|
3912
|
+
function _set_prototype_of$t(o, p) {
|
|
3913
|
+
_set_prototype_of$t = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3889
3914
|
o.__proto__ = p;
|
|
3890
3915
|
return o;
|
|
3891
3916
|
};
|
|
3892
|
-
return _set_prototype_of$
|
|
3917
|
+
return _set_prototype_of$t(o, p);
|
|
3893
3918
|
}
|
|
3894
3919
|
/**
|
|
3895
3920
|
* 全屏控件
|
|
3896
3921
|
* @category Control
|
|
3897
3922
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
3898
|
-
_inherits$
|
|
3923
|
+
_inherits$q(Fullscreen, Control);
|
|
3899
3924
|
function Fullscreen(options) {
|
|
3900
3925
|
var _this;
|
|
3901
3926
|
var _options_props, _this_options;
|
|
3902
|
-
_this = Control.call(this, _extends$
|
|
3927
|
+
_this = Control.call(this, _extends$s({
|
|
3903
3928
|
tagName: 'span',
|
|
3904
3929
|
classNameSuffix: 'fullscreen',
|
|
3905
3930
|
controlType: 'button'
|
|
@@ -3964,8 +3989,8 @@
|
|
|
3964
3989
|
return Fullscreen;
|
|
3965
3990
|
}(Control);
|
|
3966
3991
|
|
|
3967
|
-
function _extends$
|
|
3968
|
-
_extends$
|
|
3992
|
+
function _extends$r() {
|
|
3993
|
+
_extends$r = Object.assign || function(target) {
|
|
3969
3994
|
for(var i = 1; i < arguments.length; i++){
|
|
3970
3995
|
var source = arguments[i];
|
|
3971
3996
|
for(var key in source){
|
|
@@ -3976,9 +4001,9 @@
|
|
|
3976
4001
|
}
|
|
3977
4002
|
return target;
|
|
3978
4003
|
};
|
|
3979
|
-
return _extends$
|
|
4004
|
+
return _extends$r.apply(this, arguments);
|
|
3980
4005
|
}
|
|
3981
|
-
function _inherits$
|
|
4006
|
+
function _inherits$p(subClass, superClass) {
|
|
3982
4007
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
3983
4008
|
throw new TypeError("Super expression must either be null or a function");
|
|
3984
4009
|
}
|
|
@@ -3989,24 +4014,24 @@
|
|
|
3989
4014
|
configurable: true
|
|
3990
4015
|
}
|
|
3991
4016
|
});
|
|
3992
|
-
if (superClass) _set_prototype_of$
|
|
4017
|
+
if (superClass) _set_prototype_of$s(subClass, superClass);
|
|
3993
4018
|
}
|
|
3994
|
-
function _set_prototype_of$
|
|
3995
|
-
_set_prototype_of$
|
|
4019
|
+
function _set_prototype_of$s(o, p) {
|
|
4020
|
+
_set_prototype_of$s = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3996
4021
|
o.__proto__ = p;
|
|
3997
4022
|
return o;
|
|
3998
4023
|
};
|
|
3999
|
-
return _set_prototype_of$
|
|
4024
|
+
return _set_prototype_of$s(o, p);
|
|
4000
4025
|
}
|
|
4001
4026
|
/**
|
|
4002
4027
|
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
4003
4028
|
* @category Control
|
|
4004
4029
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
4005
|
-
_inherits$
|
|
4030
|
+
_inherits$p(Rec, Control);
|
|
4006
4031
|
function Rec(options) {
|
|
4007
4032
|
var _this;
|
|
4008
4033
|
var _options_props;
|
|
4009
|
-
_this = Control.call(this, _extends$
|
|
4034
|
+
_this = Control.call(this, _extends$r({}, options, {
|
|
4010
4035
|
tagName: 'div',
|
|
4011
4036
|
controlType: 'block',
|
|
4012
4037
|
classNameSuffix: 'rec'
|
|
@@ -4324,6 +4349,12 @@
|
|
|
4324
4349
|
BTN_TALK: '对讲',
|
|
4325
4350
|
BTN_BROADCAST: '语音广播',
|
|
4326
4351
|
BTN_AICHAT: 'AI对话',
|
|
4352
|
+
BTN_LIVE: '直播',
|
|
4353
|
+
BTN_REC_DROPDOWN: '回放',
|
|
4354
|
+
BTN_ALARM_MESSAGE: '消息',
|
|
4355
|
+
REC_DROPDOWN_CLOUD_REC: '云存储',
|
|
4356
|
+
REC_DROPDOWN_CLOUD_RECORD: '云录制',
|
|
4357
|
+
REC_DROPDOWN_LOCAL_REC: '本地回放',
|
|
4327
4358
|
BTN_ZOOM: '电子放大',
|
|
4328
4359
|
BTN_3D_ZOOM: '3D定位',
|
|
4329
4360
|
BTN_PTZ: '云台控制',
|
|
@@ -4596,6 +4627,12 @@
|
|
|
4596
4627
|
BTN_TALK: 'Intercom',
|
|
4597
4628
|
BTN_BROADCAST: 'Voice broadcast',
|
|
4598
4629
|
BTN_AICHAT: 'AI Chat',
|
|
4630
|
+
BTN_LIVE: 'Live',
|
|
4631
|
+
BTN_REC_DROPDOWN: 'Playback',
|
|
4632
|
+
BTN_ALARM_MESSAGE: 'Messages',
|
|
4633
|
+
REC_DROPDOWN_CLOUD_REC: 'Cloud Storage',
|
|
4634
|
+
REC_DROPDOWN_CLOUD_RECORD: 'Cloud Recording',
|
|
4635
|
+
REC_DROPDOWN_LOCAL_REC: 'Local Playback',
|
|
4599
4636
|
BTN_ZOOM: 'Electronic zoom',
|
|
4600
4637
|
BTN_3D_ZOOM: '3D positioning',
|
|
4601
4638
|
BTN_PTZ: 'PTZ control',
|
|
@@ -4785,6 +4822,21 @@
|
|
|
4785
4822
|
iconId: 'deviceName',
|
|
4786
4823
|
part: 'left',
|
|
4787
4824
|
isrender: 1
|
|
4825
|
+
},
|
|
4826
|
+
{
|
|
4827
|
+
iconId: 'live',
|
|
4828
|
+
part: 'right',
|
|
4829
|
+
isrender: 1
|
|
4830
|
+
},
|
|
4831
|
+
{
|
|
4832
|
+
iconId: 'recDropdown',
|
|
4833
|
+
part: 'right',
|
|
4834
|
+
isrender: 1
|
|
4835
|
+
},
|
|
4836
|
+
{
|
|
4837
|
+
iconId: 'alarmMessage',
|
|
4838
|
+
part: 'right',
|
|
4839
|
+
isrender: 1
|
|
4788
4840
|
}
|
|
4789
4841
|
]
|
|
4790
4842
|
},
|
|
@@ -4872,19 +4924,19 @@
|
|
|
4872
4924
|
isrender: 1
|
|
4873
4925
|
},
|
|
4874
4926
|
{
|
|
4875
|
-
iconId: '
|
|
4927
|
+
iconId: 'live',
|
|
4876
4928
|
part: 'right',
|
|
4877
4929
|
defaultActive: 0,
|
|
4878
4930
|
isrender: 1
|
|
4879
4931
|
},
|
|
4880
4932
|
{
|
|
4881
|
-
iconId: '
|
|
4933
|
+
iconId: 'recDropdown',
|
|
4882
4934
|
part: 'right',
|
|
4883
4935
|
defaultActive: 0,
|
|
4884
4936
|
isrender: 1
|
|
4885
4937
|
},
|
|
4886
4938
|
{
|
|
4887
|
-
iconId: '
|
|
4939
|
+
iconId: 'alarmMessage',
|
|
4888
4940
|
part: 'right',
|
|
4889
4941
|
defaultActive: 0,
|
|
4890
4942
|
isrender: 1
|
|
@@ -5287,7 +5339,7 @@
|
|
|
5287
5339
|
voice: voice
|
|
5288
5340
|
};
|
|
5289
5341
|
|
|
5290
|
-
function _inherits$
|
|
5342
|
+
function _inherits$o(subClass, superClass) {
|
|
5291
5343
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
5292
5344
|
throw new TypeError("Super expression must either be null or a function");
|
|
5293
5345
|
}
|
|
@@ -5298,20 +5350,20 @@
|
|
|
5298
5350
|
configurable: true
|
|
5299
5351
|
}
|
|
5300
5352
|
});
|
|
5301
|
-
if (superClass) _set_prototype_of$
|
|
5353
|
+
if (superClass) _set_prototype_of$r(subClass, superClass);
|
|
5302
5354
|
}
|
|
5303
|
-
function _set_prototype_of$
|
|
5304
|
-
_set_prototype_of$
|
|
5355
|
+
function _set_prototype_of$r(o, p) {
|
|
5356
|
+
_set_prototype_of$r = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5305
5357
|
o.__proto__ = p;
|
|
5306
5358
|
return o;
|
|
5307
5359
|
};
|
|
5308
|
-
return _set_prototype_of$
|
|
5360
|
+
return _set_prototype_of$r(o, p);
|
|
5309
5361
|
}
|
|
5310
5362
|
/**
|
|
5311
5363
|
* 截图控件
|
|
5312
5364
|
* @category Content
|
|
5313
5365
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
5314
|
-
_inherits$
|
|
5366
|
+
_inherits$o(Content, EventEmitter);
|
|
5315
5367
|
function Content(options) {
|
|
5316
5368
|
var _this;
|
|
5317
5369
|
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
@@ -5426,8 +5478,8 @@
|
|
|
5426
5478
|
return Content;
|
|
5427
5479
|
}(EventEmitter);
|
|
5428
5480
|
|
|
5429
|
-
function _extends$
|
|
5430
|
-
_extends$
|
|
5481
|
+
function _extends$q() {
|
|
5482
|
+
_extends$q = Object.assign || function(target) {
|
|
5431
5483
|
for(var i = 1; i < arguments.length; i++){
|
|
5432
5484
|
var source = arguments[i];
|
|
5433
5485
|
for(var key in source){
|
|
@@ -5438,9 +5490,9 @@
|
|
|
5438
5490
|
}
|
|
5439
5491
|
return target;
|
|
5440
5492
|
};
|
|
5441
|
-
return _extends$
|
|
5493
|
+
return _extends$q.apply(this, arguments);
|
|
5442
5494
|
}
|
|
5443
|
-
function _inherits$
|
|
5495
|
+
function _inherits$n(subClass, superClass) {
|
|
5444
5496
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
5445
5497
|
throw new TypeError("Super expression must either be null or a function");
|
|
5446
5498
|
}
|
|
@@ -5451,23 +5503,23 @@
|
|
|
5451
5503
|
configurable: true
|
|
5452
5504
|
}
|
|
5453
5505
|
});
|
|
5454
|
-
if (superClass) _set_prototype_of$
|
|
5506
|
+
if (superClass) _set_prototype_of$q(subClass, superClass);
|
|
5455
5507
|
}
|
|
5456
|
-
function _set_prototype_of$
|
|
5457
|
-
_set_prototype_of$
|
|
5508
|
+
function _set_prototype_of$q(o, p) {
|
|
5509
|
+
_set_prototype_of$q = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5458
5510
|
o.__proto__ = p;
|
|
5459
5511
|
return o;
|
|
5460
5512
|
};
|
|
5461
|
-
return _set_prototype_of$
|
|
5513
|
+
return _set_prototype_of$q(o, p);
|
|
5462
5514
|
}
|
|
5463
5515
|
/**
|
|
5464
5516
|
* 更多控件
|
|
5465
5517
|
* @category Control
|
|
5466
5518
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
5467
|
-
_inherits$
|
|
5519
|
+
_inherits$n(More, Control);
|
|
5468
5520
|
function More(options) {
|
|
5469
5521
|
var _this;
|
|
5470
|
-
_this = Control.call(this, _extends$
|
|
5522
|
+
_this = Control.call(this, _extends$q({}, options, {
|
|
5471
5523
|
tagName: 'span',
|
|
5472
5524
|
controlType: 'button',
|
|
5473
5525
|
classNameSuffix: 'more'
|
|
@@ -5577,10 +5629,10 @@
|
|
|
5577
5629
|
* @param theme - Theme
|
|
5578
5630
|
*/ function _themeEventemitter(theme) {
|
|
5579
5631
|
// prettier-ignore
|
|
5580
|
-
theme == null ? void 0 : theme.on(EVENTS.audioCodecUnsupported, function() {
|
|
5632
|
+
theme == null ? void 0 : theme.on(EVENTS.audioCodecUnsupported, function(flag) {
|
|
5581
5633
|
var _theme_controls;
|
|
5582
5634
|
if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.volumeControl) {
|
|
5583
|
-
theme.controls.volumeControl.emit(EVENTS.audioCodecUnsupported);
|
|
5635
|
+
theme.controls.volumeControl.emit(EVENTS.audioCodecUnsupported, flag);
|
|
5584
5636
|
}
|
|
5585
5637
|
});
|
|
5586
5638
|
// 处理信息提示 duration 单位秒
|
|
@@ -5683,6 +5735,15 @@
|
|
|
5683
5735
|
}
|
|
5684
5736
|
});
|
|
5685
5737
|
// =======================================================
|
|
5738
|
+
// 告警消息
|
|
5739
|
+
// =======================================================
|
|
5740
|
+
theme.on(EVENTS.alarmMessageChange, function(active) {
|
|
5741
|
+
var _theme_controls;
|
|
5742
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.alarmMessageControl) {
|
|
5743
|
+
theme.controls.alarmMessageControl._panelOpen = active;
|
|
5744
|
+
}
|
|
5745
|
+
});
|
|
5746
|
+
// =======================================================
|
|
5686
5747
|
// 录制
|
|
5687
5748
|
// =======================================================
|
|
5688
5749
|
theme.on(EVENTS.recordingChange, function(recording) {
|
|
@@ -5778,7 +5839,7 @@
|
|
|
5778
5839
|
*
|
|
5779
5840
|
* @param theme - Theme
|
|
5780
5841
|
*/ function _controlEventemitter(theme) {
|
|
5781
|
-
var _theme_controls, _theme_controls1, _theme_controls2, _theme_controls3, _theme_controls4, _theme_controls5, _theme_controls6, _theme_controls7, _theme_controls8, _theme_controls9, _theme_controls10, _theme_controls11, _theme_controls12, _theme_controls13, _theme_controls14, _theme_controls15, _theme_controls16;
|
|
5842
|
+
var _theme_controls, _theme_controls1, _theme_controls2, _theme_controls3, _theme_controls4, _theme_controls5, _theme_controls6, _theme_controls7, _theme_controls8, _theme_controls9, _theme_controls10, _theme_controls11, _theme_controls12, _theme_controls13, _theme_controls14, _theme_controls15, _theme_controls16, _theme_controls17, _theme_controls18, _theme_controls19, _theme_controls20, _theme_controls21;
|
|
5782
5843
|
// Controls
|
|
5783
5844
|
if (theme._recFooter) {
|
|
5784
5845
|
theme._recFooter.on(EVENTS.theme.recFooterDestroy, function() {
|
|
@@ -5889,8 +5950,50 @@
|
|
|
5889
5950
|
theme.emit(EVENTS.control.aichatDestroy);
|
|
5890
5951
|
});
|
|
5891
5952
|
}
|
|
5953
|
+
// 直播按钮
|
|
5954
|
+
if ((_theme_controls7 = theme.controls) == null ? void 0 : _theme_controls7.liveControl) {
|
|
5955
|
+
theme.controls.liveControl.on(EVENTS.control.liveChange, function() {
|
|
5956
|
+
var _theme_controls;
|
|
5957
|
+
// 直接设置回放下拉控件为非激活状态
|
|
5958
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.recDropdownControl) {
|
|
5959
|
+
theme.controls.recDropdownControl.active = false;
|
|
5960
|
+
}
|
|
5961
|
+
theme.emit(EVENTS.control.liveChange);
|
|
5962
|
+
});
|
|
5963
|
+
}
|
|
5964
|
+
// 回放下拉
|
|
5965
|
+
if ((_theme_controls8 = theme.controls) == null ? void 0 : _theme_controls8.recDropdownControl) {
|
|
5966
|
+
theme.controls.recDropdownControl.on(EVENTS.control.recDropdownChange, function(type) {
|
|
5967
|
+
var _theme_controls;
|
|
5968
|
+
// 直接设置直播控件为非激活状态
|
|
5969
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.liveControl) {
|
|
5970
|
+
theme.controls.liveControl.active = false;
|
|
5971
|
+
}
|
|
5972
|
+
theme.emit(EVENTS.control.recDropdownChange, type);
|
|
5973
|
+
});
|
|
5974
|
+
}
|
|
5975
|
+
// 告警消息
|
|
5976
|
+
if ((_theme_controls9 = theme.controls) == null ? void 0 : _theme_controls9.alarmMessageControl) {
|
|
5977
|
+
theme.controls.alarmMessageControl.on(EVENTS.control.alarmMessageChange, function(active) {
|
|
5978
|
+
theme.emit(EVENTS.control.alarmMessageChange, active);
|
|
5979
|
+
});
|
|
5980
|
+
}
|
|
5981
|
+
// 播放地址切换后同步 Live/RecDropdown 激活状态
|
|
5982
|
+
// changePlayUrl 后 urlInfo 已更新,firstFrameDisplay 表示新地址播放成功
|
|
5983
|
+
if (((_theme_controls10 = theme.controls) == null ? void 0 : _theme_controls10.liveControl) || ((_theme_controls11 = theme.controls) == null ? void 0 : _theme_controls11.recDropdownControl)) {
|
|
5984
|
+
theme.on(EVENTS.firstFrameDisplay, function() {
|
|
5985
|
+
var _theme_controls, _theme_controls1;
|
|
5986
|
+
var urlInfo = theme.urlInfo;
|
|
5987
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.liveControl) {
|
|
5988
|
+
theme.controls.liveControl._syncActiveByUrlInfo(urlInfo);
|
|
5989
|
+
}
|
|
5990
|
+
if ((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1.recDropdownControl) {
|
|
5991
|
+
theme.controls.recDropdownControl._syncActiveByUrlInfo(urlInfo);
|
|
5992
|
+
}
|
|
5993
|
+
});
|
|
5994
|
+
}
|
|
5892
5995
|
// 缩放控件
|
|
5893
|
-
if ((
|
|
5996
|
+
if ((_theme_controls12 = theme.controls) == null ? void 0 : _theme_controls12.zoomControl) {
|
|
5894
5997
|
theme.controls.zoomControl.on(EVENTS.control.zoomChange, function(value, _percent, _range) {
|
|
5895
5998
|
if (theme.zoom !== value) {
|
|
5896
5999
|
theme.zoom = value;
|
|
@@ -5912,7 +6015,7 @@
|
|
|
5912
6015
|
});
|
|
5913
6016
|
}
|
|
5914
6017
|
// 清晰度控件
|
|
5915
|
-
if ((
|
|
6018
|
+
if ((_theme_controls13 = theme.controls) == null ? void 0 : _theme_controls13.definitionControl) {
|
|
5916
6019
|
theme.controls.definitionControl.on(EVENTS.control.definitionPanelOpenChange, function(open, definition, item) {
|
|
5917
6020
|
theme.emit(CLEAR_TIMER_HEADER_FOOTER_ANIMATION, open, definition);
|
|
5918
6021
|
theme.emit(EVENTS.control.definitionPanelOpenChange, open, definition, item);
|
|
@@ -5925,7 +6028,7 @@
|
|
|
5925
6028
|
});
|
|
5926
6029
|
}
|
|
5927
6030
|
// 倍速控件
|
|
5928
|
-
if ((
|
|
6031
|
+
if ((_theme_controls14 = theme.controls) == null ? void 0 : _theme_controls14.speedControl) {
|
|
5929
6032
|
theme.controls.speedControl.on(EVENTS.control.speedPanelOpenChange, function(open, speed, item) {
|
|
5930
6033
|
theme.emit(CLEAR_TIMER_HEADER_FOOTER_ANIMATION, open, speed);
|
|
5931
6034
|
theme.emit(EVENTS.control.speedPanelOpenChange, open, speed, item);
|
|
@@ -5938,7 +6041,7 @@
|
|
|
5938
6041
|
});
|
|
5939
6042
|
}
|
|
5940
6043
|
// 截图控件
|
|
5941
|
-
if ((
|
|
6044
|
+
if ((_theme_controls15 = theme.controls) == null ? void 0 : _theme_controls15.capturePictureControl) {
|
|
5942
6045
|
theme.controls.capturePictureControl.on(EVENTS.control.capturePicture, function(options) {
|
|
5943
6046
|
theme.emit(EVENTS.control.capturePicture, options);
|
|
5944
6047
|
});
|
|
@@ -5947,25 +6050,25 @@
|
|
|
5947
6050
|
});
|
|
5948
6051
|
}
|
|
5949
6052
|
// 全屏控件
|
|
5950
|
-
if ((
|
|
6053
|
+
if ((_theme_controls16 = theme.controls) == null ? void 0 : _theme_controls16.fullscreenControl) {
|
|
5951
6054
|
theme.controls.fullscreenControl.on(EVENTS.control.fullscreenDestroy, function() {
|
|
5952
6055
|
theme.emit(EVENTS.control.fullscreenDestroy);
|
|
5953
6056
|
});
|
|
5954
6057
|
}
|
|
5955
6058
|
// 全局全屏控件
|
|
5956
|
-
if ((
|
|
6059
|
+
if ((_theme_controls17 = theme.controls) == null ? void 0 : _theme_controls17.globalFullscreenControl) {
|
|
5957
6060
|
theme.controls.globalFullscreenControl.on(EVENTS.control.globalFullscreenDestroy, function() {
|
|
5958
6061
|
theme.emit(EVENTS.control.globalFullscreenDestroy);
|
|
5959
6062
|
});
|
|
5960
6063
|
}
|
|
5961
6064
|
// 设备信息控件
|
|
5962
|
-
if ((
|
|
6065
|
+
if ((_theme_controls18 = theme.controls) == null ? void 0 : _theme_controls18.deviceControl) {
|
|
5963
6066
|
theme.controls.deviceControl.on(EVENTS.control.deviceDestroy, function() {
|
|
5964
6067
|
theme.emit(EVENTS.control.deviceDestroy);
|
|
5965
6068
|
});
|
|
5966
6069
|
}
|
|
5967
6070
|
// 回放类型切换控件
|
|
5968
|
-
if ((
|
|
6071
|
+
if ((_theme_controls19 = theme.controls) == null ? void 0 : _theme_controls19.recControl) {
|
|
5969
6072
|
// prettier-ignore
|
|
5970
6073
|
theme.controls.recControl.on(EVENTS.control.recTypeChange, function(type) {
|
|
5971
6074
|
if (theme.recType !== type) {
|
|
@@ -5986,7 +6089,7 @@
|
|
|
5986
6089
|
});
|
|
5987
6090
|
}
|
|
5988
6091
|
// 时间轴控件
|
|
5989
|
-
if ((
|
|
6092
|
+
if ((_theme_controls20 = theme.controls) == null ? void 0 : _theme_controls20.timeLineControl) {
|
|
5990
6093
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineChange, function(date) {
|
|
5991
6094
|
theme.emit(EVENTS.control.timeLineChange, date);
|
|
5992
6095
|
});
|
|
@@ -6003,7 +6106,7 @@
|
|
|
6003
6106
|
});
|
|
6004
6107
|
}
|
|
6005
6108
|
// 日历控件
|
|
6006
|
-
if ((
|
|
6109
|
+
if ((_theme_controls21 = theme.controls) == null ? void 0 : _theme_controls21.dateControl) {
|
|
6007
6110
|
theme.controls.dateControl.on(EVENTS.control.datePanelOpenChange, function(open, date) {
|
|
6008
6111
|
theme.emit(EVENTS.control.datePanelOpenChange, open, date);
|
|
6009
6112
|
});
|
|
@@ -6098,8 +6201,8 @@
|
|
|
6098
6201
|
if (protoProps) _defineProperties$5(Constructor.prototype, protoProps);
|
|
6099
6202
|
return Constructor;
|
|
6100
6203
|
}
|
|
6101
|
-
function _extends$
|
|
6102
|
-
_extends$
|
|
6204
|
+
function _extends$p() {
|
|
6205
|
+
_extends$p = Object.assign || function(target) {
|
|
6103
6206
|
for(var i = 1; i < arguments.length; i++){
|
|
6104
6207
|
var source = arguments[i];
|
|
6105
6208
|
for(var key in source){
|
|
@@ -6110,9 +6213,9 @@
|
|
|
6110
6213
|
}
|
|
6111
6214
|
return target;
|
|
6112
6215
|
};
|
|
6113
|
-
return _extends$
|
|
6216
|
+
return _extends$p.apply(this, arguments);
|
|
6114
6217
|
}
|
|
6115
|
-
function _inherits$
|
|
6218
|
+
function _inherits$m(subClass, superClass) {
|
|
6116
6219
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
6117
6220
|
throw new TypeError("Super expression must either be null or a function");
|
|
6118
6221
|
}
|
|
@@ -6123,14 +6226,14 @@
|
|
|
6123
6226
|
configurable: true
|
|
6124
6227
|
}
|
|
6125
6228
|
});
|
|
6126
|
-
if (superClass) _set_prototype_of$
|
|
6229
|
+
if (superClass) _set_prototype_of$p(subClass, superClass);
|
|
6127
6230
|
}
|
|
6128
|
-
function _set_prototype_of$
|
|
6129
|
-
_set_prototype_of$
|
|
6231
|
+
function _set_prototype_of$p(o, p) {
|
|
6232
|
+
_set_prototype_of$p = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
6130
6233
|
o.__proto__ = p;
|
|
6131
6234
|
return o;
|
|
6132
6235
|
};
|
|
6133
|
-
return _set_prototype_of$
|
|
6236
|
+
return _set_prototype_of$p(o, p);
|
|
6134
6237
|
}
|
|
6135
6238
|
var ZOOM_DEFAULT_OPTIONS = {
|
|
6136
6239
|
open: false,
|
|
@@ -6140,10 +6243,10 @@
|
|
|
6140
6243
|
* 电子放大控件
|
|
6141
6244
|
* @category Control
|
|
6142
6245
|
*/ var Zoom$1 = /*#__PURE__*/ function(Control) {
|
|
6143
|
-
_inherits$
|
|
6246
|
+
_inherits$m(Zoom, Control);
|
|
6144
6247
|
function Zoom(options) {
|
|
6145
6248
|
var _this;
|
|
6146
|
-
_this = Control.call(this, _extends$
|
|
6249
|
+
_this = Control.call(this, _extends$p({}, options, {
|
|
6147
6250
|
tagName: 'span',
|
|
6148
6251
|
controlType: 'button',
|
|
6149
6252
|
classNameSuffix: 'zoom'
|
|
@@ -6278,8 +6381,8 @@
|
|
|
6278
6381
|
*/
|
|
6279
6382
|
function _create_class$a(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var ZOOM_DEFAULT_POSITION=[0,0],DefaultOptions={initialZoom:1,defaultCursor:"pointer",scrollVelocity:.1,animDuration:.25,allowZoom:true,allowPan:true,onChange:function(){},onTranslateChange:function(){},onTap:function(){},max:8,min:1,zoomStep:.1,allowTouchEvents:false,allowWheel:true,ignoredMouseButtons:[],doubleTouchMaxDelay:300,decelerationDuration:750},Zoom=function(){function Zoom(container,options){var _this=this;this._dragging=false,this.destroy=function(){_this.setAllowZoom(false),_this.reset(),_this.removeEventListeners();},this.setTransform=function(trans){_this.transform=trans;},this.getTransform=function(){return _this.transform},this.updateTranslate=function(){var translateX=0,translateY=0;translateX=_this.percentPos[0]<0?_this.percentPos[0]<-0.5*(_this.zoom-1)?-0.5*(_this.zoom-1):_this.percentPos[0]:_this.percentPos[0]>.5*(_this.zoom-1)?.5*(_this.zoom-1):_this.percentPos[0],translateY=_this.percentPos[1]<0?_this.percentPos[1]<-0.5*(_this.zoom-1)?-0.5*(_this.zoom-1):_this.percentPos[1]:_this.percentPos[1]>.5*(_this.zoom-1)?.5*(_this.zoom-1):_this.percentPos[1],_this.percentPos=[translateX,translateY];},this.update=function(){_this.container&&(_this.updateTranslate(),_this.container.style.transition="transform ease-out "+_this.transition+"s",_this.container.style.transform="translate3d("+100*_this.percentPos[0]+"%, "+100*_this.percentPos[1]+"%, 0) scale("+_this.zoom+")");},this.setAllowZoom=function(allow){_this.options.allowZoom=allow;},this.setZoom=function(zoom,reset){zoom=parseFloat(zoom.toFixed(_this.getPrecision(_this.options.zoomStep))),_this.zoom!==zoom&&(_this.zoom=zoom,_this.update(),null==_this.options.onChange||_this.options.onChange.call(_this.options,+_this.zoom.toFixed(_this.getPrecision(_this.options.zoomStep)),reset));},this.getZoom=function(){return _this.zoom},this.setPos=function(pos){var _this_container,_this_container1,containerWidth=null==(_this_container=_this.container)?void 0:_this_container.clientWidth,containerHeight=null==(_this_container1=_this.container)?void 0:_this_container1.clientHeight;+_this.pos[0]===pos[0]&&+_this.pos[1]===pos[1]||(_this.percentPos=[pos[0]/containerWidth,pos[1]/containerHeight],_this.update(),null==_this.options.onTranslateChange||_this.options.onTranslateChange.call(_this.options,{posX:pos[0],posY:pos[1]}));},this.setTransitionDuration=function(duration){_this.transition=duration,_this.update();},this.setCursor=function(cursor){_this.container&&(_this.container.style.cssText+="cursor:"+cursor+";",_this.cursor=cursor);},this.zoomIn=function(value){var _this_options_max,_this_options_max1,newPosX=_this.pos[0],newPosY=_this.pos[1],prevZoom=_this.zoom,newZoom=prevZoom+value<(null!=(_this_options_max=_this.options.max)?_this_options_max:8)?prevZoom+value:null!=(_this_options_max1=_this.options.max)?_this_options_max1:8;newZoom!==prevZoom&&(newPosX=newPosX*(newZoom-1)/(prevZoom>1?prevZoom-1:prevZoom),newPosY=newPosY*(newZoom-1)/(prevZoom>1?prevZoom-1:prevZoom)),_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration);},this.zoomOut=function(value){var _this_options_min,_this_options_min1,newPosX=_this.pos[0],newPosY=_this.pos[1],prevZoom=_this.zoom,newZoom=prevZoom-value>(null!=(_this_options_min=_this.options.min)?_this_options_min:1)?prevZoom-value:null!=(_this_options_min1=_this.options.min)?_this_options_min1:1;newZoom!==prevZoom&&(newPosX=newPosX*(newZoom-1)/(prevZoom-1),newPosY=newPosY*(newZoom-1)/(prevZoom-1)),_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration);},this.zoomToZone=function(relX,relY,relWidth,relHeight){var _this_container;if(_this.container){var _this_options_max,newPosX=_this.pos[0],newPosY=_this.pos[1],parentRect=(null==(_this_container=_this.container)?void 0:_this_container.parentNode).getBoundingClientRect(),prevZoom=_this.zoom,optimalZoomX=parentRect.width/relWidth,optimalZoomY=parentRect.height/relHeight,newZoom=Math.min(optimalZoomX,optimalZoomY,null!=(_this_options_max=_this.options.max)?_this_options_max:8),rect=_this.container.getBoundingClientRect(),_ref=[rect.width/prevZoom/2,rect.height/prevZoom/2],_ref1=[relX+relWidth/2,relY+relHeight/2];newPosX=(_ref[0]-_ref1[0])*newZoom,newPosY=(_ref[1]-_ref1[1])*newZoom,_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration);}},this.getNewPosition=function(x,y,newZoom){var prevZoom=[_this.zoom,_this.pos[0],_this.pos[1]][0];if(1===newZoom||!_this)return ZOOM_DEFAULT_POSITION;var _ref1=[_this.container.clientWidth,_this.container.clientHeight],clientWidth=_ref1[0],clientHeight=_ref1[1];if(newZoom>prevZoom)return [0,0];var w=-(x-clientWidth/2)/(clientWidth/2)*newZoom/2,h=-(y-clientHeight/2)/(clientHeight/2)*newZoom/2;return w>newZoom/2-.5&&(w=3.5),h>newZoom/2-.5&&(h=3.5),[clientWidth*w,clientHeight*h]},this.fullZoomInOnPosition=function(x,y){var _this_options_max,zoom=null!=(_this_options_max=_this.options.max)?_this_options_max:DefaultOptions.max;_this.setZoom(null!=zoom?zoom:DefaultOptions.max),_this.setPos(_this.getNewPosition(x,y,zoom)),_this.setTransitionDuration(_this.options.animDuration);},this.getLimitedShift=function(shift,minLimit,maxLimit,minElement,maxElement){if(shift>0){if(minElement>minLimit)return 0;if(minElement+shift>minLimit)return minLimit-minElement}else if(shift<0){if(maxElement<maxLimit)return 0;if(maxElement+shift<maxLimit)return maxLimit-maxElement}return shift},this.getCursor=function(canMoveOnX,canMoveOnY){return canMoveOnX&&canMoveOnY?"move":canMoveOnX?"ew-resize":canMoveOnY?"ns-resize":"auto"},this.move=function(shiftX,shiftY,transitionDuration){if(void 0===transitionDuration&&(transitionDuration=0),_this.container){var newPosX=_this.pos[0],newPosY=_this.pos[1],rect=_this.container.getBoundingClientRect(),parentRect=_this.container.parentNode.getBoundingClientRect(),shiftHorizontal=_this.transform?shiftY:shiftX,shiftVertical=_this.transform?shiftX:shiftY,_ref=_this.transform?[rect.height>parentRect.bottom-parentRect.top,shiftVertical>0&&rect.top-parentRect.top<0,shiftVertical<0&&rect.bottom-parentRect.bottom>0]:[rect.width>parentRect.right-parentRect.left,shiftHorizontal>0&&rect.left-parentRect.left<0,shiftHorizontal<0&&rect.right-parentRect.right>0],canMoveOnX=_ref[0]||_ref[1]||_ref[2];canMoveOnX&&(_this.transform?newPosX+=_this.getLimitedShift(shiftVertical,parentRect.top,parentRect.bottom,rect.top,rect.bottom):newPosX+=_this.getLimitedShift(shiftHorizontal,parentRect.left,parentRect.right,rect.left,rect.right));var _ref1=_this.transform?[rect.width>parentRect.right-parentRect.left,shiftHorizontal>0&&rect.right-parentRect.right<0,shiftHorizontal<0&&rect.left-parentRect.left>0]:[rect.height>parentRect.bottom-parentRect.top,shiftVertical>0&&rect.top-parentRect.top<0,shiftVertical<0&&rect.bottom-parentRect.bottom>0],canMoveOnY=_ref1[0]||_ref1[1]||_ref1[2];if(canMoveOnY)if(_this.transform){newPosY+=function(shift,minLimit,maxLimit,minElement,maxElement){if(shift>0){if(maxElement<maxLimit+1)return 0;if(maxElement+shift<maxLimit+1)return maxLimit-maxElement}else if(shift<0){if(minElement+1>minLimit)return 0;if(minElement+1+shift>minLimit)return minLimit-minElement}return shift}(shiftHorizontal,parentRect.left,parentRect.right,rect.left,rect.right);}else newPosY+=_this.getLimitedShift(shiftVertical,parentRect.top,parentRect.bottom,rect.top,rect.bottom);var cursor=_this.getCursor(canMoveOnX,canMoveOnY);_this.setPos([newPosX,newPosY]),_this.setCursor(cursor),_this.setTransitionDuration(transitionDuration);}},this.isDoubleTapping=function(){var _this_lastTouchTime,_this_options_doubleTouchMaxDelay,_this_lastDoubleTapTime,_this_options_doubleTouchMaxDelay1,touchTime=(new Date).getTime();return touchTime-(null!=(_this_lastTouchTime=_this.lastTouchTime)?_this_lastTouchTime:0)<(null!=(_this_options_doubleTouchMaxDelay=_this.options.doubleTouchMaxDelay)?_this_options_doubleTouchMaxDelay:300)&&touchTime-(null!=(_this_lastDoubleTapTime=_this.lastDoubleTapTime)?_this_lastDoubleTapTime:0)>(null!=(_this_options_doubleTouchMaxDelay1=_this.options.doubleTouchMaxDelay)?_this_options_doubleTouchMaxDelay1:750)?(_this.lastDoubleTapTime=touchTime,true):(_this.lastTouchTime=touchTime,false)},this.startDeceleration=function(lastShiftOnX,lastShiftOnY){var startTimestamp=null,startDecelerationMove=function(timestamp){null===startTimestamp&&(startTimestamp=timestamp);var _this_options_decelerationDuration,_this_options_decelerationDuration1,_this_options_decelerationDuration2,progress=timestamp-startTimestamp,ratio=((null!=(_this_options_decelerationDuration=_this.options.decelerationDuration)?_this_options_decelerationDuration:750)-progress)/(null!=(_this_options_decelerationDuration1=_this.options.decelerationDuration)?_this_options_decelerationDuration1:750),_ref=[lastShiftOnX*ratio,lastShiftOnY*ratio],shiftX=_ref[0],shiftY=_ref[1];progress<(null!=(_this_options_decelerationDuration2=_this.options.decelerationDuration)?_this_options_decelerationDuration2:750)&&Math.max(Math.abs(shiftX),Math.abs(shiftY))>1?(_this.move(shiftX,shiftY,0),_this.lastRequestAnimationId=requestAnimationFrame(startDecelerationMove)):_this.lastRequestAnimationId=null;};_this.lastRequestAnimationId=requestAnimationFrame(startDecelerationMove);},this.reset=function(){_this.setZoom(_this.options.initialZoom,true),_this.cursor=_this.options.defaultCursor,_this.setTransitionDuration(_this.options.animDuration),_this.setPos(ZOOM_DEFAULT_POSITION);},this.addScale=function(scale){ void 0===scale&&(scale=1),_this.handleZoomAdd(scale);},this.handleZoomAdd=function(scale){if(void 0===scale&&(scale=1),_this.options.allowZoom&&_this.options.allowWheel){var _this_options_max,newZoom=parseFloat((_this.zoom+scale).toFixed(_this.getPrecision(_this.options.zoomStep)));newZoom>(null!=(_this_options_max=_this.options.max)?_this_options_max:8)&&(newZoom=8),_this.setZoom(newZoom),_this.setPos(_this.pos),_this.setTransitionDuration(.05);}},this.subScale=function(scale){ void 0===scale&&(scale=1),_this.handleZoomSub(scale);},this.handleZoomSub=function(scale){if(void 0===scale&&(scale=1),_this.options.allowZoom&&_this.options.allowWheel){var newZoom=parseFloat((_this.zoom-scale).toFixed(_this.getPrecision(_this.options.zoomStep)));newZoom<1&&(newZoom=1),_this.setZoom(newZoom),_this.setPos(_this.pos),_this.setTransitionDuration(.05);}},this.handleMouseWheel=function(event){if(event.preventDefault(),_this.options.allowZoom&&_this.options.allowWheel){var _this_options_max,_this_options_min,velocity=event.deltaY<0?_this.options.scrollVelocity:0-_this.options.scrollVelocity,newZoom=parseFloat(Math.max(Math.min(_this.zoom+velocity,null!=(_this_options_max=_this.options.max)?_this_options_max:8),null!=(_this_options_min=_this.options.min)?_this_options_min:1).toFixed(_this.getPrecision(_this.options.zoomStep)));_this.setZoom(newZoom),_this.setTransitionDuration(.05);}},this.handleMouseStart=function(event){var _this_options_ignoredMouseButtons;event.preventDefault(),_this.options.allowPan&&!(null==(_this_options_ignoredMouseButtons=_this.options.ignoredMouseButtons)?void 0:_this_options_ignoredMouseButtons.includes(event.button))&&(_this._dragging=true,_this.lastRequestAnimationId&&cancelAnimationFrame(_this.lastRequestAnimationId),_this.lastCursor=_this.getCoordinates(event));},this.handleMouseMove=function(event){event.preventDefault(),_this.options.allowPan&&_this.lastCursor&&_this._dragging&&_this._touchOrMouseDrag(event);},this.handleMouseStop=function(event){event.preventDefault(),_this.lastShift&&(_this.startDeceleration(_this.lastShift[0],_this.lastShift[1]),_this.lastShift=null),_this.lastCursor=null,_this.setCursor("auto"),_this._dragging=false;},this.handleTouchStart=function(event){var isThisDoubleTapping=_this.isDoubleTapping();_this.isMultiTouch=event.touches.length,_this.options.allowTouchEvents||event.preventDefault(),_this.lastRequestAnimationId&&cancelAnimationFrame(_this.lastRequestAnimationId);var _this_getCoordinates=_this.getCoordinates(event.touches[0]),posX=_this_getCoordinates[0],posY=_this_getCoordinates[1];if(_this.isMultiTouch>1)_this.lastCursor=[posX,posY];else if(isThisDoubleTapping&&_this.options.allowZoom)if(1===_this.zoom){var _this_container_getBoundingClientRect=_this.container.getBoundingClientRect();_this_container_getBoundingClientRect.top,_this_container_getBoundingClientRect.left;var ref,ref1,x=_this_container_getBoundingClientRect.x,y=_this_container_getBoundingClientRect.y;posX=(ref1=[posX-(x=(ref=_this.transform?[y,x]:[x,y])[0]),posY-(y=ref[1])])[0],posY=ref1[1],_this.fullZoomInOnPosition(posX,posY);}else _this.reset();else _this._tapStartTime=(new Date).getTime(),_this.options.allowPan&&(_this.lastCursor=[posX,posY]);},this.handleTouchMove=function(event){if(_this.options.allowTouchEvents||event.preventDefault(),_this.lastCursor)if(1===_this.isMultiTouch)_this._touchOrMouseDrag(event.touches[0]),_this.lastTouchDistance=null;else if(_this.isMultiTouch>1){var newZoom=_this.zoom,_this_getCoordinates=_this.getCoordinates(event.touches[0]),pos1X=_this_getCoordinates[0],pos1Y=_this_getCoordinates[1],_this_getCoordinates1=_this.getCoordinates(event.touches[1]),pos2X=_this_getCoordinates1[0],pos2Y=_this_getCoordinates1[1],distance=Math.sqrt(Math.pow(pos2X-pos1X,2)+Math.pow(pos2Y-pos1Y,2));if(_this.lastTouchDistance&&distance&&distance!==_this.lastTouchDistance){var _this_options_max,_this_options_min,_this_options_max1;if(_this.options.allowZoom)if((newZoom+=(distance-_this.lastTouchDistance)/100)>(null!=(_this_options_max=_this.options.max)?_this_options_max:8))newZoom=null!=(_this_options_max1=_this.options.max)?_this_options_max1:8;else if(newZoom<(null!=(_this_options_min=_this.options.min)?_this_options_min:1)){var _this_options_min1;newZoom=null!=(_this_options_min1=_this.options.min)?_this_options_min1:1;}_this.setZoom(newZoom),_this.setTransitionDuration(0);}_this.lastCursor=[pos1X,pos1Y],_this.lastTouchDistance=distance;}},this.handleTouchStop=function(){_this.lastShift&&(_this.startDeceleration(_this.lastShift[0],_this.lastShift[1]),_this.lastShift=null),_this._tapStartTime&&(new Date).getTime()-_this._tapStartTime<200&&(null==_this.options.onTap||_this.options.onTap.call(_this.options)),_this._tapStartTime=void 0,_this.lastCursor=null,_this.lastTouchDistance=null,_this.isMultiTouch=0;},this.container=container,this.options=Object.assign({},DefaultOptions,options||{}),this.percentPos=ZOOM_DEFAULT_POSITION,this.transition=this.options.animDuration,this.zoom=1,this.cursor="auto",this.lastCursor=[0,0],this.lastShift=null,this.lastTouchDistance=null,this.lastRequestAnimationId=null,this.lastTouchTime=(new Date).getTime(),this.lastDoubleTapTime=(new Date).getTime(),this.transform=false,this.isMultiTouch=1,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseStart=this.handleMouseStart.bind(this),this.handleMouseStop=this.handleMouseStop.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchStop=this.handleTouchStop.bind(this),this.getZoom=this.getZoom.bind(this),this.setZoom=this.setZoom.bind(this);}var _proto=Zoom.prototype;return _proto.setUpEventListeners=function(){var refCurrentValue=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==refCurrentValue||refCurrentValue.addEventListener("wheel",this.handleMouseWheel,{passive:false})),null==refCurrentValue||refCurrentValue.addEventListener("mousedown",this.handleMouseStart,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mousemove",this.handleMouseMove,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mouseup",this.handleMouseStop,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mouseleave",this.handleMouseStop,{passive:false})):(null==refCurrentValue||refCurrentValue.addEventListener("touchstart",this.handleTouchStart,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchmove",this.handleTouchMove,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchend",this.handleTouchStop,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchcancel",this.handleTouchStop,{passive:false}));},_proto.removeEventListeners=function(){var refCurrentValue=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==refCurrentValue||refCurrentValue.removeEventListener("wheel",this.handleMouseWheel)),null==refCurrentValue||refCurrentValue.removeEventListener("mousedown",this.handleMouseStart),null==refCurrentValue||refCurrentValue.removeEventListener("mousemove",this.handleMouseMove),null==refCurrentValue||refCurrentValue.removeEventListener("mouseup",this.handleMouseStop),null==refCurrentValue||refCurrentValue.removeEventListener("mouseleave",this.handleMouseStop)):(null==refCurrentValue||refCurrentValue.removeEventListener("touchstart",this.handleTouchStart),null==refCurrentValue||refCurrentValue.removeEventListener("touchmove",this.handleTouchMove),null==refCurrentValue||refCurrentValue.removeEventListener("touchend",this.handleTouchStop),null==refCurrentValue||refCurrentValue.removeEventListener("touchcancel",this.handleTouchStop));},_proto.getPrecision=function(value){ void 0===value&&(value=1);var valueStr=value.toString();return valueStr.includes(".")?valueStr.split(".")[1].length:1},_proto.getCoordinates=function(event){var clientHeight=this.container.clientHeight,clientTop=this.container.clientTop,clientLeft=this.container.clientLeft,_ref=this.transform?[event.clientY,clientHeight-event.clientX]:[event.clientX-clientTop,event.clientY-clientLeft];return [_ref[0],_ref[1]]},_proto._touchOrMouseDrag=function(event){if(this.lastCursor){var _this_getCoordinates=this.getCoordinates(event),posX=_this_getCoordinates[0],posY=_this_getCoordinates[1],shiftX=posX-this.lastCursor[0],shiftY=posY-this.lastCursor[1];this.move(shiftX,shiftY,0),this.lastCursor=[posX,posY],this.lastShift=[shiftX,shiftY];}},_create_class$a(Zoom,[{key:"pos",get:function(){return [this.container.clientWidth*this.percentPos[0],this.container.clientHeight*this.percentPos[1]]}}]),Zoom}();Zoom.VERSION="1.0.0-beta.2";
|
|
6280
6383
|
|
|
6281
|
-
function _extends$
|
|
6282
|
-
_extends$
|
|
6384
|
+
function _extends$o() {
|
|
6385
|
+
_extends$o = Object.assign || function(target) {
|
|
6283
6386
|
for(var i = 1; i < arguments.length; i++){
|
|
6284
6387
|
var source = arguments[i];
|
|
6285
6388
|
for(var key in source){
|
|
@@ -6290,10 +6393,10 @@
|
|
|
6290
6393
|
}
|
|
6291
6394
|
return target;
|
|
6292
6395
|
};
|
|
6293
|
-
return _extends$
|
|
6396
|
+
return _extends$o.apply(this, arguments);
|
|
6294
6397
|
}
|
|
6295
6398
|
function __zoom(theme, container, options) {
|
|
6296
|
-
theme.zoomUtil = new Zoom(container, _extends$
|
|
6399
|
+
theme.zoomUtil = new Zoom(container, _extends$o({}, options || {}, {
|
|
6297
6400
|
min: 1,
|
|
6298
6401
|
onChange: function(zoom, reset) {
|
|
6299
6402
|
if (zoom !== theme._zoom) {
|
|
@@ -6518,8 +6621,8 @@
|
|
|
6518
6621
|
});
|
|
6519
6622
|
};
|
|
6520
6623
|
}
|
|
6521
|
-
function _extends$
|
|
6522
|
-
_extends$
|
|
6624
|
+
function _extends$n() {
|
|
6625
|
+
_extends$n = Object.assign || function(target) {
|
|
6523
6626
|
for(var i = 1; i < arguments.length; i++){
|
|
6524
6627
|
var source = arguments[i];
|
|
6525
6628
|
for(var key in source){
|
|
@@ -6530,7 +6633,7 @@
|
|
|
6530
6633
|
}
|
|
6531
6634
|
return target;
|
|
6532
6635
|
};
|
|
6533
|
-
return _extends$
|
|
6636
|
+
return _extends$n.apply(this, arguments);
|
|
6534
6637
|
}
|
|
6535
6638
|
function _ts_generator$6(thisArg, body) {
|
|
6536
6639
|
var f, y, t, _ = {
|
|
@@ -6658,7 +6761,7 @@
|
|
|
6658
6761
|
}
|
|
6659
6762
|
if (item.isrender !== 0 && REC_GROUP.includes(item.iconId)) {
|
|
6660
6763
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
6661
|
-
recControls.push(recControls[0] ? _extends$
|
|
6764
|
+
recControls.push(recControls[0] ? _extends$n({}, item, {
|
|
6662
6765
|
part: recControls[0].part
|
|
6663
6766
|
}) : item);
|
|
6664
6767
|
return false;
|
|
@@ -6681,7 +6784,7 @@
|
|
|
6681
6784
|
}
|
|
6682
6785
|
if (item.isrender !== 0 && REC_GROUP.includes(item.iconId)) {
|
|
6683
6786
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
6684
|
-
recControls.push(recControls[0] ? _extends$
|
|
6787
|
+
recControls.push(recControls[0] ? _extends$n({}, item, {
|
|
6685
6788
|
part: recControls[0].part
|
|
6686
6789
|
}) : item);
|
|
6687
6790
|
return false;
|
|
@@ -6932,8 +7035,8 @@
|
|
|
6932
7035
|
return Component;
|
|
6933
7036
|
}();
|
|
6934
7037
|
|
|
6935
|
-
function _extends$
|
|
6936
|
-
_extends$
|
|
7038
|
+
function _extends$m() {
|
|
7039
|
+
_extends$m = Object.assign || function(target) {
|
|
6937
7040
|
for(var i = 1; i < arguments.length; i++){
|
|
6938
7041
|
var source = arguments[i];
|
|
6939
7042
|
for(var key in source){
|
|
@@ -6944,9 +7047,9 @@
|
|
|
6944
7047
|
}
|
|
6945
7048
|
return target;
|
|
6946
7049
|
};
|
|
6947
|
-
return _extends$
|
|
7050
|
+
return _extends$m.apply(this, arguments);
|
|
6948
7051
|
}
|
|
6949
|
-
function _inherits$
|
|
7052
|
+
function _inherits$l(subClass, superClass) {
|
|
6950
7053
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
6951
7054
|
throw new TypeError("Super expression must either be null or a function");
|
|
6952
7055
|
}
|
|
@@ -6957,28 +7060,28 @@
|
|
|
6957
7060
|
configurable: true
|
|
6958
7061
|
}
|
|
6959
7062
|
});
|
|
6960
|
-
if (superClass) _set_prototype_of$
|
|
7063
|
+
if (superClass) _set_prototype_of$o(subClass, superClass);
|
|
6961
7064
|
}
|
|
6962
|
-
function _set_prototype_of$
|
|
6963
|
-
_set_prototype_of$
|
|
7065
|
+
function _set_prototype_of$o(o, p) {
|
|
7066
|
+
_set_prototype_of$o = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
6964
7067
|
o.__proto__ = p;
|
|
6965
7068
|
return o;
|
|
6966
7069
|
};
|
|
6967
|
-
return _set_prototype_of$
|
|
7070
|
+
return _set_prototype_of$o(o, p);
|
|
6968
7071
|
}
|
|
6969
7072
|
var Footer = /*#__PURE__*/ function(Component) {
|
|
6970
|
-
_inherits$
|
|
7073
|
+
_inherits$l(Footer, Component);
|
|
6971
7074
|
function Footer(options) {
|
|
6972
7075
|
if (options === void 0) options = {};
|
|
6973
|
-
return Component.call(this, _extends$
|
|
7076
|
+
return Component.call(this, _extends$m({}, options, {
|
|
6974
7077
|
cType: 'footer'
|
|
6975
7078
|
})) || this;
|
|
6976
7079
|
}
|
|
6977
7080
|
return Footer;
|
|
6978
7081
|
}(Component);
|
|
6979
7082
|
|
|
6980
|
-
function _extends$
|
|
6981
|
-
_extends$
|
|
7083
|
+
function _extends$l() {
|
|
7084
|
+
_extends$l = Object.assign || function(target) {
|
|
6982
7085
|
for(var i = 1; i < arguments.length; i++){
|
|
6983
7086
|
var source = arguments[i];
|
|
6984
7087
|
for(var key in source){
|
|
@@ -6989,9 +7092,9 @@
|
|
|
6989
7092
|
}
|
|
6990
7093
|
return target;
|
|
6991
7094
|
};
|
|
6992
|
-
return _extends$
|
|
7095
|
+
return _extends$l.apply(this, arguments);
|
|
6993
7096
|
}
|
|
6994
|
-
function _inherits$
|
|
7097
|
+
function _inherits$k(subClass, superClass) {
|
|
6995
7098
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
6996
7099
|
throw new TypeError("Super expression must either be null or a function");
|
|
6997
7100
|
}
|
|
@@ -7002,20 +7105,20 @@
|
|
|
7002
7105
|
configurable: true
|
|
7003
7106
|
}
|
|
7004
7107
|
});
|
|
7005
|
-
if (superClass) _set_prototype_of$
|
|
7108
|
+
if (superClass) _set_prototype_of$n(subClass, superClass);
|
|
7006
7109
|
}
|
|
7007
|
-
function _set_prototype_of$
|
|
7008
|
-
_set_prototype_of$
|
|
7110
|
+
function _set_prototype_of$n(o, p) {
|
|
7111
|
+
_set_prototype_of$n = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7009
7112
|
o.__proto__ = p;
|
|
7010
7113
|
return o;
|
|
7011
7114
|
};
|
|
7012
|
-
return _set_prototype_of$
|
|
7115
|
+
return _set_prototype_of$n(o, p);
|
|
7013
7116
|
}
|
|
7014
7117
|
var Header$1 = /*#__PURE__*/ function(Component) {
|
|
7015
|
-
_inherits$
|
|
7118
|
+
_inherits$k(Header, Component);
|
|
7016
7119
|
function Header(options) {
|
|
7017
7120
|
if (options === void 0) options = {};
|
|
7018
|
-
return Component.call(this, _extends$
|
|
7121
|
+
return Component.call(this, _extends$l({}, options, {
|
|
7019
7122
|
cType: 'header'
|
|
7020
7123
|
})) || this;
|
|
7021
7124
|
}
|
|
@@ -7181,8 +7284,8 @@
|
|
|
7181
7284
|
};
|
|
7182
7285
|
}
|
|
7183
7286
|
|
|
7184
|
-
function _extends$
|
|
7185
|
-
_extends$
|
|
7287
|
+
function _extends$k() {
|
|
7288
|
+
_extends$k = Object.assign || function(target) {
|
|
7186
7289
|
for(var i = 1; i < arguments.length; i++){
|
|
7187
7290
|
var source = arguments[i];
|
|
7188
7291
|
for(var key in source){
|
|
@@ -7193,9 +7296,9 @@
|
|
|
7193
7296
|
}
|
|
7194
7297
|
return target;
|
|
7195
7298
|
};
|
|
7196
|
-
return _extends$
|
|
7299
|
+
return _extends$k.apply(this, arguments);
|
|
7197
7300
|
}
|
|
7198
|
-
function _inherits$
|
|
7301
|
+
function _inherits$j(subClass, superClass) {
|
|
7199
7302
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7200
7303
|
throw new TypeError("Super expression must either be null or a function");
|
|
7201
7304
|
}
|
|
@@ -7206,23 +7309,23 @@
|
|
|
7206
7309
|
configurable: true
|
|
7207
7310
|
}
|
|
7208
7311
|
});
|
|
7209
|
-
if (superClass) _set_prototype_of$
|
|
7312
|
+
if (superClass) _set_prototype_of$m(subClass, superClass);
|
|
7210
7313
|
}
|
|
7211
|
-
function _set_prototype_of$
|
|
7212
|
-
_set_prototype_of$
|
|
7314
|
+
function _set_prototype_of$m(o, p) {
|
|
7315
|
+
_set_prototype_of$m = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7213
7316
|
o.__proto__ = p;
|
|
7214
7317
|
return o;
|
|
7215
7318
|
};
|
|
7216
|
-
return _set_prototype_of$
|
|
7319
|
+
return _set_prototype_of$m(o, p);
|
|
7217
7320
|
}
|
|
7218
7321
|
/**
|
|
7219
7322
|
* 全局全屏
|
|
7220
7323
|
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
7221
7324
|
* @category Control
|
|
7222
7325
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
7223
|
-
_inherits$
|
|
7326
|
+
_inherits$j(GlobalFullscreen, Fullscreen);
|
|
7224
7327
|
function GlobalFullscreen(options) {
|
|
7225
|
-
return Fullscreen.call(this, _extends$
|
|
7328
|
+
return Fullscreen.call(this, _extends$k({}, options, {
|
|
7226
7329
|
controlType: 'button',
|
|
7227
7330
|
classNameSuffix: 'global-fullscreen'
|
|
7228
7331
|
})) || this;
|
|
@@ -7253,8 +7356,8 @@
|
|
|
7253
7356
|
return GlobalFullscreen;
|
|
7254
7357
|
}(Fullscreen);
|
|
7255
7358
|
|
|
7256
|
-
function _extends$
|
|
7257
|
-
_extends$
|
|
7359
|
+
function _extends$j() {
|
|
7360
|
+
_extends$j = Object.assign || function(target) {
|
|
7258
7361
|
for(var i = 1; i < arguments.length; i++){
|
|
7259
7362
|
var source = arguments[i];
|
|
7260
7363
|
for(var key in source){
|
|
@@ -7265,9 +7368,9 @@
|
|
|
7265
7368
|
}
|
|
7266
7369
|
return target;
|
|
7267
7370
|
};
|
|
7268
|
-
return _extends$
|
|
7371
|
+
return _extends$j.apply(this, arguments);
|
|
7269
7372
|
}
|
|
7270
|
-
function _inherits$
|
|
7373
|
+
function _inherits$i(subClass, superClass) {
|
|
7271
7374
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7272
7375
|
throw new TypeError("Super expression must either be null or a function");
|
|
7273
7376
|
}
|
|
@@ -7278,23 +7381,23 @@
|
|
|
7278
7381
|
configurable: true
|
|
7279
7382
|
}
|
|
7280
7383
|
});
|
|
7281
|
-
if (superClass) _set_prototype_of$
|
|
7384
|
+
if (superClass) _set_prototype_of$l(subClass, superClass);
|
|
7282
7385
|
}
|
|
7283
|
-
function _set_prototype_of$
|
|
7284
|
-
_set_prototype_of$
|
|
7386
|
+
function _set_prototype_of$l(o, p) {
|
|
7387
|
+
_set_prototype_of$l = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7285
7388
|
o.__proto__ = p;
|
|
7286
7389
|
return o;
|
|
7287
7390
|
};
|
|
7288
|
-
return _set_prototype_of$
|
|
7391
|
+
return _set_prototype_of$l(o, p);
|
|
7289
7392
|
}
|
|
7290
7393
|
/**
|
|
7291
7394
|
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
7292
7395
|
* @category Control
|
|
7293
7396
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
7294
|
-
_inherits$
|
|
7397
|
+
_inherits$i(CapturePicture, Control);
|
|
7295
7398
|
function CapturePicture(options) {
|
|
7296
7399
|
var _this;
|
|
7297
|
-
_this = Control.call(this, _extends$
|
|
7400
|
+
_this = Control.call(this, _extends$j({}, options, {
|
|
7298
7401
|
tagName: 'span',
|
|
7299
7402
|
classNameSuffix: 'capture-picture'
|
|
7300
7403
|
})) || this, _this._timer = null;
|
|
@@ -7352,7 +7455,7 @@
|
|
|
7352
7455
|
* Copyright (c) 2026-05-04 Ezviz-OpenBiz
|
|
7353
7456
|
* Released under the MIT License.
|
|
7354
7457
|
*/
|
|
7355
|
-
var PTZ_DEFAULT_OPTIONS={language:"zh",env:{domain:"https://open.ys7.com"},accessToken:"",speed:2,locales:{zh:{GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距"},en:{GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length"}}},PTZ_SPEED={1:1,2:3,3:7,slow:1,mid:3,fast:7},BasePtz=function(){function BasePtz(container,options){var _this_options_locales,_this_options_locales1,_this_options_locales2;if(void 0===options&&(options={}),!container)throw new Error("Ptz container is required");(this.options=deepmerge(PTZ_DEFAULT_OPTIONS,options,{clone:false}),null==(_this_options_locales=this.options.locales)?void 0:_this_options_locales[this.options.language])?this.locale=null==(_this_options_locales1=this.options.locales)?void 0:_this_options_locales1[this.options.language]:this.locale=null==(_this_options_locales2=this.options.locales)?void 0:_this_options_locales2.zh;this.$container=container,this.speed=PTZ_SPEED[this.options.speed||2];}var _proto=BasePtz.prototype;return _proto.updateOptions=function(options){this.options=deepmerge(this.options,options,{clone:false});},_proto.destroy=function(){},BasePtz}();function _set_prototype_of$1$3(o,p){return _set_prototype_of$1$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$3(o,p)}var MobilePtz=function(BasePtz){function MobilePtz(container,options){var _this;return (_this=BasePtz.call(this,container,options)||this)._touchstart=_this._touchstart.bind(_this),_this._touchend=_this._touchend.bind(_this),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1$3(subClass,superClass);}(MobilePtz,BasePtz);var _proto=MobilePtz.prototype;return _proto.destroy=function(){this._removeEventListener(),this.$content&&(this.$content.remove(),this.$content=null),BasePtz.prototype.destroy.call(this);},_proto._render=function(){this.$content=document.createElement("div"),this.$content.classList.add("ez-mobile-ptz-content"),this.$content.innerHTML='\n <div class="ez-mobile-ptz-wrap">\n <div class="ez-mobile-ptz-container">\n <div class="ez-mobile-ptz-center ez-mobile-ptz-center"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-top ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-left ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-bottom ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-right ez-mobile-ptz-default"></div>\n </div>\n </div>\n ',this.$container.appendChild(this.$content),this._addEventListener();},_proto._addEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.addEventListener(touchstart,this._touchstart),$warp.addEventListener(touchend,this._touchend));},_proto._touchstart=function(e){e.preventDefault(),this._handlePtzTouch(e,"start");},_proto._touchend=function(e){e.preventDefault(),this._handlePtzTouch(e,"stop");},_proto._removeEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.removeEventListener(touchstart,this._touchstart),$warp.removeEventListener(touchend,this._touchend));},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_e_changedTouches_,_e_changedTouches_1,_this_options_env,_this_options_token_deviceToken1,_this_options_token1;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");var _this_options_env1,$warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),rect=$warp.getBoundingClientRect(),containerCenterX=rect.left+130,containerCenterY=rect.top+130,left=(e.x||(null==(_e_changedTouches_=e.changedTouches[0])?void 0:_e_changedTouches_.clientX))-containerCenterX,top=(e.y||(null==(_e_changedTouches_1=e.changedTouches[0])?void 0:_e_changedTouches_1.clientY))-containerCenterY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),$icons=$warp.querySelectorAll(".ez-mobile-ptz-icon");(Math.abs(left)>Math.abs(top)?left>0?(direction=3,$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=2,$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):top>0?(direction=1,$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=0,$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")),$warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop",$warp.style.cssText="",$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"));var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{direction:direction,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed","1"),data.append("direction",direction+""),data.append("accessToken",token),fetch(url,{method:"POST",body:data}).then(function(response){return response.json()}).then(function(rt){200===rt.code||[60005,60002,60003,60004].includes(+rt.code)&&($warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"),null==operationResultCb||operationResultCb(rt);}).catch(function(err){}).finally(function(){operationResultCb=null;});},MobilePtz}(BasePtz);function asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value;}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw);}function _async_to_generator$5(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"throw",err);}_next(void 0);})}}function _create_class$9(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$h(o,p){return _set_prototype_of$h=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$h(o,p)}function _ts_generator$5(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_);}catch(e){op=[6,e],y=0;}finally{f=t=0;}if(5&op[0])throw op[1];return {value:op[0]?op[1]:void 0,done:true}}([n,v])}}}var Ptz$1=function(BasePtz){function Ptz(container,options){var _this;return void 0===options&&(options={}),(_this=BasePtz.call(this,container,options)||this)._isMobile=distExports$4.isMobile(),_this._isRotate=false,_this._clearTimer=null,_this._$wrapper=document.createElement("div"),_this._$wrapper.className="ez-ptz-container-wrap",_this._$directionCircleContainer=document.createElement("div"),_this._$directionCircleContainer.classList.add("ez-ptz-container"),_this._$directionCircleContainer.innerHTML='\n <div class="ez-ptz-main ez-ptz-direction-center"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top" data-direction="0"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top-left" data-direction="4"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left" data-direction="2"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left-bottom" data-direction="5"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom" data-direction="1"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom-right" data-direction="7"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right" data-direction="3"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right-top" data-direction="6"></div>\n ',_this._$wrapper.appendChild(_this._$directionCircleContainer),_this._$speedContainer=document.createElement("div"),_this._$speedContainer.classList.add("ez-ptz-speed-container"),_this._$speedContainer.innerHTML='\n <div class="ez-ptz-speed-progress" title="'+_this.locale.PTZ_SPEED+'">\n <div class="ez-ptz-speed-progress-line">\n <div class="ez-ptz-speed-progress-line-dot '+(1===_this.speed?"ez-ptz-speed-active":"")+'" data-id="slow" data-index="1" data-value="1"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(3===_this.speed?"ez-ptz-speed-active":"")+'" data-id="mid" data-index="2" data-value="3"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(7===_this.speed?"ez-ptz-speed-active":"")+'" data-id="fast" data-index="3" data-value="7"></div>\n </div>\n <div class="ez-ptz-speed-progress-points">\n <div class="ez-ptz-speed-progress-points-slow">\n '+_this.locale.PTZ_SLOW+'\n </div>\n <div class="ez-ptz-speed-progress-points-mid">\n '+_this.locale.PTZ_MID+'\n </div>\n <div class="ez-ptz-speed-progress-points-fast">\n '+_this.locale.PTZ_FAST+"\n </div>\n </div>\n </div>\n ",_this._$wrapper.appendChild(_this._$speedContainer),_this._$btnContainer=document.createElement("div"),_this._$btnContainer.classList.add("ez-ptz-btn-container"),_this._$btnContainer.innerHTML='\n <div class="ez-ptz-btn-zoom" title="'+_this.locale.DEVICE_ZOOM+'" style="user-select: none;">\n <div class="ez-ptz-btn-zoom-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" fill="#ffffff"></path>\n <path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#ffffff">\n </path>\n <path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-zoom-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" fill="#ffffff"></path>\n <path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n <div class="ez-ptz-btn-focal" title="'+_this.locale.DEVICE_FOCUS+'" style="user-select: none;">\n <div class="ez-ptz-btn-focal-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" fill="#ffffff"></path>\n <path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-focal-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" fill="#ffffff"></path>\n <path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n ',_this._$wrapper.appendChild(_this._$btnContainer),container.appendChild(_this._$wrapper),_this._$directionCircleContainer.onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start");},_this._$directionCircleContainer.onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop");},_this._$directionCircleContainer.ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start");},_this._$directionCircleContainer.ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop");},_this._onSwitchSpeed=function(e){var list=Array.from(_this._$speedContainer.querySelectorAll(".ez-ptz-speed-progress-line-dot"));if(list.includes(e.target)&&!e.target.classList.contains("ez-ptz-speed-active")){list.forEach(function(item){item===e.target?item.classList.add("ez-ptz-speed-active"):item.classList.remove("ez-ptz-speed-active");});var value=e.target.getAttribute("data-value"),index=e.target.getAttribute("data-index");_this.speed=+value,null==_this.options.onSpeedChange||_this.options.onSpeedChange.call(_this.options,+index);}},_this._$speedContainer.onmouseup=_this._onSwitchSpeed,_this._isMobile&&(_this._$speedContainer.ontouchend=_this._onSwitchSpeed),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop");}),_this._isMobile&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop");})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$h(subClass,superClass);}(Ptz,BasePtz);var _proto=Ptz.prototype;return _proto.destroy=function(){this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer&&(this._$directionCircleContainer.remove(),this._$directionCircleContainer=null),this._$speedContainer&&(this._onSwitchSpeed=null,this._$speedContainer.remove(),this._$speedContainer=null),this._$btnContainer&&(this._$btnContainer.remove(),this._$btnContainer=null),this._$wrapper&&(this._$wrapper.remove(),this._$wrapper=null),BasePtz.prototype.destroy.call(this);},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_this_options_env,_this_options_token_deviceToken1,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzQueue||(this._ptzQueue=Promise.resolve());var container=this._$directionCircleContainer.getBoundingClientRect(),containerCenterX=container.left+(this._$directionCircleContainer.clientWidth+2)/2,containerCenterY=container.top+(this._$directionCircleContainer.clientHeight+2)/2,eventX=e.x||e.changedTouches[0].clientX,eventY=e.y||e.changedTouches[0].clientY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),backDeg=0;function getAreaId(x,y){var rad=Math.atan2(y,x);rad<0&&(rad+=2*Math.PI);var deg=rad*(180/Math.PI)-225-12.5;return deg<0&&(deg+=360),Math.floor(deg/45)+1}var _this_options_env1,left=eventX-containerCenterX,top=eventY-containerCenterY;if(this.isRotate)switch(getAreaId(left,top)){case 1:direction=2,backDeg=90;break;case 2:direction=4,backDeg=135;break;case 3:direction=0,backDeg=180;break;case 4:direction=6,backDeg=225;break;case 5:direction=3,backDeg=270;break;case 6:direction=7,backDeg=315;break;case 7:direction=1,backDeg=0;break;case 8:direction=5,backDeg=45;}else switch(getAreaId(left,top)){case 1:direction=0,backDeg=180;break;case 2:direction=6,backDeg=225;break;case 3:direction=3,backDeg=270;break;case 4:direction=7,backDeg=315;break;case 5:direction=1,backDeg=0;break;case 6:direction=5,backDeg=45;break;case 7:direction=2,backDeg=90;break;case 8:direction=4,backDeg=135;}(this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer.style.cssText="start"===type?"background-image:linear-gradient("+backDeg+"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)":"","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{areaId:getAreaId(left,top),direction:direction,backDeg:backDeg,isRotate:this.isRotate,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzQueue=this._ptzQueue.then(function(){return _async_to_generator$5(function(){var _this;return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return _this=this,[4,fetch(url,{method:"POST",body:data}).then(function(response){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,response.json()];case 1:return [2,_state.sent()]}})})()}).then(function(rt){var _rt_result;null==operationResultCb||operationResultCb(rt);var code=rt.code||(null==rt||null==(_rt_result=rt.result)?void 0:_rt_result.code);return [6e4,60001,60002,60003,60004,60005,60006,10002].includes(+code)&&(_this._$directionCircleContainer.style.cssText="background-image:linear-gradient("+backDeg+"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"),rt}).catch(function(err){}).finally(function(){operationResultCb=null,"stop"===type&&(_this._clearTimer=setTimeout(function(){_this._$directionCircleContainer.style.cssText="";},1e3));})];case 1:return [2,_state.sent()]}})}).call(_this)}),"stop"===type&&(this._ptzQueue=this._ptzQueue.finally(function(){}));},_proto._handleBtnTouch=function(btn,option,type){var _this_options_token,_this_options_env,_this_options_token_deviceToken,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)?void 0:_this_options_token.deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzOperation||(this._ptzOperation=Promise.resolve());var direction=8;direction="zoom"===btn?"add"===option?8:9:"add"===option?10:11;var _this_options_env1,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken.video);"stop"===type&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{btn:btn,option:option,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzOperation=this._ptzOperation.then(function(){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,fetch(url,{method:"POST",body:data}).then(function(response){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,response.json()];case 1:return [2,_state.sent()]}})})()}).then(function(rt){return null==operationResultCb||operationResultCb(rt),rt}).catch(function(err){}).finally(function(){operationResultCb=null;})];case 1:return [2,_state.sent()]}})})()}),"stop"===type&&(this._ptzOperation=this._ptzOperation.finally(function(){_this._ptzOperation=null;}));},_create_class$9(Ptz,[{key:"isRotate",get:function(){return this._isRotate},set:function(isRotate){this._isRotate=isRotate;}}]),Ptz}(BasePtz);
|
|
7458
|
+
var PTZ_DEFAULT_OPTIONS={language:"zh",env:{domain:"https://open.ys7.com"},accessToken:"",speed:2,locales:{zh:{GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距"},en:{GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length"}}},PTZ_SPEED={1:1,2:3,3:7,slow:1,mid:3,fast:7},BasePtz=function(){function BasePtz(container,options){var _this_options_locales,_this_options_locales1,_this_options_locales2;if(void 0===options&&(options={}),!container)throw new Error("Ptz container is required");(this.options=deepmerge(PTZ_DEFAULT_OPTIONS,options,{clone:false}),null==(_this_options_locales=this.options.locales)?void 0:_this_options_locales[this.options.language])?this.locale=null==(_this_options_locales1=this.options.locales)?void 0:_this_options_locales1[this.options.language]:this.locale=null==(_this_options_locales2=this.options.locales)?void 0:_this_options_locales2.zh;this.$container=container,this.speed=PTZ_SPEED[this.options.speed||2];}var _proto=BasePtz.prototype;return _proto.updateOptions=function(options){this.options=deepmerge(this.options,options,{clone:false});},_proto.destroy=function(){},BasePtz}();function _set_prototype_of$1$3(o,p){return _set_prototype_of$1$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$3(o,p)}var MobilePtz=function(BasePtz){function MobilePtz(container,options){var _this;return (_this=BasePtz.call(this,container,options)||this)._touchstart=_this._touchstart.bind(_this),_this._touchend=_this._touchend.bind(_this),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1$3(subClass,superClass);}(MobilePtz,BasePtz);var _proto=MobilePtz.prototype;return _proto.destroy=function(){this._removeEventListener(),this.$content&&(this.$content.remove(),this.$content=null),BasePtz.prototype.destroy.call(this);},_proto._render=function(){this.$content=document.createElement("div"),this.$content.classList.add("ez-mobile-ptz-content"),this.$content.innerHTML='\n <div class="ez-mobile-ptz-wrap">\n <div class="ez-mobile-ptz-container">\n <div class="ez-mobile-ptz-center ez-mobile-ptz-center"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-top ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-left ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-bottom ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-right ez-mobile-ptz-default"></div>\n </div>\n </div>\n ',this.$container.appendChild(this.$content),this._addEventListener();},_proto._addEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.addEventListener(touchstart,this._touchstart),$warp.addEventListener(touchend,this._touchend));},_proto._touchstart=function(e){e.preventDefault(),this._handlePtzTouch(e,"start");},_proto._touchend=function(e){e.preventDefault(),this._handlePtzTouch(e,"stop");},_proto._removeEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.removeEventListener(touchstart,this._touchstart),$warp.removeEventListener(touchend,this._touchend));},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_e_changedTouches_,_e_changedTouches_1,_this_options_env,_this_options_token_deviceToken1,_this_options_token1;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");var _this_options_env1,$warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),rect=$warp.getBoundingClientRect(),containerCenterX=rect.left+130,containerCenterY=rect.top+130,left=(e.x||(null==(_e_changedTouches_=e.changedTouches[0])?void 0:_e_changedTouches_.clientX))-containerCenterX,top=(e.y||(null==(_e_changedTouches_1=e.changedTouches[0])?void 0:_e_changedTouches_1.clientY))-containerCenterY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),$icons=$warp.querySelectorAll(".ez-mobile-ptz-icon");(Math.abs(left)>Math.abs(top)?left>0?(direction=3,$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=2,$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):top>0?(direction=1,$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=0,$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")),$warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop",$warp.style.cssText="",$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"));var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{direction:direction,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed","1"),data.append("direction",direction+""),data.append("accessToken",token),fetch(url,{method:"POST",body:data}).then(function(response){return response.json()}).then(function(rt){200===rt.code||[60005,60002,60003,60004].includes(+rt.code)&&($warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"),null==operationResultCb||operationResultCb(rt);}).catch(function(err){}).finally(function(){operationResultCb=null;});},MobilePtz}(BasePtz);function asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value;}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw);}function _async_to_generator$5(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"throw",err);}_next(void 0);})}}function _create_class$9(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$k(o,p){return _set_prototype_of$k=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$k(o,p)}function _ts_generator$5(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_);}catch(e){op=[6,e],y=0;}finally{f=t=0;}if(5&op[0])throw op[1];return {value:op[0]?op[1]:void 0,done:true}}([n,v])}}}var Ptz$1=function(BasePtz){function Ptz(container,options){var _this;return void 0===options&&(options={}),(_this=BasePtz.call(this,container,options)||this)._isMobile=distExports$4.isMobile(),_this._isRotate=false,_this._clearTimer=null,_this._$wrapper=document.createElement("div"),_this._$wrapper.className="ez-ptz-container-wrap",_this._$directionCircleContainer=document.createElement("div"),_this._$directionCircleContainer.classList.add("ez-ptz-container"),_this._$directionCircleContainer.innerHTML='\n <div class="ez-ptz-main ez-ptz-direction-center"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top" data-direction="0"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top-left" data-direction="4"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left" data-direction="2"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left-bottom" data-direction="5"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom" data-direction="1"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom-right" data-direction="7"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right" data-direction="3"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right-top" data-direction="6"></div>\n ',_this._$wrapper.appendChild(_this._$directionCircleContainer),_this._$speedContainer=document.createElement("div"),_this._$speedContainer.classList.add("ez-ptz-speed-container"),_this._$speedContainer.innerHTML='\n <div class="ez-ptz-speed-progress" title="'+_this.locale.PTZ_SPEED+'">\n <div class="ez-ptz-speed-progress-line">\n <div class="ez-ptz-speed-progress-line-dot '+(1===_this.speed?"ez-ptz-speed-active":"")+'" data-id="slow" data-index="1" data-value="1"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(3===_this.speed?"ez-ptz-speed-active":"")+'" data-id="mid" data-index="2" data-value="3"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(7===_this.speed?"ez-ptz-speed-active":"")+'" data-id="fast" data-index="3" data-value="7"></div>\n </div>\n <div class="ez-ptz-speed-progress-points">\n <div class="ez-ptz-speed-progress-points-slow">\n '+_this.locale.PTZ_SLOW+'\n </div>\n <div class="ez-ptz-speed-progress-points-mid">\n '+_this.locale.PTZ_MID+'\n </div>\n <div class="ez-ptz-speed-progress-points-fast">\n '+_this.locale.PTZ_FAST+"\n </div>\n </div>\n </div>\n ",_this._$wrapper.appendChild(_this._$speedContainer),_this._$btnContainer=document.createElement("div"),_this._$btnContainer.classList.add("ez-ptz-btn-container"),_this._$btnContainer.innerHTML='\n <div class="ez-ptz-btn-zoom" title="'+_this.locale.DEVICE_ZOOM+'" style="user-select: none;">\n <div class="ez-ptz-btn-zoom-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" fill="#ffffff"></path>\n <path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#ffffff">\n </path>\n <path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-zoom-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" fill="#ffffff"></path>\n <path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n <div class="ez-ptz-btn-focal" title="'+_this.locale.DEVICE_FOCUS+'" style="user-select: none;">\n <div class="ez-ptz-btn-focal-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" fill="#ffffff"></path>\n <path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-focal-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" fill="#ffffff"></path>\n <path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n ',_this._$wrapper.appendChild(_this._$btnContainer),container.appendChild(_this._$wrapper),_this._$directionCircleContainer.onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start");},_this._$directionCircleContainer.onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop");},_this._$directionCircleContainer.ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start");},_this._$directionCircleContainer.ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop");},_this._onSwitchSpeed=function(e){var list=Array.from(_this._$speedContainer.querySelectorAll(".ez-ptz-speed-progress-line-dot"));if(list.includes(e.target)&&!e.target.classList.contains("ez-ptz-speed-active")){list.forEach(function(item){item===e.target?item.classList.add("ez-ptz-speed-active"):item.classList.remove("ez-ptz-speed-active");});var value=e.target.getAttribute("data-value"),index=e.target.getAttribute("data-index");_this.speed=+value,null==_this.options.onSpeedChange||_this.options.onSpeedChange.call(_this.options,+index);}},_this._$speedContainer.onmouseup=_this._onSwitchSpeed,_this._isMobile&&(_this._$speedContainer.ontouchend=_this._onSwitchSpeed),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop");}),_this._isMobile&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop");})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$k(subClass,superClass);}(Ptz,BasePtz);var _proto=Ptz.prototype;return _proto.destroy=function(){this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer&&(this._$directionCircleContainer.remove(),this._$directionCircleContainer=null),this._$speedContainer&&(this._onSwitchSpeed=null,this._$speedContainer.remove(),this._$speedContainer=null),this._$btnContainer&&(this._$btnContainer.remove(),this._$btnContainer=null),this._$wrapper&&(this._$wrapper.remove(),this._$wrapper=null),BasePtz.prototype.destroy.call(this);},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_this_options_env,_this_options_token_deviceToken1,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzQueue||(this._ptzQueue=Promise.resolve());var container=this._$directionCircleContainer.getBoundingClientRect(),containerCenterX=container.left+(this._$directionCircleContainer.clientWidth+2)/2,containerCenterY=container.top+(this._$directionCircleContainer.clientHeight+2)/2,eventX=e.x||e.changedTouches[0].clientX,eventY=e.y||e.changedTouches[0].clientY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),backDeg=0;function getAreaId(x,y){var rad=Math.atan2(y,x);rad<0&&(rad+=2*Math.PI);var deg=rad*(180/Math.PI)-225-12.5;return deg<0&&(deg+=360),Math.floor(deg/45)+1}var _this_options_env1,left=eventX-containerCenterX,top=eventY-containerCenterY;if(this.isRotate)switch(getAreaId(left,top)){case 1:direction=2,backDeg=90;break;case 2:direction=4,backDeg=135;break;case 3:direction=0,backDeg=180;break;case 4:direction=6,backDeg=225;break;case 5:direction=3,backDeg=270;break;case 6:direction=7,backDeg=315;break;case 7:direction=1,backDeg=0;break;case 8:direction=5,backDeg=45;}else switch(getAreaId(left,top)){case 1:direction=0,backDeg=180;break;case 2:direction=6,backDeg=225;break;case 3:direction=3,backDeg=270;break;case 4:direction=7,backDeg=315;break;case 5:direction=1,backDeg=0;break;case 6:direction=5,backDeg=45;break;case 7:direction=2,backDeg=90;break;case 8:direction=4,backDeg=135;}(this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer.style.cssText="start"===type?"background-image:linear-gradient("+backDeg+"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)":"","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{areaId:getAreaId(left,top),direction:direction,backDeg:backDeg,isRotate:this.isRotate,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzQueue=this._ptzQueue.then(function(){return _async_to_generator$5(function(){var _this;return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return _this=this,[4,fetch(url,{method:"POST",body:data}).then(function(response){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,response.json()];case 1:return [2,_state.sent()]}})})()}).then(function(rt){var _rt_result;null==operationResultCb||operationResultCb(rt);var code=rt.code||(null==rt||null==(_rt_result=rt.result)?void 0:_rt_result.code);return [6e4,60001,60002,60003,60004,60005,60006,10002].includes(+code)&&(_this._$directionCircleContainer.style.cssText="background-image:linear-gradient("+backDeg+"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"),rt}).catch(function(err){}).finally(function(){operationResultCb=null,"stop"===type&&(_this._clearTimer=setTimeout(function(){_this._$directionCircleContainer.style.cssText="";},1e3));})];case 1:return [2,_state.sent()]}})}).call(_this)}),"stop"===type&&(this._ptzQueue=this._ptzQueue.finally(function(){}));},_proto._handleBtnTouch=function(btn,option,type){var _this_options_token,_this_options_env,_this_options_token_deviceToken,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)?void 0:_this_options_token.deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzOperation||(this._ptzOperation=Promise.resolve());var direction=8;direction="zoom"===btn?"add"===option?8:9:"add"===option?10:11;var _this_options_env1,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken.video);"stop"===type&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{btn:btn,option:option,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzOperation=this._ptzOperation.then(function(){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,fetch(url,{method:"POST",body:data}).then(function(response){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,response.json()];case 1:return [2,_state.sent()]}})})()}).then(function(rt){return null==operationResultCb||operationResultCb(rt),rt}).catch(function(err){}).finally(function(){operationResultCb=null;})];case 1:return [2,_state.sent()]}})})()}),"stop"===type&&(this._ptzOperation=this._ptzOperation.finally(function(){_this._ptzOperation=null;}));},_create_class$9(Ptz,[{key:"isRotate",get:function(){return this._isRotate},set:function(isRotate){this._isRotate=isRotate;}}]),Ptz}(BasePtz);
|
|
7356
7459
|
|
|
7357
7460
|
function _defineProperties$4(target, props) {
|
|
7358
7461
|
for(var i = 0; i < props.length; i++){
|
|
@@ -7367,8 +7470,8 @@
|
|
|
7367
7470
|
if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
|
|
7368
7471
|
return Constructor;
|
|
7369
7472
|
}
|
|
7370
|
-
function _extends$
|
|
7371
|
-
_extends$
|
|
7473
|
+
function _extends$i() {
|
|
7474
|
+
_extends$i = Object.assign || function(target) {
|
|
7372
7475
|
for(var i = 1; i < arguments.length; i++){
|
|
7373
7476
|
var source = arguments[i];
|
|
7374
7477
|
for(var key in source){
|
|
@@ -7379,9 +7482,9 @@
|
|
|
7379
7482
|
}
|
|
7380
7483
|
return target;
|
|
7381
7484
|
};
|
|
7382
|
-
return _extends$
|
|
7485
|
+
return _extends$i.apply(this, arguments);
|
|
7383
7486
|
}
|
|
7384
|
-
function _inherits$
|
|
7487
|
+
function _inherits$h(subClass, superClass) {
|
|
7385
7488
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7386
7489
|
throw new TypeError("Super expression must either be null or a function");
|
|
7387
7490
|
}
|
|
@@ -7392,23 +7495,23 @@
|
|
|
7392
7495
|
configurable: true
|
|
7393
7496
|
}
|
|
7394
7497
|
});
|
|
7395
|
-
if (superClass) _set_prototype_of$
|
|
7498
|
+
if (superClass) _set_prototype_of$j(subClass, superClass);
|
|
7396
7499
|
}
|
|
7397
|
-
function _set_prototype_of$
|
|
7398
|
-
_set_prototype_of$
|
|
7500
|
+
function _set_prototype_of$j(o, p) {
|
|
7501
|
+
_set_prototype_of$j = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7399
7502
|
o.__proto__ = p;
|
|
7400
7503
|
return o;
|
|
7401
7504
|
};
|
|
7402
|
-
return _set_prototype_of$
|
|
7505
|
+
return _set_prototype_of$j(o, p);
|
|
7403
7506
|
}
|
|
7404
7507
|
/**
|
|
7405
7508
|
* 云台控件
|
|
7406
7509
|
* @category Control
|
|
7407
7510
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
7408
|
-
_inherits$
|
|
7511
|
+
_inherits$h(Ptz, Control);
|
|
7409
7512
|
function Ptz(options) {
|
|
7410
7513
|
var _this;
|
|
7411
|
-
_this = Control.call(this, _extends$
|
|
7514
|
+
_this = Control.call(this, _extends$i({}, options, {
|
|
7412
7515
|
tagName: 'span',
|
|
7413
7516
|
controlType: 'button',
|
|
7414
7517
|
classNameSuffix: 'ptz'
|
|
@@ -7451,7 +7554,7 @@
|
|
|
7451
7554
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
7452
7555
|
this.$panel.appendChild(this.$turntable);
|
|
7453
7556
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7454
|
-
this._ptzControl = new Ptz$1(this.$turntable, _extends$
|
|
7557
|
+
this._ptzControl = new Ptz$1(this.$turntable, _extends$i({}, this._options, {
|
|
7455
7558
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7456
7559
|
onDirection: this._onDirection.bind(this)
|
|
7457
7560
|
}));
|
|
@@ -7460,7 +7563,7 @@
|
|
|
7460
7563
|
};
|
|
7461
7564
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
7462
7565
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7463
|
-
if (!this._ptzControl1) this._ptzControl1 = new MobilePtz($container, _extends$
|
|
7566
|
+
if (!this._ptzControl1) this._ptzControl1 = new MobilePtz($container, _extends$i({}, this._options, {
|
|
7464
7567
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7465
7568
|
onDirection: this._onDirection.bind(this)
|
|
7466
7569
|
}));
|
|
@@ -7563,8 +7666,8 @@
|
|
|
7563
7666
|
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
7564
7667
|
return Constructor;
|
|
7565
7668
|
}
|
|
7566
|
-
function _extends$
|
|
7567
|
-
_extends$
|
|
7669
|
+
function _extends$h() {
|
|
7670
|
+
_extends$h = Object.assign || function(target) {
|
|
7568
7671
|
for(var i = 1; i < arguments.length; i++){
|
|
7569
7672
|
var source = arguments[i];
|
|
7570
7673
|
for(var key in source){
|
|
@@ -7575,9 +7678,9 @@
|
|
|
7575
7678
|
}
|
|
7576
7679
|
return target;
|
|
7577
7680
|
};
|
|
7578
|
-
return _extends$
|
|
7681
|
+
return _extends$h.apply(this, arguments);
|
|
7579
7682
|
}
|
|
7580
|
-
function _inherits$
|
|
7683
|
+
function _inherits$g(subClass, superClass) {
|
|
7581
7684
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7582
7685
|
throw new TypeError("Super expression must either be null or a function");
|
|
7583
7686
|
}
|
|
@@ -7588,14 +7691,14 @@
|
|
|
7588
7691
|
configurable: true
|
|
7589
7692
|
}
|
|
7590
7693
|
});
|
|
7591
|
-
if (superClass) _set_prototype_of$
|
|
7694
|
+
if (superClass) _set_prototype_of$i(subClass, superClass);
|
|
7592
7695
|
}
|
|
7593
|
-
function _set_prototype_of$
|
|
7594
|
-
_set_prototype_of$
|
|
7696
|
+
function _set_prototype_of$i(o, p) {
|
|
7697
|
+
_set_prototype_of$i = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7595
7698
|
o.__proto__ = p;
|
|
7596
7699
|
return o;
|
|
7597
7700
|
};
|
|
7598
|
-
return _set_prototype_of$
|
|
7701
|
+
return _set_prototype_of$i(o, p);
|
|
7599
7702
|
}
|
|
7600
7703
|
var RECORD_DEFAULT_OPTIONS = {
|
|
7601
7704
|
maxDuration: 3600
|
|
@@ -7609,10 +7712,10 @@
|
|
|
7609
7712
|
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
7610
7713
|
* @category Control
|
|
7611
7714
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
7612
|
-
_inherits$
|
|
7715
|
+
_inherits$g(Record, Control);
|
|
7613
7716
|
function Record(options) {
|
|
7614
7717
|
var _this;
|
|
7615
|
-
_this = Control.call(this, _extends$
|
|
7718
|
+
_this = Control.call(this, _extends$h({}, options, {
|
|
7616
7719
|
tagName: 'span',
|
|
7617
7720
|
controlType: 'button',
|
|
7618
7721
|
classNameSuffix: 'record'
|
|
@@ -7753,8 +7856,8 @@
|
|
|
7753
7856
|
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
7754
7857
|
return Constructor;
|
|
7755
7858
|
}
|
|
7756
|
-
function _extends$
|
|
7757
|
-
_extends$
|
|
7859
|
+
function _extends$g() {
|
|
7860
|
+
_extends$g = Object.assign || function(target) {
|
|
7758
7861
|
for(var i = 1; i < arguments.length; i++){
|
|
7759
7862
|
var source = arguments[i];
|
|
7760
7863
|
for(var key in source){
|
|
@@ -7765,9 +7868,9 @@
|
|
|
7765
7868
|
}
|
|
7766
7869
|
return target;
|
|
7767
7870
|
};
|
|
7768
|
-
return _extends$
|
|
7871
|
+
return _extends$g.apply(this, arguments);
|
|
7769
7872
|
}
|
|
7770
|
-
function _inherits$
|
|
7873
|
+
function _inherits$f(subClass, superClass) {
|
|
7771
7874
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7772
7875
|
throw new TypeError("Super expression must either be null or a function");
|
|
7773
7876
|
}
|
|
@@ -7778,14 +7881,14 @@
|
|
|
7778
7881
|
configurable: true
|
|
7779
7882
|
}
|
|
7780
7883
|
});
|
|
7781
|
-
if (superClass) _set_prototype_of$
|
|
7884
|
+
if (superClass) _set_prototype_of$h(subClass, superClass);
|
|
7782
7885
|
}
|
|
7783
|
-
function _set_prototype_of$
|
|
7784
|
-
_set_prototype_of$
|
|
7886
|
+
function _set_prototype_of$h(o, p) {
|
|
7887
|
+
_set_prototype_of$h = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7785
7888
|
o.__proto__ = p;
|
|
7786
7889
|
return o;
|
|
7787
7890
|
};
|
|
7788
|
-
return _set_prototype_of$
|
|
7891
|
+
return _set_prototype_of$h(o, p);
|
|
7789
7892
|
}
|
|
7790
7893
|
function _ts_generator$4(thisArg, body) {
|
|
7791
7894
|
var f, y, t, _ = {
|
|
@@ -7887,10 +7990,10 @@
|
|
|
7887
7990
|
*
|
|
7888
7991
|
* @category Control
|
|
7889
7992
|
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
7890
|
-
_inherits$
|
|
7993
|
+
_inherits$f(Talk, Control);
|
|
7891
7994
|
function Talk(options) {
|
|
7892
7995
|
var _this;
|
|
7893
|
-
_this = Control.call(this, _extends$
|
|
7996
|
+
_this = Control.call(this, _extends$g({}, options, {
|
|
7894
7997
|
tagName: 'span',
|
|
7895
7998
|
controlType: 'button',
|
|
7896
7999
|
classNameSuffix: 'talk'
|
|
@@ -8023,8 +8126,8 @@
|
|
|
8023
8126
|
});
|
|
8024
8127
|
};
|
|
8025
8128
|
}
|
|
8026
|
-
function _extends$
|
|
8027
|
-
_extends$
|
|
8129
|
+
function _extends$f() {
|
|
8130
|
+
_extends$f = Object.assign || function(target) {
|
|
8028
8131
|
for(var i = 1; i < arguments.length; i++){
|
|
8029
8132
|
var source = arguments[i];
|
|
8030
8133
|
for(var key in source){
|
|
@@ -8035,9 +8138,9 @@
|
|
|
8035
8138
|
}
|
|
8036
8139
|
return target;
|
|
8037
8140
|
};
|
|
8038
|
-
return _extends$
|
|
8141
|
+
return _extends$f.apply(this, arguments);
|
|
8039
8142
|
}
|
|
8040
|
-
function _inherits$
|
|
8143
|
+
function _inherits$e(subClass, superClass) {
|
|
8041
8144
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
8042
8145
|
throw new TypeError("Super expression must either be null or a function");
|
|
8043
8146
|
}
|
|
@@ -8048,14 +8151,14 @@
|
|
|
8048
8151
|
configurable: true
|
|
8049
8152
|
}
|
|
8050
8153
|
});
|
|
8051
|
-
if (superClass) _set_prototype_of$
|
|
8154
|
+
if (superClass) _set_prototype_of$g(subClass, superClass);
|
|
8052
8155
|
}
|
|
8053
|
-
function _set_prototype_of$
|
|
8054
|
-
_set_prototype_of$
|
|
8156
|
+
function _set_prototype_of$g(o, p) {
|
|
8157
|
+
_set_prototype_of$g = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8055
8158
|
o.__proto__ = p;
|
|
8056
8159
|
return o;
|
|
8057
8160
|
};
|
|
8058
|
-
return _set_prototype_of$
|
|
8161
|
+
return _set_prototype_of$g(o, p);
|
|
8059
8162
|
}
|
|
8060
8163
|
function _ts_generator$3(thisArg, body) {
|
|
8061
8164
|
var f, y, t, _ = {
|
|
@@ -8155,10 +8258,10 @@
|
|
|
8155
8258
|
*
|
|
8156
8259
|
* @category Control
|
|
8157
8260
|
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
8158
|
-
_inherits$
|
|
8261
|
+
_inherits$e(Broadcast, Control);
|
|
8159
8262
|
function Broadcast(options) {
|
|
8160
8263
|
var _this;
|
|
8161
|
-
_this = Control.call(this, _extends$
|
|
8264
|
+
_this = Control.call(this, _extends$f({}, options, {
|
|
8162
8265
|
tagName: 'span',
|
|
8163
8266
|
controlType: 'button',
|
|
8164
8267
|
classNameSuffix: 'broadcast'
|
|
@@ -8253,8 +8356,8 @@
|
|
|
8253
8356
|
});
|
|
8254
8357
|
};
|
|
8255
8358
|
}
|
|
8256
|
-
function _extends$
|
|
8257
|
-
_extends$
|
|
8359
|
+
function _extends$e() {
|
|
8360
|
+
_extends$e = Object.assign || function(target) {
|
|
8258
8361
|
for(var i = 1; i < arguments.length; i++){
|
|
8259
8362
|
var source = arguments[i];
|
|
8260
8363
|
for(var key in source){
|
|
@@ -8265,9 +8368,9 @@
|
|
|
8265
8368
|
}
|
|
8266
8369
|
return target;
|
|
8267
8370
|
};
|
|
8268
|
-
return _extends$
|
|
8371
|
+
return _extends$e.apply(this, arguments);
|
|
8269
8372
|
}
|
|
8270
|
-
function _inherits$
|
|
8373
|
+
function _inherits$d(subClass, superClass) {
|
|
8271
8374
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
8272
8375
|
throw new TypeError("Super expression must either be null or a function");
|
|
8273
8376
|
}
|
|
@@ -8278,14 +8381,14 @@
|
|
|
8278
8381
|
configurable: true
|
|
8279
8382
|
}
|
|
8280
8383
|
});
|
|
8281
|
-
if (superClass) _set_prototype_of$
|
|
8384
|
+
if (superClass) _set_prototype_of$f(subClass, superClass);
|
|
8282
8385
|
}
|
|
8283
|
-
function _set_prototype_of$
|
|
8284
|
-
_set_prototype_of$
|
|
8386
|
+
function _set_prototype_of$f(o, p) {
|
|
8387
|
+
_set_prototype_of$f = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8285
8388
|
o.__proto__ = p;
|
|
8286
8389
|
return o;
|
|
8287
8390
|
};
|
|
8288
|
-
return _set_prototype_of$
|
|
8391
|
+
return _set_prototype_of$f(o, p);
|
|
8289
8392
|
}
|
|
8290
8393
|
function _ts_generator$2(thisArg, body) {
|
|
8291
8394
|
var f, y, t, _ = {
|
|
@@ -8385,10 +8488,10 @@
|
|
|
8385
8488
|
*
|
|
8386
8489
|
* @category Control
|
|
8387
8490
|
*/ var AIChat = /*#__PURE__*/ function(Control) {
|
|
8388
|
-
_inherits$
|
|
8491
|
+
_inherits$d(AIChat, Control);
|
|
8389
8492
|
function AIChat(options) {
|
|
8390
8493
|
var _this;
|
|
8391
|
-
_this = Control.call(this, _extends$
|
|
8494
|
+
_this = Control.call(this, _extends$e({}, options, {
|
|
8392
8495
|
tagName: 'span',
|
|
8393
8496
|
controlType: 'button',
|
|
8394
8497
|
classNameSuffix: 'aichat'
|
|
@@ -8454,6 +8557,340 @@
|
|
|
8454
8557
|
return AIChat;
|
|
8455
8558
|
}(Control);
|
|
8456
8559
|
|
|
8560
|
+
function _extends$d() {
|
|
8561
|
+
_extends$d = Object.assign || function(target) {
|
|
8562
|
+
for(var i = 1; i < arguments.length; i++){
|
|
8563
|
+
var source = arguments[i];
|
|
8564
|
+
for(var key in source){
|
|
8565
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8566
|
+
target[key] = source[key];
|
|
8567
|
+
}
|
|
8568
|
+
}
|
|
8569
|
+
}
|
|
8570
|
+
return target;
|
|
8571
|
+
};
|
|
8572
|
+
return _extends$d.apply(this, arguments);
|
|
8573
|
+
}
|
|
8574
|
+
function _inherits$c(subClass, superClass) {
|
|
8575
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
8576
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
8577
|
+
}
|
|
8578
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
8579
|
+
constructor: {
|
|
8580
|
+
value: subClass,
|
|
8581
|
+
writable: true,
|
|
8582
|
+
configurable: true
|
|
8583
|
+
}
|
|
8584
|
+
});
|
|
8585
|
+
if (superClass) _set_prototype_of$e(subClass, superClass);
|
|
8586
|
+
}
|
|
8587
|
+
function _set_prototype_of$e(o, p) {
|
|
8588
|
+
_set_prototype_of$e = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8589
|
+
o.__proto__ = p;
|
|
8590
|
+
return o;
|
|
8591
|
+
};
|
|
8592
|
+
return _set_prototype_of$e(o, p);
|
|
8593
|
+
}
|
|
8594
|
+
/**
|
|
8595
|
+
* 直播按钮控件
|
|
8596
|
+
*
|
|
8597
|
+
* 点击切换到直播模式
|
|
8598
|
+
*
|
|
8599
|
+
* @category Control
|
|
8600
|
+
*/ var Live = /*#__PURE__*/ function(Control) {
|
|
8601
|
+
_inherits$c(Live, Control);
|
|
8602
|
+
function Live(options) {
|
|
8603
|
+
var _this;
|
|
8604
|
+
var _this___options_props1;
|
|
8605
|
+
_this = Control.call(this, _extends$d({}, options, {
|
|
8606
|
+
tagName: 'span',
|
|
8607
|
+
controlType: 'button',
|
|
8608
|
+
classNameSuffix: 'live'
|
|
8609
|
+
})) || this;
|
|
8610
|
+
_this._options = options;
|
|
8611
|
+
_this._render();
|
|
8612
|
+
// 初始化时根据当前播放模式确定激活状态
|
|
8613
|
+
_this._syncActiveByUrlInfo((_this___options_props1 = _this.__options.props) == null ? void 0 : _this___options_props1.urlInfo);
|
|
8614
|
+
return _this;
|
|
8615
|
+
}
|
|
8616
|
+
var _proto = Live.prototype;
|
|
8617
|
+
/**
|
|
8618
|
+
* 根据 urlInfo 同步激活状态
|
|
8619
|
+
* 在初始化和播放地址切换后调用
|
|
8620
|
+
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
8621
|
+
var shouldBeActive = !!(urlInfo && urlInfo.type === 'live');
|
|
8622
|
+
this.active = shouldBeActive;
|
|
8623
|
+
};
|
|
8624
|
+
_proto._render = function _render() {
|
|
8625
|
+
var _this_locale;
|
|
8626
|
+
this.$container.innerHTML = IconComponents.live({
|
|
8627
|
+
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_LIVE) || '直播'
|
|
8628
|
+
});
|
|
8629
|
+
};
|
|
8630
|
+
/**
|
|
8631
|
+
* 销毁
|
|
8632
|
+
*/ _proto.destroy = function destroy() {
|
|
8633
|
+
Control.prototype.destroy.call(this);
|
|
8634
|
+
};
|
|
8635
|
+
/**
|
|
8636
|
+
* 点击 Control 会触发
|
|
8637
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8638
|
+
var _this__options_onChange, _this__options;
|
|
8639
|
+
Control.prototype._onControlClick.call(this, e);
|
|
8640
|
+
// 已经是直播模式则不触发
|
|
8641
|
+
if (this.active) {
|
|
8642
|
+
return;
|
|
8643
|
+
}
|
|
8644
|
+
this.active = true;
|
|
8645
|
+
this.emit(EVENTS.control.liveChange);
|
|
8646
|
+
(_this__options = this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options);
|
|
8647
|
+
};
|
|
8648
|
+
return Live;
|
|
8649
|
+
}(Control);
|
|
8650
|
+
|
|
8651
|
+
function _extends$c() {
|
|
8652
|
+
_extends$c = Object.assign || function(target) {
|
|
8653
|
+
for(var i = 1; i < arguments.length; i++){
|
|
8654
|
+
var source = arguments[i];
|
|
8655
|
+
for(var key in source){
|
|
8656
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8657
|
+
target[key] = source[key];
|
|
8658
|
+
}
|
|
8659
|
+
}
|
|
8660
|
+
}
|
|
8661
|
+
return target;
|
|
8662
|
+
};
|
|
8663
|
+
return _extends$c.apply(this, arguments);
|
|
8664
|
+
}
|
|
8665
|
+
function _inherits$b(subClass, superClass) {
|
|
8666
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
8667
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
8668
|
+
}
|
|
8669
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
8670
|
+
constructor: {
|
|
8671
|
+
value: subClass,
|
|
8672
|
+
writable: true,
|
|
8673
|
+
configurable: true
|
|
8674
|
+
}
|
|
8675
|
+
});
|
|
8676
|
+
if (superClass) _set_prototype_of$d(subClass, superClass);
|
|
8677
|
+
}
|
|
8678
|
+
function _set_prototype_of$d(o, p) {
|
|
8679
|
+
_set_prototype_of$d = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8680
|
+
o.__proto__ = p;
|
|
8681
|
+
return o;
|
|
8682
|
+
};
|
|
8683
|
+
return _set_prototype_of$d(o, p);
|
|
8684
|
+
}
|
|
8685
|
+
/**
|
|
8686
|
+
* 回放下拉控件
|
|
8687
|
+
*
|
|
8688
|
+
* 鼠标移入弹出气泡,展示云存储、云录制、本地回放三个选项
|
|
8689
|
+
*
|
|
8690
|
+
* @category Control
|
|
8691
|
+
*/ var RecDropdown = /*#__PURE__*/ function(Control) {
|
|
8692
|
+
_inherits$b(RecDropdown, Control);
|
|
8693
|
+
function RecDropdown(options) {
|
|
8694
|
+
var _this;
|
|
8695
|
+
var _options_props, _this___options_props1;
|
|
8696
|
+
_this = Control.call(this, _extends$c({}, options, {
|
|
8697
|
+
tagName: 'span',
|
|
8698
|
+
controlType: 'button',
|
|
8699
|
+
classNameSuffix: 'rec-dropdown'
|
|
8700
|
+
})) || this;
|
|
8701
|
+
_this._options = options;
|
|
8702
|
+
// 初始化时根据 urlInfo 确定当前回放类型和激活状态
|
|
8703
|
+
_this._recType = options.recType || ((_options_props = options.props) == null ? void 0 : _options_props.recType) || 'cloudRec';
|
|
8704
|
+
_this._syncActiveByUrlInfo((_this___options_props1 = _this.__options.props) == null ? void 0 : _this___options_props1.urlInfo);
|
|
8705
|
+
_this._render();
|
|
8706
|
+
_this._initPicker();
|
|
8707
|
+
return _this;
|
|
8708
|
+
}
|
|
8709
|
+
var _proto = RecDropdown.prototype;
|
|
8710
|
+
/**
|
|
8711
|
+
* 根据 urlInfo 同步激活状态和回放类型
|
|
8712
|
+
* 在初始化和播放地址切换后调用
|
|
8713
|
+
*/ _proto._syncActiveByUrlInfo = function _syncActiveByUrlInfo(urlInfo) {
|
|
8714
|
+
if (urlInfo && urlInfo.type === 'rec') {
|
|
8715
|
+
var _urlInfo_searchParams1;
|
|
8716
|
+
this.active = true;
|
|
8717
|
+
if (urlInfo.recType === 'cloud' && ((_urlInfo_searchParams1 = urlInfo.searchParams) == null ? void 0 : _urlInfo_searchParams1.busType) === '7') {
|
|
8718
|
+
this._recType = 'cloudRecord';
|
|
8719
|
+
} else if (urlInfo.recType === 'cloud') {
|
|
8720
|
+
this._recType = 'cloudRec';
|
|
8721
|
+
} else {
|
|
8722
|
+
this._recType = 'rec';
|
|
8723
|
+
}
|
|
8724
|
+
this._activeOption(this._recType);
|
|
8725
|
+
} else {
|
|
8726
|
+
this.active = false;
|
|
8727
|
+
}
|
|
8728
|
+
};
|
|
8729
|
+
_proto._render = function _render() {
|
|
8730
|
+
var _this_locale;
|
|
8731
|
+
this.$container.innerHTML = IconComponents.recDropdown({
|
|
8732
|
+
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_REC_DROPDOWN) || '回放'
|
|
8733
|
+
});
|
|
8734
|
+
};
|
|
8735
|
+
_proto._initPicker = function _initPicker() {
|
|
8736
|
+
var _this = this;
|
|
8737
|
+
this._picker = new Picker(this.$container, {
|
|
8738
|
+
getPopupContainer: function() {
|
|
8739
|
+
return Utils.isMobile ? _this.__options.rootContainer : _this.$container;
|
|
8740
|
+
},
|
|
8741
|
+
trigger: Utils.isMobile ? 'click' : 'hover',
|
|
8742
|
+
isMobile: Utils.isMobile,
|
|
8743
|
+
wrapClassName: "" + PREFIX_CLASS + "-rec-dropdown-picker",
|
|
8744
|
+
placement: 'bottom',
|
|
8745
|
+
offset: [
|
|
8746
|
+
0,
|
|
8747
|
+
4
|
|
8748
|
+
]
|
|
8749
|
+
});
|
|
8750
|
+
this._picker.innerHTML(this._getPanelHTML());
|
|
8751
|
+
this._activeOption(this._recType);
|
|
8752
|
+
this._bindPanelEvents();
|
|
8753
|
+
};
|
|
8754
|
+
_proto._getPanelHTML = function _getPanelHTML() {
|
|
8755
|
+
var _this_locale, _this_locale1, _this_locale2;
|
|
8756
|
+
var cloudRecLabel = ((_this_locale = this.locale) == null ? void 0 : _this_locale.REC_DROPDOWN_CLOUD_REC) || '云存储';
|
|
8757
|
+
var cloudRecordLabel = ((_this_locale1 = this.locale) == null ? void 0 : _this_locale1.REC_DROPDOWN_CLOUD_RECORD) || '云录制';
|
|
8758
|
+
var localRecLabel = ((_this_locale2 = this.locale) == null ? void 0 : _this_locale2.REC_DROPDOWN_LOCAL_REC) || '本地回放';
|
|
8759
|
+
return '<div class="' + PREFIX_CLASS + '-rec-dropdown-panel">\n <ul class="' + PREFIX_CLASS + '-rec-dropdown-list">\n <li class="' + PREFIX_CLASS + '-rec-dropdown-item" data-type="cloudRec">\n <span>' + cloudRecLabel + '</span>\n </li>\n <li class="' + PREFIX_CLASS + '-rec-dropdown-item" data-type="cloudRecord">\n <span>' + cloudRecordLabel + '</span>\n </li>\n <li class="' + PREFIX_CLASS + '-rec-dropdown-item" data-type="rec">\n <span>' + localRecLabel + "</span>\n </li>\n </ul>\n </div>";
|
|
8760
|
+
};
|
|
8761
|
+
_proto._bindPanelEvents = function _bindPanelEvents() {
|
|
8762
|
+
var _this = this;
|
|
8763
|
+
this._delegation = delegate(this._picker.$body, "." + PREFIX_CLASS + "-rec-dropdown-item", 'click', function(e) {
|
|
8764
|
+
e.stopPropagation();
|
|
8765
|
+
var type = e.delegateTarget.getAttribute('data-type');
|
|
8766
|
+
if (type) {
|
|
8767
|
+
var _this__options_onChange, _this__options;
|
|
8768
|
+
_this._recType = type;
|
|
8769
|
+
_this._activeOption(type);
|
|
8770
|
+
// 设置自身为激活状态
|
|
8771
|
+
_this.active = true;
|
|
8772
|
+
_this.emit(EVENTS.control.recDropdownChange, type);
|
|
8773
|
+
(_this__options = _this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, type);
|
|
8774
|
+
_this._picker.open = false;
|
|
8775
|
+
}
|
|
8776
|
+
});
|
|
8777
|
+
};
|
|
8778
|
+
_proto._activeOption = function _activeOption(type) {
|
|
8779
|
+
var _this__picker;
|
|
8780
|
+
if ((_this__picker = this._picker) == null ? void 0 : _this__picker.$body) {
|
|
8781
|
+
var items = this._picker.$body.querySelectorAll("." + PREFIX_CLASS + "-rec-dropdown-item");
|
|
8782
|
+
items.forEach(function(item) {
|
|
8783
|
+
item.classList.remove("" + PREFIX_CLASS + "-active");
|
|
8784
|
+
});
|
|
8785
|
+
var target = this._picker.$body.querySelector("." + PREFIX_CLASS + '-rec-dropdown-item[data-type="' + type + '"]');
|
|
8786
|
+
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS + "-active");
|
|
8787
|
+
}
|
|
8788
|
+
};
|
|
8789
|
+
/**
|
|
8790
|
+
* 销毁
|
|
8791
|
+
*/ _proto.destroy = function destroy() {
|
|
8792
|
+
var _this__delegation_destroy, _this__delegation;
|
|
8793
|
+
(_this__delegation = this._delegation) == null ? void 0 : (_this__delegation_destroy = _this__delegation.destroy) == null ? void 0 : _this__delegation_destroy.call(_this__delegation);
|
|
8794
|
+
this._delegation = null;
|
|
8795
|
+
if (this._picker) {
|
|
8796
|
+
this._picker.destroy();
|
|
8797
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8798
|
+
this._picker = null;
|
|
8799
|
+
}
|
|
8800
|
+
Control.prototype.destroy.call(this);
|
|
8801
|
+
};
|
|
8802
|
+
/**
|
|
8803
|
+
* 点击 Control 会触发(移动端 click 触发 picker)
|
|
8804
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8805
|
+
_proto._onControlClick = function _onControlClick(_e) {
|
|
8806
|
+
// picker 自行处理 click/hover,这里不额外处理
|
|
8807
|
+
};
|
|
8808
|
+
return RecDropdown;
|
|
8809
|
+
}(Control);
|
|
8810
|
+
|
|
8811
|
+
function _extends$b() {
|
|
8812
|
+
_extends$b = Object.assign || function(target) {
|
|
8813
|
+
for(var i = 1; i < arguments.length; i++){
|
|
8814
|
+
var source = arguments[i];
|
|
8815
|
+
for(var key in source){
|
|
8816
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8817
|
+
target[key] = source[key];
|
|
8818
|
+
}
|
|
8819
|
+
}
|
|
8820
|
+
}
|
|
8821
|
+
return target;
|
|
8822
|
+
};
|
|
8823
|
+
return _extends$b.apply(this, arguments);
|
|
8824
|
+
}
|
|
8825
|
+
function _inherits$a(subClass, superClass) {
|
|
8826
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
8827
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
8828
|
+
}
|
|
8829
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
8830
|
+
constructor: {
|
|
8831
|
+
value: subClass,
|
|
8832
|
+
writable: true,
|
|
8833
|
+
configurable: true
|
|
8834
|
+
}
|
|
8835
|
+
});
|
|
8836
|
+
if (superClass) _set_prototype_of$c(subClass, superClass);
|
|
8837
|
+
}
|
|
8838
|
+
function _set_prototype_of$c(o, p) {
|
|
8839
|
+
_set_prototype_of$c = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8840
|
+
o.__proto__ = p;
|
|
8841
|
+
return o;
|
|
8842
|
+
};
|
|
8843
|
+
return _set_prototype_of$c(o, p);
|
|
8844
|
+
}
|
|
8845
|
+
/**
|
|
8846
|
+
* 告警消息按钮控件
|
|
8847
|
+
*
|
|
8848
|
+
* 点击弹出告警消息列表弹窗(纯触发按钮,无激活状态)
|
|
8849
|
+
*
|
|
8850
|
+
* @category Control
|
|
8851
|
+
*/ var AlarmMessage = /*#__PURE__*/ function(Control) {
|
|
8852
|
+
_inherits$a(AlarmMessage, Control);
|
|
8853
|
+
function AlarmMessage(options) {
|
|
8854
|
+
var _this;
|
|
8855
|
+
_this = Control.call(this, _extends$b({}, options, {
|
|
8856
|
+
tagName: 'span',
|
|
8857
|
+
controlType: 'button',
|
|
8858
|
+
classNameSuffix: 'alarm-message'
|
|
8859
|
+
})) || this, _this._panelOpen = false;
|
|
8860
|
+
_this._options = options;
|
|
8861
|
+
_this._render();
|
|
8862
|
+
_this.on(EVENTS.alarmMessageChange, function(open) {
|
|
8863
|
+
_this._panelOpen = open;
|
|
8864
|
+
});
|
|
8865
|
+
return _this;
|
|
8866
|
+
}
|
|
8867
|
+
var _proto = AlarmMessage.prototype;
|
|
8868
|
+
_proto._render = function _render() {
|
|
8869
|
+
var _this_locale;
|
|
8870
|
+
this.$container.innerHTML = IconComponents.alarmMessage({
|
|
8871
|
+
title: ((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_ALARM_MESSAGE) || '消息'
|
|
8872
|
+
});
|
|
8873
|
+
};
|
|
8874
|
+
/**
|
|
8875
|
+
* 销毁
|
|
8876
|
+
*/ _proto.destroy = function destroy() {
|
|
8877
|
+
if (this._panelOpen) {
|
|
8878
|
+
this.emit(EVENTS.control.alarmMessageChange, false);
|
|
8879
|
+
}
|
|
8880
|
+
Control.prototype.destroy.call(this);
|
|
8881
|
+
};
|
|
8882
|
+
/**
|
|
8883
|
+
* 点击 Control 会触发
|
|
8884
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8885
|
+
var _this__options_onChange, _this__options;
|
|
8886
|
+
Control.prototype._onControlClick.call(this, e);
|
|
8887
|
+
this._panelOpen = !this._panelOpen;
|
|
8888
|
+
this.emit(EVENTS.control.alarmMessageChange, this._panelOpen);
|
|
8889
|
+
(_this__options = this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, this._panelOpen);
|
|
8890
|
+
};
|
|
8891
|
+
return AlarmMessage;
|
|
8892
|
+
}(Control);
|
|
8893
|
+
|
|
8457
8894
|
function _defineProperties$1(target, props) {
|
|
8458
8895
|
for(var i = 0; i < props.length; i++){
|
|
8459
8896
|
var descriptor = props[i];
|
|
@@ -10002,6 +10439,9 @@
|
|
|
10002
10439
|
talk: Talk,
|
|
10003
10440
|
broadcast: Broadcast,
|
|
10004
10441
|
aiChat: AIChat,
|
|
10442
|
+
live: Live,
|
|
10443
|
+
recDropdown: RecDropdown,
|
|
10444
|
+
alarmMessage: AlarmMessage,
|
|
10005
10445
|
zoom: Zoom$1,
|
|
10006
10446
|
definition: Definition,
|
|
10007
10447
|
fullscreen: Fullscreen,
|
|
@@ -10535,7 +10975,10 @@
|
|
|
10535
10975
|
// 需要权限的控件
|
|
10536
10976
|
var AUTH_KEY = [
|
|
10537
10977
|
'ptz',
|
|
10538
|
-
'aiChat'
|
|
10978
|
+
'aiChat',
|
|
10979
|
+
'live',
|
|
10980
|
+
'recDropdown',
|
|
10981
|
+
'alarmMessage'
|
|
10539
10982
|
];
|
|
10540
10983
|
/**
|
|
10541
10984
|
* 渲染控件
|
|
@@ -10615,7 +11058,7 @@
|
|
|
10615
11058
|
}
|
|
10616
11059
|
function _renderTheme(theme, data) {
|
|
10617
11060
|
return _async_to_generator$1(function() {
|
|
10618
|
-
var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
|
|
11061
|
+
var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_urlInfo, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_controls2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1, _theme_options;
|
|
10619
11062
|
return _ts_generator$1(this, function(_state) {
|
|
10620
11063
|
switch(_state.label){
|
|
10621
11064
|
case 0:
|
|
@@ -10756,8 +11199,8 @@
|
|
|
10756
11199
|
list = [].concat(((_filterThemeData_header = filterThemeData.header) == null ? void 0 : _filterThemeData_header.btnList) || [], (_filterThemeData_footer_btnList = (_filterThemeData_footer = filterThemeData.footer) == null ? void 0 : _filterThemeData_footer.btnList) != null ? _filterThemeData_footer_btnList : []);
|
|
10757
11200
|
// FIXME: 这个逻辑实际上是有问题的
|
|
10758
11201
|
_needTimeLine = list.some(function(item) {
|
|
10759
|
-
return REC_GROUP.includes(item.iconId);
|
|
10760
|
-
});
|
|
11202
|
+
return REC_GROUP.includes(item.iconId) || item.iconId === 'recDropdown';
|
|
11203
|
+
}) && ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.type) === 'rec';
|
|
10761
11204
|
// PC 单独渲染timeLine
|
|
10762
11205
|
if (!Utils.isMobile && !(theme.options.timeLineOptions === null || theme.options.disabledTimeLine) && _needTimeLine) {
|
|
10763
11206
|
theme._recFooter = new RecFooter(theme.$container, {
|
|
@@ -10788,6 +11231,23 @@
|
|
|
10788
11231
|
if (REC_GROUP.includes(item.iconId)) _renderRecType(theme, (_theme__mobileExtend = theme._mobileExtend) == null ? void 0 : _theme__mobileExtend.$topRight, item.iconId, props);
|
|
10789
11232
|
});
|
|
10790
11233
|
}
|
|
11234
|
+
// 移动端:在 rec 控件旁渲染 alarmMessage 按钮
|
|
11235
|
+
if (theme.options.alarmMessageOptions !== null && !((_theme_controls2 = theme.controls) == null ? void 0 : _theme_controls2['alarmMessageControl'])) {
|
|
11236
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
11237
|
+
theme.controls['alarmMessageControl'] = new Controls['alarmMessage'](_extends$1({
|
|
11238
|
+
rootContainer: theme.$container,
|
|
11239
|
+
getPopupContainer: function() {
|
|
11240
|
+
var _theme__mobileExtend;
|
|
11241
|
+
return (_theme__mobileExtend = theme._mobileExtend) == null ? void 0 : _theme__mobileExtend.$topRight;
|
|
11242
|
+
},
|
|
11243
|
+
language: theme.options.language || 'zh',
|
|
11244
|
+
locales: theme.i18n.translations,
|
|
11245
|
+
sdkType: theme.options.sdkType,
|
|
11246
|
+
urlInfo: theme.urlInfo
|
|
11247
|
+
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options.alarmMessageOptions) || {}, {
|
|
11248
|
+
props: props
|
|
11249
|
+
}));
|
|
11250
|
+
}
|
|
10791
11251
|
if ((theme.options.timeLineOptions !== null || !theme.options.disabledTimeLine) && ((_theme_options_mobileExtendOptions3 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions3.controls.includes('timeLine')) && _needTimeLine) {
|
|
10792
11252
|
_renderTimeLine(theme, theme._mobileExtend.$content, props);
|
|
10793
11253
|
}
|
|
@@ -10798,6 +11258,10 @@
|
|
|
10798
11258
|
}
|
|
10799
11259
|
theme.emit(EVENTS.control.mountedControls);
|
|
10800
11260
|
if (!theme.playing) theme._disabled(true);
|
|
11261
|
+
// 同步 loading 状态(修复:_loadingControl 创建前设置的 loading=true 不生效的问题)
|
|
11262
|
+
if (theme._loading && theme._loadingControl) {
|
|
11263
|
+
theme._loadingControl.show();
|
|
11264
|
+
}
|
|
10801
11265
|
_controlEventemitter(theme);
|
|
10802
11266
|
return [
|
|
10803
11267
|
2
|
|
@@ -11196,7 +11660,7 @@
|
|
|
11196
11660
|
// 标准流暂时仅支持 TEMPLATES 中的配置, 多余的的展示不生效(如电子放大是不支持的等等), 待版本更新才能支持
|
|
11197
11661
|
// prettier-ignore
|
|
11198
11662
|
_this._renderTheme(// hls 不支持自定义
|
|
11199
|
-
options.type === 'hls' ? hlsLiveTemplate : // flv mp4 支持自定义 themeData
|
|
11663
|
+
options.type === 'hls' || options.type === 'ezhls' ? hlsLiveTemplate : // flv mp4 支持自定义 themeData
|
|
11200
11664
|
[
|
|
11201
11665
|
'flv',
|
|
11202
11666
|
'mp4'
|
|
@@ -12393,7 +12857,7 @@
|
|
|
12393
12857
|
zh: zh,
|
|
12394
12858
|
en: en
|
|
12395
12859
|
};
|
|
12396
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.0.
|
|
12860
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.0.1-beta.3';
|
|
12397
12861
|
|
|
12398
12862
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
12399
12863
|
|