mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
fix: Brightness issue #299
This commit is contained in:
parent
54b51391ad
commit
eef72d8b70
1 changed files with 5 additions and 4 deletions
|
|
@ -111,11 +111,12 @@ export const usePlayerSetup = (
|
|||
return () => {
|
||||
subscription?.remove();
|
||||
disableImmersiveMode();
|
||||
|
||||
// Restore brightness on unmount
|
||||
if (Platform.OS === 'android' && originalSystemBrightnessRef.current !== null) {
|
||||
// restoration logic normally happens here or in a separate effect
|
||||
async function restoreBrightness() {
|
||||
await Brightness.setBrightnessAsync(originalSystemBrightnessRef.current!);
|
||||
setBrightness(originalSystemBrightnessRef.current!);
|
||||
}
|
||||
if (Platform.OS === 'android' && originalSystemBrightnessRef.current !== null)
|
||||
restoreBrightness();
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue