【发布时间】:2018-10-29 14:22:24
【问题描述】:
我正在使用这样的视频组件:
<Video style={[videoPlayerStyle, this.props.containerStyle, {height: videoHeight, width: videoWidth}] }
source={{uri: this.props.videoURL}}
ref={(ref) => {
this.player = ref
}}
paused={this.state.paused}
controls={nativeControls}
playInBackground={false}
repeat={false}
key="something123"
muted={this.state.mute}
onBuffer={this.onBuffer}
onEnd={this.onEnd}
onError={this.onError}
onLoad={this.onLoad}
onLoadStart={this.onLoadStart}
onProgress={this.onProgress}
/>
视频结束后,我会显示一个允许用户再次播放的按钮。我尝试使用:
restartPlayingVideo = (dict) => {
this.player.seek(0) // I tried with and without this
this.setState({paused: false})
}
但视频在 Android 上无法重新开始(在 iOS 上运行良好)。
我错过了什么吗?
【问题讨论】:
-
这可能与您的视频资产有关,某些视频编码可能会导致此问题。您使用的是带断点的 mp4 视频吗?
-
感谢您的反馈。我只是尝试了另外两个,它并没有改变任何东西。我检查的另外两个视频:clips.vorwaerts-gmbh.de/big_buck_bunny.mp4techslides.com/demos/sample-videos/small.mp4
标签: react-native react-native-android react-native-video