1.0.6 • Published 4 years ago
react-native-simple-video-trimmer v1.0.6
react-native-simple-video-trimmer
All-in-one video trimmer. Pick a video from device then trim it. Component will return the "path to the trimmed video".
Installation
Download a copy of repo from github. Add it to your project manually as if it's one of your custom components. Install dependencies below;
- react-native-image-picker
- react-native-video
- react-native-video-processing
- react-native-fs
npm install react-native-image-picker react-native-video react-native-video-processing react-native-fs
Using these modules, you will be able to pick a file, play it, trim it and save it. Please be aware of that, some video files will not allow you to seek precisely. This could be a codec related issue.
Basic Usage
import React from 'react';
import {View} from 'react-native';
import {VideoTrimmer} from "to/path/of/component";
const App = (props) => {
return (
<View style={{flex: 1, backgroundColor: 'red'}}>
<VideoTrimmer onProgressCompleted={(path) => console.log('Path to trimmed video ' + path)}/>
</View>
);
};
export default App;
Properties
Props | Type | Description |
---|---|---|
onProgressCompleted | function | returns path to trimmed video |
progressDialogComponent | react component | Custom dialog component to be displayed while in progress |
Customization
By looking at the source code, a mid-level RN developer can easily tell which block of code is doing what task. You can customize it the way you want. You can change the color of the buttons, icons or specify the directory where the file will be saved.
Contribution
Yalçın ÖZER. yalcinozer.com