@ray-js/ipc-player-integration 0.0.1-beta-69 → 0.0.1-beta-70

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.
@@ -5,7 +5,6 @@ type Ctx = ReturnType<UseCtx>;
5
5
  export declare function initPlayerWidgets(ctx: Ctx, options: {
6
6
  verticalResolutionCustomClick?: boolean;
7
7
  hideHorizontalMenu?: boolean;
8
- throttleTime?: number;
9
8
  directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
10
9
  }): Promise<void>;
11
10
  export {};
@@ -21,7 +21,6 @@ export async function initPlayerWidgets(ctx, options) {
21
21
  // @ts-ignore
22
22
  newDefaultBottomRightContent[fullScreenIndex].initProps = {
23
23
  hideHorizontalMenu: options.hideHorizontalMenu,
24
- throttleTime: options.throttleTime,
25
24
  directionControlProps: options.directionControlProps
26
25
  };
27
26
  }
@@ -5,6 +5,6 @@ import type { ComponentConfigProps } from '../../interface';
5
5
  type Props = ComponentConfigProps & {
6
6
  className?: string;
7
7
  hideHorizontalMenu?: boolean;
8
- } & Pick<FullTravelRouteControlProps, 'throttleTime' | 'directionControlProps'>;
8
+ } & Pick<FullTravelRouteControlProps, 'directionControlProps'>;
9
9
  export declare function FullScreen(props: Props): React.JSX.Element | null;
10
10
  export {};
@@ -6,7 +6,6 @@ import RectDirectionControl from '@ray-js/direction-control';
6
6
  import type { ComponentConfigProps } from '../../interface';
7
7
  type RectDirectionControlProps = React.ComponentProps<typeof RectDirectionControl>;
8
8
  export type FullTravelRouteControlProps = ComponentConfigProps & {
9
- throttleTime?: number;
10
9
  directionControlProps?: Partial<RectDirectionControlProps>;
11
10
  };
12
11
  export declare function FullTravelRouteControl(props: FullTravelRouteControlProps): React.JSX.Element;
@@ -7,7 +7,7 @@ import React, { useEffect, useContext, useState, useRef } from 'react';
7
7
  import { View } from '@ray-js/ray';
8
8
  import clsx from 'clsx';
9
9
  import RectDirectionControl from '@ray-js/direction-control';
10
- import { useThrottleFn, useMemoizedFn } from 'ahooks';
10
+ import { useMemoizedFn } from 'ahooks';
11
11
  import { UIEventContext } from '../../ui/context';
12
12
  import { useDpState } from '../../hooks';
13
13
  import { useComponentHideState } from '../../ui/hooks';
@@ -16,7 +16,6 @@ import { DIRECTION_CONTROL_DP_CODE } from './constant';
16
16
  import { useStore } from '../../ctx/store';
17
17
  export function FullTravelRouteControl(props) {
18
18
  const {
19
- throttleTime = 300,
20
19
  directionControlProps
21
20
  } = props;
22
21
  const [shouldHide] = useComponentHideState();
@@ -59,19 +58,13 @@ export function FullTravelRouteControl(props) {
59
58
  event.emit(pauseTimeToHideAllComponent);
60
59
  }, 300);
61
60
  };
62
- const {
63
- run: sendDpValue
64
- } = useThrottleFn(value => {
61
+ const sendDpValueFn = value => {
65
62
  if (value === prevRotate.current) return;
66
63
  sendDp({
67
64
  [DIRECTION_CONTROL_DP_CODE]: value
68
65
  });
69
66
  prevRotate.current = value;
70
- }, {
71
- wait: throttleTime,
72
- leading: true,
73
- trailing: true
74
- });
67
+ };
75
68
  return /*#__PURE__*/React.createElement(View, {
76
69
  className: clsx('ipc-player-plugin-full-screen-voice', {
77
70
  'ipc-player-plugin-full-screen-voice-hide': shouldHide || isPtzActive
@@ -81,21 +74,21 @@ export function FullTravelRouteControl(props) {
81
74
  value: 0,
82
75
  onTouchStart: value => {
83
76
  pauseTimeToHideAllComponentFn();
84
- sendDpValue(String(value));
77
+ sendDpValueFn(String(value));
85
78
  ty.nativeDisabled(true);
86
79
  },
87
80
  onTouchMove: value => {
88
81
  pauseTimeToHideAllComponentFn();
89
- sendDpValue(String(value));
82
+ sendDpValueFn(String(value));
90
83
  ty.nativeDisabled(true);
91
84
  },
92
85
  onTouchEnd: () => {
93
86
  event.emit(startTimeToHideAllComponent);
94
- sendDpValue('-1');
87
+ sendDpValueFn('-1');
95
88
  ty.nativeDisabled(false);
96
89
  },
97
90
  onMoveNonIntersection: () => {
98
- sendDpValue('-1');
91
+ sendDpValueFn('-1');
99
92
  },
100
93
  showArcOnTouchInEdgeProximity: true,
101
94
  arcEdgeProximityColor: brandColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-69",
3
+ "version": "0.0.1-beta-70",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -32,7 +32,7 @@
32
32
  "test": "yarn jest"
33
33
  },
34
34
  "peerDependencies": {
35
- "@ray-js/direction-control": "0.0.7-beta-7",
35
+ "@ray-js/direction-control": "0.0.7-beta-8",
36
36
  "ahooks": "^3.1.6"
37
37
  },
38
38
  "dependencies": {
@@ -48,7 +48,7 @@
48
48
  "@commitlint/cli": "^7.2.1",
49
49
  "@commitlint/config-conventional": "^9.0.1",
50
50
  "@ray-js/cli": "^1.4.9",
51
- "@ray-js/direction-control": "0.0.7-beta-7",
51
+ "@ray-js/direction-control": "0.0.7-beta-8",
52
52
  "@ray-js/ray": "^1.4.9",
53
53
  "@testing-library/react-hooks": "^8.0.1",
54
54
  "@types/jest": "^29.5.14",