【发布时间】:2019-08-05 20:33:03
【问题描述】:
当我尝试播放直播时,播放器立即停止。 从日志中,我看到视频一开始就调用了 onEnd si。
奇怪的是它只发生在实际手机上,它在模拟器上运行良好。尝试使用 Android Studio Emulator 和 Genymotion,都可以正常工作。 调试和发布都无法在实际手机上播放直播。
<TouchableOpacity style={VideoPlayerStyles.fullScreen} onPress={this.handleVideoTap}>
<Video source={{ uri: this.props.channelSrc }}
style={VideoPlayerStyles.fullScreen}
rate={this.state.rate}
paused={this.state.paused}
volume={this.state.volume}
muted={this.state.muted}
resizeMode={this.state.resizeMode}
onLoad={this.onLoad}
onProgress={this.onProgress}
onEnd={this.onEnd}
repeat={false}
fullscreen={true}
ref={ref => {
this.player = ref
}}
onBuffer={this.onBuffer}
onError={this.videoError} />
</TouchableOpacity>
【问题讨论】:
-
您的视频网址 (this.props.channelSrc) 是否可以通过移动网络访问?
-
播放失败时,您是否在 Android Studio 中看到任何调试信息?此外,它是否对所有视频都这样做(您可以尝试其他 URL)吗?
-
它只适用于直播,适用于电影。视频最多只有一秒长,没有错误。用 rn-fetch-blob 试过,视频长约 20-30 秒。链接也适用于 react native vlc。
-
你可以分享流媒体链接吗?
-
@Gowtham 任何 IPTV 直播都有同样的问题,我可以私下分享。
标签: android react-native react-native-video