video_duration 0.0.3
video_duration: ^0.0.3 copied to clipboard
A Flutter package that provides a simple cross-platform utility to get the duration of a video file in seconds
πΉ video_duration #
A Flutter package that provides a simple cross-platform utility to get the duration of a video file in seconds.
Currently supports Windows and macOS. Contributions are welcome to extend support to Linux, Android, iOS, and Web!
β¨ Features #
- Returns the duration of a video file.
- Outputs a double value (e.g.,
3.728= 3 seconds and 728 milliseconds). - Works seamlessly on Windows and macOS.
- Minimal, focused, and easy to integrate.
π§ Installation #
Add this to your pubspec.yaml:
dependencies:
video_duration: ^<latest_version>
or type:
flutter pub add video_duration
Then run:
flutter pub get
π§ Usage #
import 'package:video_duration/video_duration.dart';
void main() async {
final duration = await getVideoDuration('path/to/video.mp4');
print('Video duration: $duration seconds');
}
π» Supported Platforms #
- β macOS
- β Windows
- β³ Linux (Help wanted!)
- β iOS
- β³ Android (Help wanted!)
- β³ Web (Help wanted!)
π€ Contributing #
Contributions are welcome and appreciated! Feel free to:
- Submit a pull request for additional platform support
- Report issues or bugs
- Suggest improvements