@ray-js/ipc-player-integration 0.0.29-beta.22 → 0.0.29-beta.23
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 +9 -1
- package/package.json +1 -1
package/lib/ui/ui.js
CHANGED
|
@@ -90,6 +90,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
90
90
|
*/
|
|
91
91
|
const [componentHideState, setComponentHideState] = useState(false);
|
|
92
92
|
prevTriggerEvent.current = componentHideState ? hideAllComponent : showAllComponent;
|
|
93
|
+
|
|
94
|
+
// 记录切换横屏前的竖屏全屏状态,用于从横屏切回竖屏时恢复
|
|
95
|
+
const prevVerticalFullLayoutRef = useRef(false);
|
|
93
96
|
const eventRef = useRef(instance.event);
|
|
94
97
|
if (eventRef.current !== instance.event) {
|
|
95
98
|
eventRef.current = instance.event;
|
|
@@ -465,9 +468,14 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
465
468
|
setScreenType('vertical');
|
|
466
469
|
} else {
|
|
467
470
|
setScreenType(type === 'landscape' ? 'full' : 'vertical');
|
|
468
|
-
// 横屏时重置竖屏全屏状态
|
|
469
471
|
if (type === 'landscape') {
|
|
472
|
+
// 记录切换横屏前的竖屏全屏状态
|
|
473
|
+
prevVerticalFullLayoutRef.current = isVerticalFullLayout;
|
|
474
|
+
// 横屏时重置竖屏全屏状态
|
|
470
475
|
updateAtom(instance.isVerticalFullLayout, false);
|
|
476
|
+
} else if (!instance.multiCameraCtx.isSupport) {
|
|
477
|
+
// 单目设备从横屏切回竖屏时,恢复之前的竖屏全屏状态
|
|
478
|
+
updateAtom(instance.isVerticalFullLayout, prevVerticalFullLayoutRef.current);
|
|
471
479
|
}
|
|
472
480
|
triggerEvent(showAllComponent);
|
|
473
481
|
}
|