Home > Net >  How can I use video in React Native insta-story?
How can I use video in React Native insta-story?

Time:12-14

I want to

react-native-insta-story

for show videos and images but I can't show videos.I am encountering an error. I saw black screen until end of video's time.

` Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: AndroidCubeEffect`

my rn and component version

and How can I fix?

I search github and stackoverflow but I didnt find resolve. I am open every solution.

CodePudding user response:

unfortunately you can't use video in that package. but you can download the package and make change according to your requirements in this StoryListItem component and then you can use the videos.

    <View style={{ flexDirection: 'row', alignItems: 'center' }}>
                {props.isVideo ? <Video src={src} style={styles.avatarImage} /> : 
<Image style={styles.avatarImage} source={{ uri: profileImage }} />
                <Text style={styles.avatarText}>{profileName}</Text>
              </View>

here Image Component is used you can use react-native-video and use Video component here

  • Related