flutter_native_video_trimmer 1.0.0 copy "flutter_native_video_trimmer: ^1.0.0" to clipboard
flutter_native_video_trimmer: ^1.0.0 copied to clipboard

A lightweight Flutter plugin for video manipulation using pure native code (Media3 for Android and AVFoundation for iOS). Efficiently trim videos, generate thumbnails, and retrieve video information w [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_native_video_trimmer/video_trimmer.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _videoTrimmer = VideoTrimmer();

  // Example of how to use the video trimmer functions
  Future<void> _exampleUsage() async {
    try {
      // 1. Load a video file
      await _videoTrimmer.loadVideo('/path/to/your/video.mp4');

      // 2. Get video information
      final videoInfo = await _videoTrimmer.getVideoInfo();
      print('Video Info: $videoInfo');

      // 3. Generate a thumbnail at 1 second mark
      final thumbnailPath = await _videoTrimmer.getVideoThumbnail(
        positionMs: 1000,
        quality: 100,
        width: 640,
        height: 480,
      );
      print('Thumbnail generated at: $thumbnailPath');

      // 4. Trim the video (first 5 seconds)
      final trimmedPath = await _videoTrimmer.trimVideo(
        startTimeMs: 0,
        endTimeMs: 5000,
      );
      print('Video trimmed to: $trimmedPath');
    } catch (e) {
      print('Error: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Check console for function usage example'),
        ),
      ),
    );
  }
}
5
likes
0
points
536
downloads

Publisher

verified publishertuankhoidev.com

Weekly Downloads

A lightweight Flutter plugin for video manipulation using pure native code (Media3 for Android and AVFoundation for iOS). Efficiently trim videos, generate thumbnails, and retrieve video information without FFmpeg dependency.

Repository (GitHub)
View/report issues

Topics

#video #trimmer #thumbnail #media

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_native_video_trimmer