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