I am trying to play react native video from uri returned by react native cameraroll. but video is blank. Code for camera roll is:
CameraRoll.getPhotos({ first: 100, assetType: 'videos', }) .then(r => {
this.getPhotosFromCamera(r.edges);
})
.catch((err) => {
console.log("here in error : ", err)
//Error Loading Images
});
and when I pass an individual uri into react native video player, it is still showing blank.
<Video
ref={(ref) => this.videoPlayer = ref}
source={{ uri: item.node.image.uri }}
rate={1.0}
volume={1.0}
muted={false}
paused={true}
stop={!this.props.screenAppearing}
ignoreSilentSwitch='ignore'
resizeMode="contain"
startTime={this.state.videoStartTime}
endTime={this.state.videoEndTime}
onLoad={ev => this.videoDuration = ev.duration}
onProgress={ev => {
Animated.event([
{ left: this.progressPan }
])({
left: (ev.currentTime/this.videoDuration)*Dimensions.get('window').width
})
}}
style={{
height: Dimensions.get('window').width*0.8
}}
/>
Please help. Thanks.