video_player_web 0.1.2+1

video_player_web #

The web implementation of video_player.

Usage #

This package is the endorsed implementation of video_player for the web platform since version 0.10.5, so it gets automatically added to your application by depending on video_player: ^0.10.5.

No further modifications to your pubspec.yaml should be required in a recent enough version of Flutter (>=1.12.13+hotfix.4):

  video_player: ^0.10.5

Once you have the correct video_player dependency in your pubspec, you should be able to use package:video_player as normal, even from your web code.

dart:io #

The Web platform does not suppport dart:io, so attempts to create a VideoPlayerController.file will throw an UnimplementedError.

Autoplay #

Playing videos without prior interaction with the site might be prohibited by the browser and lead to runtime errors. See also:

Supported Formats #

Different web browsers support different sets of video codecs.

Video codecs? #

Check MDN's Web video codec guide to learn more about the pros and cons of each video codec.

What codecs are supported? #

Visit 'video format' for a breakdown of which browsers support what codecs. You can customize charts there for the users of your particular website(s).

Here's an abridged version of the data from caniuse, for a Global audience:

MPEG-4/H.264 #

Data on Global support for the MPEG-4/H.264 video format

WebM #

Data on Global support for the WebM video format

Ogg/Theora #

Data on Global support for the Ogg/Theora video format

AV1 #

Data on Global support for the AV1 video format

HEVC/H.265 #

Data on Global support for the HEVC/H.265 video format

0.1.2+1 #

  • Make the pedantic dev_dependency explicit.

0.1.2 #

  • Add a PlatformException to the player's eventController when there's a videoElement.onError. Fixes
  • Handle DomExceptions on and turn them into PlatformException as well, so we don't end up with unhandled Futures.
  • Update setup instructions in the README.

0.1.1+1 #

0.1.1 #

  • Support videos from assets.

0.1.0+1 #

  • Remove the deprecated author: field from pubspec.yaml
  • Require Flutter SDK 1.10.0 or greater.

0.1.0 #

  • Initial release

Use this package as a library

1. Depend on it

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

  video_player_web: ^0.1.2+1

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_web/video_player_web.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Maintenance suggestions

The package description is too short. (-17 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and video_player_web.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
flutter_web_plugins 0.0.0
meta ^1.1.7 1.1.8
video_player_platform_interface ^1.0.0 1.0.5
Transitive dependencies
collection 1.14.11 1.14.12
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
pedantic ^1.8.0