当我在页面上时,该视频是可见的,并且可以按照我想要的方式播放。当我按下它时,我会调用该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不支持该功能。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句