@ray-js/ipc-player-integration 0.0.1-beta-33 → 0.0.1-beta-35

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 (80) hide show
  1. package/lib/ctx/ctx.composition.d.ts +9 -0
  2. package/lib/ctx/ctx.composition.js +10 -9
  3. package/lib/ctx/ctx.js +57 -16
  4. package/lib/hooks/index.d.ts +1 -0
  5. package/lib/hooks/index.js +2 -1
  6. package/lib/hooks/useDpState/useDpState.d.ts +6 -1
  7. package/lib/hooks/useDpState/useDpState.js +33 -5
  8. package/lib/hooks/useMemoizedFn/index.d.ts +1 -0
  9. package/lib/hooks/useMemoizedFn/index.js +1 -0
  10. package/lib/i18n/index.d.ts +4 -0
  11. package/lib/i18n/strings.d.ts +2 -0
  12. package/lib/i18n/strings.js +4 -2
  13. package/lib/iconfont/iconfont.css +67 -8
  14. package/lib/iconfont/iconfont.js +13 -13
  15. package/lib/iconfont/iconfont.json +112 -7
  16. package/lib/iconfont/iconfont.ttf +0 -0
  17. package/lib/iconfont/iconfont.woff +0 -0
  18. package/lib/iconfont/iconfont.woff2 +0 -0
  19. package/lib/interface.d.ts +9 -9
  20. package/lib/plugins/battery/battery.composition.d.ts +14 -18
  21. package/lib/plugins/battery/battery.js +2 -2
  22. package/lib/plugins/battery/battery.less +3 -3
  23. package/lib/plugins/fullScreen/constant.d.ts +1 -0
  24. package/lib/plugins/fullScreen/constant.js +1 -0
  25. package/lib/plugins/fullScreen/fullScreen.d.ts +3 -1
  26. package/lib/plugins/fullScreen/fullScreen.js +49 -32
  27. package/lib/plugins/fullScreen/fullScreen.less +6 -1
  28. package/lib/plugins/fullScreen/fullTravelRouteControl.d.ts +8 -0
  29. package/lib/plugins/fullScreen/fullTravelRouteControl.js +73 -0
  30. package/lib/plugins/fullScreen/fullVoiceIntercom.d.ts +3 -0
  31. package/lib/plugins/fullScreen/fullVoiceIntercom.js +22 -13
  32. package/lib/plugins/fullScreen/verticalScreen.d.ts +1 -0
  33. package/lib/plugins/fullSmallIntercom/fullSmallIntercom.d.ts +3 -1
  34. package/lib/plugins/fullSmallIntercom/fullSmallIntercom.js +2 -4
  35. package/lib/plugins/index.d.ts +1 -0
  36. package/lib/plugins/index.js +2 -1
  37. package/lib/plugins/moveInteractiveControl/controlButton.d.ts +8 -0
  38. package/lib/plugins/moveInteractiveControl/controlButton.js +44 -0
  39. package/lib/plugins/moveInteractiveControl/controlButton.less +4 -0
  40. package/lib/plugins/moveInteractiveControl/index.d.ts +2 -0
  41. package/lib/plugins/moveInteractiveControl/index.js +2 -0
  42. package/lib/plugins/moveInteractiveControl/moveInteractiveControl.d.ts +6 -0
  43. package/lib/plugins/moveInteractiveControl/moveInteractiveControl.js +50 -0
  44. package/lib/plugins/moveInteractiveControl/moveInteractiveControl.less +38 -0
  45. package/lib/plugins/moveInteractiveControl/moveInteractiveControlUI.d.ts +28 -0
  46. package/lib/plugins/moveInteractiveControl/moveInteractiveControlUI.js +103 -0
  47. package/lib/plugins/moveInteractiveControl/moveInteractiveControlUI.less +71 -0
  48. package/lib/plugins/ptz/ptz.d.ts +5 -1
  49. package/lib/plugins/ptz/ptz.js +21 -7
  50. package/lib/plugins/ptz/ptz.less +26 -6
  51. package/lib/plugins/ptz/ptzControl.js +16 -7
  52. package/lib/plugins/resolution/fullResolutionControl.js +32 -11
  53. package/lib/plugins/resolution/resolution.d.ts +8 -2
  54. package/lib/plugins/resolution/resolution.js +25 -23
  55. package/lib/plugins/resolution/resolution.less +2 -3
  56. package/lib/plugins/verticalSmallIntercom/verticalSmallIntercom.d.ts +3 -1
  57. package/lib/plugins/verticalSmallIntercom/verticalSmallIntercom.js +0 -1
  58. package/lib/plugins/videoBitKBP/videoBitKBP.d.ts +3 -1
  59. package/lib/ui/bottomLeftContent.js +5 -7
  60. package/lib/ui/bottomRightContent.js +5 -7
  61. package/lib/ui/constant.d.ts +1 -0
  62. package/lib/ui/constant.js +1 -0
  63. package/lib/ui/context.d.ts +1 -0
  64. package/lib/ui/context.js +2 -1
  65. package/lib/ui/hooks.d.ts +1 -1
  66. package/lib/ui/hooks.js +3 -21
  67. package/lib/ui/index.d.ts +1 -0
  68. package/lib/ui/topLeftContent.d.ts +2 -2
  69. package/lib/ui/topLeftContent.js +6 -8
  70. package/lib/ui/topRightContent.js +5 -7
  71. package/lib/ui/ui.d.ts +2 -0
  72. package/lib/ui/ui.js +57 -40
  73. package/lib/ui/ui.less +49 -12
  74. package/lib/utils/device/index.d.ts +4 -0
  75. package/lib/utils/device/index.js +27 -1
  76. package/lib/utils/plugins/index.d.ts +4 -0
  77. package/lib/utils/plugins/index.js +20 -0
  78. package/package.json +7 -2
  79. package/lib/iconfont/demo.css +0 -539
  80. package/lib/iconfont/demo_index.html +0 -1062
