我参考官方网站https://www.npmjs.com/package/react-native-youtube并使用命令https://www.npmjs.com/package/react-native-youtube
这是我的包版本:
"dependencies": {
"expo": "^19.0.0",
"firebase": "^4.2.0",
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-19.0.0.tar.gz",
"react-native-router-flux": "^3.41.0",
"react-native-youtube": "^1.0.0-beta.3",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
我像官方一样使用代码:
<YouTube
videoId='KVZ-P-ZI6W4'
play={true} // control playback of video with true/false
fullscreen={true} // control whether the video should play in fullscreen or inline
loop={true} // 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: 300 }}
/>
有人可以告诉我,我可能会错过哪一步?
提前致谢。
我找到了这个文件https://github.com/irccloud/ios/blob/master/YTPlayerView/Assets/YTPlayerView-iframe-player.html 并在我的资产文件夹下创建它,我接下来应该做什么步骤?我仍然看到空白。
答案 0 :(得分:0)