video_box 0.4.2

video_box #

A control that plays video in flutter, I make the control as flexible as possible, can play a single video, video list on the page.

note:

  • Only tested on android
  • No ios test
  • Development api may change at any time

Install #

dependencies:
  video_box:

android: AndroidManifest.xml

<manifest>
    ...
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    ...
</manifest>

ios: Info.plist

<plist>
    ...
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
</plist>

Usage #

import 'package:flutter/material.dart';
import 'package:video_box/video.controller.dart';
import 'package:video_box/video_box.dart';
import 'package:video_player/video_player.dart';

class ListVideo extends StatefulWidget {
  @override
  _ListVideoState createState() => _ListVideoState();
}

class _ListVideoState extends State<ListVideo> {
  List<VideoController> vcs = [];

  @override
  void initState() {
    super.initState();
    for (var i = 0; i < 4; i++) {
      vcs.add(VideoController(source: VideoPlayerController.network('xxx.mp4')));
    }
  }

  @override
  void dispose() {
    for (var vc in vcs) {
      vc.dispose();
    }
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('list video'),
      ),
      body: ListView(
        children: <Widget>[
          for (var vc in vcs)
            Padding(
              padding: const EdgeInsets.only(top: 12.0),
              child: AspectRatio(
                aspectRatio: 16 / 9,
                child: VideoBox(controller: vc),
              ),
            ),
        ],
      ),
    );
  }
}

For details, see /example or source code.

show:

0.4.2 - 2019-9-6 #

  • 增加缓冲进度条
  • 自定义全屏页面

0.4.1 - 2019-9-5 #

  • 更新video_player依赖版本

0.4.0 - 2019-9-1 #

  • api 更改
  • 代码优化
  • 处理细微bug

0.3.1 - 2019-8-22 #

  • 优化ui
  • 使用'AnimatedSwitcher'代替'AnimatedCrossFade'

0.3.0 - 2019-8-6 #

  • api变更
  • 优化ui
  • 优化视频播放完毕的处理事件

0.2.4 - 2019-7-9 #

  • 修复 ui的BUG

0.2.3 - 2019-7-7 #

  • 播放按钮bug显示
  • buffers为空错误

0.2.2 - 2019-7-5 #

  • 优化ui
  • 暂无发现BUG

0.2.1 - 2019-7-4 #

  • 优化ui

0.2.0 - 2019-7-4 #

  • 更改api
  • 更改ui

[0.1.2] - 2019-7-1

  • 更新依赖包

[0.1.1] - 2019-6-26

  • 优化全屏事件,用户好在外面调用
  • 文档尽量使用英语
  • 更新mobx依赖包的版本
  • 优化setSource函数
  • 增加videos的example

[0.1.0] - 2019-6-24

  • 更改了重要的api
  • 删除了src

[0.0.4] - 2019-6-24

  • 只要改变了src,不管是否为空,都会结束掉当前播放的video,并开启loading状态,但是在插件内部并不会去加载空的src地址

[0.0.3] - 2019-6-23

  • 增加option选项
  • 切换video的src

[0.0.2] - 2019-6-23

  • 增加option选项,和快进,快退功能

[0.0.1] - 2019-6-22

example/README.md

video_box_example #

A new Flutter project.

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:


dependencies:
  video_box: ^0.4.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:video_box/video_box.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
61
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]
80
Learn more about scoring.

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

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
flutter_mobx ^0.3.2 0.3.2
mobx ^0.3.7 0.3.7
provider ^3.1.0 3.1.0
screen ^0.0.5 0.0.5
video_player ^0.10.2+1 0.10.2+1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
build_runner any
flutter_test
mobx_codegen any