1.0.2 • Published 5 years ago
react-native-local-video-trimmer v1.0.2
react-native-local-video-trimmer
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
Property | Type | Description |
---|---|---|
source | string | Path to file. Built-in file picker can also be used |
dialogComponent | React component | Display a fully customized progress dialog' |
dialogContent | {title:<string>,message:<string>} | Replace dialog content with yours |
onProgressCompleted | function | Returns 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>
)
}