Add in your pubspec.yaml
.
dependencies:
...
flutter_media_metadata: ^1.0.0
Example app running on Windows.
Please consider buying me a coffee if you like the plugin.
final metadata = await MetadataRetriever.fromFile(File(filePath));
String? trackName = metadata.trackName;
List<String>? trackArtistNames = metadata.trackArtistNames;
String? albumName = metadata.albumName;
String? albumArtistName = metadata.albumArtistName;
int? trackNumber = metadata.trackNumber;
int? albumLength = metadata.albumLength;
int? year = metadata.year;
String? genre = metadata.genre;
String? authorName = metadata.authorName;
String? writerName = metadata.writerName;
int? discNumber = metadata.discNumber;
String? mimeType = metadata.mimeType;
int? trackDuration = metadata.trackDuration;
int? bitrate = metadata.bitrate;
Uint8List? albumArt = metadata.albumArt;
For using the plugin on web, add following line to your index.html
.
<link rel="manifest" href="manifest.json">
</head>
<body>
+ <script type="text/javascript" src="https://unpkg.com/mediainfo.js/dist/mediainfo.min.js"></script>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
var serviceWorkerVersion = null;
var scriptLoaded = false;
And use MetadataRetriever.fromBytes
instead of MetadataRetriever.fromFile
.
Platform | Status | Author/Maintainer |
---|---|---|
Windows | βοΈ | Hitesh Kumar Saini |
Linux | βοΈ | Hitesh Kumar Saini |
Android | βοΈ | Hitesh Kumar Saini |
Web | βοΈ | Hitesh Kumar Saini |
MacOS | βοΈ | @DiscombobulatedDrag |
iOS | βοΈ | @DiscombobulatedDrag |
Example app running on Web.
Example app running on Android.
Example app running on Linux.
This library & work under this repository is MIT licensed.
Copyright (c) 2021-2022 Hitesh Kumar Saini [email protected]