gplayer 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 81

GPlayer #

pub package

Video Player plugin for Flutter,On Android, the backing player is base on ijkplayer 0.8.8 (not implement on iOS)

The example app running in Android

features #

  1. base on ijkplayer(ffmpeg),support RTMP , HLS (http & https) , MP4,M4A etc.
  2. gestures for volume control
  3. gestures for brightness control
  4. gestures for forward or backward
  5. support fullscreen
  6. try to replay when error(only for live video)
  7. specify video scale type
  8. support lazy load (download player on demand)
  9. customize media controller (without change this project source code)

note: this using lazy load for default,it will take a few seconds to download decoders before first play, if you want to include the decoder in your apk just find the android/build.gradle and add the dependencies which you want to support.

Getting Started #

1.add dependency #

First, add gplayer as a dependency in your pubspec.yaml file.

    sdk: flutter

  # add gplayer dependency
  gplayer: ^0.0.2

2.create player #

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

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

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

class _MyAppState extends State<MyApp> {
  GPlayer player;
  void initState() {
    //1.create & init player
    player = GPlayer(uri: '')
      ..addListener((_) {
        //update control button out of player
        setState(() {});

  void dispose() {
    player?.dispose(); //2.release player

  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        appBar: AppBar(
          title: Text('GPlayer'),
        body: player.display,//3.put the player display in Widget tree
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              player.isPlaying ? player.pause() : player.start();
          child: Icon(
            player.isPlaying ? Icons.pause : Icons.play_arrow,

Customize media contoller #

1.define a class extend from buildMediaController

2.implement method Widget buildMediaController(BuildContext context)

3.pass the instance to player constructor GPlayer(uri:'',mediaController:MyMeidaController())

0.0.1 #

  • init release.

0.0.2 #

  • support float window
  • fixed some bugs


gplayer_example #

Demonstrates how to use the gplayer plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  gplayer: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:gplayer/gplayer.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/defaultmediacontrol.dart.

Run flutter format to format lib/defaultmediacontrol.dart.

Format lib/gplayer.dart.

Run flutter format to format lib/gplayer.dart.

Format lib/util.dart.

Run flutter format to format lib/util.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The package description is too short. (-7 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
uuid ^2.0.2 2.0.2
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.3
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8