video_duration_native 0.2.1+4
video_duration_native: ^0.2.1+4 copied to clipboard
Lightweight native duration reader (Android/iOS) by path or content URI. No FFmpeg, no byte loading.
video_duration_native #
Developed with 💙 by Very Good Ventures 🦄
A lightweight native video duration reader for Flutter. Uses native platform APIs (MediaMetadataRetriever on Android, AVURLAsset on iOS) for fast metadata extraction. No FFmpeg, no byte loading.
Generated by the Very Good CLI 🤖
Features #
✅ Lightweight - Native platform APIs only
✅ Fast - Metadata extraction without loading video into memory
✅ Cross-platform - Android and iOS support
✅ Content URI support - Android content:// URIs
✅ Type-safe - Returns Dart Duration object
Usage #
import 'package:video_duration_native/video_duration_native.dart';
// Get duration from a file path
final duration = await getDuration('/path/to/video.mp4');
print('Duration: ${duration.inSeconds} seconds');
// Android content URI
final duration2 = await getDuration('content://media/external/video/123');
// Returns Duration.zero on error
final invalid = await getDuration('/invalid.mp4'); // Duration.zero
Platform Support #
- Android: File paths, content:// URIs
- iOS: File paths, file:// URLs

