@ezuikit/player-theme 3.1.1-beta.2 → 3.1.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/constant.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.1-beta.2
3
- * Copyright (c) 2026-07-30 01:56:43 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.1
3
+ * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  /**
@@ -32,7 +32,8 @@ var THEME_PROPS = [
32
32
  'urlInfo',
33
33
  'videoLevelList',
34
34
  'videoLevel',
35
- 'recMonth'
35
+ 'recMonth',
36
+ 'url'
36
37
  ];
37
38
  /**
38
39
  * 当移动端 picker 控件打开时需要关闭动画(定时器)
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.1-beta.2
3
- * Copyright (c) 2026-07-30 01:56:43 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.1
3
+ * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  'use strict';
@@ -47,7 +47,8 @@ var THEME_PROPS = [
47
47
  'urlInfo',
48
48
  'videoLevelList',
49
49
  'videoLevel',
50
- 'recMonth'
50
+ 'recMonth',
51
+ 'url'
51
52
  ];
52
53
  /**
53
54
  * 当移动端 picker 控件打开时需要关闭动画(定时器)
@@ -3350,6 +3351,59 @@ var en = {
3350
3351
  }
3351
3352
  };
3352
3353
 
3354
+ /**
3355
+ * flv 预览
3356
+ */ var hlsRecTemplate = {
3357
+ autoFocus: 3,
3358
+ // poster:
3359
+ // "https://img2.baidu.com/it/u=3209353042,356122753&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",
3360
+ footer: {
3361
+ btnList: [
3362
+ {
3363
+ iconId: 'play',
3364
+ part: 'left',
3365
+ isrender: 1
3366
+ },
3367
+ {
3368
+ iconId: 'capturePicture',
3369
+ part: 'left',
3370
+ defaultActive: 0,
3371
+ isrender: 1
3372
+ },
3373
+ {
3374
+ iconId: 'volume',
3375
+ part: 'left',
3376
+ defaultActive: 0,
3377
+ isrender: 1
3378
+ },
3379
+ {
3380
+ iconId: 'zoom',
3381
+ part: 'left',
3382
+ defaultActive: 0,
3383
+ isrender: 1
3384
+ },
3385
+ {
3386
+ iconId: 'speed',
3387
+ part: 'right',
3388
+ defaultActive: 0,
3389
+ isrender: 1
3390
+ },
3391
+ {
3392
+ iconId: 'fullscreen',
3393
+ part: 'right',
3394
+ defaultActive: 0,
3395
+ isrender: 1
3396
+ },
3397
+ {
3398
+ iconId: 'globalFullscreen',
3399
+ part: 'right',
3400
+ defaultActive: 0,
3401
+ isrender: 1
3402
+ }
3403
+ ]
3404
+ }
3405
+ };
3406
+
3353
3407
  /**
3354
3408
  * pc 预览
3355
3409
  */ var pcLive = {
@@ -8204,7 +8258,7 @@ var SPEED_DEFAULT_OPTIONS = {
8204
8258
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
8205
8259
  }
8206
8260
  })) || this;
8207
- _this._filterSpeedList(options.list, options.props.recType);
8261
+ _this._filterSpeedList(options.list, options.props.recType, options.props.url);
8208
8262
  _this.on(EVENTS.speedChange, function(speed) {
8209
8263
  if (_this.value !== speed + '') _this.value = speed + '';
8210
8264
  });
