thumbnaillib 0.1.1

Flutter Android iOS

获取视频缩略图的控件.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:thumbnaillib/thumbnaillib.dart';

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

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

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }



  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ThumbnailImage(
            videoUrl: "https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4",
            showWidth: 100,
            showHeight: 200,
            imageType: ImageType.CENTER_INSIDE,
          ),
        ),
      ),
    );
  }
}