试图在反应原生视频中全屏时视频消失
问题描述:
当我在页面上时,视频是可见的,可以播放,就像我想要的一样。当我按下它时,我打电话给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>
我认为我的风格可能是错的,但我不会知道该怎么用它做。
造型:
locatieVideo:{
position: 'absolute',
top: 0,
left: 0,
width: 250,
height: 200,
zIndex: 501,
},
video:{
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 500,
},
编辑:
我也注意到它得到全屏幕,但它停留在背景图片后面。该页面是使用react-native-router-flux创建的模块。这与它有什么关系?
答
显然功能this.player.presentFullscreenPlayer()
在Android上不受支持。