我想要處理一些將導航到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()仍然沒有解決問題。