0

My problem: short Videos scrolling used different windowHeight for different device in react native.

I used

const windowHeight = Dimensions.get('window').height;
const screenHeight = Dimensions.get('screen').height; 

And give video view to windowHeight for height but it will take full windowHeight for some Devices and for some Devices it will not take the exact screen, in some devices there is extra height that will go beneath the navbar and for some device it will not reach to the navbar or if navbar not present before screen ending video view is getting end and this certain extra space (excced or less) get doubled in every scrolling of videos what to do here?

<SafeAreaView
      style={{
        width: windowWidth,
         height: windowHeight,
        //  position: 'relative',
        justifyContent: 'center',
        alignItems: 'center',
      }}>
     
         <Video
          videoRef={videoRef}
          onBuffer={onBuffer}
          onError={onError}
          repeat={true}
          poster={item.reel.thumb}
          posterResizeMode='cover'
          resizeMode="cover"
          paused={currentIndex == index ? false : true}
          source={{uri: item.reel.file}}
          muted={isMuted}
          style={{
            width: '100%',
            height: windowHeight,
            position: 'absolute',
            backgroundColor:'#000'
          }}
    />
</SafeArearView> 

Please help

React_Coder
  • 353
  • 2
  • 12

0 Answers0