@ray-js/ipc-player-integration 0.0.1-beta-65 → 0.0.1-beta-67

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 (2) hide show
  1. package/lib/ui/ui.js +6 -10
  2. package/package.json +1 -1
package/lib/ui/ui.js CHANGED
@@ -67,7 +67,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
67
67
  setVerticalMic
68
68
  } = instance;
69
69
  const prevTriggerEvent = useRef();
70
-
71
70
  /*
72
71
  player 的UI效果期望有一些控件在初始化的时候都展示,在点击 Player 之后隐藏:
73
72
  在控件显示时,点击播放器期望隐藏控件
@@ -84,16 +83,14 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
84
83
  const timer = useRef();
85
84
  const [scaleMultiple, setScaleMultiple] = useState(playerFit === 'contain' ? 1 : -2);
86
85
  const [currentZoomLevel, setCurrentZoomLevel] = useState(playerFit === 'contain' ? 1 : -2);
87
-
88
- // 监听playerMode的变化,更新scaleMultiple
89
- useEffect(() => {
90
- setScaleMultiple(playerFit === 'contain' ? 1 : -2);
91
- setCurrentZoomLevel(playerFit === 'contain' ? 1 : -2);
92
- }, [playerFit]);
93
86
  useEffect(() => {
94
87
  setBrandColor(brandColor);
95
88
  setVerticalMic(verticalMic);
96
89
  }, []);
90
+ useEffect(() => {
91
+ landscapeModeRef.current = landscapeMode;
92
+ playerFitRef.current = playerFit;
93
+ }, [landscapeMode, playerFit]);
97
94
  const refreshBottomLeft = () => {
98
95
  event.current.emit(startTimeToHideAllComponent);
99
96
  event.current.emit(showAllComponent);
@@ -103,7 +100,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
103
100
  /**
104
101
  * 监听屏幕布局变化
105
102
  */
106
- usePageEvent('onResize', sizeData => {
103
+ usePageEvent('onResize', useMemoizedFn(sizeData => {
107
104
  try {
108
105
  const {
109
106
  type
@@ -123,7 +120,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
123
120
 
124
121
  // 若为全屏模式并且要求按宽填充,即横屏时充满,主动设置模式为-1即可
125
122
  if (type === 'landscape' && landscapeMode === 'fill') {
126
- console.log('横屏时充满');
127
123
  setScaleMultiple(-1);
128
124
  } else {
129
125
  // 将屏幕播放比例设为1
@@ -132,7 +128,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
132
128
  } catch (err) {
133
129
  console.log(err, 'err');
134
130
  }
135
- });
131
+ }));
136
132
  const systemInfo = useRef(null);
137
133
  if (!systemInfo.current) {
138
134
  systemInfo.current = getSystemInfoSync();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-65",
3
+ "version": "0.0.1-beta-67",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [