@cloud-app-dev/vidc 3.2.13 → 3.2.14

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.
Files changed (131) hide show
  1. package/es/List/DynamicGridList/index.d.ts +3 -3
  2. package/es/List/DynamicGridList/index.js +5 -5
  3. package/es/ListWithSizeAnimate/demo.d.ts +2 -0
  4. package/es/ListWithSizeAnimate/demo.js +19 -0
  5. package/es/ListWithSizeAnimate/index.d.ts +9 -0
  6. package/es/ListWithSizeAnimate/index.js +71 -0
  7. package/es/ListWithSizeAnimate/index.less +13 -0
  8. package/es/Picture/interface.d.ts +0 -6
  9. package/es/Player/contraller_bar/volume.d.ts +1 -1
  10. package/es/PlayerExt/index.d.ts +1 -1
  11. package/es/PlayerExt/index.js +4 -5
  12. package/es/ScreenPlayer/Live.d.ts +1 -1
  13. package/es/ScreenPlayer/Live.js +24 -17
  14. package/es/ScreenPlayer/LiveTools.d.ts +2 -2
  15. package/es/ScreenPlayer/LiveTools.js +9 -6
  16. package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
  17. package/es/ScreenPlayer/PlayerWithExt.js +7 -5
  18. package/es/ScreenPlayer/Record.d.ts +1 -1
  19. package/es/ScreenPlayer/Record.js +30 -21
  20. package/es/ScreenPlayer/RecordTools.d.ts +2 -2
  21. package/es/ScreenPlayer/RecordTools.js +20 -12
  22. package/es/ScreenPlayer/ScreenSelect.js +4 -2
  23. package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
  24. package/es/ScreenPlayer/SegmentTimeLine.js +1 -1
  25. package/es/ScreenPlayer/TimeSelect.js +2 -2
  26. package/es/ScreenPlayer/demo2.js +1 -1
  27. package/es/ScreenPlayer/interface.d.ts +2 -2
  28. package/es/ScreenPlayer/useTimeSlider.d.ts +8 -8
  29. package/es/ScreenPlayer/useTimeSlider.js +23 -15
  30. package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
  31. package/es/ScreenPlayer/utils.d.ts +1 -1
  32. package/es/ScreenPlayer/utils.js +4 -1
  33. package/es/ThemeAntd/style/button.less +1 -1
  34. package/es/ThemeAntd/style/pagination.less +1 -1
  35. package/es/index.d.ts +1 -0
  36. package/es/index.js +1 -0
  37. package/package.json +2 -7
  38. package/.dumi/tmp/core/EmptyRoute.tsx +0 -9
  39. package/.dumi/tmp/core/defineApp.ts +0 -16
  40. package/.dumi/tmp/core/history.ts +0 -61
  41. package/.dumi/tmp/core/plugin.ts +0 -42
  42. package/.dumi/tmp/core/pluginConfig.d.ts +0 -276
  43. package/.dumi/tmp/core/polyfill.ts +0 -202
  44. package/.dumi/tmp/core/route.tsx +0 -38
  45. package/.dumi/tmp/core/terminal.ts +0 -38
  46. package/.dumi/tmp/dumi/exports.ts +0 -5
  47. package/.dumi/tmp/dumi/locales/config.ts +0 -56
  48. package/.dumi/tmp/dumi/locales/runtime.tsx +0 -38
  49. package/.dumi/tmp/dumi/meta/atoms.ts +0 -4
  50. package/.dumi/tmp/dumi/meta/index.ts +0 -186
  51. package/.dumi/tmp/dumi/meta/runtime.ts +0 -18
  52. package/.dumi/tmp/dumi/meta/tabs.ts +0 -8
  53. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +0 -41
  54. package/.dumi/tmp/dumi/theme/builtins/API.ts +0 -4
  55. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +0 -4
  56. package/.dumi/tmp/dumi/theme/builtins/Container.ts +0 -4
  57. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +0 -4
  58. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +0 -4
  59. package/.dumi/tmp/dumi/theme/builtins/Table.ts +0 -4
  60. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +0 -4
  61. package/.dumi/tmp/dumi/theme/slots/Content.ts +0 -4
  62. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +0 -4
  63. package/.dumi/tmp/dumi/theme/slots/Features.ts +0 -4
  64. package/.dumi/tmp/dumi/theme/slots/Footer.ts +0 -4
  65. package/.dumi/tmp/dumi/theme/slots/Header.ts +0 -4
  66. package/.dumi/tmp/dumi/theme/slots/Hero.ts +0 -4
  67. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +0 -4
  68. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +0 -4
  69. package/.dumi/tmp/dumi/theme/slots/Logo.ts +0 -4
  70. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +0 -4
  71. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +0 -4
  72. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +0 -4
  73. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +0 -4
  74. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +0 -4
  75. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +0 -4
  76. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +0 -4
  77. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +0 -4
  78. package/.dumi/tmp/dumi/theme/slots/Toc.ts +0 -4
  79. package/.dumi/tmp/exports.ts +0 -15
  80. package/.dumi/tmp/testBrowser.tsx +0 -82
  81. package/.dumi/tmp/tsconfig.json +0 -35
  82. package/.dumi/tmp/typings.d.ts +0 -136
  83. package/.dumi/tmp/umi.ts +0 -77
  84. package/.dumi/tmp-production/core/EmptyRoute.tsx +0 -9
  85. package/.dumi/tmp-production/core/defineApp.ts +0 -16
  86. package/.dumi/tmp-production/core/history.ts +0 -61
  87. package/.dumi/tmp-production/core/plugin.ts +0 -42
  88. package/.dumi/tmp-production/core/pluginConfig.d.ts +0 -276
  89. package/.dumi/tmp-production/core/polyfill.ts +0 -202
  90. package/.dumi/tmp-production/core/route.tsx +0 -38
  91. package/.dumi/tmp-production/core/terminal.ts +0 -38
  92. package/.dumi/tmp-production/dumi/exports.ts +0 -5
  93. package/.dumi/tmp-production/dumi/locales/config.ts +0 -56
  94. package/.dumi/tmp-production/dumi/locales/runtime.tsx +0 -38
  95. package/.dumi/tmp-production/dumi/meta/atoms.ts +0 -4
  96. package/.dumi/tmp-production/dumi/meta/index.ts +0 -178
  97. package/.dumi/tmp-production/dumi/meta/runtime.ts +0 -18
  98. package/.dumi/tmp-production/dumi/meta/tabs.ts +0 -5
  99. package/.dumi/tmp-production/dumi/theme/ContextWrapper.tsx +0 -41
  100. package/.dumi/tmp-production/dumi/theme/builtins/API.ts +0 -4
  101. package/.dumi/tmp-production/dumi/theme/builtins/Badge.ts +0 -4
  102. package/.dumi/tmp-production/dumi/theme/builtins/Container.ts +0 -4
  103. package/.dumi/tmp-production/dumi/theme/builtins/Previewer.ts +0 -4
  104. package/.dumi/tmp-production/dumi/theme/builtins/SourceCode.ts +0 -4
  105. package/.dumi/tmp-production/dumi/theme/builtins/Table.ts +0 -4
  106. package/.dumi/tmp-production/dumi/theme/layouts/DocLayout.ts +0 -4
  107. package/.dumi/tmp-production/dumi/theme/slots/Content.ts +0 -4
  108. package/.dumi/tmp-production/dumi/theme/slots/ContentTabs.ts +0 -4
  109. package/.dumi/tmp-production/dumi/theme/slots/Features.ts +0 -4
  110. package/.dumi/tmp-production/dumi/theme/slots/Footer.ts +0 -4
  111. package/.dumi/tmp-production/dumi/theme/slots/Header.ts +0 -4
  112. package/.dumi/tmp-production/dumi/theme/slots/Hero.ts +0 -4
  113. package/.dumi/tmp-production/dumi/theme/slots/HeroTitle.ts +0 -4
  114. package/.dumi/tmp-production/dumi/theme/slots/LangSwitch.ts +0 -4
  115. package/.dumi/tmp-production/dumi/theme/slots/Logo.ts +0 -4
  116. package/.dumi/tmp-production/dumi/theme/slots/Navbar.ts +0 -4
  117. package/.dumi/tmp-production/dumi/theme/slots/NotFound.ts +0 -4
  118. package/.dumi/tmp-production/dumi/theme/slots/PreviewerActions.ts +0 -4
  119. package/.dumi/tmp-production/dumi/theme/slots/PreviewerActionsExtra.ts +0 -4
  120. package/.dumi/tmp-production/dumi/theme/slots/RtlSwitch.ts +0 -4
  121. package/.dumi/tmp-production/dumi/theme/slots/SearchBar.ts +0 -4
  122. package/.dumi/tmp-production/dumi/theme/slots/SearchResult.ts +0 -4
  123. package/.dumi/tmp-production/dumi/theme/slots/Sidebar.ts +0 -4
  124. package/.dumi/tmp-production/dumi/theme/slots/Toc.ts +0 -4
  125. package/.dumi/tmp-production/exports.ts +0 -14
  126. package/.dumi/tmp-production/testBrowser.tsx +0 -82
  127. package/.dumi/tmp-production/tsconfig.json +0 -35
  128. package/.dumi/tmp-production/typings.d.ts +0 -136
  129. package/.dumi/tmp-production/umi.ts +0 -77
  130. package/.stylelintrc +0 -3
  131. package/clear-cache.sh +0 -4
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { GridListCell } from '../GridList/interface';
3
2
  import { TData } from '../../useInfiniteScroll';
