我想要处理一些将导航到video.js文件的应用程序,该文件将自动触发视频以横向全屏播放。将视频锁定为横向全屏方向(react-native-video)
我使用的反应本地视频 链接:https://github.com/react-native-community/react-native-video
render() {
return (
<View style={styles.container}>
<View style={styles.fullScreen}>
<Video
ref={(ref) => {
this.player = ref
}}
source={require('../vid/intro-video.mp4')}
style={styles.nativeVideoControls}
rate={this.state.rate}
paused={this.state.paused}
volume={this.state.volume}
muted={this.state.muted}
resizeMode={this.state.resizeMode}
onLoad={this.onLoad}
onLoadStart={this.loadStart}
onBuffer={this.onBuffer}
onProgress={this.onProgress}
onEnd={debounce(this.onEnd, 100)}
repeat={false}
controls={this.state.controls}
/>
</View>
</View>
);
}
我尝试添加loadStart函数内部的贝洛奥里藏特的代码,但它不工作..当我旋转如果不是全屏模式,视频将出现在我的屏幕底部。
this.player.presentFullscreenPlayer()
的解决方案,我想: 1)使用onLayout的视图标签,但什么都没有发生。 2)使用this.player.presentFullscreenPlayer()仍然没有解决问题。