@@ -8218,18 +8272,24 @@ var SPEED_DEFAULT_OPTIONS = {
8218
8272
  * 滤掉本地回放不支持的倍速
8219
8273
  * @param optionsList 初始化配置倍速列表
8220
8274
  * @param type 回放类型
8221
- */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
8275
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
8222
8276
  if (!optionsList) {
8223
- // 非用户自定义
8224
- if (type === 'rec') {
8225
- // 本地回放 不支持 8 16 32 倍速
8277
+ // 非用户自定义 /openpb/ 是标准流回放路径
8278
+ if (type === 'rec' || (url == null ? void 0 : url.includes('/openpb/'))) {
8279
+ // ezopen本地回放 或 hls 回放 不支持 8 16 32 倍速
8226
8280
  var list = this.list.filter(function(item) {
8227
8281
  return (item == null ? void 0 : item.value) && +item.value < 8;
8228
8282
  });
8229
8283
  this.updateOptions(list);
8230
- } else {
8284
+ } else if (type === 'cloudRec' || type === 'cloudRecord') {
8231
8285
  // 云端回放 支持 8 16 32 倍速
8232
8286
  this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8287
+ } else {
8288
+ // 三方默认回放倍速设置
8289
+ var list1 = this.list.filter(function(item) {
8290
+ return (item == null ? void 0 : item.value) && +item.value < 8;
8291
+ });
8292
+ this.updateOptions(list1);
8233
8293
  }
8234
8294
  }
8235
8295
  };
@@ -9509,7 +9569,11 @@ function _renderTheme(theme, data) {
9509
9569
  }
9510
9570
  if (!theme._playing) (_theme_posterControl = theme.posterControl) == null ? void 0 : _theme_posterControl.show();
9511
9571
  props = THEME_PROPS.reduce(function(acc, cur) {
9512
- acc[cur] = theme[cur];
9572
+ if (cur === 'url') {
9573
+ acc[cur] = theme.options.url;
9574
+ } else {
9575
+ acc[cur] = theme[cur];
9576
+ }
9513
9577
  return acc;
9514
9578
  }, {});
9515
9579
  // 由于 resize 改变有延时(节流), 第一次渲染时, 宽度高度可能为 0, 需要手动设置一下
@@ -10112,11 +10176,10 @@ var THEME_DEFAULT_OPTIONS = {
10112
10176
  // _recMonthObj: Record<string, string[]> = {};
10113
10177
  /**
10114
10178
  * 录像回放的月份列表 @private
10115
- */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
10179
+ */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
10116
10180
  _this._initOptions(options);
10117
10181
  if (_this.options.type === 'ezopen') {
10118
10182
  var _this_urlInfo_searchParams, _this_urlInfo;
10119
- _this.urlInfo = utilsTools.parseEzopenUrl(_this.options.url);
10120
10183
  if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
10121
10184
  _this.options.spaceId = _this.urlInfo.searchParams.spaceId;
10122
10185
  }
@@ -10171,9 +10234,10 @@ var THEME_DEFAULT_OPTIONS = {
10171
10234
  var template = (_this_options1 = _this.options) == null ? void 0 : _this_options1.template; // ThemeTemplateType | string | undefined
10172
10235
  var initialThemeData;
10173
10236
  if (options.type === 'hls' || options.type === 'ezhls') {
10237
+ var _options_url;
10174
10238
  // hls / ezhls:@3.1.1 起支持自定义 themeData,但不支持标准提供的模板;未传时回退 hlsLiveTemplate
10175
- // FIXME: 部分控件在 hls 下不生效,开发者需自行斟酌
10176
- initialThemeData = themeData !== undefined ? themeData : hlsLiveTemplate;
10239
+ // FIXME: themeData 部分控件在 hls 下不生效,开发者需自行斟酌
10240
+ initialThemeData = themeData !== undefined ? themeData : ((_options_url = options.url) == null ? void 0 : _options_url.includes('/openpb/')) ? hlsRecTemplate : hlsLiveTemplate;
10177
10241
  } else if ([
10178
10242
  'flv',
10179
10243
  'mp4'
@@ -10896,13 +10960,12 @@ var THEME_DEFAULT_OPTIONS = {
10896
10960
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
10897
10961
  */ _proto._getRecType = function _getRecType(url) {
10898
10962
  if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
10899
- var urlInfo = utilsTools.parseEzopenUrl(url);
10900
- if (urlInfo.type === 'rec') {
10901
- var _urlInfo_searchParams;
10902
- if (urlInfo.recType === 'cloud' && (urlInfo == null ? void 0 : (_urlInfo_searchParams = urlInfo.searchParams) == null ? void 0 : _urlInfo_searchParams.busType) === '7') {
10963
+ if (this.urlInfo.type === 'rec') {
10964
+ var _this_urlInfo_searchParams, _this_urlInfo;
10965
+ if (this.urlInfo.recType === 'cloud' && ((_this_urlInfo = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
10903
10966
  this.recType = 'cloudRecord';
10904
10967
  return 'cloudRecord';
10905
- } else if (urlInfo.recType === 'cloud') {
10968
+ } else if (this.urlInfo.recType === 'cloud') {
10906
10969
  this.recType = 'cloudRec';
10907
10970
  return 'cloudRec';
10908
10971
  } else {
@@ -10910,6 +10973,18 @@ var THEME_DEFAULT_OPTIONS = {
10910
10973
  return 'rec';
10911
10974
  }
10912
10975
  }
10976
+ } else if (utilsTools.isHttp(url) && url.includes('/openpb/')) {
10977
+ // 萤石 ll-hls/flv 回放
10978
+ if (url.includes('rec=cloud')) {
10979
+ // 云存储
10980
+ this.recType = 'cloudRec';
10981
+ return 'cloudRec';
10982
+ } else if (url.includes('rec=local')) {
10983
+ // 本地存储
10984
+ this.recType = 'rec';
10985
+ return 'rec';
10986
+ }
10987
+ // 不支持云录制
10913
10988
  }
10914
10989
  this.recType = '';
10915
10990
  return '';
@@ -10952,6 +11027,17 @@ var THEME_DEFAULT_OPTIONS = {
10952
11027
  }
10953
11028
  };
10954
11029
  _create_class(Theme, [
11030
+ {
11031
+ key: "urlInfo",
11032
+ get: /**
11033
+ * url 信息 播放地址信息
11034
+ */ function get() {
11035
+ if (this.options.url) {
11036
+ return utilsTools.parseEzopenUrl(this.options.url);
11037
+ }
11038
+ return {};
11039
+ }
11040
+ },
10955
11041
  {
10956
11042
  key: "width",
10957
11043
  get: /**
@@ -11361,7 +11447,7 @@ var THEME_DEFAULT_OPTIONS = {
11361
11447
  zh: zh,
11362
11448
  en: en
11363
11449
  };
11364
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.1-beta.2';
11450
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.1';
11365
11451
 
11366
11452
  exports.Control = Control;
11367
11453
  exports.EVENTS = EVENTS;
package/dist/index.esm.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.1-beta.2
3
- * Copyright (c) 2026-07-30 01:56:43 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.1
3
+ * Copyright (c) 2026-08-10 02:32:17 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 } 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 = {
@@ -8202,7 +8256,7 @@ var SPEED_DEFAULT_OPTIONS = {
8202
8256
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
8203
8257
  }
8204
8258
  })) || this;
8205
- _this._filterSpeedList(options.list, options.props.recType);
8259
+ _this._filterSpeedList(options.list, options.props.recType, options.props.url);
8206
8260
  _this.on(EVENTS.speedChange, function(speed) {
8207
8261
  if (_this.value !== speed + '') _this.value = speed + '';
8208
8262
  });
@@ -8216,18 +8270,24 @@ var SPEED_DEFAULT_OPTIONS = {
8216
8270
  * 滤掉本地回放不支持的倍速
8217
8271
  * @param optionsList 初始化配置倍速列表
8218
8272
  * @param type 回放类型
8219
- */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
8273
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type, url) {
8220
8274
  if (!optionsList) {
8221
- // 非用户自定义
8222
- if (type === 'rec') {
8223
- // 本地回放 不支持 8 16 32 倍速
8275
+ // 非用户自定义 /openpb/ 是标准流回放路径
8276
+ if (type === 'rec' || (url == null ? void 0 : url.includes('/openpb/'))) {
8277
+ // ezopen本地回放 或 hls 回放 不支持 8 16 32 倍速
8224
8278
  var list = this.list.filter(function(item) {
8225
8279
  return (item == null ? void 0 : item.value) && +item.value < 8;
8226
8280
  });
8227
8281
  this.updateOptions(list);
8228
- } else {
8282
+ } else if (type === 'cloudRec' || type === 'cloudRecord') {
8229
8283
  // 云端回放 支持 8 16 32 倍速
8230
8284
  this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8285
+ } else {
8286
+ // 三方默认回放倍速设置
8287
+ var list1 = this.list.filter(function(item) {
8288
+ return (item == null ? void 0 : item.value) && +item.value < 8;
8289
+ });
8290
+ this.updateOptions(list1);
8231
8291
  }
8232
8292
  }
8233
8293
  };
@@ -9507,7 +9567,11 @@ function _renderTheme(theme, data) {
9507
9567
  }
9508
9568
  if (!theme._playing) (_theme_posterControl = theme.posterControl) == null ? void 0 : _theme_posterControl.show();
9509
9569
  props = THEME_PROPS.reduce(function(acc, cur) {
9510
- acc[cur] = theme[cur];
9570
+ if (cur === 'url') {
9571
+ acc[cur] = theme.options.url;
9572
+ } else {
9573
+ acc[cur] = theme[cur];
9574
+ }
9511
9575
  return acc;
9512
9576
  }, {});
9513
9577
  // 由于 resize 改变有延时(节流), 第一次渲染时, 宽度高度可能为 0, 需要手动设置一下
@@ -10110,11 +10174,10 @@ var THEME_DEFAULT_OPTIONS = {
10110
10174
  // _recMonthObj: Record<string, string[]> = {};
10111
10175
  /**
10112
10176
  * 录像回放的月份列表 @private
10113
- */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
10177
+ */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
10114
10178
  _this._initOptions(options);
10115
10179
  if (_this.options.type === 'ezopen') {
10116
10180
  var _this_urlInfo_searchParams, _this_urlInfo;
10117
- _this.urlInfo = parseEzopenUrl(_this.options.url);
10118
10181
  if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
10119
10182
  _this.options.spaceId = _this.urlInfo.searchParams.spaceId;
10120
10183
  }
@@ -10169,9 +10232,10 @@ var THEME_DEFAULT_OPTIONS = {
10169
10232
  var template = (_this_options1 = _this.options) == null ? void 0 : _this_options1.template; // ThemeTemplateType | string | undefined
10170
10233
  var initialThemeData;
10171
10234
  if (options.type === 'hls' || options.type === 'ezhls') {
10235
+ var _options_url;
10172
10236
  // hls / ezhls:@3.1.1 起支持自定义 themeData,但不支持标准提供的模板;未传时回退 hlsLiveTemplate
10173
- // FIXME: 部分控件在 hls 下不生效,开发者需自行斟酌
10174
- initialThemeData = themeData !== undefined ? themeData : hlsLiveTemplate;
10237
+ // FIXME: themeData 部分控件在 hls 下不生效,开发者需自行斟酌
10238
+ initialThemeData = themeData !== undefined ? themeData : ((_options_url = options.url) == null ? void 0 : _options_url.includes('/openpb/')) ? hlsRecTemplate : hlsLiveTemplate;
10175
10239
  } else if ([
10176
10240
  'flv',
10177
10241
  'mp4'
@@ -10894,13 +10958,12 @@ var THEME_DEFAULT_OPTIONS = {
10894
10958
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
10895
10959
  */ _proto._getRecType = function _getRecType(url) {
10896
10960
  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') {
10961
+ if (this.urlInfo.type === 'rec') {
10962
+ var _this_urlInfo_searchParams, _this_urlInfo;
10963
+ if (this.urlInfo.recType === 'cloud' && ((_this_urlInfo = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
10901
10964
  this.recType = 'cloudRecord';
10902
10965
  return 'cloudRecord';
10903
- } else if (urlInfo.recType === 'cloud') {
10966
+ } else if (this.urlInfo.recType === 'cloud') {
10904
10967
  this.recType = 'cloudRec';
10905
10968
  return 'cloudRec';
10906
10969
  } else {
@@ -10908,6 +10971,18 @@ var THEME_DEFAULT_OPTIONS = {
10908
10971
  return 'rec';
10909
10972
  }
10910
10973
  }
10974
+ } else if (isHttp(url) && url.includes('/openpb/')) {
10975
+ // 萤石 ll-hls/flv 回放
10976
+ if (url.includes('rec=cloud')) {
10977
+ // 云存储
10978
+ this.recType = 'cloudRec';
10979
+ return 'cloudRec';
10980
+ } else if (url.includes('rec=local')) {
10981
+ // 本地存储
10982
+ this.recType = 'rec';
10983
+ return 'rec';
10984
+ }
10985
+ // 不支持云录制
10911
10986
  }
10912
10987
  this.recType = '';
10913
10988
  return '';
@@ -10950,6 +11025,17 @@ var THEME_DEFAULT_OPTIONS = {
10950
11025
  }
10951
11026
  };
10952
11027
  _create_class(Theme, [
11028
+ {
11029
+ key: "urlInfo",
11030
+ get: /**
11031
+ * url 信息 播放地址信息
11032
+ */ function get() {
11033
+ if (this.options.url) {
11034
+ return parseEzopenUrl(this.options.url);
11035
+ }
11036
+ return {};
11037
+ }
11038
+ },
10953
11039
  {
10954
11040
  key: "width",
10955
11041
  get: /**
@@ -11359,6 +11445,6 @@ var THEME_DEFAULT_OPTIONS = {
11359
11445
  zh: zh,
11360
11446
  en: en
11361
11447
  };
11362
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.1-beta.2';
11448
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.1';
11363
11449
 
11364
11450
  export { Control, EVENTS, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };