Ошибка при использовании библиотеки react-native-video
Хочу использовать видео в react native
Установил react-native-video, подключил библиотеку, создал элемент Video, вписал в uri ссылку на видео поставил style={styles.backgroundVideo} и выскакивает ошибка TypeError: Cannot read property 'Constants' of null
Весь интернет обыскал и не нашёл решения.
Может тут хоть кто поможет
Полная ошибка:
TypeError: Cannot read property 'Constants' of null
This error is located at:
in Video (created by App)
in RCTView (created by View)
in View (created by App)
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent), js engine: hermes`
Полный код:
import Video from "react-native-video";
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<StatusBar style="auto"/>
<Video source={{uri:'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4'}}
style={styles.backgroundVideo}/>
</View>
);
};
const styles = StyleSheet.create({
container: {
backgroundColor: '#F0EFEC',
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}
});
Источник: Stack Overflow на русском