Skip to content

Commit ab29f4e

Browse files
committed
v1.5.1
1 parent ffd0d91 commit ab29f4e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ createThumbnail({
5353
| url | `String` (required) | Path to video file (local or remote) |
5454
| timeStamp | `Number` (default `0`) | Thumbnail timestamp (in milliseconds) |
5555
| format | `String` (default `jpeg`) | Thumbnail format, can be one of: `jpeg`, or `png` |
56-
| dirSize | `Number` (default `100`) | Maximum size of the cache directory (in megabytes) |
56+
| 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. |
5757
| headers | `Object` | Headers to load the video with. e.g. `{ Authorization: 'someAuthToken' }` |
58-
| 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. |
58+
| 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. |
5959

6060
## Response Object
6161

@@ -79,6 +79,7 @@ READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE
7979

8080
- Remote videos aren't supported on android sdk_version < 14.
8181
- This is a **Native Module**, so it won't work in expo managed projects.
82+
- 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.
8283

8384
#### Credits
8485

example/App.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function App() {
2626
onChangeText={setPath}
2727
style={styles.pathInput}
2828
placeholder="Paste video url"
29+
placeholderTextColor="lightgrey"
2930
/>
3031
<TextInput
3132
keyboardType="numeric"
@@ -67,7 +68,7 @@ export default function App() {
6768
});
6869
setThumbnail(response.path);
6970
} catch (err) {
70-
console.log({err});
71+
console.error(err);
7172
} finally {
7273
setIsLoading(false);
7374
}
@@ -85,6 +86,7 @@ const styles = StyleSheet.create({
8586
fontSize: 20,
8687
textAlign: 'center',
8788
margin: 20,
89+
color: 'black',
8890
},
8991
instructions: {
9092
textAlign: 'center',
@@ -102,12 +104,16 @@ const styles = StyleSheet.create({
102104
width: '80%',
103105
paddingHorizontal: 10,
104106
color: 'black',
107+
borderColor: 'lightgrey',
108+
borderWidth: 1,
105109
},
106110
timeInput: {
107111
backgroundColor: '#eaeaea',
108112
width: '40%',
109113
paddingHorizontal: 10,
110114
margin: 20,
111115
color: 'black',
116+
borderColor: 'lightgrey',
117+
borderWidth: 1,
112118
},
113119
});

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-create-thumbnail",
33
"title": "React Native Create Thumbnail",
4-
"version": "1.5.0",
4+
"version": "1.5.1",
55
"description": "iOS/Android thumbnail generator with support for both local and remote videos",
66
"main": "index.js",
77
"repository": {
@@ -18,5 +18,8 @@
1818
},
1919
"license": "MIT",
2020
"licenseFilename": "LICENSE",
21-
"readmeFilename": "README.md"
21+
"readmeFilename": "README.md",
22+
"peerDependencies": {
23+
"react-native": ">=0.59.0"
24+
}
2225
}

0 commit comments

Comments
 (0)