3
+ import { GridListCell } from '../GridList/interface';
4
4
  export interface IDynamicGridListProps<T> {
5
5
  itemHeight?: number;
6
6
  className?: string;
@@ -13,11 +13,11 @@ export interface IDynamicGridListProps<T> {
13
13
  * @param options
14
14
  */
15
15
  renderItem: (item: T, cell: GridListCell<T>) => React.ReactNode;
16
- loadPage(d: TData<T>): Promise<TData<T>>;
16
+ loadPage(d?: TData<T>): Promise<TData<T>>;
17
17
  itemWidth?: number;
18
18
  itemKey: string;
19
19
  getGridGap?: (...args: any) => number;
20
- isNoMore?: (data: TData<T>) => boolean;
20
+ isNoMore?: (data?: TData<T>) => boolean;
21
21
  threshold?: number;
22
22
  }
23
23
  declare function DynamicGridList<T>({ renderItem, itemHeight, itemKey, itemWidth, reloadDeps, getGridGap, loadPage, isNoMore, threshold, ...props }: IDynamicGridListProps<T>): JSX.Element;
@@ -1,5 +1,3 @@
1
- import "antd/lib/message/style";
2
- import _message from "antd/lib/message";
3
1
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
4
2
  var _excluded = ["renderItem", "itemHeight", "itemKey", "itemWidth", "reloadDeps", "getGridGap", "loadPage", "isNoMore", "threshold"];
5
3
 
@@ -8,8 +6,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
8
6
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
7
 
10
8
  import React, { useMemo, useRef } from 'react';
11
- import GridList from "../GridList";
12
9
  import useInfiniteScroll from "../../useInfiniteScroll";
10
+ import GridList from "../GridList";
13
11
  import { jsx as _jsx } from "react/jsx-runtime";
14
12
 
15
13
  function DynamicGridList(_ref) {
@@ -36,7 +34,9 @@ function DynamicGridList(_ref) {
36
34
  noMore = _useInfiniteScroll.noMore;
37
35
 
38
36
  _useUpdateEffect(function () {
39
- noMore && _message.success('数据已全部加载完成!');
37
+ if (noMore) {
38
+ console.warn('数据已全部加载完成');
39
+ }
40
40
  }, [noMore]);
41
41
 
42
42
  function getItemData(data) {
@@ -48,7 +48,7 @@ function DynamicGridList(_ref) {
48
48
  }
49
49
 
50
50
  function getColumnCount(elementWidth, gridGap) {
51
- return Math.floor((elementWidth + gridGap) / (itemWidth + gridGap));
51
+ return Math.floor((elementWidth + gridGap) / ((itemWidth !== null && itemWidth !== void 0 ? itemWidth : 0) + gridGap));
52
52
  }
53
53
 
54
54
  function getWindowMargin(windowHeight) {
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function App(): JSX.Element;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import ListWithSizeAnimate from "./index";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default function App() {
5
+ return /*#__PURE__*/_jsx("div", {
6
+ style: {
7
+ width: '100%',
8
+ height: 800
9
+ },
10
+ children: /*#__PURE__*/_jsx(ListWithSizeAnimate, {
11
+ headerSize: 400,
12
+ children: /*#__PURE__*/_jsx("div", {
13
+ style: {
14
+ height: 800
15
+ }
16
+ })
17
+ })
18
+ });
19
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface IListWithSizeAnimateProps {
4
+ headerSize: number;
5
+ children?: React.ReactNode;
6
+ header?: React.ReactNode;
7
+ }
8
+ declare function ListWithSizeAnimate({ headerSize, children, header }: IListWithSizeAnimateProps): JSX.Element;
9
+ export default ListWithSizeAnimate;
@@ -0,0 +1,71 @@
1
+ import _useEventListener from "ahooks/es/useEventListener";
2
+
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
+
11
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+
15
+ import React, { useMemo, useRef } from 'react';
16
+ import useSimpleState from "../useSimpleState";
17
+ import "./index.less";
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsxs as _jsxs } from "react/jsx-runtime";
20
+
21
+ function ListWithSizeAnimate(_ref) {
22
+ var headerSize = _ref.headerSize,
23
+ children = _ref.children,
24
+ header = _ref.header;
25
+
26
+ var _useSimpleState = useSimpleState({
27
+ open: true
28
+ }),
29
+ _useSimpleState2 = _slicedToArray(_useSimpleState, 2),
30
+ state = _useSimpleState2[0],
31
+ updateState = _useSimpleState2[1];
32
+
33
+ var ref = useRef(null);
34
+ var headerHeight = useMemo(function () {
35
+ return state.open ? headerSize : 0;
36
+ }, [state.open]);
37
+ var contentHeight = useMemo(function () {
38
+ return "calc(100% - ".concat(headerHeight, "px)");
39
+ }, [headerHeight]);
40
+
41
+ _useEventListener('wheel', function (event) {
42
+ updateState({
43
+ open: event.deltaY < 0
44
+ });
45
+ }, {
46
+ target: ref
47
+ });
48
+
49
+ return /*#__PURE__*/_jsxs("div", {
50
+ className: "list-with-size-animate-layout",
51
+ ref: ref,
52
+ children: [/*#__PURE__*/_jsx("div", {
53
+ className: "list-animate-header",
54
+ style: {
55
+ height: headerHeight
56
+ },
57
+ children: /*#__PURE__*/_jsx("div", {
58
+ className: "list-animate-header-content",
59
+ children: header
60
+ })
61
+ }), /*#__PURE__*/_jsx("div", {
62
+ className: "list-animate-content",
63
+ style: {
64
+ height: contentHeight
65
+ },
66
+ children: children
67
+ })]
68
+ });
69
+ }
70
+
71
+ export default ListWithSizeAnimate;
@@ -0,0 +1,13 @@
1
+ .list-with-size-animate-layout {
2
+ height: 100%;
3
+ width: 100%;
4
+ overflow: hidden;
5
+ .list-animate-header {
6
+ background-color: gray;
7
+ transition: height 0.3s;
8
+ }
9
+ .list-animate-content {
10
+ background-color: blue;
11
+ overflow: hidden;
12
+ }
13
+ }
@@ -1,5 +1,3 @@
1
- import * as React from 'react';
2
-
3
1
  export type MenuRectType = {
4
2
  /**
5
3
  * 路由地址
@@ -21,7 +19,6 @@ export type MenuRectType = {
21
19
  */
22
20
  base64?: string;
23
21
  };
24
- export const MenuRectTypeDemo: React.FC<MenuRectType>;
25
22
 
26
23
  export type TagItemType = {
27
24
  /**
@@ -44,7 +41,6 @@ export type TagItemType = {
44
41
  */
45
42
  titleAttr?: string;
46
43
  };
47
- export const TagItemTypeDemo: React.FC<TagItemType>;
48
44
 
49
45
  export type ImageType = 'face' | 'body' | 'nonVehicle' | 'vehicle' | 'thing';
50
46
 
@@ -104,8 +100,6 @@ export type RectType = {
104
100
  base64?: string;
105
101
  };
106
102
 
107
- export const RectTypeDemo: React.FC<RectType>;
108
-
109
103
  export type PositionType = {
110
104
  x: number;
111
105
  y: number;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type Api from '../api';
3
3
  import '../style/volume.less';
4
4
  declare function Volume({ api, style }: {
5
- api: Api;
5
+ api?: Api;
6
6
  style?: React.CSSProperties;
7
7
  }): JSX.Element;
8
8
  declare const _default: React.MemoExoticComponent<typeof Volume>;
@@ -41,7 +41,7 @@ export declare function getLocalPort(): string;
41
41
  * @returns
42
42
  */
43
43
  export declare function getLocalPlayPath(url: string, params?: string): string;
44
- export declare function usePlugin(mode: PlayModeType, key: any): {
44
+ export declare function usePlugin(mode?: PlayModeType, key?: any): {
45
45
  needInstall: boolean;
46
46
  };
47
47
  export declare function ExtModel({ url, children, mode, pluginDownloadUrl, pluginParams, loading, segments }: IPluginProps): JSX.Element;
@@ -16,7 +16,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- /* eslint-disable jsx-a11y/anchor-is-valid */
20
19
  import React, { useEffect, useMemo, useState } from 'react';
21
20
  import IconFont from "../Player/iconfont";
22
21
  import "./index.less";
@@ -46,7 +45,7 @@ export function getLocalPlayPath(url) {
46
45
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
47
46
  var URL_TEMPLATE = "http://127.0.0.1:<port>/video/v1/transcoding?uri=<pull_uri>";
48
47
  var port = getLocalPort();
49
- var pull_uri = window.btoa(url).replaceAll('=', '').replaceAll('/', '_').replaceAll('+', '-');
48
+ var pull_uri = window.btoa(url).replace(/=/g, '').replace(/\//, '_').replace('+', '-');
50
49
  return URL_TEMPLATE.replace('<port>', port).replace('<pull_uri>', pull_uri) + params;
51
50
  }
52
51
  export function usePlugin(mode, key) {
@@ -191,11 +190,11 @@ export function ExtModel(_ref2) {
191
190
  }, [url, mode]); // eslint-disable-next-line react-hooks/exhaustive-deps
192
191
 
193
192
  var playSegments = useMemo(function () {
194
- return mode === 2 && url ? segments.map(function (v) {
193
+ return mode === 2 && segments ? segments.map(function (v) {
195
194
  return _objectSpread(_objectSpread({}, v), {}, {
196
- url: getLocalPlayPath(v.url, pluginParams)
195
+ url: v.url ? getLocalPlayPath(v.url, pluginParams) : undefined
197
196
  });
198
- }) : url;
197
+ }) : segments;
199
198
  }, [segments, mode]);
200
199
 
201
200
  if (needInstall) {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { ILivePlayerProps } from './interface';
3
2
  import './index.less';
3
+ import type { ILivePlayerProps } from './interface';
4
4
  declare function LivePlayer({ list, children, oneWinExtTools, allWinExtTools, ...props }: ILivePlayerProps): JSX.Element;
5
5
  declare namespace LivePlayer {
6
6
  var defaultProps: {
@@ -25,12 +25,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
25
25
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
26
26
 
27
27
  import React, { useEffect, useMemo, useRef, useState } from 'react';
28
- import { ScreenType, mergeFill } from "./utils";
29
- import { LivePlayerWithExt } from "./PlayerWithExt";
30
- import Tools from "./LiveTools";
31
- import useVideoFit from "./useVideoFit";
32
28
  import DisableMark from "../DisableMark";
33
29
  import "./index.less";
30
+ import Tools from "./LiveTools";
31
+ import { LivePlayerWithExt } from "./PlayerWithExt";
32
+ import useVideoFit from "./useVideoFit";
33
+ import { mergeFill, ScreenType } from "./utils";
34
34
  import { createElement as _createElement } from "react";
35
35
  import { jsx as _jsx } from "react/jsx-runtime";
36
36
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -77,10 +77,11 @@ function LivePlayer(_ref) {
77
77
  }, [list, screenNum]); // 获取选中player对象
78
78
 
79
79
  var getPlayerItem = function getPlayerItem() {
80
- var _playerRef$current, _playerRef$current$it;
80
+ var _playerRef$current, _playerRef$current$ci;
81
81
 
82
- var item = list[state.selectIndex];
83
- return (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : (_playerRef$current$it = _playerRef$current[item === null || item === void 0 ? void 0 : item.cid]) === null || _playerRef$current$it === void 0 ? void 0 : _playerRef$current$it.current;
82
+ var item = list ? list[state.selectIndex] : {};
83
+ var cid = item.cid;
84
+ return cid ? (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : (_playerRef$current$ci = _playerRef$current[cid]) === null || _playerRef$current$ci === void 0 ? void 0 : _playerRef$current$ci.current : undefined;
84
85
  }; // 更新状态
85
86
 
86
87
 
@@ -98,18 +99,22 @@ function LivePlayer(_ref) {
98
99
  } // 修正选中索引
99
100
 
100
101
 
101
- if (newState.screenNum < state.selectIndex) {
102
+ if (newState.screenNum && newState.screenNum < state.selectIndex) {
102
103
  obj.selectIndex = 0;
103
104
  }
104
105
  }
105
106
 
106
107
  if (newState.hasOwnProperty('mode')) {
107
- var item = list[state.selectIndex];
108
+ var item = list === null || list === void 0 ? void 0 : list[state.selectIndex];
108
109
 
109
110
  var newModes = _objectSpread({}, state.modes);
110
111
 
111
- newModes[item.cid] = newState.mode;
112
- obj.modes = newModes;
112
+ var cid = item === null || item === void 0 ? void 0 : item.cid;
113
+
114
+ if (cid) {
115
+ newModes[cid] = newState.mode;
116
+ obj.modes = newModes;
117
+ }
113
118
  }
114
119
 
115
120
  setState(function (old) {
@@ -119,7 +124,7 @@ function LivePlayer(_ref) {
119
124
 
120
125
 
121
126
  var segmentItem = useMemo(function () {
122
- return list[state.selectIndex] || {};
127
+ return (list === null || list === void 0 ? void 0 : list[state.selectIndex]) || {};
123
128
  }, [state.selectIndex, list]);
124
129
  /**
125
130
  * 同步外部的selectIndex变化
@@ -196,13 +201,15 @@ function LivePlayer(_ref) {
196
201
  className: "player-layout",
197
202
  ref: domRef,
198
203
  children: screenList.map(function (item, index) {
199
- var _state$modes$item$cid, _item$url;
204
+ var _item$url;
200
205
 
201
206
  return /*#__PURE__*/_createElement(LivePlayerWithExt, _objectSpread(_objectSpread({}, item), {}, {
202
- mode: (_state$modes$item$cid = state.modes[item.cid]) !== null && _state$modes$item$cid !== void 0 ? _state$modes$item$cid : item.mode,
207
+ mode: item.cid ? state.modes[item.cid] : item.mode,
203
208
  key: (_item$url = item.url) !== null && _item$url !== void 0 ? _item$url : "".concat(index),
204
209
  updatePlayer: function updatePlayer(player) {
205
- return playerRef.current[item.cid] = player;
210
+ if (item.cid) {
211
+ playerRef.current[item.cid] = player;
212
+ }
206
213
  },
207
214
  className: state.selectIndex === index ? 'player-current-index' : '',
208
215
  onClick: index !== state.selectIndex ? function () {
@@ -213,8 +220,8 @@ function LivePlayer(_ref) {
213
220
  });
214
221
  } : undefined,
215
222
  style: {
216
- width: screenType.width,
217
- height: screenType.height
223
+ width: screenType === null || screenType === void 0 ? void 0 : screenType.width,
224
+ height: screenType === null || screenType === void 0 ? void 0 : screenType.height
218
225
  },
219
226
  pluginDownloadUrl: props.pluginDownloadUrl
220
227
  }));
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ExportPlayerType } from '../Player/player';
3
3
  import { PlayModeType } from '../PlayerExt';
4
4
  interface IToolsProps {
5
- containerRef: React.MutableRefObject<HTMLDivElement>;
5
+ containerRef: React.RefObject<HTMLDivElement>;
6
6
  updateState: (state: {
7
7
  screenNum?: number;
8
8
  mode?: PlayModeType;
@@ -14,7 +14,7 @@ interface IToolsProps {
14
14
  toggleFit?: () => void;
15
15
  onClose?: () => void;
16
16
  onCloseAll?: () => void;
17
- snapshot?: (base64?: string) => void;
17
+ snapshot?: (base64: string) => void;
18
18
  /**
19
19
  * 单窗口拓展工具条,左侧
20
20
  */
@@ -19,10 +19,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
20
 
21
21
  import React from 'react';
22
+ import Volume from "../Player/contraller_bar/volume";
22
23
  import IconFont from "../Player/iconfont";
23
- import ScreenSelect from "./ScreenSelect";
24
24
  import useFullscreen from "../useFullscreen";
25
- import Volume from "../Player/contraller_bar/volume";
25
+ import ScreenSelect from "./ScreenSelect";
26
26
  import { jsx as _jsx } from "react/jsx-runtime";
27
27
  import { jsxs as _jsxs } from "react/jsx-runtime";
28
28
 
@@ -59,11 +59,14 @@ function LiveTools(_ref) {
59
59
  };
60
60
 
61
61
  var snapshotaction = function snapshotaction() {
62
- var _props$snapshot;
63
-
64
62
  var player = props.getPlayerItem();
65
63
  var base64 = player === null || player === void 0 ? void 0 : player.api.snapshot();
66
- (_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 ? void 0 : _props$snapshot.call(props, base64);
64
+
65
+ if (base64) {
66
+ var _props$snapshot;
67
+
68
+ (_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 ? void 0 : _props$snapshot.call(props, base64);
69
+ }
67
70
  };
68
71
 
69
72
  var player = props.getPlayerItem();
@@ -110,7 +113,7 @@ function LiveTools(_ref) {
110
113
  className: "icon-chajian",
111
114
  style: mode === 2 ? {
112
115
  color: 'var(--primary)'
113
- } : null,
116
+ } : undefined,
114
117
  title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
115
118
  })
116
119
  }), /*#__PURE__*/_jsx("div", {
@@ -4,7 +4,7 @@ import type { PlayModeType } from '../PlayerExt';
4
4
  interface ILivePlayerWithExtProps extends ISinglePlayerProps {
5
5
  mode?: PlayModeType;
6
6
  style: React.CSSProperties;
7
- onClick: () => void;
7
+ onClick?: () => void;
8
8
  updatePlayer: (obj: React.MutableRefObject<ExportPlayerType>) => void;
9
9
  pluginDownloadUrl?: string;
10
10
  }
@@ -28,7 +28,7 @@ interface IFrontendPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url
28
28
  end: number;
29
29
  screenIndex: number;
30
30
  }) => Promise<string>;
31
- screenIndex?: number;
31
+ screenIndex: number;
32
32
  }
33
33
  export declare function FrontendPlayerWithExt({ mode, style, className, segments, pluginDownloadUrl, screenIndex, httpLoading, ...props }: IFrontendPlayerWithExtProps): JSX.Element;
34
34
  export {};
@@ -27,12 +27,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
27
27
 
28
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
29
 
30
+ import moment from 'moment';
30
31
  import React, { useEffect, useRef, useState } from 'react';
31
- import LivePlayer from "../Player/single_player";
32
- import SegmentPlayer from "../Player/segment_player";
33
32
  import FrontendPlayer from "../Player/frontend_player";
33
+ import SegmentPlayer from "../Player/segment_player";
34
+ import LivePlayer from "../Player/single_player";
34
35
  import ExtModel from "../PlayerExt";
35
- import moment from 'moment';
36
36
  import useFullscreen from "../useFullscreen";
37
37
  import { jsx as _jsx } from "react/jsx-runtime";
38
38
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -114,7 +114,7 @@ export function SegmentPlayerWithExt(_ref2) {
114
114
  onClick: props.onClick,
115
115
  onDoubleClick: toggleFullscreen,
116
116
  children: /*#__PURE__*/_jsx(ExtModel, {
117
- mode: 1,
117
+ mode: mode,
118
118
  loading: httpLoading,
119
119
  segments: segments,
120
120
  children: /*#__PURE__*/_jsx(SegmentPlayer, _objectSpread(_objectSpread({}, props), {}, {
@@ -155,6 +155,8 @@ export function FrontendPlayerWithExt(_ref3) {
155
155
  var latestUrl = _useLatest(state.url);
156
156
 
157
157
  useEffect(function () {
158
+ var _segments$index$url, _segments$index;
159
+
158
160
  if (!(Array.isArray(segments) && segments.length > 0)) {
159
161
  return undefined;
160
162
  }
@@ -170,7 +172,7 @@ export function FrontendPlayerWithExt(_ref3) {
170
172
  var _ref4 = [segments[0].beginTime, segments[segments.length - 1].endTime],
171
173
  begin = _ref4[0],
172
174
  end = _ref4[1];
173
- var videoUrl = new URL(segments[index].url);
175
+ var videoUrl = new URL((_segments$index$url = (_segments$index = segments[index]) === null || _segments$index === void 0 ? void 0 : _segments$index.url) !== null && _segments$index$url !== void 0 ? _segments$index$url : '');
174
176
  var url;
175
177
 
176
178
  if (props.getLocalRecordUrl) {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { IRecordPlayerProps } from './interface';
3
2
  import './index.less';
3
+ import type { IRecordPlayerProps } from './interface';
4
4
  /**
5
5
  * @desc 录像设计的时间全部需要到毫秒
6
6
  * @param param0
@@ -32,15 +32,15 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
32
32
 
33
33
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
34
34
 
35
+ import { cloneDeep } from 'lodash-es';
35
36
  import React, { useEffect, useMemo, useRef, useState } from 'react';
36
- import { ScreenType, mergeFill, sleep } from "./utils";
37
- import { SegmentPlayerWithExt, FrontendPlayerWithExt } from "./PlayerWithExt";
37
+ import DisableMark from "../DisableMark";
38
+ import "./index.less";
39
+ import { FrontendPlayerWithExt, SegmentPlayerWithExt } from "./PlayerWithExt";
38
40
  import RecordTools from "./RecordTools";
39
41
  import SegmentTimeLine from "./SegmentTimeLine";
40
42
  import useVideoFit from "./useVideoFit";
41
- import DisableMark from "../DisableMark";
42
- import { cloneDeep } from 'lodash-es';
43
- import "./index.less";
43
+ import { mergeFill, ScreenType, sleep } from "./utils";
44
44
  import { createElement as _createElement } from "react";
45
45
  import { jsx as _jsx } from "react/jsx-runtime";
46
46
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -113,7 +113,7 @@ function RecordPlayer(_ref) {
113
113
  var _playerRef$current, _playerRef$current2;
114
114
 
115
115
  var item = screenList[state.selectIndex];
116
- return item ? (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : (_playerRef$current2 = _playerRef$current["".concat(getKey(item))]) === null || _playerRef$current2 === void 0 ? void 0 : _playerRef$current2.current : null;
116
+ return item ? (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : (_playerRef$current2 = _playerRef$current["".concat(getKey(item))]) === null || _playerRef$current2 === void 0 ? void 0 : _playerRef$current2.current : undefined;
117
117
  }; // 当前窗口信息
118
118
 
119
119
 
@@ -121,9 +121,9 @@ function RecordPlayer(_ref) {
121
121
  return screenList[state.selectIndex] || {};
122
122
  }, [state.selectIndex, screenList]);
123
123
  var timeBegin = useMemo(function () {
124
- var _state$begins;
124
+ var _state$begins, _segmentItem$date;
125
125
 
126
- return (_state$begins = state.begins["".concat(getKey(segmentItem))]) !== null && _state$begins !== void 0 ? _state$begins : segmentItem.date - state.timeMode / 2 * 3600 * 1000;
126
+ return (_state$begins = state.begins["".concat(getKey(segmentItem))]) !== null && _state$begins !== void 0 ? _state$begins : ((_segmentItem$date = segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.date) !== null && _segmentItem$date !== void 0 ? _segmentItem$date : 0) - state.timeMode / 2 * 3600 * 1000;
127
127
  }, [segmentItem, state.begins, state.timeMode]);
128
128
  var currentTime = useMemo(function () {
129
129
  var _state$currentTimes;
@@ -142,11 +142,17 @@ function RecordPlayer(_ref) {
142
142
  */
143
143
 
144
144
  useEffect(function () {
145
- var _item$segments$findIn, _item$segments;
145
+ var _state$seekTo, _item$segments$findIn, _item$segments;
146
146
 
147
- // 寻找需要seek的item
148
- var key = Object.keys(state.seekTo).find(function (k) {
149
- return state.seekTo[k] !== 0;
147
+ if (!state.seekTo) {
148
+ return;
149
+ } // 寻找需要seek的item
150
+
151
+
152
+ var key = Object.keys((_state$seekTo = state.seekTo) !== null && _state$seekTo !== void 0 ? _state$seekTo : {}).find(function (k) {
153
+ var _state$seekTo2;
154
+
155
+ return ((_state$seekTo2 = state.seekTo) === null || _state$seekTo2 === void 0 ? void 0 : _state$seekTo2[k]) !== 0;
150
156
  });
151
157
 
152
158
  if (!key) {
@@ -154,7 +160,7 @@ function RecordPlayer(_ref) {
154
160
  }
155
161
 
156
162
  var seekTime = state.seekTo[key];
157
- var item = list.find(function (v) {
163
+ var item = list === null || list === void 0 ? void 0 : list.find(function (v) {
158
164
  return !!v && "".concat(v.cid, "-").concat(v.date) === key;
159
165
  });
160
166
  var index = (_item$segments$findIn = item === null || item === void 0 ? void 0 : (_item$segments = item.segments) === null || _item$segments === void 0 ? void 0 : _item$segments.findIndex(function (v) {
@@ -219,7 +225,10 @@ function RecordPlayer(_ref) {
219
225
  }
220
226
 
221
227
  getPlay(key).then(function (play) {
222
- play && play.api.seekTo(seekTime);
228
+ if (play) {
229
+ play.api.seekTo(seekTime);
230
+ }
231
+
223
232
  setState(function (old) {
224
233
  return _objectSpread(_objectSpread({}, old), {}, {
225
234
  seekTo: _objectSpread(_objectSpread({}, old.seekTo), {}, _defineProperty({}, key, 0))
@@ -242,7 +251,7 @@ function RecordPlayer(_ref) {
242
251
  } // 修正选中索引
243
252
 
244
253
 
245
- if (newState.screenNum < state.selectIndex) {
254
+ if (newState.screenNum && newState.screenNum < state.selectIndex) {
246
255
  obj.selectIndex = 0;
247
256
  }
248
257
  }
@@ -439,8 +448,8 @@ function RecordPlayer(_ref) {
439
448
  });
440
449
  },
441
450
  style: {
442
- width: screenType.width,
443
- height: screenType.height
451
+ width: screenType === null || screenType === void 0 ? void 0 : screenType.width,
452
+ height: screenType === null || screenType === void 0 ? void 0 : screenType.height
444
453
  },
445
454
  mode: (_state$modes = state.modes["".concat(item === null || item === void 0 ? void 0 : item.date, "-").concat(item.cid)]) !== null && _state$modes !== void 0 ? _state$modes : item.mode,
446
455
  fps: fps,
@@ -463,8 +472,8 @@ function RecordPlayer(_ref) {
463
472
  mode: (_state$modes2 = state.modes["".concat(item === null || item === void 0 ? void 0 : item.date, "-").concat(item.cid)]) !== null && _state$modes2 !== void 0 ? _state$modes2 : item.mode,
464
473
  key: item.date && item.cid ? "".concat(item === null || item === void 0 ? void 0 : item.date, "-").concat(item.cid) : "".concat(index),
465
474
  style: {
466
- width: screenType.width,
467
- height: screenType.height
475
+ width: screenType === null || screenType === void 0 ? void 0 : screenType.width,
476
+ height: screenType === null || screenType === void 0 ? void 0 : screenType.height
468
477
  },
469
478
  httpLoading: item.loading,
470
479
  getLocalRecordUrl: props.getLocalRecordUrl,
@@ -491,9 +500,9 @@ function RecordPlayer(_ref) {
491
500
  onCloseAll: onCloseAll,
492
501
  timeMode: state.timeMode,
493
502
  download: props.download ? function () {
494
- var _segmentItem$segments;
503
+ var _props$download, _segmentItem$segments;
495
504
 
496
- return props.download((_segmentItem$segments = segmentItem.segments) !== null && _segmentItem$segments !== void 0 ? _segmentItem$segments : []);
505
+ return (_props$download = props.download) === null || _props$download === void 0 ? void 0 : _props$download.call(props, (_segmentItem$segments = segmentItem.segments) !== null && _segmentItem$segments !== void 0 ? _segmentItem$segments : []);
497
506
  } : undefined,
498
507
  snapshot: props.snapshot,
499
508
  oneWinExtTools: oneWinExtTools,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ExportPlayerType } from '../Player/player';
3
3
  import { PlayModeType } from '../PlayerExt';
4
4
  interface IToolsProps {
5
- containerRef: React.MutableRefObject<HTMLDivElement>;
5
+ containerRef: React.RefObject<HTMLDivElement>;
6
6
  screenNum: number;
7
7
  mode: PlayModeType;
8
8
  fit?: string;
@@ -33,5 +33,5 @@ interface IToolsProps {
33
33
  allWinExtTools?: JSX.Element;
34
34
  hasPlugin?: boolean;
35
35
  }
36
- declare function RecordTools({ containerRef, screenNum, timeMode, mode, fit, time, oneWinExtTools, allWinExtTools, hasPlugin, ...props }: IToolsProps): JSX.Element;
36
+ declare function RecordTools({ containerRef, screenNum, mode, fit, time, oneWinExtTools, allWinExtTools, hasPlugin, ...props }: IToolsProps): JSX.Element;
37
37
  export default RecordTools;