【问题标题】:React Native Black Screen for a second between loading and video playback using react-native-video (Android)使用 react-native-video (Android) 在加载和视频播放之间反应原生黑屏一秒钟
【发布时间】:2018-07-15 09:28:55
【问题描述】:

从 onLoad 移动时总是会出现大约 2 秒的黑屏,这会停止我的加载微调器组件并在下面的代码中开始视频播放。我正在使用 ExoPlayer。 知道我做错了什么,或者如何改进我的代码以摆脱黑屏?!

render() {
let loading = null;
let waitingVideo = null;
if (!this.state.waitingVideoURL) {
  loading = (
    <View>
      <Text style={styles.loading}>Loading...</Text>
      <ActivityIndicator size="large" color="#2C3942" />
    </View>
  );
} else {
  waitingVideo = (
    <Video
      source={{
        uri: this.state.waitingVideoURL,
      }}
      resizeMode="cover"
      style={styles.backgroundVideo}
      repeat
      onLoad={this.stopLoading}
    />
  );
}

return (
  <View style={styles.container}>
    <StatusBar hidden />
    {waitingVideo}
    {loading}
  </View>
);
}
}

【问题讨论】:

    标签: android reactjs react-native react-native-video


    【解决方案1】:

    您尝试投放的视频可能仍在缓冲中? 尝试注册onBuffer 事件并查看视频是否仍在缓冲中。

    【讨论】:

      猜你喜欢
      • 2019-05-24
      • 1970-01-01
      • 2019-12-16
      • 2011-10-01
      • 2021-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多