React native 尝试使用react原生YouTube模块嵌入YouTube视频
我正在尝试使用react原生youtube模块嵌入youtube视频,但没有成功。我可以很好地构建我的react原生项目,应用程序也会出现,但我看到的只是一个黑屏,视频播放器应该放在那里React native 尝试使用react原生YouTube模块嵌入YouTube视频,react-native,React Native,我正在尝试使用react原生youtube模块嵌入youtube视频,但没有成功。我可以很好地构建我的react原生项目,应用程序也会出现,但我看到的只是一个黑屏,视频播放器应该放在那里 <View> <YouTube apiKey={API_KEY} videoId={VIDEO_ID} play fullscreen loop={false}
<View>
<YouTube
apiKey={API_KEY}
videoId={VIDEO_ID}
play
fullscreen
loop={false}
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: 300 }}
/>
</View>
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})}
样式={{alignSelf:'stretch',高度:300}
/>
你是说这个模块吗?是的。查看文档,这可能是react native版本的问题。我将尝试他们正在使用的版本。尝试了较旧的版本,但仍然存在相同的问题。好的,我还为模拟器安装了youtube apk,但也没有成功。我还从github.com/inProgress-team/react-native-youtube下载了android示例,但代码也遇到了同样的问题。我放弃了这个模块,只使用了这个。