react-native-thumbnail-generator
v1.0.0
Published
Get thumbnail from video file. Supports both local and remote media.
Downloads
9
Readme
react-native-thumbnail-generator
iOS/Android thumbnail generator with support for both local and remote videos
Getting started
Install library from
npm
yarn add react-native-thumbnail-generator
Link native code
With autolinking (react-native 0.60+)
cd ios && pod install
Pre 0.60
react-native link react-native-thumbnail-generator
Usage
import { createThumbnail } from "react-native-thumbnail-generator";
createThumbnail({
url: "path to video file",
timeStamp: 10
})
.then(response => {
console.log({ response });
this.setState({
status: "Thumbnail received",
thumbnail: response.path
});
})
.catch(err => console.log({ err }));
Request Object
| Property | Type | Description |
| --------- | :---------------------: | :------------------------------------ |
| url | String
(default ""
) | Path to video file (local or remote). |
| timeStamp | Number
(default 1
) | Thumbnail time |
Response Object
| Property | Type | Description |
| -------- | :------: | :--------------------------- |
| path | String
| Path to generated thumbnail. |
| width | Number
| Thumbnail width |
| height | Number
| Thumbnail height |
License
MIT