我正在使用模块react-native-video,它在调试版本中就像我想要的那样工作。但是只要我assembleRelease
它只显示白屏而不是视频。为什么不在发布版本中播放?
我认为以某种方式编译它时无法找到位置,但我该如何解决?
这是我的视频组件:
render() {
let video = this.props.video;
return (
<TouchableHighlight onPress={this.backToQuestion}>
<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={this.state.paused} // Pauses playback entirely.
resizeMode="stretch" // 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
onProgress={() => {this.state.restart ? this.restartVideo() : null}} // Callback every ~250ms with currentTime
onEnd={this.backToQuestion} // Callback when playback finishes
onError={this.videoError} // Callback when video cannot be loaded
style={styles.video} />
</View>
</TouchableHighlight>
)
视频道具从另一个页面传递出来:
let videos = [
require('../videos/HISTORISCHETUIN.mp4'), //0n
require('../videos/HISTORISCHETUIN.mp4'), //1n
require('../videos/HISTORISCHETUIN.mp4'), //2n
require('../videos/TOREN.mp4'), //3
require('../videos/KELDER.mp4'), //4
require('../videos/HISTORISCHETUIN.mp4'), //5
require('../videos/SLOTGRACHT.mp4'), //6
require('../videos/PLEIN.mp4') //7
]
goToVideo = () => {
this.props.music.backgroundMusic.pause()
Actions.videoplayer({paused: false, restart: true, video: videos[question.image]})
}