Socket
Socket
Sign inDemoInstall

react-native-mov-to-mp4

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-mov-to-mp4

React Native convert mov files to mp4


Version published
Weekly downloads
963
decreased by-22.02%
Maintainers
1
Install size
15.3 kB
Created
Weekly downloads
 

Readme

Source

react-native-mov-to-mp4

Convert mov file to mp4 for cross-platform playback compatibility.

Installation

react-native >= 0.40:

npm install react-native-mov-to-mp4 --save

also for iOS:

cd ios && pod install && cd ..

react-native < 0.40:

npm install react-native-mov-to-mp4@0.1 --save

link react-native-mov-to-mp4:

react-native link react-native-mov-to-mp4
import MovToMp4 from 'react-native-mov-to-mp4';

const filename = Date.now().toString();
MovToMp4.convertMovToMp4(data.path, filename + ".mp4")
  .then(function (results) {
    //here you can upload the video...
    console.log(results);
  });
          

Parameters:

convertMovToMp4(videoFilePath,newFilenameMp4,callback)

Example

this example use react-native-camera

render() {
    return (
      <View style={styles.container}>
        <Camera
            ref={(cam) => {
            this.camera = cam;
          }}
            captureTarget={Camera.constants.CaptureTarget.disk}
            captureMode={Camera.constants.CaptureMode.video}
            style={styles.preview}
            aspect={Camera.constants.Aspect.fill}>
          <Text style={styles.capture} onPress={this.takeVideo.bind(this)}>[CAPTURE]</Text>
        </Camera>
      </View>
    );
  }
  takeVideo() {
    if(this.isRec){
      this.isRec = false;
      this.camera.stopCapture();
    }else {
      this.isRec = true;
      this.camera.capture()
          .then((data) => {
            const filename = Date.now().toString();
            MovToMp4.convertMovToMp4(data.path, filename + ".mp4")
              .then(function (results) {
              //here you can upload the video...
              console.log(results);
            });
          })
          .catch(err => console.error(err));
    }
  }

License

MIT

Keywords

FAQs

Last updated on 07 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc