flutter_video_compress 0.1.8

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new78

flutter_video_compress #

A flutter plugin, compress video in a new path, delete or not. get media thumbnail by unit8list, you can select quality.

pub version license github stars

Methods #

FunctionParameterDescriptionReturn
getThumbnailString path, int qualityReturn a thumbnail of the video from the input file uriUint8List bitmap
compressVideoString path, bool deleteOriginCompress the video file and return a new pathString path

Usage #

Creating instance.

FlutterVideoCompress _flutterVideoCompress = FlutterVideoCompress();

Get a video file thumbnail

final Uint8List _image = await _flutterVideoCompress
  .getThumbnail(path: file.path, quality: 50)

Compress a Video

final String newPath = await _flutterVideoCompress
  .compressVideo(path: file.path, deleteOrigin: true);
  
print(newPath);

0.1.8 #

  • fix: ios import AVFoundation module

0.1.7 #

  • docs: Better Readme

0.1.6 #

  • docs: Better documentation

0.1.5 #

  • CHANGELOG.md
  • fix: supported x86 arm64-v8a armeabi armeabi-v7a

0.1.4 #

  • fix:gradle config 'compile' replaced with 'implementation'

0.1.3 #

  • fix: fix ios 4.2 version bugs

0.1.2 #

  • fix: fix ios build swift_version

0.1.1 #

  • chore: update AndroidX

0.1.0 #

  • feature: get vedio thumbnail
  • feature: compress vedio

example/README.md

flutter_video_compress_example #

import 'dart:io';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:image_picker/image_picker.dart';
import 'package:flutter_video_compress/flutter_video_compress.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  FlutterVideoCompress _flutterVideoCompress = FlutterVideoCompress();
  Uint8List _image;  

  Future<void> _videoPicker() async {
    File file = await ImagePicker.pickVideo(source: ImageSource.camera);
    if (file != null && mounted) {
      _image = await _flutterVideoCompress
          .getThumbnail(path: file.path, quality: 50)
          .whenComplete(() {
        setState(() {});
      });
      final String newPath = await _flutterVideoCompress.compressVideo(
          path: file.path, deleteOrigin: true);
      print(newPath);
    }
  }

  @override
  Widget build(BuildContext context) {
    final _list = <Widget>[
      FlatButton(child: Text('take video'), onPressed: _videoPicker),
    ];
    if (_image != null) {
      _list.add(Flexible(child: Center(child: Image.memory(_image))));
    }
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        body: Column(children: _list),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_video_compress: ^0.1.8

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_video_compress/flutter_video_compress.dart';
  
Version Uploaded Documentation Archive
0.1.8 Apr 12, 2019 Go to the documentation of flutter_video_compress 0.1.8 Download flutter_video_compress 0.1.8 archive
0.1.7 Apr 11, 2019 Go to the documentation of flutter_video_compress 0.1.7 Download flutter_video_compress 0.1.7 archive
0.1.6 Apr 11, 2019 Go to the documentation of flutter_video_compress 0.1.6 Download flutter_video_compress 0.1.6 archive
0.1.5 Apr 11, 2019 Go to the documentation of flutter_video_compress 0.1.5 Download flutter_video_compress 0.1.5 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

We analyzed this package on Apr 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test