【问题标题】:react-native-video - Video stalls and then keeps playingreact-native-video - 视频停顿然后继续播放
【发布时间】:2022-11-10 16:25:28
【问题描述】:

我目前在我的应用程序中使用 react-native-video。我们将一个 m3u8 流 url 传递给视频播放器。流确实会播放,但是两秒钟后会触发 onStall 事件。然后在 2-5 秒内触发 onResume 事件并恢复流,尽管现在落后了 2-5 秒。

我的视频实现如下:

<Video
    key={index}
    ref={this.vPlayer}
    source={{uri: item.uri}}
    poster={item.poster}
    posterResizeMode="cover"
    style={styles.mediaPlayer}
    onError={(error) => {
        console.log(error);
    }}
    onPlaybackStalled={() => {
        console.log("Stalled");
    }}
    onBuffer={(data) => {
        console.log("Buffer", data);
    }}
    onVideoBuffer={() => {
        console.log("Video Buffer");
    }}
    onPlaybackResume={() => {
        console.log("Resume");
    }}
    muted={this.state.auctionMuted}
    playInBackground={false}
    resizeMode="cover"
    controls={true}
    paused={false}
/>

从我记录的各种事件中获取控制台日志的混合。通常是:

Stalled
Resume

但我有时也会得到,错误似乎每 1 秒帧发生一次:

Stalled
{"error": {"extra": 0, "what": -2147483648}}
{"error": {"extra": 0, "what": -38}}
{"error": {"extra": 0, "what": -38}}
{"error": {"extra": 0, "what": -38}}
{"error": {"extra": 0, "what": -38}}
{"error": {"extra": 0, "what": -38}}
{"error": {"extra": 0, "what": -38}}
{"error": {"extra": 0, "what": -38}}

这个问题似乎只发生在 Android 上,iOS 应用程序流正常。

有什么建议么?

干杯,

【问题讨论】:

    标签: reactjs video stream native


    【解决方案1】:

    你有没有想过这个?我有同样的问题

    【讨论】:

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