Video not loading when setting source uri with state

The below code fails to load video (no error but just blank screen). uri is passed from different screen using navigation params.

----------------------code-----------------------------

import { Video } from 'expo';

...

componentDidMount(){
    const { navigation } = this.props;
    const data = navigation.getParam('uri', 'null');
    this.setState({uri: data});
  }

...

render() {
return (
...
<Video 
            source={{uri: this.state.uri}}
            style={{width: this.deviceWidth, height: 300}}
            shouldPlay
            isLooping
            resizeMode="cover"
          />
...
)}

Can you create a reproducible example on snack.expo.io ? That would help us run your code and see if we can find an issue.

Thank you for our reply!

This is my snack: Unnamed Snack - Snack

I want to record video using “Camera” screen. Then replay the recorded video in the “Upload” screen.
The expected steps/outcomes are:

  1. Click on “Camera” in the bottom tab.
  2. Record a video
  3. after recording is stopped, the screen moves to “Upload” screen
  4. recorded video should play in the upload screen.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.