1.0.2 • Published 4 years ago

react-native-local-video-trimmer v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

react-native-local-video-trimmer

npm.io

Trim videos that are stored on your device easily. This package includes modules listed below:

  • Video processing,
  • Video player,
  • Video trim UI,
  • File system module (to create a copy of trimmed video)

Installation

Using npm:

npm install --save react-native-local-video-trimmer

Important Notes

Note: Video player can play videos from URL. But trimming URL videos only supported on iOS devices. Note: Use a real device.

Props

PropertyTypeDescription
sourcestringPath to file. Built-in file picker can also be used
dialogComponentReact componentDisplay a fully customized progress dialog'
dialogContent{title:<string>,message:<string>}Replace dialog content with yours
onProgressCompletedfunctionReturns path of trimmed video.

Example

import React from 'react';
import {View, Text} from 'react-native';
import VideoTrimmer from "react-native-local-video-trimmer";

const App = () => {

    return (
        <View>
            <VideoTrimmer
                source={"path/to/local/file"}//Optional.
                dialogContent={{title: "Custom title", message: "Custom message..."}}//Optional
                // dialogComponent={<DialogComponent/>} //Optional
                onProgressCompleted={(path) => console.log(path)}
            />
        </View>
    );
};

export default App;

const DialogComponent = () => {
    return (
        <View>
            <Text style={{color: "#fff"}}>Default dialog component will be replaced with this.</Text>
        </View>
    )
}