5

I am trying to play a video in react-native-video, but I hear only sound. I checked that the file is valid (tried with few), all the callbacks are triggered during the playback. To narrow the problem down I made the following example:

<View style={{flex: 1, backgroundColor: 'grey', alignItems: 'stretch'}}>
  <View style={{backgroundColor: 'blue', flex: 1}}/>
  <Video
    style={{flex: 1}}
    source={{
      uri: 'path/to/the/file.mp4',
      type: 'mp4'
    }}
    resizeMode={"stretch"}
    rate={1.0}
    volume={1.0}
    muted={false}
    onProgress={console.log}
    onLoadStart={console.log}
    onLoad={console.log}
    onEnd={console.log}
    onError={console.log}
    onBuffer={console.log}/>
  <View style={{backgroundColor: 'green', flex: 1}}/>
</View>

So that the expected video is surrounded by other views with blue and green backgrounds, and the parent view's background is grey.

Here is what I see:

emulator screenshot

So the picture does not show up. Tried the same on the real device with the same result. What could it be?

UPDATE, more research: adding controls={true} makes the controls appear after tapping the grey area.

bereal
  • 32,519
  • 6
  • 58
  • 104
  • Any update on this issue – srinivas Jun 13 '20 at 04:20
  • @srinivas iirc, that time it worked when I made the video element the root one. I don't remember details, because soon after I migrated to Flutter and never looked back. – bereal Jun 13 '20 at 16:07
  • Hi thanks for the reply , In real device its working my question why it is not working in emulator. – srinivas Jun 14 '20 at 03:58

0 Answers0