|
|
6 年之前 | |
|---|---|---|
| Example | 7 年之前 | |
| android | 7 年之前 | |
| ios | 7 年之前 | |
| .gitattributes | 8 年之前 | |
| .gitignore | 8 年之前 | |
| .npmignore | 8 年之前 | |
| LICENSE | 7 年之前 | |
| README.md | 6 年之前 | |
| RNThumbnail.podspec | 7 年之前 | |
| index.js | 8 年之前 | |
| package.json | 7 年之前 | |
| yarn.lock | 7 年之前 |
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.xcodeprojlibRNThumbnail.a to your project’s Build Phases ➜ Link Binary With LibrariesCmd+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
})