videos_player 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

videos_player #

The videos player for Flutter which uses chewie and video_player behind the scenes to play list of videos to be displayed and switched when needed without any complicating configurations.

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

Videos Player handles both configurations in a single package.

Demo #

DemoDemo
Style 1Style 2

Installation #

In your pubspec.yaml file within your Flutter Project:

dependencies:
  videos_player: <latest_version>

Use it #

import 'package:videos_player/model/video.model.dart';
import 'package:videos_player/videos_player.dart';
import 'package:videos_player/model/control.model.dart';

final widget = VideosPlayer(
                       networkVideos: [
                         new NetworkVideo(
                             id: "2",
                             name: "Elephant Dream",
                             videoUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",
                             thumbnailUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ElephantsDream.jpg",
                             videoControl: new NetworkVideoControl(
                               fullScreenByDefault: true,
                             )),
                         new NetworkVideo(
                             id: "3",
                             name: "Big Buck Bunny",
                             videoUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
                             thumbnailUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg",
                             videoControl: new NetworkVideoControl(autoPlay: true)),
                         new NetworkVideo(
                             id: "4",
                             name: "For Bigger Blazes",
                             videoUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4",
                             thumbnailUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerBlazes.jpg"),
                         new NetworkVideo(
                             id: "5",
                             name: "For Bigger Escape",
                             videoUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4",
                             thumbnailUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerEscapes.jpg"),
                         new NetworkVideo(
                             id: "6",
                             name: "For Bigger Fun",
                             videoUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4",
                             thumbnailUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerFun.jpg"),
                         new NetworkVideo(
                             id: "7",
                             name: "For Bigger Joyrides",
                             videoUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
                             thumbnailUrl:
                                 "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerJoyrides.jpg"),
                       ],
                       playlistStyle: Style.Style2,
                     );

Video Controls #

Video controls support is added according to each video.

Example #

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

iOS warning #

The video player plugin is not functional on iOS simulators. An iOS device must be used during development/testing. Please refer to this issue.

[0.1.3] #

  • Another Styling option added

[0.1.2] #

  • Download size decreased

[0.1.1] #

  • Simple bugfix

[0.1.0] #

  • Read me updated, example added, with/without videos control support

[0.0.3] #

  • Read me updated, example added, with/without thumbnail support

[0.0.2] #

  • Example added, style 1 polished, support for thumbnail image is not provided

[0.0.1] #

  • Initial several set of videos to be played with a single style.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:videos_player/model/video.model.dart';
import 'package:videos_player/util/theme.util.dart';
import 'package:videos_player/videos_player.dart';
import 'package:videos_player/model/control.model.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Videos Player'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: VideosPlayer(
        networkVideos: [
          new NetworkVideo(
              id: "2",
              name: "Elephant Dream",
              videoUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",
              thumbnailUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ElephantsDream.jpg",
              videoControl: new NetworkVideoControl(
                fullScreenByDefault: true,
              )),
          new NetworkVideo(
              id: "3",
              name: "Big Buck Bunny",
              videoUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
              thumbnailUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg",
              videoControl: new NetworkVideoControl(autoPlay: true)),
          new NetworkVideo(
              id: "4",
              name: "For Bigger Blazes",
              videoUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4",
              thumbnailUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerBlazes.jpg"),
          new NetworkVideo(
              id: "5",
              name: "For Bigger Escape",
              videoUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4",
              thumbnailUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerEscapes.jpg"),
          new NetworkVideo(
              id: "6",
              name: "For Bigger Fun",
              videoUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4",
              thumbnailUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerFun.jpg"),
          new NetworkVideo(
              id: "7",
              name: "For Bigger Joyrides",
              videoUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
              thumbnailUrl:
                  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerJoyrides.jpg"),
        ],
        playlistStyle: Style.Style2,
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  videos_player: ^0.1.3

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:videos_player/videos_player.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
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]
76
Learn more about scoring.

We analyzed this package on May 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
chewie ^0.9.8+1 0.9.10
flutter 0.0.0
video_player ^0.10.8+1 0.10.11+1
Transitive dependencies
collection 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
open_iconic_flutter 0.3.0
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
video_player_platform_interface 2.0.2
video_player_web 0.1.3+1
wakelock 0.1.4+1
Dev dependencies
flutter_test