@icos-desktop/react-components 2.2.12 → 2.2.13-zdhd.1.p

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.
@@ -1502,6 +1502,14 @@ interface VideoPlayerProps {
1502
1502
  * 视频源类型
1503
1503
  */
1504
1504
  videoStreamSource?: 'cityeyes' | 'hikvision' | 'custom';
1505
+ /**
1506
+ * 视频播放器宽度
1507
+ */
1508
+ width?: number;
1509
+ /**
1510
+ * 视频播放器高度
1511
+ */
1512
+ height?: number;
1505
1513
  }
1506
1514
 
1507
1515
  declare const VideoPlayer: (props: VideoPlayerProps) => React.JSX.Element;
@@ -7702,9 +7702,11 @@ var Cityeyes = function (_a) {
7702
7702
  return React__default.createElement("video", { ref: videoElement, style: { width: '100%', height: '100%' }, autoPlay: true });
7703
7703
  };
7704
7704
 
7705
+ // import { useExternal } from 'ahooks';
7705
7706
  var H5player = function (_a) {
7706
- var url = _a.url, libPath = _a.libPath;
7707
- var status = useExternal("".concat(libPath, "/h5player.min.js"), { type: 'js' });
7707
+ // const status = useExternal(`${libPath}/h5player.min.js`, { type: 'js' });
7708
+ var url = _a.url, libPath = _a.libPath, width = _a.width, height = _a.height;
7709
+ // console.log('status', status);
7708
7710
  var videoRef = useRef(null);
7709
7711
  var videoElementId = useState(function () { return v4(); })[0];
7710
7712
  var _b = useState(false), init = _b[0], setInit = _b[1];
@@ -7718,24 +7720,41 @@ var H5player = function (_a) {
7718
7720
  }
7719
7721
  }
7720
7722
  }, [init, url]);
7723
+ // TODO: 重大活动保障定制
7721
7724
  useEffect(function () {
7722
- var JSPlugin = window.JSPlugin;
7723
- if (status === 'ready' && JSPlugin && !videoRef.current) {
7725
+ var JSPlugin = window.parent.JSPlugin;
7726
+ if (JSPlugin && !videoRef.current) {
7724
7727
  videoRef.current = new JSPlugin({
7725
7728
  szId: videoElementId,
7726
7729
  szBasePath: libPath,
7727
7730
  bSupporDoubleClickFull: true,
7728
7731
  iMaxSplit: 1,
7732
+ iWidth: width,
7733
+ iHeight: height,
7729
7734
  });
7730
7735
  setInit(true);
7731
7736
  }
7732
- }, [status]);
7737
+ }, []);
7738
+ // useEffect(() => {
7739
+ // const JSPlugin = (window as any).JSPlugin;
7740
+ // if (status === 'ready' && JSPlugin && !videoRef.current) {
7741
+ // videoRef.current = new JSPlugin({
7742
+ // szId: videoElementId,
7743
+ // szBasePath: libPath,
7744
+ // bSupporDoubleClickFull: true,
7745
+ // iMaxSplit: 1,
7746
+ // iWidth: width,
7747
+ // iHeight: height,
7748
+ // });
7749
+ // setInit(true);
7750
+ // }
7751
+ // }, [status]);
7733
7752
  return React__default.createElement("div", { id: videoElementId, style: { width: '100%', height: '100%' } });
7734
7753
  };
7735
7754
 