@@ -0,0 +1,71 @@
1
+ .ipc-player-plugin-active-control-wrap {
2
+ display: flex;
3
+ flex-direction: column;
4
+ overflow: hidden;
5
+ background: var(--bgColor);
6
+ }
7
+
8
+ .ipc-player-plugin-active-control {
9
+ display: grid;
10
+ grid-template-columns: 1fr 1fr;
11
+ gap: calc(8px * var(--ipc-player-size-scale, 1));
12
+ padding: calc(16px * var(--ipc-player-size-scale, 1));
13
+ padding-top: 0;
14
+ }
15
+
16
+ .ipc-player-plugin-active-control-title {
17
+ position: relative;
18
+ text-align: center;
19
+ font-size: calc(16px * var(--ipc-player-size-scale, 1));
20
+ font-weight: 600;
21
+ padding: calc(16px * var(--ipc-player-size-scale, 1));
22
+ color: var(--titleColor);
23
+ }
24
+ .ipc-player-plugin-active-control-item {
25
+ border-radius: calc(16px * var(--ipc-player-size-scale, 1));
26
+ background: var(--itemBgColor);
27
+ padding: calc(18px * var(--ipc-player-size-scale, 1)) calc(16px * var(--ipc-player-size-scale, 1));
28
+ font-size: calc(var(--itemFontSize) * var(--ipc-player-size-scale, 1));
29
+ display: flex;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ color: var(--color);
33
+ &.ipc-player-plugin-active-control-item-active {
34
+ color: var(--activeColor);
35
+ .ipc-player-plugin-active-control-item-icon {
36
+ color: var(--activeColor);
37
+ .ipc-player-plugin-active-control-item-icon-mask {
38
+ background: var(--activeColor);
39
+ opacity: 0.05;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ .ipc-player-plugin-active-control-item-icon {
45
+ position: relative;
46
+ z-index: 1;
47
+ width: calc(42px * var(--ipc-player-size-scale, 1));
48
+ height: calc(42px * var(--ipc-player-size-scale, 1));
49
+ border-radius: calc(42px * var(--ipc-player-size-scale, 1));
50
+ margin-bottom: calc(11px * var(--ipc-player-size-scale, 1));
51
+ display: flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+ font-size: calc(16px * var(--ipc-player-size-scale, 1));
55
+ color: var(--color);
56
+ overflow: hidden;
57
+ .ipc-player-plugin-active-control-item-icon-mask {
58
+ position: absolute;
59
+ width: 100%;
60
+ top: 0;
61
+ bottom: 0;
62
+ background: var(--iconBgColor);
63
+ opacity: 1;
64
+ }
65
+ }
66
+ .ipc-player-plugin-active-control-item-title {
67
+ width: calc(70px * var(--ipc-player-size-scale, 1));
68
+ white-space: nowrap; /* 防止文本换行 */
69
+ overflow: hidden; /* 隐藏溢出文本 */
70
+ text-overflow: ellipsis; /* 使用省略号表示溢出文本 */
71
+ }
@@ -1,4 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ComponentConfigProps } from '../../interface';
3
3
  import './ptz.less';
4
- export declare const Ptz: (props: ComponentConfigProps) => React.JSX.Element | null;
4
+ type Props = ComponentConfigProps & {
5
+ className?: string;
6
+ };
7
+ export declare const Ptz: (props: Props) => React.JSX.Element | null;
8
+ export {};
@@ -1,8 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import React from 'react';
5
- import { useStore, updateAtom } from '../../ctx/store';
4
+ import React, { useEffect, useState, useContext } from 'react';
5
+ import { UIEventContext } from '../../ui/context';
6
+ import { useStore } from '../../ctx/store';
6
7
  import { ptzControlId } from '../../ui/constant';
7
8
  import './ptz.less';
8
9
  import { PtzControl } from './ptzControl';
@@ -10,20 +11,29 @@ export const Ptz = props => {
10
11
  const {
11
12
  IPCPlayerContext,
12
13
  screenType: screenTypeAtom,
13
- ptzActive,
14
14
  addContent,
15
15
  deleteContent,
16
+ showContent,
17
+ hideContent,
16
18
  className
17
19
  } = props;
18
20
  const {
19
21
  screenType,
20
- isPtzActive,
21
22
  brandColor
22
23
  } = useStore({
23
24
  screenType: screenTypeAtom,
24
- isPtzActive: ptzActive,
25
25
  brandColor: props.brandColor
26
26
  });
27
+ const [isPtzActive, setIsPtzActive] = useState(false);
28
+ const {
29
+ event
30
+ } = useContext(UIEventContext);
31
+ useEffect(() => {
32
+ if (screenType === 'vertical') {
33
+ event.emit('ptzControlHide');
34
+ setIsPtzActive(false);
35
+ }
36
+ }, [screenType]);
27
37
  if (screenType === 'vertical') {
28
38
  return null;
29
39
  }
@@ -31,6 +41,7 @@ export const Ptz = props => {
31
41
  className: clsx(className),
32
42
  onClick: () => {
33
43
  if (!isPtzActive) {
44
+ showContent('bottomLeft', 'FullSmallIntercom');
34
45
  // 添加ptz空间
35
46
  addContent('absolute', {
36
47
  id: ptzControlId,
@@ -40,10 +51,13 @@ export const Ptz = props => {
40
51
  absoluteContentClassName: 'ipc-player-plugin-full-screen-ptz-control-wrap',
41
52
  initProps: _objectSpread({}, props)
42
53
  });
54
+ event.emit('ptzControlShow');
43
55
  } else {
44
- deleteContent('absolute', ptzControlId);
56
+ // deleteContent('absolute', ptzControlId);
57
+ hideContent('bottomLeft', 'FullSmallIntercom');
58
+ event.emit('ptzControlHide');
45
59
  }
46
- updateAtom(ptzActive, !isPtzActive);
60
+ setIsPtzActive(!isPtzActive);
47
61
  }
48
62
  }, /*#__PURE__*/React.createElement(Text, {
49
63
  className: clsx('icon-panel', 'icon-panel-ptz', 'ipc-player-plugin-ptz-text-icon'),
@@ -1,3 +1,5 @@
1
+ @animation-time: 0.3s;
2
+
1
3
  .ipc-player-plugin-ptz-text-icon {
2
4
  color: var(--iconColor);
3
5
  font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
@@ -13,20 +15,38 @@
13
15
 
14
16
  .ipc-player-plugin-full-screen-ptz-control-wrap {
15
17
  position: absolute;
16
- bottom: 10px;
18
+ bottom: 32px;
17
19
  // transform: translate(0, -20%);
18
- right: calc(10px * var(--ipc-player-size-scale, 1));;
20
+ right: calc(32px * var(--ipc-player-size-scale, 1));;
19
21
  z-index: 3;
20
22
  }
21
23
 
22
24
 
25
+ @keyframes ipc-player-plugin-full-screen-ptz-control-move-in {
26
+ 0% {
27
+ transform: translate(0, 200%); /* 从下方滑入 */
28
+ }
29
+ 100% {
30
+ transform: translate(0, 0); /* 移动到目标位置 */
31
+ }
32
+ }
33
+
34
+ @keyframes ipc-player-plugin-full-screen-ptz-control-move-out {
35
+ 0% {
36
+ transform: translate(0, 0); /* 从当前位置开始 */
37
+ }
38
+ 100% {
39
+ transform: translate(0, 200%); /* 向下滑出,隐藏 */
40
+ }
41
+ }
23
42
 
24
43
  .ipc-player-plugin-full-screen-ptz-control {
25
44
  transform: translate(0, 0);
26
- transition: transform ease-in 0.3s;
27
- &.ipc-player-plugin-full-screen-ptz-control-hide {
28
- transform: translate(0, 200%);
29
- }
45
+ transition: @animation-time ease-in;
46
+ animation: ipc-player-plugin-full-screen-ptz-control-move-in @animation-time ease-in-out forwards;
47
+ &.ipc-player-plugin-full-screen-ptz-control-hide {
48
+ animation: ipc-player-plugin-full-screen-ptz-control-move-out @animation-time ease-in-out forwards;
49
+ }
30
50
  }
31
51
 
32
52
  .arrow-icon-wrapper {
@@ -1,10 +1,11 @@
1
- import React, { useContext, useEffect, useRef } from 'react';
1
+ import React, { useContext, useEffect, useRef, useState } from 'react';
2
2
  import { CoverView } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import _find from 'lodash/find';
5
5
  import _get from 'lodash/get';
6
6
  import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
7
7
  import IpcUtils from '@ray-js/ray-ipc-utils';
8
+ import { useMemoizedFn } from '../../hooks';
8
9
  import { useComponentHideState } from '../../ui/hooks';
9
10
  import { UIEventContext } from '../../ui/context';
10
11
  import { useStore } from '../../ctx/store';
@@ -40,19 +41,27 @@ export const PtzControl = props => {
40
41
  } = props;
41
42
  const {
42
43
  screenType,
43
- brandColor,
44
- fullResolutionActive
44
+ brandColor
45
45
  } = useStore({
46
46
  screenType: props.screenType,
47
- brandColor: props.brandColor,
48
- fullResolutionActive: props.fullResolutionActive
47
+ brandColor: props.brandColor
49
48
  });
50
- const [shouldHide] = useComponentHideState(screenType);
49
+ const [shouldHide] = useComponentHideState();
50
+ const [isPtzActive, setIsPtzActive] = useState(true);
51
51
  const {
52
52
  event
53
53
  } = useContext(UIEventContext);
54
54
  const ptzTimeId = useRef(null);
55
55
  const ptzData = useRef(getPtzData(devId));
56
+ const onPtzControlHide = useMemoizedFn(() => {
57
+ setIsPtzActive(false);
58
+ });
59
+ useEffect(() => {
60
+ event.on('ptzControlHide', onPtzControlHide);
61
+ return () => {
62
+ event.off('ptzControlHide', onPtzControlHide);
63
+ };
64
+ }, []);
56
65
  useEffect(() => {
57
66
  return () => {
58
67
  if (ptzTimeId.current) {
@@ -63,7 +72,7 @@ export const PtzControl = props => {
63
72
  }, []);
64
73
  return /*#__PURE__*/React.createElement(CoverView, {
65
74
  className: clsx('ipc-player-plugin-full-screen-ptz-control', {
66
- 'ipc-player-plugin-full-screen-ptz-control-hide': shouldHide || fullResolutionActive
75
+ 'ipc-player-plugin-full-screen-ptz-control-hide': shouldHide || !isPtzActive
67
76
  })
68
77
  }, /*#__PURE__*/React.createElement(IpcPtzZoom, {
69
78
  ptzSize: "172px",
@@ -1,29 +1,45 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useState, useContext, useEffect } from 'react';
2
2
  import { Text, View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import Strings from '../../i18n';
5
- import { useComponentHideState } from '../../ui/hooks';
5
+ import { useMemoizedFn } from '../../hooks';
6
6
  import { useStore } from '../../ctx/store';
7
+ import { UIEventContext } from '../../ui/context';
8
+ import { playerTap } from '../../ui/constant';
7
9
  import './resolution.less';
8
10
  export const FullResolutionControl = props => {
9
11
  const {
10
- setResolution,
11
- setFullResolutionActive
12
+ setResolution
12
13
  } = props;
13
14
  const {
14
15
  screenType,
15
- fullResolutionActive,
16
16
  resolution,
17
17
  resolutionList,
18
18
  brandColor
19
19
  } = useStore({
20
20
  screenType: props.screenType,
21
- fullResolutionActive: props.fullResolutionActive,
22
21
  resolutionList: props.resolutionList,
23
22
  brandColor: props.brandColor,
24
23
  resolution: props.resolution
25
24
  });
26
- const [shouldHide] = useComponentHideState(screenType);
25
+ const {
26
+ event
27
+ } = useContext(UIEventContext);
28
+ const [hide, setHide] = useState(false);
29
+ const onShowFullResolutionControl = useMemoizedFn(() => {
30
+ setHide(false);
31
+ });
32
+ const onPlayerTap = useMemoizedFn(() => {
33
+ setHide(true);
34
+ });
35
+ useEffect(() => {
36
+ event.on('showFullResolutionControl', onShowFullResolutionControl);
37
+ event.on(playerTap, onPlayerTap);
38
+ return () => {
39
+ event.off('showFullResolutionControl', onShowFullResolutionControl);
40
+ event.off(playerTap, onPlayerTap);
41
+ };
42
+ }, []);
27
43
  const changeResolution = useCallback(value => {
28
44
  if (value === resolution) {
29
45
  ty.showToast({
@@ -31,14 +47,19 @@ export const FullResolutionControl = props => {
31
47
  title: Strings.getLang('ipc_player_current_resolution_is_equal')
32
48
  });
33
49
  } else {
34
- setResolution(value);
35
- // setFullResolutionActive(false);
50
+ setResolution(value).then(() => {
51
+ setHide(true);
52
+ }).catch(() => {
53
+ ty.showToast({
54
+ icon: 'error',
55
+ title: Strings.getLang('ipc_player_resolution_change_error')
56
+ });
57
+ });
36
58
  }
37
59
  }, [resolution]);
38
60
  return /*#__PURE__*/React.createElement(View, {
39
61
  className: clsx('ipc-player-plugin-full-resolution-control', {
40
- 'ipc-player-plugin-full-resolution-control-show': fullResolutionActive,
41
- 'ipc-player-plugin-full-resolution-control-hide': shouldHide || !fullResolutionActive
62
+ 'ipc-player-plugin-full-resolution-control-hide': hide
42
63
  })
43
64
  }, resolutionList.map(item => /*#__PURE__*/React.createElement(Text, {
44
65
  onClick: () => changeResolution(item),
@@ -1,4 +1,10 @@
1
1
  import React from 'react';
2
- import { ComponentConfigProps } from '../../interface';
2
+ import { ComponentConfigProps, ScreenType } from '../../interface';
3
3
  import './resolution.less';
4
- export declare const Resolution: (props: ComponentConfigProps) => React.JSX.Element;
4
+ export type ChangeResolutionWhenClick = ScreenType[];
5
+ type Props = ComponentConfigProps & {
6
+ className?: string;
7
+ changeResolutionWhenClick?: ChangeResolutionWhenClick;
8
+ };
9
+ export declare const Resolution: (props: Props) => React.JSX.Element;
10
+ export {};
@@ -4,52 +4,54 @@ import clsx from 'clsx';
4
4
  import React, { useContext } from 'react';
5
5
  import Strings from '../../i18n';
6
6
  import { FullResolutionControl } from './fullResolutionControl';
7
- import { fullResolutionId, pauseTimeToHideAllComponent } from '../../ui/constant';
7
+ import { fullResolutionId, pauseTimeToHideAllComponent, hideAllComponent } from '../../ui/constant';
8
8
  import { UIEventContext } from '../../ui/context';
9
9
  import { useStore } from '../../ctx/store';
10
10
  import './resolution.less';
11
+ const defaultChangeResolutionWhenClick = ['full'];
11
12
  export const Resolution = props => {
12
13
  const {
13
14
  IPCPlayerContext,
14
15
  setResolution,
15
16
  addContent,
16
- deleteContent,
17
- setFullResolutionActive,
18
- className
17
+ hasContent,
18
+ className,
19
+ changeResolutionWhenClick = defaultChangeResolutionWhenClick
19
20
  } = props;
20
21
  const {
21
22
  resolution,
22
23
  screenType
23
24
  } = useStore({
24
25
  resolution: props.resolution,
25
- screenType: props.screenType,
26
- fullResolutionActive: props.fullResolutionActive
26
+ screenType: props.screenType
27
27
  });
28
28
  const {
29
29
  event
30
30
  } = useContext(UIEventContext);
31
31
  return /*#__PURE__*/React.createElement(View, {
32
32
  onClick: () => {
33
- if (screenType === 'full') {
34
- console.log('dsakdhjksahdhsadsahdkhskahdkshk');
35
- // 更改全屏清晰度展开状态
36
- setFullResolutionActive(true);
37
- // 移除全屏清晰度空间
38
- deleteContent('absolute', fullResolutionId);
39
- // 添加全屏清晰度空间
40
- addContent('absolute', {
41
- id: fullResolutionId,
42
- content: props => {
43
- return /*#__PURE__*/React.createElement(FullResolutionControl, props);
44
- },
45
- absoluteContentClassName: 'ipc-player-plugin-full-resolution-control-wrap',
46
- initProps: _objectSpread({}, props)
47
- });
48
- event.emit(pauseTimeToHideAllComponent);
33
+ event.emit('resolutionBtnControlClick');
34
+ if (!(changeResolutionWhenClick !== null && changeResolutionWhenClick !== void 0 && changeResolutionWhenClick.length)) return false;
35
+ if (screenType === 'full' && defaultChangeResolutionWhenClick.includes(screenType)) {
36
+ event.emit(hideAllComponent);
37
+ if (hasContent('absolute', fullResolutionId)) {
38
+ event.emit('showFullResolutionControl');
39
+ } else {
40
+ addContent('absolute', {
41
+ id: fullResolutionId,
42
+ content: props => {
43
+ return /*#__PURE__*/React.createElement(FullResolutionControl, props);
44
+ },
45
+ absoluteContentClassName: 'ipc-player-plugin-full-resolution-control-wrap',
46
+ initProps: _objectSpread({}, props)
47
+ });
48
+ }
49
49
  return false;
50
50
  }
51
+ if (screenType === 'vertical' && defaultChangeResolutionWhenClick.includes(screenType)) {
52
+ setResolution(resolution === 'HD' ? 'SD' : 'HD');
53
+ }
51
54
  event.emit(pauseTimeToHideAllComponent);
52
- setResolution(resolution === 'HD' ? 'SD' : 'HD');
53
55
  return true;
54
56
  },
55
57
  className: clsx(className, screenType === 'vertical' ? 'ipc-player-plugin-resolution-vertical' : 'ipc-player-plugin-resolution-full')
@@ -17,7 +17,6 @@
17
17
  }
18
18
 
19
19
  .ipc-player-plugin-full-resolution-control {
20
- transform: translate(300%, 0);
21
20
  height: 100%;
22
21
  transition: transform @animation-time ease-in, opacity @animation-time ease-in, width @animation-time ease-in;
23
22
  width: 200px;
@@ -26,7 +25,7 @@
26
25
  justify-content: center;
27
26
  align-items: center;
28
27
  background-color: rgba(0,0,0,0.9);
29
- animation: ipc-player-plugin-full-resolution-control-move-in @animation-time ease-in-out forwards;
28
+ animation: ipc-player-plugin-full-resolution-control-move-in @animation-time ease-in-out;
30
29
  &.ipc-player-plugin-full-resolution-control-hide {
31
30
  transform: translate(300%, 0);
32
31
  opacity: 0;
@@ -47,7 +46,7 @@
47
46
  }
48
47
 
49
48
  @keyframes ipc-player-plugin-full-resolution-control-move-in {
50
- form {
49
+ from {
51
50
  transform: translate(300%, 0);
52
51
  }
53
52
  to {
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ComponentConfigProps } from '../../interface';
3
3
  import './verticalSmallIntercom.less';
4
- type Props = ComponentConfigProps;
4
+ type Props = ComponentConfigProps & {
5
+ className?: string;
6
+ };
5
7
  export declare function VerticalSmallIntercom(props: Props): React.JSX.Element | null;
6
8
  export {};
@@ -17,7 +17,6 @@ export function VerticalSmallIntercom(props) {
17
17
  brandColor
18
18
  } = useStore({
19
19
  screenType: props.screenType,
20
- ptzActive: props.ptzActive,
21
20
  verticalMic: props.verticalMic,
22
21
  intercomMode: props.intercomMode,
23
22
  brandColor: props.brandColor
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ComponentConfigProps } from '../../interface';
3
3
  import './videoBitKBP.less';
4
- type Props = ComponentConfigProps;
4
+ type Props = ComponentConfigProps & {
5
+ className?: string;
6
+ };
5
7
  export declare const VideoBitKBP: (props: Props) => React.JSX.Element | null;
6
8
  export {};
@@ -9,14 +9,12 @@ const BottomLeftContent = _ref => {
9
9
  children
10
10
  } = _ref;
11
11
  const {
12
- screenType,
13
- fullResolutionActive
12
+ screenType
14
13
  } = useStore({
15
14
  screenType: ctx.screenType,
16
- playState: ctx.playState,
17
- fullResolutionActive: ctx.fullResolutionActive
15
+ playState: ctx.playState
18
16
  });
19
- const [shouldHide] = useComponentHideState(screenType);
17
+ const [shouldHide] = useComponentHideState();
20
18
  return /*#__PURE__*/React.createElement(CoverView, {
21
19
  className: clsx('ipc-player-bottom-left-content-wrap')
22
20
  }, /*#__PURE__*/React.createElement(View, {
@@ -25,8 +23,8 @@ const BottomLeftContent = _ref => {
25
23
  paddingLeft: screenType === 'vertical' ? 0 : '25px'
26
24
  },
27
25
  className: clsx('ipc-player-bottom-left-content-container', {
28
- 'ipc-player-bottom-left-content-hide': shouldHide || fullResolutionActive,
29
- 'ipc-player-bottom-left-content-show': !shouldHide && !fullResolutionActive
26
+ // 'ipc-player-bottom-left-content-hide': shouldHide,
27
+ // 'ipc-player-bottom-left-content-show': !shouldHide,
30
28
  })
31
29
  }, children));
32
30
  };
@@ -9,14 +9,12 @@ const BottomRightContent = _ref => {
9
9
  children
10
10
  } = _ref;
11
11
  const {
12
- screenType,
13
- fullResolutionActive
12
+ screenType
14
13
  } = useStore({
15
14
  screenType: ctx.screenType,
16
- playState: ctx.playState,
17
- fullResolutionActive: ctx.fullResolutionActive
15
+ playState: ctx.playState
18
16
  });
19
- const [shouldHide] = useComponentHideState(screenType);
17
+ const [shouldHide] = useComponentHideState();
20
18
  return /*#__PURE__*/React.createElement(CoverView, {
21
19
  className: clsx('ipc-player-bottom-right-content-wrap')
22
20
  }, /*#__PURE__*/React.createElement(View, {
@@ -25,8 +23,8 @@ const BottomRightContent = _ref => {
25
23
  paddingRight: screenType === 'vertical' ? 0 : '25px'
26
24
  },
27
25
  className: clsx('ipc-player-bottom-right-content-container', {
28
- 'ipc-player-bottom-right-content-hide': shouldHide || fullResolutionActive,
29
- 'ipc-player-bottom-right-content-show': !shouldHide && !fullResolutionActive
26
+ // 'ipc-player-bottom-right-content-hide': shouldHide,
27
+ // 'ipc-player-bottom-right-content-show': !shouldHide,
30
28
  })
31
29
  }, children));
32
30
  };
@@ -4,6 +4,7 @@ export declare const playerTap = "playerTap";
4
4
  export declare const pauseTimeToHideAllComponent = "pauseTimeToHideAllComponent";
5
5
  export declare const startTimeToHideAllComponent = "startTimeToHideAllComponent";
6
6
  export declare const voiceIntercomId = "voiceIntercomId";
7
+ export declare const fullTravelRouteControlId = "fullTravelRouteControl";
7
8
  export declare const verticalScreenId = "verticalScreenId";
8
9
  export declare const ptzControlId = "ptzControlId";
9
10
  export declare const fullResolutionId = "fullResolutionId";
@@ -4,6 +4,7 @@ export const playerTap = 'playerTap';
4
4
  export const pauseTimeToHideAllComponent = 'pauseTimeToHideAllComponent';
5
5
  export const startTimeToHideAllComponent = 'startTimeToHideAllComponent';
6
6
  export const voiceIntercomId = 'voiceIntercomId';
7
+ export const fullTravelRouteControlId = 'fullTravelRouteControl';
7
8
  export const verticalScreenId = 'verticalScreenId';
8
9
  export const ptzControlId = 'ptzControlId';
9
10
  export const fullResolutionId = 'fullResolutionId';
@@ -2,5 +2,6 @@
2
2
  import { EventInstance } from './event';
3
3
  export type UIEvent = {
4
4
  event: EventInstance;
5
+ componentHideState: boolean;
5
6
  };
6
7
  export declare const UIEventContext: import("react").Context<UIEvent>;
package/lib/ui/context.js CHANGED
@@ -4,5 +4,6 @@ export const UIEventContext = /*#__PURE__*/createContext({
4
4
  off: () => null,
5
5
  on: () => null,
6
6
  emit: () => null
7
- }
7
+ },
8
+ componentHideState: false
8
9
  });
package/lib/ui/hooks.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const useComponentHideState: (screenType: any) => boolean[];
1
+ export declare const useComponentHideState: () => boolean[];
package/lib/ui/hooks.js CHANGED
@@ -1,26 +1,8 @@
1
- import { useContext, useState, useEffect } from 'react';
1
+ import { useContext } from 'react';
2
2
  import { UIEventContext } from './context';
3
- import { hideAllComponent, showAllComponent } from './constant';
4
3
  export const useComponentHideState = () => {
5
4
  const {
6
- event
5
+ componentHideState
7
6
  } = useContext(UIEventContext);
8
- const [shouldHide, setShouldHide] = useState(false);
9
- const listenHideEvent = () => {
10
- // 横竖屏都支持点击隐藏
11
- // if (screenType === 'vertical') return;
12
- setShouldHide(true);
13
- };
14
- const listenShowEvent = () => {
15
- setShouldHide(false);
16
- };
17
- useEffect(() => {
18
- event.on(hideAllComponent, listenHideEvent);
19
- event.on(showAllComponent, listenShowEvent);
20
- return () => {
21
- event.off(hideAllComponent, listenHideEvent);
22
- event.off(showAllComponent, listenShowEvent);
23
- };
24
- }, [listenHideEvent]);
25
- return [shouldHide];
7
+ return [componentHideState];
26
8
  };
package/lib/ui/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './ui';
2
2
  export * from './hooks';
3
3
  export * from './context';
4
+ export type * from './event';
@@ -4,5 +4,5 @@ type Props = {
4
4
  ctx: ReturnType<UseCtx>;
5
5
  children: React.ReactNode;
6
6
  };
7
- declare const TopLeftContent: ({ ctx, children }: Props) => React.JSX.Element;
8
- export default TopLeftContent;
7
+ declare const _default: React.MemoExoticComponent<({ ctx, children }: Props) => React.JSX.Element>;
8
+ export default _default;
@@ -9,14 +9,12 @@ const TopLeftContent = _ref => {
9
9
  children
10
10
  } = _ref;
11
11
  const {
12
- screenType,
13
- fullResolutionActive
12
+ screenType
14
13
  } = useStore({
15
14
  screenType: ctx.screenType,
16
- playState: ctx.playState,
17
- fullResolutionActive: ctx.fullResolutionActive
15
+ playState: ctx.playState
18
16
  });
19
- const [shouldHide] = useComponentHideState(screenType);
17
+ const [shouldHide] = useComponentHideState();
20
18
  return /*#__PURE__*/React.createElement(CoverView, {
21
19
  className: clsx('ipc-player-top-left-content-wrap')
22
20
  }, /*#__PURE__*/React.createElement(View, {
@@ -25,9 +23,9 @@ const TopLeftContent = _ref => {
25
23
  paddingLeft: screenType === 'vertical' ? 0 : '25px'
26
24
  },
27
25
  className: clsx('ipc-player-top-left-content-container', {
28
- 'ipc-player-top-left-content-hide': shouldHide || fullResolutionActive,
29
- 'ipc-player-top-left-content-show': !shouldHide && !fullResolutionActive
26
+ // 'ipc-player-top-left-content-hide': shouldHide,
27
+ // 'ipc-player-top-left-content-show': !shouldHide,
30
28
  })
31
29
  }, children));
32
30
  };
33
- export default TopLeftContent;
31
+ export default /*#__PURE__*/React.memo(TopLeftContent);