fix: Brightness issue #299

This commit is contained in:
Saif Shaikh 2026-01-14 03:37:00 -08:00
parent 54b51391ad
commit eef72d8b70

View file

@ -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();
};
}, []);