In expo-av Video, onPlaybackStatusUpdate is not getting called while video is playing

40 Views Asked by At

I'm using Expo SDK 49 and expo-av 13.4.1. I'm using "Video" from "expo-av". Here sometimes callback for onPlaybackStatusUpdate is getting called while video is playing and sometimes it is not getting called. It works on some androids and on some it doesn't and since it is not getting called my states are not updating to show video's current timestamps.

updatePlaybackCallback(status) {
        console.log("time", status.positionMillis , status.durationMillis)
        const durationSeconds = (status.positionMillis || status.durationMillis) / 1000;
       /*.... other code for timestamps */
}
<Video
      ref={this.videoRef}
      source={{
          uri: this.state.videoURL,
      }}
      rate={1.0}
      volume={this.state.playbackInstanceInfo.volume}
      isMuted={false}
      // resizeMode="cover"
      resizeMode="contain"
      shouldPlay={
          this.state.playbackInstanceInfo.state !== "Buffering"
      }
      // useNativeControls

      isLooping={false}
      style={
          this.state.playbackInstanceInfo.fullScreen
              ? {
                  ...styles.fullVideo,
                  width: this.state.width,
                  height: this.state.height,
              }
              : styles.video
      }
      onPlaybackStatusUpdate={(status) =>
          this.updatePlaybackCallback(status)
      }
 />

I tried callback with and without 'async', but no success.

0

There are 0 best solutions below