0

Im using react-native-video with react-native. I need to install and run this on an older Android version Android 4.4 (API 19) kitkat.

But Im only getting a black screen when playing video on Android 4.4 (API 19). Not sure what is happening. Works fine on Android 9 (API 28)

Is the library not supported on Android 4.4?

const App = () => {
  return (
    <Fragment>
      <View>
        <Video
          source={require('./assets/backgroundVideo.mp4')}
          ref={(ref) => {
            this.player = ref
          }}                                      
          onBuffer={this.onBuffer}                
          onError={this.videoError}               
          style={styles.backgroundVideo} />
      </View>
    </Fragment>
  );
};

UPDATE: Im also getting the same error in Android studio using the mediaplayer library.

I read this https://developer.android.com/guide/topics/media/media-formats so I changed the profile in my encoding from H.264 AVC Main Profile to H.264 AVC Baseline Profile (BP). But no difference.

Im testing on emulator via android studio. I have got no device with that os. Android 4.4 Version.api: 19 (Google API) and resolution 1920 x 1080

Community
  • 1
  • 1
acroscene
  • 845
  • 4
  • 16
  • 45
  • Which version of react-native-video? – Morrison Chang Aug 29 '19 at 22:27
  • version 4.4.4 I just tried as well running on mediaplayer built in Android studio. Got the same problem there. Could it possibly be a codec problem/ video format? Im using .mp4 – acroscene Aug 29 '19 at 22:30
  • .mp4 is just a container. What is the actual video stream format? – Pawel Aug 29 '19 at 22:33
  • When Im opening the file in VLC and choosing codec information i get: H264 - MPEG-4 AVC (part 10)(avc1) I guess it is that? – acroscene Aug 29 '19 at 22:38
  • @acroscene That seems like normal H264, what is the size (HxW) and how are you testing on Kitkat (emulator or device, list specs). – Morrison Chang Aug 29 '19 at 22:50
  • I read this: https://developer.android.com/guide/topics/media/media-formats#video-codecs .... so I changed the profile in my encoding from H.264 AVC Main Profile to H.264 AVC Baseline Profile (BP). But no difference. Im testing on emulator via android studio. I have got no device with that os. Android 4.4 Version.api: 19 (Google API) and resolution 1920 x 1080 – acroscene Aug 29 '19 at 23:00

1 Answers1

0

Per the exoplayer website, if you're using an emulator, it at least needs api version 23.

petrosmm
  • 528
  • 9
  • 23