Rob Walker 3e8993ca58 Change compile to implementation in Gradle | 5 years ago | |
---|---|---|
Example | 6 years ago | |
android | 6 years ago | |
ios | 6 years ago | |
.gitattributes | 7 years ago | |
.gitignore | 7 years ago | |
.npmignore | 7 years ago | |
LICENSE | 6 years ago | |
README.md | 5 years ago | |
RNThumbnail.podspec | 6 years ago | |
index.js | 7 years ago | |
package.json | 6 years ago | |
yarn.lock | 6 years ago |
Get thumbnail from local media. Currently, it only supports for video.
$ npm install react-native-thumbnail --save
$ react-native link react-native-thumbnail
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-thumbnail
and add RNThumbnail.xcodeproj
libRNThumbnail.a
to your project’s Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainActivity.java
import com.reactlibrary.RNThumbnailPackage;
to the imports at the top of the filenew RNThumbnailPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-thumbnail'
project(':react-native-thumbnail').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-thumbnail/android')
android/app/build.gradle
:
implementation project(':react-native-thumbnail')
import RNThumbnail from 'react-native-thumbnail';
RNThumbnail.get(filepath).then((result) => {
console.log(result.path); // thumbnail path
})