0

Can someone please tell me why this isn't working?

This is killing me right now...

  import Video from 'react-native-video';


  <View
    style={{width: 100, height: 100, flex: 1, backgroundColor: 'black'}}>
    <Video
      source={{
        uri:
          'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4',
      }}
      resizeMode="cover"
      style={{
        width: 500,
        height: 500,
        backgroundColor: 'orange',
      }}
    />
 </View>

enter image description here

enter image description here

hellomello
  • 8,219
  • 39
  • 151
  • 297
  • Did you checked with "Inspector" of ReactNative Debugger, if Video-Component is loaded (and maybe only overlaped or miss-sized)? – suther Feb 18 '20 at 18:12
  • @suther I updated the post with another screenshot showing the elements, it looks like its there. Is this what I'm supposed to be seeing? I also see source, with the url, and stuff – hellomello Feb 18 '20 at 20:59
  • 1
    @suther this is so terrible. it worked after I restarted the simulator.... – hellomello Feb 18 '20 at 21:13

1 Answers1

0

You should refer this code

 <View
        style={{
          paddingVertical: 15,
          width: '100%',
        }}>
        <Video
          resizeMode="contain"
          source={{
            uri: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4',
          }}
          ref={ref => {
            this.player = ref;
          }}
          onBuffer={this.onBuffer}
          onError={this.videoError}
          style={CollectionStyle.backgroundVideo}
          controls={false}
        />
      </View>

for the style

backgroundVideo: { marginTop: 40, height: 100, },