7736
7755
  var Player = function (props) {
7737
7756
  var _a, _b;
7738
- var libsPath = props.libsPath, url = props.url, videoPlayerType = props.videoPlayerType;
7757
+ var libsPath = props.libsPath, url = props.url, videoPlayerType = props.videoPlayerType, width = props.width, height = props.height;
7739
7758
  var cityeyesPath = (_a = libsPath === null || libsPath === void 0 ? void 0 : libsPath.cityeyes) !== null && _a !== void 0 ? _a : 'https://unpkg.com/hls.js';
7740
7759
  var h5playerPath = (_b = libsPath === null || libsPath === void 0 ? void 0 : libsPath.h5player) !== null && _b !== void 0 ? _b : '/libs/h5player';
7741
7760
  if (!url) {
@@ -7745,7 +7764,7 @@ var Player = function (props) {
7745
7764
  return React__default.createElement(Cityeyes, { url: url, libPath: cityeyesPath });
7746
7765
  }
7747
7766
  if (videoPlayerType === 'h5player') {
7748
- return React__default.createElement(H5player, { url: url, libPath: h5playerPath });
7767
+ return React__default.createElement(H5player, { url: url, libPath: h5playerPath, width: width, height: height });
7749
7768
  }
7750
7769
  };
7751
7770
 
@@ -7754,7 +7773,7 @@ var styles$k = {"container":"VideoPlayer-module_container__Afx8w","control":"Vid
7754
7773
  styleInject(css_248z$k);
7755
7774
 
7756
7775
  var VideoPlayer = function (props) {
7757
- var libsPath = props.libsPath, url = props.url, senseGlobalCode = props.senseGlobalCode, channelId = props.channelId, videoPlayerType = props.videoPlayerType, videoStreamSource = props.videoStreamSource;
7776
+ var libsPath = props.libsPath, url = props.url, senseGlobalCode = props.senseGlobalCode, channelId = props.channelId, videoPlayerType = props.videoPlayerType, videoStreamSource = props.videoStreamSource, width = props.width, height = props.height;
7758
7777
  var _a = useState(false), openControl = _a[0], setOpenControl = _a[1];
7759
7778
  /**
7760
7779
  * 视频播放器需要参数 url 和 videoPlayerType
@@ -7815,7 +7834,7 @@ var VideoPlayer = function (props) {
7815
7834
  return null;
7816
7835
  }
7817
7836
  return (React__default.createElement("div", { className: styles$k.container },
7818
- React__default.createElement(Player, { libsPath: libsPath, videoPlayerType: data.videoPlayerType, url: data.url }),
7837
+ React__default.createElement(Player, { libsPath: libsPath, videoPlayerType: data.videoPlayerType, url: data.url, width: width, height: height }),
7819
7838
  data.ptzControl ? (React__default.createElement("div", { className: styles$k.control, onClick: handleOpenControl },
7820
7839
  React__default.createElement(FullscreenOutlined, null),
7821
7840
  React__default.createElement("span", null, "\u8BBE\u5907\u63A7\u5236"))) : null,
@@ -12977,11 +12996,11 @@ var CcosVideoPlayer = function (props) {
12977
12996
  CcosVideoPlayer.settings = settings$1;
12978
12997
 
12979
12998
  try {
12980
- window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.2.12","branch":"release_v2.2.0","buildDate":"2025-07-29 11:01:46"}');
12999
+ window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.2.13-zdhd.1.p","branch":"release_v2.2.0","buildDate":"2025-07-29 20:37:38"}');
12981
13000
  }
12982
13001
  catch (err) {
12983
13002
  console.warn(err);
12984
- window._ICOS_DESKTOP_VERSION_ = '{"version":"2.2.12","branch":"release_v2.2.0","buildDate":"2025-07-29 11:01:46"}';
13003
+ window._ICOS_DESKTOP_VERSION_ = '{"version":"2.2.13-zdhd.1.p","branch":"release_v2.2.0","buildDate":"2025-07-29 20:37:38"}';
12985
13004
  }
12986
13005
 
12987
13006
  export { BookDetail, BookGroupImport, BookGroupTable, BookImport, BookInfo, BookSelect, BookTable, CcosBookDetail, CcosImportTable, CcosSenseContentTable, CcosSenseCreate, CcosSenseDetail, CcosSenseEdit, CcosSenseFullTable, CcosSenseManager, CcosSenseSearch, CcosSenseTree, CcosSenseView, CcosTagConfig, CcosVideoControl, CcosVideoPlayer, EntityClassFilter, EntityClassTreeSelect, ImportTable, Modal, OrgTreeSelect, PersonSelector, ProTable$1 as ProTable, RegionCascader, RegionTreeSelect, RelationGraph, SenseContentTable, SenseCreate, SenseDetail, SenseEdit, SenseForm, SenseFullTable, SenseInfo, SenseManager, SenseSearch, SenseTable, SenseTree, SenseView, TagConfig, TagTreeSelect, VideoControl, VideoPlayer, setCconfig as config };