video_box 0.10.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

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: <project root>/android/app/src/main/AndroidManifest.xml:

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

ios: <project root>/ios/Runner/Info.plist:

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

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(src1))
        ..initialize());
    }
  }

  @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.10.0 - 2020-1-25 #

  • 增加API:
    • options 可以设置自定义参数
    • bottomViewBuilder 用于自定义VideoBox底部视图

0.9.1 - 2020-1-14 #

  • 删除平台差异 #14
  • 删除部分作用不大方法和减少对外部暴露无用的方法。
  • 变更: setLoop=>setLoopingloop=>looping
  • 检查example的每个示例

0.9.0 - 2020-1-9 #

  • 增加Api: customLoadingWidget customBufferedWidget customFullScreen controllerLayerDuration
  • 变更API: onFullScreen=>onFullScreenSwitch controllerDuration=> controllerLiveDuration
  • 添加画中画example

0.8.2 - 2019-12-25 #

  • screen依赖在打包时出现错误,删除此库,相关功能不可用
  • 增加addFullScreenChangeListener用于监听全屏变化事件

0.8.1 - 2019-12-22 #

  • 修复一个小错误

0.8.0 - 2019-12-22 #

  • 更新依赖包
  • Example迁移至AndroidX
  • 修复部分错误
  • 修改,增加部分API

0.7.2 - 2019-11-19 #

  • 重新提交一个版本,没有任何更新

0.7.1 - 2019-11-18 #

  • 优化大量问题

0.7.0 - 2019-11-8 #

  • api更变,构建方式发生了改变
  • 修复: 视频的原始尺寸
  • 修复: paly()pause()AnimatedIcon显示错误

0.6.0 - 2019-10-7 #

  • 增加: [改变屏幕亮度]和[媒体音量功能]

0.5.2 - 2019-10-2 #

  • 修复[children] [beforeChildren] [afterChildren] 的BUG

0.5.1 - 2019-9-23 #

  • 优化buffer loading的显示

0.5.0 - 2019-9-22 #

  • 默认ui改变

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

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.10.0

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]
82
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

Fix lib/widgets/buffer_slider.dart. (-25 points)

Analysis of lib/widgets/buffer_slider.dart failed with 1 error:

line 101 col 27: The getter 'bodyText1' isn't defined for the class 'TextTheme'.

Format lib/video.controller.dart.

Run flutter format to format lib/video.controller.dart.

Format lib/widgets/video_bottom_ctroller.dart.

Run flutter format to format lib/widgets/video_bottom_ctroller.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
flutter_mobx ^0.3.6 0.3.6+2
mobx ^0.4.0 0.4.0+4
video_player ^0.10.5 0.10.5+2
Transitive dependencies
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
video_player_platform_interface 1.0.4
video_player_web 0.1.1+1
Dev dependencies
build_runner any
flutter_test
mobx_codegen any