video_duration_native 0.2.3 copy "video_duration_native: ^0.2.3" to clipboard
video_duration_native: ^0.2.3 copied to clipboard

Lightweight native duration reader (Android/iOS) by path or content URI. No FFmpeg, no byte loading.

video_duration_native #

Very Good Ventures Very Good Ventures

Developed with 💙 by Very Good Ventures 🦄

coverage style: very good analysis License: MIT

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
1
likes
155
points
143
downloads

Publisher

unverified uploader

Weekly Downloads

Lightweight native duration reader (Android/iOS) by path or content URI. No FFmpeg, no byte loading.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

flutter, video_duration_native_android, video_duration_native_ios, video_duration_native_platform_interface

More

Packages that depend on video_duration_native

Packages that implement video_duration_native