当我在页面上时,视频可见并且播放就像我想要的那样。当我按下它时,我会调用if let vc = self.storyboard?.instantiateViewController(withIdentifier: "ViewController2") as? ViewController2{
vc.dataFrom1StVC = "message send from 1st VC"
vc.sendDataToBackController = {
message in
print(message)
}
self.navigationController?.pushViewController(vc, animated: true)
}
}
功能,视频会在我仍能听到的时候消失。
视频:
presentFullscreenPlayer()
我认为我的造型可能有误,但我不确定如何处理它。
样式:
<TouchableHighlight style={styles.video} onPress={() => this.player.presentFullscreenPlayer()}>
<View>
<Video source={video} // Can be a URL or a local file.
ref={ref => this.player = ref} // Store reference
rate={1.0} // 0 is paused, 1 is normal.
volume={1.0} // 0 is muted, 1 is normal.
muted={false} // Mutes the audio entirely.
paused={true} // Pauses playback entirely.
resizeMode="cover" // Fill the whole screen at aspect ratio.
repeat={false} // Repeat forever.
playInBackground={false} // Audio continues to play when app entering background.
playWhenInactive={false} // [iOS] Video continues to play when control or notification center are shown.
progressUpdateInterval={250.0} // [iOS] Interval to fire onProgress (default to ~250ms)
onLoadStart={this.loadStart} // Callback when video starts to load
onLoad={() => {
this.player.seek(10);
}} // Callback when video loads
onProgress={this.setTime} // Callback every ~250ms with currentTime
onEnd={this.onEnd} // Callback when playback finishes
onError={this.videoError} // Callback when video cannot be loaded
style={styles.locatieVideo} />
</View>
</TouchableHighlight>
编辑:
我还注意到它确实是全屏但它仍然在背景图像后面。该页面是使用react-native-router-flux创建的模态。它可以与此有关吗?
答案 0 :(得分:0)
显然Android上不支持this.player.presentFullscreenPlayer()
功能。