fix(sample): remove warning on ios with NavigationBar (#4148)

* fix(sample): remove warning on ios with NavigationBar
This commit is contained in:
Olivier Bouillet 2024-09-06 09:45:24 +02:00 committed by GitHub
parent 4a2beaa147
commit e18769ab3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,7 +34,7 @@ import Video, {
} from 'react-native-video'; } from 'react-native-video';
import styles from './styles'; import styles from './styles';
import {type AdditionalSourceInfo} from './types'; import {type AdditionalSourceInfo} from './types';
import {bufferConfig, srcList, textTracksSelectionBy} from './constants'; import {bufferConfig, isAndroid, srcList, textTracksSelectionBy} from './constants';
import {Overlay, toast, VideoLoader} from './components'; import {Overlay, toast, VideoLoader} from './components';
import * as NavigationBar from 'expo-navigation-bar'; import * as NavigationBar from 'expo-navigation-bar';
@ -106,7 +106,9 @@ const VideoPlayer: FC<Props> = ({}) => {
}, [goToChannel, srcListId]); }, [goToChannel, srcListId]);
useEffect(() => { useEffect(() => {
if (isAndroid) {
NavigationBar.setVisibilityAsync('visible'); NavigationBar.setVisibilityAsync('visible');
}
}, []); }, []);
const onAudioTracks = (data: OnAudioTracksData) => { const onAudioTracks = (data: OnAudioTracksData) => {