gpt4 book ai didi

android - Youtube 视频无法在 android 中播放(react-native)

转载 作者:行者123 更新时间:2023-12-02 21:04:29 25 4
gpt4 key购买 nike

我正在开发一个显示 Youtube 视频的示例应用程序。它在 iOS 上运行完美,但在 Android 上,它不显示播放按钮,而是显示带有微调器的黑屏。

我正在使用react-native-youtube用于添加 YouTube 组件的 GitHub 项目。

 <YouTube
apiKey={'xxxxxxxxxxxx'}
videoId={xxxxxxxxx}
play={true}
fullscreen={false}
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={[styles.articleImage, allTabFilterSelected ? {}
styles.articleImageFilterTab]}
/>

在 iOS 上,我的应用程序运行良好,播放按钮有效。但在 Android 上,它显示的是一个空黑屏,如下所示:

enter image description here

请提出一些解决方案!提前致谢。

最佳答案

重要! (仅限 Android):此组件的 Android 实现需要在设备上安装官方 YouTube 应用。否则,系统将提示用户安装/激活应用程序,并会触发错误事件 SERVICE_MISSING/SERVICE_DISABLED。

关于android - Youtube 视频无法在 android 中播放(react-native),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49809783/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com