react-native-ffmpeg-media-metadata-retriever
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

react-native-ffmpeg-media-metadata-retriever

Wraps FFmpegMediaMetadataRetriever for React Native.

Installation

npm install react-native-ffmpeg-media-metadata-retriever

Android

  • 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')

iOS

Currently, iOS is not supported.

Windows

Currently, Windows is not supported.

Usage

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}`);
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

/react-native-ffmpeg-media-metadata-retriever/

    Package Sidebar

    Install

    npm i react-native-ffmpeg-media-metadata-retriever

    Weekly Downloads

    10

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    1.11 MB

    Total Files

    155

    Last publish

    Collaborators

    • trusted.tomato