Skip to content

Commit

Permalink
v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
souvik-ghosh committed Dec 13, 2021
1 parent ffd0d91 commit ab29f4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ createThumbnail({
| url | `String` (required) | Path to video file (local or remote) |
| timeStamp | `Number` (default `0`) | Thumbnail timestamp (in milliseconds) |
| format | `String` (default `jpeg`) | Thumbnail format, can be one of: `jpeg`, or `png` |
| dirSize | `Number` (default `100`) | Maximum size of the cache directory (in megabytes) |
| dirSize | `Number` (default `100`) | Maximum size of the cache directory (in megabytes). When this directory is full, the previously generated thumbnails will be deleted to clear about half of it's size. |
| headers | `Object` | Headers to load the video with. e.g. `{ Authorization: 'someAuthToken' }` |
| cacheName | `String` (optional) | Cache name for this thumbnail to avoid duplicate generation. If specified, and a thumbnail already exists with the same cache name, it will be returned without generating a new one. |
| cacheName | `String` (optional) | Cache name for this thumbnail to avoid duplicate generation. If specified, and a thumbnail already exists with the same cache name, it will be returned instead of generating a new one. |
## Response Object
Expand All @@ -79,6 +79,7 @@ READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE
- Remote videos aren't supported on android sdk_version < 14.
- This is a **Native Module**, so it won't work in expo managed projects.
- This library heavily depends on the native API's to generate the thumbnails. Thus it can only generate from the video formats/codecs that are supported by the device's OS.
#### Credits
Expand Down
8 changes: 7 additions & 1 deletion example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function App() {
onChangeText={setPath}
style={styles.pathInput}
placeholder="Paste video url"
placeholderTextColor="lightgrey"
/>
<TextInput
keyboardType="numeric"
Expand Down Expand Up @@ -67,7 +68,7 @@ export default function App() {
});
setThumbnail(response.path);
} catch (err) {
console.log({err});
console.error(err);
} finally {
setIsLoading(false);
}
Expand All @@ -85,6 +86,7 @@ const styles = StyleSheet.create({
fontSize: 20,
textAlign: 'center',
margin: 20,
color: 'black',
},
instructions: {
textAlign: 'center',
Expand All @@ -102,12 +104,16 @@ const styles = StyleSheet.create({
width: '80%',
paddingHorizontal: 10,
color: 'black',
borderColor: 'lightgrey',
borderWidth: 1,
},
timeInput: {
backgroundColor: '#eaeaea',
width: '40%',
paddingHorizontal: 10,
margin: 20,
color: 'black',
borderColor: 'lightgrey',
borderWidth: 1,
},
});
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-create-thumbnail",
"title": "React Native Create Thumbnail",
"version": "1.5.0",
"version": "1.5.1",
"description": "iOS/Android thumbnail generator with support for both local and remote videos",
"main": "index.js",
"repository": {
Expand All @@ -18,5 +18,8 @@
},
"license": "MIT",
"licenseFilename": "LICENSE",
"readmeFilename": "README.md"
"readmeFilename": "README.md",
"peerDependencies": {
"react-native": ">=0.59.0"
}
}

0 comments on commit ab29f4e

Please sign in to comment.