š¦ zeba_academy_media_tools
A powerful Flutter media utilities toolkit for handling images, videos, and audio in your apps.
zeba_academy_media_tools provides simple APIs to perform common media tasks such as:
- š· Image picking and compression
- āļø Image cropping
- š¬ Video compression
- š¼ Video thumbnail generation
- š¤ Audio recording utilities
This package helps developers quickly integrate media processing features without writing complex native code.
⨠Features
- š· Pick images from gallery or camera
- āļø Crop and compress images
- š¬ Compress videos to reduce file size
- š¼ Generate thumbnails from videos
- š¤ Record audio using microphone
- ā” Simple and clean API
- š± Android & iOS support
š¦ Installation
Add the package to your pubspec.yaml.
dependencies:
zeba_academy_media_tools: ^1.0.0
Then run:
flutter pub get
š Usage
Import the package:
import 'package:zeba_academy_media_tools/zeba_academy_media_tools.dart';
š· Pick and Compress Image
final image = await MediaTools.pickImage();
if (image != null) {
final compressed = await MediaTools.cropAndCompressImage(image);
}
š¬ Compress Video
File videoFile = File("video_path");
final compressedVideo = await MediaTools.compressVideo(videoFile);
š¼ Generate Video Thumbnail
final thumbnail = await MediaTools.generateVideoThumbnail(videoPath);
š¤ Audio Recording
Initialize recorder:
await MediaTools.initRecorder();
Start recording:
await MediaTools.startRecording("audio_file");
Stop recording:
final path = await MediaTools.stopRecording();
š Permissions
Make sure you add the required permissions.
Android
android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
iOS
Add to ios/Runner/Info.plist:
NSMicrophoneUsageDescription
NSPhotoLibraryUsageDescription
NSCameraUsageDescription
š± Example
A complete example application is included in the /example folder demonstrating:
- Image compression
- Video thumbnail generation
- Video compression
- Audio recording
š¤ Contributing
Contributions are welcome!
If you'd like to improve this package:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request
š License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
You are free to:
- Use
- Modify
- Distribute
But any distributed modifications must also be licensed under GPL-3.0.
See the LICENSE file for the full license text.
šØāš» About Me
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin
š Your all-in-one no-bloat hub!
š Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! š»āØ
Zeba Academy is a learning platform dedicated to coding, technology, and development.
ā” Visit our main site: https://zeba.academy ā” Explore hands-on courses and resources at: https://code.zeba.academy ā” Check out our YouTube for more tutorials: https://www.youtube.com/@zeba.academy ā” Follow us on Instagram: https://www.instagram.com/zeba.academy/
Thank you for visiting!