Merge pull request #404 from saifshaikh1805/patch/brightness-issue#299

This commit is contained in:
Nayif 2026-01-16 11:28:18 +05:30 committed by GitHub
commit fd864c0cc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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