custom_chewie 0.7.0

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

custom_chewie

fork

A custom chewie fork that has a unique design and some extra features.

The video player for Flutter with a heart of gold.

The video_player plugin provides low-level access to video playback. Chewie uses the video_player under the hood and wraps it in a friendly Material or Cupertino UI!

features

  • Fullscreen on orientation change to landscape
  • Exit fullscreen on portrait orientation
  • Picture in Picture for Android SDK > 24
  • Custom design
  • Back button

Demo

Installation

In your pubspec.yaml file within your Flutter Project:

dependencies:
  custom_chewie: <latest_version>

Use it

import 'package:custom_chewie/custom_chewie.dart';

final playerWidget = new Chewie(
  new VideoPlayerController.network(
    'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4'
  ),
  aspectRatio: 3 / 2,
  autoPlay: true,
  looping: true,
);

Example

Please run the app in the example/ folder to start playing!

Changelog

0.7.0

  • Requires Dart 2
  • Updated dependencies that were not Dart 2 compatible

0.6.1

  • Fix time formatting
  • Fix skipping
  • Remove listener when disposed
  • Start video at certain position

0.6.0

  • Update to work with video_player: ">=0.6.0 <0.7.0

0.5.1

  • Update README to fix installation instructions

0.5.0

  • Update to work with video_player: ">=0.5.0 <0.6.0

0.3.0

  • Update to work with video_player: ">=0.2.0 <0.3.0
  • Add showControls option. You can use this to show / hide the controls
  • Move from VideoProgressColors to ChewieProgressColors for customization of the Chewie progress controls
  • Remove progressColors in favor of platform-specific customizations: cupertinoProgressColors and materialProgressColors to control
  • Add analysis options

0.2.0

  • Take a controller instead of a String uri. Allows for better control of playback outside the player if need be.

0.1.1

  • Fix images in docs for pub

0.1.0

Initial version of Chewie, the video player with a heart of gold.

  • Hand a VideoPlayerController to Chewie, and let it do the rest.
  • Includes Material Player Controls
  • Includes Cupertino Player Controls
  • Spike version: Focus on good looking UI. Internal code is sloppy, needs a refactor and tests

example/lib/main.dart

import 'package:custom_chewie/custom_chewie.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(
    new ChewieDemo(),
  );
}

class ChewieDemo extends StatefulWidget {
  final String title;

  ChewieDemo({this.title = 'Chewie Demo'});

  @override
  State<StatefulWidget> createState() {
    return new _ChewieDemoState();
  }
}

class _ChewieDemoState extends State<ChewieDemo> {
  TargetPlatform _platform;
  VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = new VideoPlayerController.network(
      'https://github.com/flutter/assets-for-api-docs/blob/master/assets/videos/butterfly.mp4?raw=true',
    );
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: widget.title,
      theme: new ThemeData.light().copyWith(
        platform: _platform ?? Theme.of(context).platform,
      ),
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text(widget.title),
        ),
        body: new Column(
          children: <Widget>[
            new Expanded(
              child: new Center(
                child: new Chewie(
                  _controller,
                  aspectRatio: 3 / 2,
                  autoPlay: true,
                  looping: true,

                  // Try playing around with some of these other options:

                  // showControls: false,
                  // materialProgressColors: new ChewieProgressColors(
                  //   playedColor: Colors.red,
                  //   handleColor: Colors.blue,
                  //   backgroundColor: Colors.grey,
                  //   bufferedColor: Colors.lightGreen,
                  // ),
                  // placeholder: new Container(
                  //   color: Colors.grey,
                  // ),
                  // autoInitialize: true,
                ),
              ),
            ),
            new Row(
              children: <Widget>[
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _controller = new VideoPlayerController.network(
                          'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
                        );
                      });
                    },
                    child: new Padding(
                      child: new Text("Video 1"),
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                    ),
                  ),
                ),
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _controller = new VideoPlayerController.network(
                          'http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_20mb.mp4',
                        );
                      });
                    },
                    child: new Padding(
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                      child: new Text("Video 2"),
                    ),
                  ),
                )
              ],
            ),
            new Row(
              children: <Widget>[
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _platform = TargetPlatform.android;
                      });
                    },
                    child: new Padding(
                      child: new Text("Android controls"),
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                    ),
                  ),
                ),
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _platform = TargetPlatform.iOS;
                      });
                    },
                    child: new Padding(
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                      child: new Text("iOS controls"),
                    ),
                  ),
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  custom_chewie: ^0.7.0

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:custom_chewie/custom_chewie.dart';
  
Version Uploaded Documentation Archive
0.7.0 Sep 7, 2018 Go to the documentation of custom_chewie 0.7.0 Download custom_chewie 0.7.0 archive
0.6.4 Aug 26, 2018 Go to the documentation of custom_chewie 0.6.4 Download custom_chewie 0.6.4 archive
0.6.1 Aug 25, 2018 Go to the documentation of custom_chewie 0.6.1 Download custom_chewie 0.6.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
76
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]
88
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/material_controls.dart. (-0.50 points)

Analysis of lib/src/material_controls.dart reported 1 hint:

line 131 col 11: The value of the local variable 'iconColor' isn't used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
flutter_android_pip ^0.0.2 0.0.2
open_iconic_flutter >=0.3.0 <0.4.0 0.3.0
video_player >=0.6.0 <0.7.0 0.6.5 0.7.2
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test