title: react-native-image-picker duration of video
body: <p>I'm using <code>react-native-image-picker</code> library for video recording and <code>react-native-video</code> to play video in which duration of video in <code>onLoad</code> callback function is given but how can I use it in my code can anyone please guide me? I have written <code>durationLimit</code> in function but it is not working. How can I record video of duration 30 seconds? I tried <a href="https://github.com/Saad-Bashar/Find-Video-Length-React-Native" rel="nofollow noreferrer">this</a>
  too but failed.</p>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>import ImagePicker from 'react-native-image-picker';   
  import Video from 'react-native-video';
  
  constructor(props){
     super(props);
     this.state = {
        video: '',
        isVideo: true
     };
  };
  _handleVideoUpload = () =&gt; {
     const options = {
        mediaType: 'video',
        videoQuality: 'medium',
        durationLimit: 30000,
        thumbnail: true,
        allowsEditing: true,
     };
  
     ImagePicker.launchCamera(options, (response) =&gt; {
        if (response.didCancel) {
          // console.warn('User cancelled video picker');
          return true;
        } else if (response.error) {
           // console.warn('ImagePicker Error: ', response.error);
        } else if (response.customButton) {
            console.warn('User tapped custom button: ', response.customButton);
        } else {
           this.setState({video: response.uri});
        } 
     });
   }
  
  render() {
     return(
       &lt;View&gt;
       {
        this.state.video != '' ?
           &lt;View&gt;                     
             &lt;Video
                ref={ref =&gt; this._video = ref}
                source={{ uri: this.state.video }}
                resizeMode={'cover'}
                repeat={true}
                paused = {true}
                onLoad={() =&gt; { this._video.seek(2);}} 
             /&gt;
         &lt;/View&gt;
       : 
         &lt;TouchableOpacity 
            onPress={() =&gt; this._handleVideoUpload()}
         &gt;
           &lt;Text&gt;Upload Video&lt;/Text&gt;
        &lt;/TouchableOpacity&gt;
      }
     &lt;/View&gt;
  );}
  </code></pre>
  
  <p>Thank you in advance.</p>