Hi I'm trying to get an youtube player using react-native-youtube
but I'm getting a black screen with an endless loading in android. It works well in iOS. Does someone have an idea why ?
Here is the code :
<View>
<YouTube
apiKey="APIKEY"
videoId={this.state.videoUrls} // The YouTube video ID
play = {this.state.isPlaying} // control playback of video with true/false
fullscreen = {this.state.fullscreen} // control whether the video should play in fullscreen or inline
loop = {this.state.isLooping}// control whether the video should loop when ended
onReady={e => this.setState({ isReady: true })}
onChangeState={e => this.setState({ status: e.state })}
onChangeQuality={e => this.setState({ quality: e.quality })}
onError={e => this.setState({ error: e.error })}
style={{ alignSelf: 'stretch', height: 250 }}
/>
</View>
EDIT : the code of the videoId
<View style = {styles.containerPlaylist}>
<View>
{
this.state.dataVideos.map((item,i) =>
<TouchableHighlight
key = {item.contentDetails.videoId}
onPress = {()=> this.setState({videoUrls: item.contentDetails.videoId})}>
<View style = {styles.vids}>
<Image
source = {{uri: item.snippet.thumbnails.medium.url}}
style = {{flex: 2, height: '100%', backgroundColor:'#fff', resizeMode:'contain'}}
/>
<Text style = {styles.vidText}>{item.snippet.title}</Text>
</View>
</TouchableHighlight>
)}
</View>
</View>