video_player_flutter 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • new59

Flutter Video Player Package #

#

A Flutter based Video Player Package inspired from Mx-Player. flutter_video_player based on Dart build using existing Video_Player and Wrapping with High-Level PlayBack access such as Zooming, Aspect Control,Preferred-Rotation and much more. Note: Tested only on Android ### Developer are Welcomed for Fork/Pull Request.Newer Features are Welcomed !!

Demo #

Demo

Features #

  • Video Zooming / Scaling
  • Video Controller Hide/show with One-tap control
  • Custom option for potrait and Fullscreen Control
  • Custom option for Mute/volume control
  • Custom option for Restricting the Orientation

Installation #

First,Add the following as dependancy in pubspec.yaml

dependencies:
  video_player_flutter: <latest_version>
  video_player: <latest_version>

Android #

Ensure that the following Permissions are enabled in your Android Manifest File <project root>/android/app/src/main/AndroidManifest.xml

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

If You Want to Enable Zooming above the Notch Cut-out in SmartPhones. Navigate to <project root>/android/app/src/main/res and Create the new-Folder with the name values v-28 And create a new styles.xml and paste the following snippet.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
    </style>
</resources>

IOS Warning #

The Package is not tested on Ios Devices.

Example #


import 'package:flutter_video_player/video_player_flutter.dart';
import 'package:video_player/video_player.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(VideoApp());
}
class VideoApp extends StatefulWidget {
  @override
  _VideoAppState createState() => _VideoAppState();
}
class _VideoAppState extends State<VideoApp> {
  VideoPlayerController _controller;
  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network("https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4");//Specify the url/filePath/asset Path .
                                                                                                                             //No Need to initalize or Dispose VideoController.

}

@override
  void dispose() {
    super.dispose();
    
  }
@override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: fluttervideoplayer(controller:_controller,enableLooping:true,enableScaling:true,flutterVolume:0.5,allowonlylandscape:false,),
);
 }
}

[0.0.1] -Initail release #

[0.1.0] - resolved Zooming after Notch in Smartphone #

[0.1.1] - added Proper Documentation #

[0.1.2] - Removed All the Dead Codes #

[0.1.3] - Re-Formatted entire code #

[0.1.4] - Resolved Draging slider Issue #

  • TODO: Adding New Features such as Brightness and Volume control on Screen using Gesture-Detector.Expanding Packages to IOS Devices.

example/lib/main.dart

import 'package:video_player_flutter/video_player_flutter.dart';
import 'package:video_player/video_player.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(VideoApp());
}


class VideoApp extends StatefulWidget {
  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network("https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4");

  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Fluttervideoplayer(controller:_controller,enableLooping:true,enableScaling:true,flutterVolume:0.5,allowonlylandscape:false,),

    );
  }


}

Use this package as a library

1. Depend on it

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


dependencies:
  video_player_flutter: ^0.1.4

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

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:video_player_flutter/video_player_flutter.dart, package:video_player/video_player.dart] that declares support for platforms: android, ios, web

Package does not support Flutter platform macos

Because of import path [package:video_player_flutter/video_player_flutter.dart, package:video_player/video_player.dart] that declares support for platforms: android, ios, web

Package does not support Flutter platform web

Because of import path [package:video_player_flutter/video_player_flutter.dart, package:video_player_flutter/src/Containercontrols.dart, package:screen/screen.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:video_player_flutter/video_player_flutter.dart, package:video_player/video_player.dart] that declares support for platforms: android, ios, web

Package not compatible with SDK dart

because of import path [video_player_flutter] that is in a package requiring null.

Health suggestions

Fix lib/video_player_flutter.dart. (-0.50 points)

Analysis of lib/video_player_flutter.dart reported 1 hint:

line 157 col 41: Avoid using unnecessary statements.

Format lib/src/utils.dart.

Run flutter format to format lib/src/utils.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
orientation ^1.2.0 1.2.0
provider ^4.1.3 4.2.0
screen ^0.0.5 0.0.5
video_player ^0.10.11+1 0.10.11+2
Transitive dependencies
collection 1.14.12 1.14.13
flutter_web_plugins 0.0.0
meta 1.1.8 1.2.1
nested 0.0.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
video_player_platform_interface 2.0.2
video_player_web 0.1.3+2
Dev dependencies
flutter_test