我正在使用react-native-video包获取视频播放器,以便我可以播放我的YouTube视频。
我尝试了这个方法,但只有一个空白的区域出现,而没有视频播放器。
我尝试了这个方法,但只有一个空白的区域出现,而没有视频播放器。
import Video from 'react-native-video';
<Video source={{uri: 'https://www.youtube.com/watch?v=Gh2FaDqZp2g'}}
ref={(ref) => {
this.player = ref
}}
onBuffer={this.onBuffer}
onEnd={this.onEnd}
onError={this.videoError}
style={styles.backgroundVideo} />
样式:
backgroundVideo: {
height:300,
width:'100%',
}