@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/index.esm.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.1
3
- * Copyright (c) 2026-08-03 10:44:57 Ezviz-OpenBiz
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
  import EventEmitter from 'eventemitter3';
7
7
  import Picker from '@skax/picker';
8
8
  import delegate from '@skax/delegate';
9
9
  import deepmerge from 'deepmerge';
10
- import { isMobile, DateTime, parseEzopenUrl, isHttp } from '@ezuikit/utils-tools';
10
+ import { isMobile, DateTime, isHttp, parseEzopenUrl } from '@ezuikit/utils-tools';
11
11
  import screenfull from 'screenfull';
12
12
  import I18n from '@ezuikit/utils-i18n';
13
13
  import Logger from '@ezuikit/utils-logger';
@@ -45,7 +45,8 @@ var THEME_PROPS = [
45
45
  'urlInfo',
46
46
  'videoLevelList',
47
47
  'videoLevel',
48
- 'recMonth'
48
+ 'recMonth',
49
+ 'url'
49
50
  ];
50
51
  /**
51
52
  * 当移动端 picker 控件打开时需要关闭动画(定时器)
@@ -3348,6 +3349,59 @@ var en = {
3348
3349
  }
3349
3350
  };
3350
3351
 
3352
+ /**
3353
+ * flv 预览
3354
+ */ var hlsRecTemplate = {
3355
+ autoFocus: 3,
3356
+ // poster:
3357
+ // "https://img2.baidu.com/it/u=3209353042,356122753&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",
3358
+ footer: {
3359
+ btnList: [
3360
+ {
3361
+ iconId: 'play',
3362
+ part: 'left',
3363
+ isrender: 1
3364
+ },
3365
+ {
3366
+ iconId: 'capturePicture',
3367
+ part: 'left',
3368
+ defaultActive: 0,
3369
+ isrender: 1
3370
+ },
3371
+ {
3372
+ iconId: 'volume',
3373
+ part: 'left',
3374
+ defaultActive: 0,
3375
+ isrender: 1
3376
+ },
3377
+ {
3378
+ iconId: 'zoom',
3379
+ part: 'left',
3380
+ defaultActive: 0,
3381
+ isrender: 1
3382
+ },
3383
+ {
3384
+ iconId: 'speed',
3385
+ part: 'right',
3386
+ defaultActive: 0,
3387
+ isrender: 1
3388
+ },
3389
+ {
3390
+ iconId: 'fullscreen',
3391
+ part: 'right',
3392
+ defaultActive: 0,
3393
+ isrender: 1
3394
+ },
3395
+ {
3396
+ iconId: 'globalFullscreen',
3397
+ part: 'right',
3398
+ defaultActive: 0,
3399
+ isrender: 1
3400
+ }
3401
+ ]
3402
+ }
3403
+ };
3404
+
3351
3405
  /**
3352
3406
  * pc 预览
3353
3407
  */ var pcLive = {
@@ -7084,6 +7138,7 @@ function _ts_generator$2(thisArg, body) {
7084
7138
  _inherits$f(AIChat, Control);
7085
7139
  function AIChat(options) {
7086
7140
  var _this;
7141
+ var _options_urlInfo_searchParams, _options_urlInfo, _options_urlInfo1;
7087
7142
  _this = Control.call(this, _extends$e({}, options, {
7088
7143
  tagName: 'span',
7089
7144
  controlType: 'button',
@@ -7097,7 +7152,7 @@ function _ts_generator$2(thisArg, body) {
7097
7152
  _this._render();
7098
7153
  }
7099
7154
  });
7100
- if (options.urlInfo.searchParams.busType !== '7' && options.urlInfo.recType === 'cloud' && options.sdkType === 'base') {
7155
+ 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') {
7101
7156
  _this.$container.style.removeProperty('display');
7102
7157
  } else {
7103
7158
  _this.$container.style.display = 'none';
@@ -8202,7 +8257,7 @@ var SPEED_DEFAULT_OPTIONS = {
8202
8257
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
8203
8258
  }
8204
8259
  })) || this;
8205
- _this._filterSpeedList(options.list, options.props.recType);
8260
+ _this._filterSpeedList(options.list, options.props.recType, options.props.url);
8206
8261
  _this.on(EVENTS.speedChange, function(speed) {
8207
8262
  if (_this.value !== speed + '') _this.value = speed + '';
8208
8263
  });
@@ -8216,18 +8271,24 @@ var SPEED_DEFAULT_OPTIONS = {
8216
8271
  * 滤掉本地回放不支持的倍速
8217
8272
  * @param optionsList 初始化配置倍速列表
8218
8273
  * @param type 回放类型
8219
- */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
8274
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
8220
8275
  if (!optionsList) {
8221
- // 非用户自定义
8222
- if (type === 'rec') {
8223
- // 本地回放 不支持 8 16 32 倍速
8276
+ // 非用户自定义 /openpb/ 是标准流回放路径
8277
+ if (type === 'rec' || (url == null ? void 0 : url.includes('/openpb/'))) {
8278
+ // ezopen本地回放 或 hls 回放 不支持 8 16 32 倍速
8224
8279
  var list = this.list.filter(function(item) {
8225
8280
  return (item == null ? void 0 : item.value) && +item.value < 8;
8226
8281
  });
8227
8282
  this.updateOptions(list);
8228
- } else {
8283
+ } else if (type === 'cloudRec' || type === 'cloudRecord') {
8229
8284
  // 云端回放 支持 8 16 32 倍速
8230
8285
  this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8286
+ } else {
8287
+ // 三方默认回放倍速设置
8288
+ var list1 = this.list.filter(function(item) {
8289
+ return (item == null ? void 0 : item.value) && +item.value < 8;
8290
+ });
8291
+ this.updateOptions(list1);
8231
8292
  }
8232
8293
  }
8233
8294
  };
@@ -9388,7 +9449,7 @@ function _renderControls(theme, $container, btnList, props) {
9388
9449
  if (theme.options.deviceOptions !== null) {
9389
9450
  var _theme_controls;
9390
9451
  if (!((_theme_controls = theme.controls) == null ? void 0 : _theme_controls["deviceControl"])) {
9391
- var _theme_options;
9452
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options;
9392
9453
  // eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
9393
9454
  theme.controls["deviceControl"] = new Controls["device"](_extends$1({
9394
9455
  rootContainer: theme.$container,
@@ -9399,8 +9460,8 @@ function _renderControls(theme, $container, btnList, props) {
9399
9460
  language: theme.options.language,
9400
9461
  locales: theme.i18n.translations,
9401
9462
  type: theme.options.type,
9402
- deviceSerial: theme.urlInfo.deviceSerial,
9403
- channelNo: theme.urlInfo.channelNo
9463
+ deviceSerial: (_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.deviceSerial,
9464
+ channelNo: (_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.channelNo
9404
9465
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
9405
9466
  props: props
9406
9467
  }));
@@ -9411,7 +9472,7 @@ function _renderControls(theme, $container, btnList, props) {
9411
9472
  // footer
9412
9473
  if (Controls[item.iconId]) {
9413
9474
  if (theme.options["" + item.iconId + "Options"] !== null) {
9414
- var _theme_options1;
9475
+ var _theme_urlInfo2, _theme_urlInfo3, _theme_options1;
9415
9476
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9416
9477
  theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
9417
9478
  rootContainer: theme.$container,
@@ -9424,8 +9485,8 @@ function _renderControls(theme, $container, btnList, props) {
9424
9485
  env: theme.options.env,
9425
9486
  accessToken: theme.options.accessToken,
9426
9487
  token: theme.options.token,
9427
- deviceSerial: theme.urlInfo.deviceSerial,
9428
- channelNo: theme.urlInfo.channelNo,
9488
+ deviceSerial: (_theme_urlInfo2 = theme.urlInfo) == null ? void 0 : _theme_urlInfo2.deviceSerial,
9489
+ channelNo: (_theme_urlInfo3 = theme.urlInfo) == null ? void 0 : _theme_urlInfo3.channelNo,
9429
9490
  urlInfo: theme.urlInfo
9430
9491
  } : {}, {
9431
9492
  PLAY_TYPE: theme.options.type,
@@ -9507,7 +9568,11 @@ function _renderTheme(theme, data) {
9507
9568
  }
9508
9569
  if (!theme._playing) (_theme_posterControl = theme.posterControl) == null ? void 0 : _theme_posterControl.show();
9509
9570
  props = THEME_PROPS.reduce(function(acc, cur) {
9510
- acc[cur] = theme[cur];
9571
+ if (cur === 'url') {
9572
+ acc[cur] = theme.options.url;
9573
+ } else {
9574
+ acc[cur] = theme[cur];
9575
+ }
9511
9576
  return acc;
9512
9577
  }, {});
9513
9578
  // 由于 resize 改变有延时(节流), 第一次渲染时, 宽度高度可能为 0, 需要手动设置一下
@@ -9667,7 +9732,7 @@ function _renderTheme(theme, data) {
9667
9732
  var _renderTimeLine = function(theme, container, props) {
9668
9733
  if (props === void 0) props = {};
9669
9734
  if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
9670
- var _theme_urlInfo, _theme_options, _theme_options1, _this, _theme_options2;
9735
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options, _theme_options1, _this, _theme_options2;
9671
9736
  var _showSectionIcon;
9672
9737
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9673
9738
  theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
@@ -9676,7 +9741,7 @@ var _renderTimeLine = function(theme, container, props) {
9676
9741
  },
9677
9742
  language: theme.options.language,
9678
9743
  locales: theme.i18n.translations,
9679
- coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + theme.urlInfo.validateCode : ''
9744
+ coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + ((_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.validateCode) : ''
9680
9745
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeLineOptions"]) || {}, {
9681
9746
  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,
9682
9747
  props: props
@@ -10079,7 +10144,7 @@ var THEME_DEFAULT_OPTIONS = {
10079
10144
  _inherits(Theme, EventEmitter);
10080
10145
  function Theme(options) {
10081
10146
  var _this;
10082
- var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1;
10147
+ var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_urlInfo_searchParams, _this_urlInfo, _this_options, _this_options1;
10083
10148
  _this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
10084
10149
  * @since 0.0.1
10085
10150
  * @private
@@ -10099,7 +10164,7 @@ var THEME_DEFAULT_OPTIONS = {
10099
10164
  */ _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, /**
10100
10165
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
10101
10166
  * @private
10102
- */ _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, // /**
10167
+ */ _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, // /**
10103
10168
  // * 记录回放的月份
10104
10169
  // *
10105
10170
  // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
@@ -10110,17 +10175,17 @@ var THEME_DEFAULT_OPTIONS = {
10110
10175
  // _recMonthObj: Record<string, string[]> = {};
10111
10176
  /**
10112
10177
  * 录像回放的月份列表 @private
10113
- */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
10178
+ */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
10114
10179
  _this._initOptions(options);
10115
10180
  if (_this.options.type === 'ezopen') {
10116
- var _this_urlInfo_searchParams, _this_urlInfo;
10117
- _this.urlInfo = parseEzopenUrl(_this.options.url);
10118
- if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
10119
- _this.options.spaceId = _this.urlInfo.searchParams.spaceId;
10181
+ var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo2;
10182
+ if ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.spaceId) {
10183
+ var _this_urlInfo_searchParams2, _this_urlInfo3;
10184
+ _this.options.spaceId = (_this_urlInfo3 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo3.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.spaceId;
10120
10185
  }
10121
- if (_this.urlInfo.type === 'rec') {
10122
- var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
10123
- _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : DateTime.toDate(DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10186
+ if (((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : _this_urlInfo2.type) === 'rec') {
10187
+ var _this_urlInfo_searchParams3, _this_urlInfo4, _this_urlInfo_searchParams4, _this_urlInfo5;
10188
+ _this._seekDate = ((_this_urlInfo4 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams3 = _this_urlInfo4.searchParams) == null ? void 0 : _this_urlInfo_searchParams3.begin) ? DateTime.toDate((_this_urlInfo5 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams4 = _this_urlInfo5.searchParams) == null ? void 0 : _this_urlInfo_searchParams4.begin) : DateTime.toDate(DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10124
10189
  }
10125
10190
  }
10126
10191
  _this._getRecType(_this.options.url);
@@ -10152,7 +10217,8 @@ var THEME_DEFAULT_OPTIONS = {
10152
10217
  var _this_options_volumeOptions_muted, _ref1;
10153
10218
  _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;
10154
10219
  var _this_options_speedOptions_value, _ref2;
10155
- _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.options.value) != null ? _ref2 : 1;
10220
+ // playbackSpeed 是 萤石标准流倍速字段
10221
+ _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;
10156
10222
  _this._mobileInnerWidthHeight = _this._mobileInnerWidthHeight.bind(_this);
10157
10223
  _this._throttleMobileInnerWidthHeight = throttle(_this._mobileInnerWidthHeight, 20).bind(_this);
10158
10224
  _this._onDblClickFullscreen = debounce(_this._onDblClickFullscreen, 20).bind(_this);
@@ -10169,9 +10235,10 @@ var THEME_DEFAULT_OPTIONS = {
10169
10235
  var template = (_this_options1 = _this.options) == null ? void 0 : _this_options1.template; // ThemeTemplateType | string | undefined
10170
10236
  var initialThemeData;
10171
10237
  if (options.type === 'hls' || options.type === 'ezhls') {
10238
+ var _options_url;
10172
10239
  // hls / ezhls:@3.1.1 起支持自定义 themeData,但不支持标准提供的模板;未传时回退 hlsLiveTemplate
10173
- // FIXME: 部分控件在 hls 下不生效,开发者需自行斟酌
10174
- initialThemeData = themeData !== undefined ? themeData : hlsLiveTemplate;
10240
+ // FIXME: themeData 部分控件在 hls 下不生效,开发者需自行斟酌
10241
+ initialThemeData = themeData !== undefined ? themeData : ((_options_url = options.url) == null ? void 0 : _options_url.includes('/openpb/')) ? hlsRecTemplate : hlsLiveTemplate;
10175
10242
  } else if ([
10176
10243
  'flv',
10177
10244
  'mp4'
@@ -10404,6 +10471,7 @@ var THEME_DEFAULT_OPTIONS = {
10404
10471
  this.options = deepmerge(THEME_DEFAULT_OPTIONS, options, {
10405
10472
  clone: false
10406
10473
  });
10474
+ this._url = this.options.url;
10407
10475
  // ⚠警告 (./utils/interactiveHF.ts)
10408
10476
  // PC 中窗口鼠标在header footer 移动(mousemove), 不允许消失及不要冒泡
10409
10477
  // Mobile 中窗口点击在header footer 上(pointerdown/touchstart), 不允许消失及不要冒泡
@@ -10894,13 +10962,13 @@ var THEME_DEFAULT_OPTIONS = {
10894
10962
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
10895
10963
  */ _proto._getRecType = function _getRecType(url) {
10896
10964
  if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
10897
- var urlInfo = parseEzopenUrl(url);
10898
- if (urlInfo.type === 'rec') {
10899
- var _urlInfo_searchParams;
10900
- if (urlInfo.recType === 'cloud' && (urlInfo == null ? void 0 : (_urlInfo_searchParams = urlInfo.searchParams) == null ? void 0 : _urlInfo_searchParams.busType) === '7') {
10965
+ var _this_urlInfo;
10966
+ if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'rec') {
10967
+ var _this_urlInfo1, _this_urlInfo_searchParams, _this_urlInfo2, _this_urlInfo3;
10968
+ 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') {
10901
10969
  this.recType = 'cloudRecord';
10902
10970
  return 'cloudRecord';
10903
- } else if (urlInfo.recType === 'cloud') {
10971
+ } else if (((_this_urlInfo3 = this.urlInfo) == null ? void 0 : _this_urlInfo3.recType) === 'cloud') {
10904
10972
  this.recType = 'cloudRec';
10905
10973
  return 'cloudRec';
10906
10974
  } else {
@@ -10908,13 +10976,13 @@ var THEME_DEFAULT_OPTIONS = {
10908
10976
  return 'rec';
10909
10977
  }
10910
10978
  }
10911
- } else if (isHttp(url) && url.includes("/openpb/llhls/")) {
10912
- // 萤石 ll-hls 回放
10913
- if (url.includes("rec=cloud")) {
10979
+ } else if (isHttp(url) && url.includes('/openpb/')) {
10980
+ // 萤石 ll-hls/flv 回放
10981
+ if (url.includes('rec=cloud')) {
10914
10982
  // 云存储
10915
10983
  this.recType = 'cloudRec';
10916
10984
  return 'cloudRec';
10917
- } else if (url.includes("rec=local")) {
10985
+ } else if (url.includes('rec=local')) {
10918
10986
  // 本地存储
10919
10987
  this.recType = 'rec';
10920
10988
  return 'rec';
@@ -10962,6 +11030,26 @@ var THEME_DEFAULT_OPTIONS = {
10962
11030
  }
10963
11031
  };
10964
11032
  _create_class(Theme, [
11033
+ {
11034
+ key: "url",
11035
+ get: function get() {
11036
+ return this._url;
11037
+ },
11038
+ set: function set(url) {
11039
+ this._url = url;
11040
+ }
11041
+ },
11042
+ {
11043
+ key: "urlInfo",
11044
+ get: /**
11045
+ * url 信息 播放地址信息
11046
+ */ function get() {
11047
+ if (this._url) {
11048
+ return parseEzopenUrl(this._url);
11049
+ }
11050
+ return {};
11051
+ }
11052
+ },
10965
11053
  {
10966
11054
  key: "width",
10967
11055
  get: /**
@@ -11361,6 +11449,36 @@ var THEME_DEFAULT_OPTIONS = {
11361
11449
  */ function get() {
11362
11450
  return !!this._footerMoreControl;
11363
11451
  }
11452
+ },
11453
+ {
11454
+ key: "isEzopen",
11455
+ get: function get() {
11456
+ // 私有流地址
11457
+ return /^ezopen:\/\//.test(this._url);
11458
+ }
11459
+ },
11460
+ {
11461
+ key: "isEzviz",
11462
+ get: /**
11463
+ * 判断播放地址是萤石的播放地址
11464
+ * @since 3.1.2
11465
+ */ function get() {
11466
+ var path = this._url.split('?')[0];
11467
+ var queryStr = this._url.split('?')[1];
11468
+ var lastPath = path.split('/')[path.split('/').length - 1];
11469
+ // ezopen://open.ys7.com/BC7799091/1.rec
11470
+ // rtmp://rtmp05open.ys7.com:1935/v3/openpb/BC7799091_1_1
11471
+ // https://open.ys7.com/v3/openpb/llhls/BC7799091_1_1.m3u8
11472
+ // https://rtmp05open.ys7.com:9188/v3/openpb/BC7799091_1_1.flv
11473
+ // https://host:2001/live?dev=D08197169&chn=1&ss=token&stream=1
11474
+ if (// 私有流地址
11475
+ /^ezopen:\/\//.test(path) || // 标准流地址
11476
+ path.includes('/openlive/') || path.includes('/openpb/') && /[a-zA-Z0-9:]+_\d+_\d+/.test(lastPath) || // webtransport 取流
11477
+ isHttp(this._url) && queryStr && /dev=[a-zA-Z0-9:]+/.test(queryStr) && /chn=\d+/.test(queryStr) && /stream=\d+/.test(queryStr) && queryStr.includes('ssn=')) {
11478
+ return true;
11479
+ }
11480
+ return false;
11481
+ }
11364
11482
  }
11365
11483
  ]);
11366
11484
  return Theme;
@@ -11371,6 +11489,6 @@ var THEME_DEFAULT_OPTIONS = {
11371
11489
  zh: zh,
11372
11490
  en: en
11373
11491
  };
11374
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.1';
11492
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.2';
11375
11493
 
11376
11494
  export { Control, EVENTS, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };