@ezuikit/player-theme 3.1.1 → 3.1.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constant.js +4 -3
- package/dist/index.cjs +160 -42
- package/dist/index.esm.js +161 -43
- package/dist/index.umd.js +160 -42
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +325 -56
- package/package.json +4 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.
|
|
3
|
-
* Copyright (c) 2026-08-
|
|
2
|
+
* @ezuikit/player-theme v3.1.2-beta.2
|
|
3
|
+
* Copyright (c) 2026-08-12 04:37:54 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -393,7 +393,8 @@
|
|
|
393
393
|
'urlInfo',
|
|
394
394
|
'videoLevelList',
|
|
395
395
|
'videoLevel',
|
|
396
|
-
'recMonth'
|
|
396
|
+
'recMonth',
|
|
397
|
+
'url'
|
|
397
398
|
];
|
|
398
399
|
/**
|
|
399
400
|
* 当移动端 picker 控件打开时需要关闭动画(定时器)
|
|
@@ -4838,6 +4839,59 @@
|
|
|
4838
4839
|
}
|
|
4839
4840
|
};
|
|
4840
4841
|
|
|
4842
|
+
/**
|
|
4843
|
+
* flv 预览
|
|
4844
|
+
*/ var hlsRecTemplate = {
|
|
4845
|
+
autoFocus: 3,
|
|
4846
|
+
// poster:
|
|
4847
|
+
// "https://img2.baidu.com/it/u=3209353042,356122753&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",
|
|
4848
|
+
footer: {
|
|
4849
|
+
btnList: [
|
|
4850
|
+
{
|
|
4851
|
+
iconId: 'play',
|
|
4852
|
+
part: 'left',
|
|
4853
|
+
isrender: 1
|
|
4854
|
+
},
|
|
4855
|
+
{
|
|
4856
|
+
iconId: 'capturePicture',
|
|
4857
|
+
part: 'left',
|
|
4858
|
+
defaultActive: 0,
|
|
4859
|
+
isrender: 1
|
|
4860
|
+
},
|
|
4861
|
+
{
|
|
4862
|
+
iconId: 'volume',
|
|
4863
|
+
part: 'left',
|
|
4864
|
+
defaultActive: 0,
|
|
4865
|
+
isrender: 1
|
|
4866
|
+
},
|
|
4867
|
+
{
|
|
4868
|
+
iconId: 'zoom',
|
|
4869
|
+
part: 'left',
|
|
4870
|
+
defaultActive: 0,
|
|
4871
|
+
isrender: 1
|
|
4872
|
+
},
|
|
4873
|
+
{
|
|
4874
|
+
iconId: 'speed',
|
|
4875
|
+
part: 'right',
|
|
4876
|
+
defaultActive: 0,
|
|
4877
|
+
isrender: 1
|
|
4878
|
+
},
|
|
4879
|
+
{
|
|
4880
|
+
iconId: 'fullscreen',
|
|
4881
|
+
part: 'right',
|
|
4882
|
+
defaultActive: 0,
|
|
4883
|
+
isrender: 1
|
|
4884
|
+
},
|
|
4885
|
+
{
|
|
4886
|
+
iconId: 'globalFullscreen',
|
|
4887
|
+
part: 'right',
|
|
4888
|
+
defaultActive: 0,
|
|
4889
|
+
isrender: 1
|
|
4890
|
+
}
|
|
4891
|
+
]
|
|
4892
|
+
}
|
|
4893
|
+
};
|
|
4894
|
+
|
|
4841
4895
|
/**
|
|
4842
4896
|
* pc 预览
|
|
4843
4897
|
*/ var pcLive = {
|
|
@@ -8588,6 +8642,7 @@
|
|
|
8588
8642
|
_inherits$f(AIChat, Control);
|
|
8589
8643
|
function AIChat(options) {
|
|
8590
8644
|
var _this;
|
|
8645
|
+
var _options_urlInfo_searchParams, _options_urlInfo, _options_urlInfo1;
|
|
8591
8646
|
_this = Control.call(this, _extends$h({}, options, {
|
|
8592
8647
|
tagName: 'span',
|
|
8593
8648
|
controlType: 'button',
|
|
@@ -8601,7 +8656,7 @@
|
|
|
8601
8656
|
_this._render();
|
|
8602
8657
|
}
|
|
8603
8658
|
});
|
|
8604
|
-
if (options.urlInfo.searchParams.busType !== '7' && options.urlInfo.recType === 'cloud' && options.sdkType === 'base') {
|
|
8659
|
+
if (((_options_urlInfo = options.urlInfo) == null ? void 0 : (_options_urlInfo_searchParams = _options_urlInfo.searchParams) == null ? void 0 : _options_urlInfo_searchParams.busType) !== '7' && ((_options_urlInfo1 = options.urlInfo) == null ? void 0 : _options_urlInfo1.recType) === 'cloud' && options.sdkType === 'base') {
|
|
8605
8660
|
_this.$container.style.removeProperty('display');
|
|
8606
8661
|
} else {
|
|
8607
8662
|
_this.$container.style.display = 'none';
|
|
@@ -10077,7 +10132,7 @@
|
|
|
10077
10132
|
_assert_this_initialized(_this).emit(EVENTS$2.control.speedPanelOpenChange, open, value, item);
|
|
10078
10133
|
}
|
|
10079
10134
|
})) || this;
|
|
10080
|
-
_this._filterSpeedList(options.list, options.props.recType);
|
|
10135
|
+
_this._filterSpeedList(options.list, options.props.recType, options.props.url);
|
|
10081
10136
|
_this.on(EVENTS$2.speedChange, function(speed) {
|
|
10082
10137
|
if (_this.value !== speed + '') _this.value = speed + '';
|
|
10083
10138
|
});
|
|
@@ -10091,18 +10146,24 @@
|
|
|
10091
10146
|
* 滤掉本地回放不支持的倍速
|
|
10092
10147
|
* @param optionsList 初始化配置倍速列表
|
|
10093
10148
|
* @param type 回放类型
|
|
10094
|
-
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
|
|
10149
|
+
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
|
|
10095
10150
|
if (!optionsList) {
|
|
10096
|
-
// 非用户自定义
|
|
10097
|
-
if (type === 'rec') {
|
|
10098
|
-
// 本地回放 不支持 8 16 32 倍速
|
|
10151
|
+
// 非用户自定义 /openpb/ 是标准流回放路径
|
|
10152
|
+
if (type === 'rec' || (url == null ? void 0 : url.includes('/openpb/'))) {
|
|
10153
|
+
// ezopen本地回放 或 hls 回放 不支持 8 16 32 倍速
|
|
10099
10154
|
var list = this.list.filter(function(item) {
|
|
10100
10155
|
return (item == null ? void 0 : item.value) && +item.value < 8;
|
|
10101
10156
|
});
|
|
10102
10157
|
this.updateOptions(list);
|
|
10103
|
-
} else {
|
|
10158
|
+
} else if (type === 'cloudRec' || type === 'cloudRecord') {
|
|
10104
10159
|
// 云端回放 支持 8 16 32 倍速
|
|
10105
10160
|
this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
|
|
10161
|
+
} else {
|
|
10162
|
+
// 三方默认回放倍速设置
|
|
10163
|
+
var list1 = this.list.filter(function(item) {
|
|
10164
|
+
return (item == null ? void 0 : item.value) && +item.value < 8;
|
|
10165
|
+
});
|
|
10166
|
+
this.updateOptions(list1);
|
|
10106
10167
|
}
|
|
10107
10168
|
}
|
|
10108
10169
|
};
|
|
@@ -11734,7 +11795,7 @@
|
|
|
11734
11795
|
if (theme.options.deviceOptions !== null) {
|
|
11735
11796
|
var _theme_controls;
|
|
11736
11797
|
if (!((_theme_controls = theme.controls) == null ? void 0 : _theme_controls["deviceControl"])) {
|
|
11737
|
-
var _theme_options;
|
|
11798
|
+
var _theme_urlInfo, _theme_urlInfo1, _theme_options;
|
|
11738
11799
|
// eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
|
|
11739
11800
|
theme.controls["deviceControl"] = new Controls["device"](_extends$1({
|
|
11740
11801
|
rootContainer: theme.$container,
|
|
@@ -11745,8 +11806,8 @@
|
|
|
11745
11806
|
language: theme.options.language,
|
|
11746
11807
|
locales: theme.i18n.translations,
|
|
11747
11808
|
type: theme.options.type,
|
|
11748
|
-
deviceSerial: theme.urlInfo.deviceSerial,
|
|
11749
|
-
channelNo: theme.urlInfo.channelNo
|
|
11809
|
+
deviceSerial: (_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.deviceSerial,
|
|
11810
|
+
channelNo: (_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.channelNo
|
|
11750
11811
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
|
|
11751
11812
|
props: props
|
|
11752
11813
|
}));
|
|
@@ -11757,7 +11818,7 @@
|
|
|
11757
11818
|
// footer
|
|
11758
11819
|
if (Controls[item.iconId]) {
|
|
11759
11820
|
if (theme.options["" + item.iconId + "Options"] !== null) {
|
|
11760
|
-
var _theme_options1;
|
|
11821
|
+
var _theme_urlInfo2, _theme_urlInfo3, _theme_options1;
|
|
11761
11822
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
11762
11823
|
theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
|
|
11763
11824
|
rootContainer: theme.$container,
|
|
@@ -11770,8 +11831,8 @@
|
|
|
11770
11831
|
env: theme.options.env,
|
|
11771
11832
|
accessToken: theme.options.accessToken,
|
|
11772
11833
|
token: theme.options.token,
|
|
11773
|
-
deviceSerial: theme.urlInfo.deviceSerial,
|
|
11774
|
-
channelNo: theme.urlInfo.channelNo,
|
|
11834
|
+
deviceSerial: (_theme_urlInfo2 = theme.urlInfo) == null ? void 0 : _theme_urlInfo2.deviceSerial,
|
|
11835
|
+
channelNo: (_theme_urlInfo3 = theme.urlInfo) == null ? void 0 : _theme_urlInfo3.channelNo,
|
|
11775
11836
|
urlInfo: theme.urlInfo
|
|
11776
11837
|
} : {}, {
|
|
11777
11838
|
PLAY_TYPE: theme.options.type,
|
|
@@ -11853,7 +11914,11 @@
|
|
|
11853
11914
|
}
|
|
11854
11915
|
if (!theme._playing) (_theme_posterControl = theme.posterControl) == null ? void 0 : _theme_posterControl.show();
|
|
11855
11916
|
props = THEME_PROPS.reduce(function(acc, cur) {
|
|
11856
|
-
|
|
11917
|
+
if (cur === 'url') {
|
|
11918
|
+
acc[cur] = theme.options.url;
|
|
11919
|
+
} else {
|
|
11920
|
+
acc[cur] = theme[cur];
|
|
11921
|
+
}
|
|
11857
11922
|
return acc;
|
|
11858
11923
|
}, {});
|
|
11859
11924
|
// 由于 resize 改变有延时(节流), 第一次渲染时, 宽度高度可能为 0, 需要手动设置一下
|
|
@@ -12013,7 +12078,7 @@
|
|
|
12013
12078
|
var _renderTimeLine = function(theme, container, props) {
|
|
12014
12079
|
if (props === void 0) props = {};
|
|
12015
12080
|
if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
|
|
12016
|
-
var _theme_urlInfo, _theme_options, _theme_options1, _this, _theme_options2;
|
|
12081
|
+
var _theme_urlInfo, _theme_urlInfo1, _theme_options, _theme_options1, _this, _theme_options2;
|
|
12017
12082
|
var _showSectionIcon;
|
|
12018
12083
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12019
12084
|
theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
|
|
@@ -12022,7 +12087,7 @@
|
|
|
12022
12087
|
},
|
|
12023
12088
|
language: theme.options.language,
|
|
12024
12089
|
locales: theme.i18n.translations,
|
|
12025
|
-
coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + theme.urlInfo.validateCode : ''
|
|
12090
|
+
coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + ((_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.validateCode) : ''
|
|
12026
12091
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeLineOptions"]) || {}, {
|
|
12027
12092
|
showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_showSectionIcon = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _showSectionIcon : true : true,
|
|
12028
12093
|
props: props
|
|
@@ -12425,7 +12490,7 @@
|
|
|
12425
12490
|
_inherits(Theme, EventEmitter);
|
|
12426
12491
|
function Theme(options) {
|
|
12427
12492
|
var _this;
|
|
12428
|
-
var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1;
|
|
12493
|
+
var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_urlInfo_searchParams, _this_urlInfo, _this_options, _this_options1;
|
|
12429
12494
|
_this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
|
|
12430
12495
|
* @since 0.0.1
|
|
12431
12496
|
* @private
|
|
@@ -12445,7 +12510,7 @@
|
|
|
12445
12510
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
12446
12511
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
12447
12512
|
* @private
|
|
12448
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
|
|
12513
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
|
|
12449
12514
|
// * 记录回放的月份
|
|
12450
12515
|
// *
|
|
12451
12516
|
// * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
|
|
@@ -12456,17 +12521,17 @@
|
|
|
12456
12521
|
// _recMonthObj: Record<string, string[]> = {};
|
|
12457
12522
|
/**
|
|
12458
12523
|
* 录像回放的月份列表 @private
|
|
12459
|
-
*/ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false,
|
|
12524
|
+
*/ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
|
|
12460
12525
|
_this._initOptions(options);
|
|
12461
12526
|
if (_this.options.type === 'ezopen') {
|
|
12462
|
-
var
|
|
12463
|
-
_this.urlInfo =
|
|
12464
|
-
|
|
12465
|
-
_this.options.spaceId = _this.urlInfo.searchParams.spaceId;
|
|
12527
|
+
var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo2;
|
|
12528
|
+
if ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.spaceId) {
|
|
12529
|
+
var _this_urlInfo_searchParams2, _this_urlInfo3;
|
|
12530
|
+
_this.options.spaceId = (_this_urlInfo3 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo3.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.spaceId;
|
|
12466
12531
|
}
|
|
12467
|
-
if (_this.urlInfo.type === 'rec') {
|
|
12468
|
-
var
|
|
12469
|
-
_this._seekDate = ((
|
|
12532
|
+
if (((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : _this_urlInfo2.type) === 'rec') {
|
|
12533
|
+
var _this_urlInfo_searchParams3, _this_urlInfo4, _this_urlInfo_searchParams4, _this_urlInfo5;
|
|
12534
|
+
_this._seekDate = ((_this_urlInfo4 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams3 = _this_urlInfo4.searchParams) == null ? void 0 : _this_urlInfo_searchParams3.begin) ? distExports$3.DateTime.toDate((_this_urlInfo5 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams4 = _this_urlInfo5.searchParams) == null ? void 0 : _this_urlInfo_searchParams4.begin) : distExports$3.DateTime.toDate(distExports$3.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
|
|
12470
12535
|
}
|
|
12471
12536
|
}
|
|
12472
12537
|
_this._getRecType(_this.options.url);
|
|
@@ -12498,7 +12563,8 @@
|
|
|
12498
12563
|
var _this_options_volumeOptions_muted, _ref1;
|
|
12499
12564
|
_this._muted = (_ref1 = (_this_options_volumeOptions_muted = (_this_options_volumeOptions1 = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions1.muted) != null ? _this_options_volumeOptions_muted : _this.options.muted) != null ? _ref1 : false;
|
|
12500
12565
|
var _this_options_speedOptions_value, _ref2;
|
|
12501
|
-
|
|
12566
|
+
// playbackSpeed 是 萤石标准流倍速字段
|
|
12567
|
+
_this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : (_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.playbackSpeed) != null ? _ref2 : 1;
|
|
12502
12568
|
_this._mobileInnerWidthHeight = _this._mobileInnerWidthHeight.bind(_this);
|
|
12503
12569
|
_this._throttleMobileInnerWidthHeight = throttle(_this._mobileInnerWidthHeight, 20).bind(_this);
|
|
12504
12570
|
_this._onDblClickFullscreen = debounce(_this._onDblClickFullscreen, 20).bind(_this);
|
|
@@ -12515,9 +12581,10 @@
|
|
|
12515
12581
|
var template = (_this_options1 = _this.options) == null ? void 0 : _this_options1.template; // ThemeTemplateType | string | undefined
|
|
12516
12582
|
var initialThemeData;
|
|
12517
12583
|
if (options.type === 'hls' || options.type === 'ezhls') {
|
|
12584
|
+
var _options_url;
|
|
12518
12585
|
// hls / ezhls:@3.1.1 起支持自定义 themeData,但不支持标准提供的模板;未传时回退 hlsLiveTemplate
|
|
12519
|
-
// FIXME: 部分控件在 hls 下不生效,开发者需自行斟酌
|
|
12520
|
-
initialThemeData = themeData !== undefined ? themeData : hlsLiveTemplate;
|
|
12586
|
+
// FIXME: themeData 部分控件在 hls 下不生效,开发者需自行斟酌
|
|
12587
|
+
initialThemeData = themeData !== undefined ? themeData : ((_options_url = options.url) == null ? void 0 : _options_url.includes('/openpb/')) ? hlsRecTemplate : hlsLiveTemplate;
|
|
12521
12588
|
} else if ([
|
|
12522
12589
|
'flv',
|
|
12523
12590
|
'mp4'
|
|
@@ -12750,6 +12817,7 @@
|
|
|
12750
12817
|
this.options = deepmerge(THEME_DEFAULT_OPTIONS, options, {
|
|
12751
12818
|
clone: false
|
|
12752
12819
|
});
|
|
12820
|
+
this._url = this.options.url;
|
|
12753
12821
|
// ⚠警告 (./utils/interactiveHF.ts)
|
|
12754
12822
|
// PC 中窗口鼠标在header footer 移动(mousemove), 不允许消失及不要冒泡
|
|
12755
12823
|
// Mobile 中窗口点击在header footer 上(pointerdown/touchstart), 不允许消失及不要冒泡
|
|
@@ -13240,13 +13308,13 @@
|
|
|
13240
13308
|
* @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
|
|
13241
13309
|
*/ _proto._getRecType = function _getRecType(url) {
|
|
13242
13310
|
if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
|
|
13243
|
-
var
|
|
13244
|
-
if (urlInfo.type === 'rec') {
|
|
13245
|
-
var
|
|
13246
|
-
if (urlInfo.recType === 'cloud' && (urlInfo == null ? void 0 : (
|
|
13311
|
+
var _this_urlInfo;
|
|
13312
|
+
if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'rec') {
|
|
13313
|
+
var _this_urlInfo1, _this_urlInfo_searchParams, _this_urlInfo2, _this_urlInfo3;
|
|
13314
|
+
if (((_this_urlInfo1 = this.urlInfo) == null ? void 0 : _this_urlInfo1.recType) === 'cloud' && ((_this_urlInfo2 = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
|
|
13247
13315
|
this.recType = 'cloudRecord';
|
|
13248
13316
|
return 'cloudRecord';
|
|
13249
|
-
} else if (urlInfo.recType === 'cloud') {
|
|
13317
|
+
} else if (((_this_urlInfo3 = this.urlInfo) == null ? void 0 : _this_urlInfo3.recType) === 'cloud') {
|
|
13250
13318
|
this.recType = 'cloudRec';
|
|
13251
13319
|
return 'cloudRec';
|
|
13252
13320
|
} else {
|
|
@@ -13254,13 +13322,13 @@
|
|
|
13254
13322
|
return 'rec';
|
|
13255
13323
|
}
|
|
13256
13324
|
}
|
|
13257
|
-
} else if (distExports$3.isHttp(url) && url.includes(
|
|
13258
|
-
// 萤石 ll-hls 回放
|
|
13259
|
-
if (url.includes(
|
|
13325
|
+
} else if (distExports$3.isHttp(url) && url.includes('/openpb/')) {
|
|
13326
|
+
// 萤石 ll-hls/flv 回放
|
|
13327
|
+
if (url.includes('rec=cloud')) {
|
|
13260
13328
|
// 云存储
|
|
13261
13329
|
this.recType = 'cloudRec';
|
|
13262
13330
|
return 'cloudRec';
|
|
13263
|
-
} else if (url.includes(
|
|
13331
|
+
} else if (url.includes('rec=local')) {
|
|
13264
13332
|
// 本地存储
|
|
13265
13333
|
this.recType = 'rec';
|
|
13266
13334
|
return 'rec';
|
|
@@ -13308,6 +13376,26 @@
|
|
|
13308
13376
|
}
|
|
13309
13377
|
};
|
|
13310
13378
|
_create_class(Theme, [
|
|
13379
|
+
{
|
|
13380
|
+
key: "url",
|
|
13381
|
+
get: function get() {
|
|
13382
|
+
return this._url;
|
|
13383
|
+
},
|
|
13384
|
+
set: function set(url) {
|
|
13385
|
+
this._url = url;
|
|
13386
|
+
}
|
|
13387
|
+
},
|
|
13388
|
+
{
|
|
13389
|
+
key: "urlInfo",
|
|
13390
|
+
get: /**
|
|
13391
|
+
* url 信息 播放地址信息
|
|
13392
|
+
*/ function get() {
|
|
13393
|
+
if (this._url) {
|
|
13394
|
+
return distExports$3.parseEzopenUrl(this._url);
|
|
13395
|
+
}
|
|
13396
|
+
return {};
|
|
13397
|
+
}
|
|
13398
|
+
},
|
|
13311
13399
|
{
|
|
13312
13400
|
key: "width",
|
|
13313
13401
|
get: /**
|
|
@@ -13707,6 +13795,36 @@
|
|
|
13707
13795
|
*/ function get() {
|
|
13708
13796
|
return !!this._footerMoreControl;
|
|
13709
13797
|
}
|
|
13798
|
+
},
|
|
13799
|
+
{
|
|
13800
|
+
key: "isEzopen",
|
|
13801
|
+
get: function get() {
|
|
13802
|
+
// 私有流地址
|
|
13803
|
+
return /^ezopen:\/\//.test(this._url);
|
|
13804
|
+
}
|
|
13805
|
+
},
|
|
13806
|
+
{
|
|
13807
|
+
key: "isEzviz",
|
|
13808
|
+
get: /**
|
|
13809
|
+
* 判断播放地址是萤石的播放地址
|
|
13810
|
+
* @since 3.1.2
|
|
13811
|
+
*/ function get() {
|
|
13812
|
+
var path = this._url.split('?')[0];
|
|
13813
|
+
var queryStr = this._url.split('?')[1];
|
|
13814
|
+
var lastPath = path.split('/')[path.split('/').length - 1];
|
|
13815
|
+
// ezopen://open.ys7.com/BC7799091/1.rec
|
|
13816
|
+
// rtmp://rtmp05open.ys7.com:1935/v3/openpb/BC7799091_1_1
|
|
13817
|
+
// https://open.ys7.com/v3/openpb/llhls/BC7799091_1_1.m3u8
|
|
13818
|
+
// https://rtmp05open.ys7.com:9188/v3/openpb/BC7799091_1_1.flv
|
|
13819
|
+
// https://host:2001/live?dev=D08197169&chn=1&ss=token&stream=1
|
|
13820
|
+
if (// 私有流地址
|
|
13821
|
+
/^ezopen:\/\//.test(path) || // 标准流地址
|
|
13822
|
+
path.includes('/openlive/') || path.includes('/openpb/') && /[a-zA-Z0-9:]+_\d+_\d+/.test(lastPath) || // webtransport 取流
|
|
13823
|
+
distExports$3.isHttp(this._url) && queryStr && /dev=[a-zA-Z0-9:]+/.test(queryStr) && /chn=\d+/.test(queryStr) && /stream=\d+/.test(queryStr) && queryStr.includes('ssn=')) {
|
|
13824
|
+
return true;
|
|
13825
|
+
}
|
|
13826
|
+
return false;
|
|
13827
|
+
}
|
|
13710
13828
|
}
|
|
13711
13829
|
]);
|
|
13712
13830
|
return Theme;
|
|
@@ -13717,7 +13835,7 @@
|
|
|
13717
13835
|
zh: zh,
|
|
13718
13836
|
en: en
|
|
13719
13837
|
};
|
|
13720
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.
|
|
13838
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.2';
|
|
13721
13839
|
|
|
13722
13840
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13723
13841
|
|
package/dist/style.js
CHANGED