import {View, StyleSheet} from 'react-native';
import React from 'react';
import Video from 'react-native-video';
const SecondPage = () => {
return (
<View style={styles.container}>
<Video
source={{
uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4',
}}
style={styles.backgroundVideo}
fullscreen={true}
resizeMode={'contain'}
repeat={true}
controls={true}
/>
</View>
);
};
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
},
backgroundVideo: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});
export default SecondPage;
render error null is not an object (evaluating 'RCTVideoInstance.Constants')
비디오를 테스트하기위해 react-native-video 라이브러리를 설치하고 실행하려는데 위와 같은 에러가 나왔다.
검색해보니 깃헙의 이슈에도 나와같은 증상인 사람들이 여럿잇으나 하라는대로 해도 되지 않았는데 결국 해결은 함
allprojects {
repositories {
...
jcenter()
}
}
android/build.gradle에 jcenter()을 추가하니까 됐당 왜인지는 모름... 재생은 잘됨
'React Native' 카테고리의 다른 글
NFC를 태그하고 페이지를 이동하는 법 (1) | 2022.04.12 |
---|---|
Page 이동할때는 역시 react-navigation (0) | 2022.04.11 |
ScrollView의 간지기능 (0) | 2022.04.06 |
React Native의 기본 레이아웃 (0) | 2022.04.06 |
지원하는 Component와 APIs가 적어서 만들 수가 없잖아!!!!! (0) | 2022.04.06 |