2

I'm using expo-av to render a list of videos (like Tiktok home screen style), it works fine on IOS but on Android is lagging. I've tried also react-native-android-video but I faced a lot of configuration problems.

Have a look to my code, if you can see something wrong please let me know :

<Video
        ref={videoRef}
        nativeID={videoUrl}
        onError={e => console.log(e)}
        isLooping={!pausedMemo}
        isMuted={isMuted}
        accessible={false}
        style={styles.media}
        onLoad={() => setVideoLoaded(true)}
        onLoadStart={() => setVideoLoaded(false)}
        shouldPlay={!pausedMemo}
        useNativeControls={false}
        status={{
          shouldPlay: !pausedMemo,
          isLooping: !pausedMemo,
          isMuted: isMuted,
          pitchCorrectionQuality: PitchCorrectionQuality.High,
          shouldCorrectPitch: true,
          progressUpdateIntervalMillis: 100,
          seekMillisToleranceAfter: 1000,
          seekMillisToleranceBefore: 1000,
        }}
        volume={1}
        pointerEvents="none"
        posterSource={{
          uri: mediaItem.thumbnail_url,
          height: itemHeight,
          width: SIZES.screenWidth,
        }}
        usePoster
        posterStyle={styles.posterStyle}
        onPlaybackStatusUpdate={onProgress}
        progressUpdateIntervalMillis={100}
        resizeMode={ResizeMode.COVER}
        source={{
          uri: videoUrl,
        }}
      />

Let me know if you need to see more details.

Rihab
  • 21
  • 1

0 Answers0