Wraps FFmpegMediaMetadataRetriever for React Native.
npm install react-native-ffmpeg-media-metadata-retriever
- in
android/app/build.gradle
:
dependencies {
...
+ implementation project(':reactnativeffmpegmediametadataretriever')
}
- in
android/settings.gradle
+ include ':reactnativeffmpegmediametadataretriever'
+ project(':reactnativeffmpegmediametadataretriever').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ffmpeg-media-metadata-retriever/android')
Currently, iOS is not supported.
Currently, Windows is not supported.
import fs from 'react-native-fs';
import readdirp from 'react-native-readdirp';
import FfmpegMediaMetadataRetriever from 'react-native-ffmpeg-media-metadata-retriever';
const uri = fs.ExternalStorageDirectoryPath + '/Music';
readdirp(uri).forEach(async (file) => {
const metadata = await FfmpegMediaMetadataRetriever.getMetadata(
file.path,
['title', 'artist']
));
console.log(`${metadata.artist} - ${metadata.title}`);
});
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT