tkmct / react-native-media-editor

Add text on image or video with ReactNative
27 stars 10 forks source link

EmbedText is not a function #7

Open jesukka opened 6 years ago

jesukka commented 6 years ago

We are building an app where we need to add text to video. User should be able to add text to video which was recorded with in-app camera. Unfortunately I can't make it work. I'm getting error:

nayttokuva 2017-10-18 kello 11 45 39

And here is the code:

import RNMediaEditor from 'react-native-media-editor';
...............................
textOnVideo = () => {

      const options = {
        path: this.props.post.path,
        type: 'video',
        left: 200,
        top: 200,
        backgroundOpacity: 0.5,
        text: 'Hello world',
        fontSize: 22,
        textColor: "#FFFFFF",
        backgroundColor: '#000000',
      };

      console.log("Text added");

      RNMediaEditor.embedText(options)
      .then(res => {
        console.log("Conversion succeed: ", res);
      })
      .catch(err => {
        console.log("Could not convert text on video: ", err);
      });

    }
.................................
<Video
   source={{uri: this.props.post.path}}
   style={styles.fullScreen}
   muted={false}
   onLoad={this.onLoad}
   onBuffer={this.onBuffer} />
rf1804 commented 6 years ago

same error, please help