Viewing version 6.9.0. Open the latest package page.

video_player_platform_interface

6.9.0

A common platform interface for the video_player plugin.

Download archive

Readme

video_player_platform_interface

A common platform interface for the video_player plugin.

This interface allows platform-specific implementations of the video_player plugin, as well as the plugin itself, to ensure they are supporting the same interface.

Usage

To implement a new platform-specific implementation of video_player, extend VideoPlayerPlatform with an implementation that performs the platform-specific behavior, and when you register your plugin, set the default VideoPlayerPlatform by calling VideoPlayerPlatform.instance = MyPlatformVideoPlayer().

Note on breaking changes

Strongly prefer non-breaking changes (such as adding a method to the interface) over breaking changes for this package.

See https://flutter.dev/go/platform-interface-breaking-changes for a discussion on why a less-clean interface is preferable to a breaking change.

Changelog

6.9.0

  • Adds backBufferDurationMs to VideoPlayerOptions to support configuring the back buffer duration.

6.8.0

  • Adds preventsDisplaySleepDuringVideoPlayback to VideoPlayerOptions and setPreventsDisplaySleepDuringVideoPlayback to VideoPlayerPlatform. The default implementation is a no-op so platforms that do not support controlling display sleep silently fall back to their default behavior.
  • Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.

6.7.0

  • Adds VideoTrack class and getVideoTracks(), selectVideoTrack(), isVideoTrackSupportAvailable() methods for video track (quality) selection.
  • Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.

6.6.0

  • Adds VideoAudioTrack class and getAudioTracks(), selectAudioTrack(), isAudioTrackSupportAvailable() methods for audio track management.

6.5.0

  • Adds a setAllowBackgroundPlayback method to dynamically control background playback.
  • Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.

6.4.0

  • Adds HTML5 video poster support as a VideoPlayerWebOptions.
  • Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.

6.3.0

  • Adds support for platform views as an optional way of displaying a video.
  • Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.

6.2.3

  • Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
  • Clarified that VideoEventType.initialized cannot be sent more than once.

6.2.2

  • Updates minimum required plugin_platform_interface version to 2.1.7.
  • Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

6.2.1

  • Adds pub topics to package metadata.
  • Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.

6.2.0

  • Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.
  • Adds web options to customize control's list and displaying context menu.

6.1.0

  • Aligns Dart and Flutter SDK constraints.
  • Adds the VideoEventType.isPlayingStateUpdate event to track changes in play / pause state with the underlying video player.

6.0.2

  • Updates links for the merge of flutter/plugins into flutter/packages.
  • Updates minimum Flutter version to 3.0.

6.0.1

  • Fixes comment describing file URI construction.

6.0.0

  • BREAKING CHANGE: Removes MethodChannelVideoPlayer. The default implementation is now only a placeholder with no functionality; implementations of video_player must include their own VideoPlayerPlatform Dart implementation.
  • Updates minimum Flutter version to 2.10.
  • Fixes violations of new analysis option use_named_constants.

5.1.4

  • Fixes avoid_redundant_argument_values lint warnings and minor typos.
  • Ignores unnecessary import warnings in preparation for upcoming Flutter changes.

5.1.3

  • Updates references to the obsolete master branch.
  • Removes unnecessary imports.

5.1.2

  • Adopts Object.hash.
  • Removes obsolete dependency on pedantic.

5.1.1

  • Adds rotationCorrection (for Android playing videos recorded in landscapeRight #60327).

5.1.0

  • Adds allowBackgroundPlayback to VideoPlayerOptions.

5.0.2

  • Adds the Pigeon definitions used to create the method channel implementation.
  • Internal code cleanup for stricter analysis options.

5.0.1

  • Update to use the verify method introduced in platform_plugin_interface 2.1.0.

5.0.0

  • BREAKING CHANGES:
    • Updates to extending PlatformInterface. Removes isMock, in favor of the now-standard MockPlatformInterfaceMixin.
    • Removes test.dart from the public interface. Tests in other packages should mock VideoPlatformInterface rather than the method channel.

4.2.0

  • Add contentUri to DataSourceType.

4.1.0

  • Add httpHeaders to DataSource

4.0.0

  • Breaking Changes:
    • Migrate to null-safety
    • Update to latest Pigeon. This includes a breaking change to how the test logic is exposed.
  • Add note about the mixWithOthers option being ignored on the web.
  • Make DataSource's uri parameter nullable.
  • messages.dart sets Dart 2.12.

3.0.0

  • Version 3 only was published as nullsafety "previews".

2.2.1

  • Update Flutter SDK constraint.

2.2.0

  • Added option to set the video playback speed on the video controller.

2.1.1

  • Fix mixWithOthers test channel.

2.1.0

  • Add VideoPlayerOptions with audio mix mode

2.0.2

  • Migrated tests to use pigeon correctly.

2.0.1

  • Updated minimum Dart version.
  • Added class to help testing Pigeon communication.

2.0.0

1.0.5

  • Make the pedantic dev_dependency explicit.

1.0.4

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

1.0.3

  • Document public API.

1.0.2

  • Fix unawaited futures in the tests.

1.0.1

  • Return correct platform event type when buffering

1.0.0

  • Initial release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'video_player_platform_interface:6.9.0'
pubspec.yaml
name: video_player_platform_interface
description: A common platform interface for the video_player plugin.
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_platform_interface
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 6.9.0

environment:
  sdk: ^3.10.0
  flutter: ">=3.38.0"

dependencies:
  flutter:
    sdk: flutter
  plugin_platform_interface: ^2.1.7

dev_dependencies:
  flutter_test:
    sdk: flutter

topics:
  - video
  - video-player

Version history

VersionPublishedArchiveSHA-256
1.0.0On demandDownload120ac27f…fb5cd9
1.0.1On demandDownload8f0cba1a…616680
1.0.2On demandDownloadabc65f95…c211db
1.0.3On demandDownload8fd0b8ca…40ea55
1.0.4On demandDownloadc644c311…6e7557
1.0.5On demandDownload8116acf5…276632
2.0.0On demandDownloadf158642d…b08fe3
2.0.1On demandDownload1d1b5b04…256e67
2.0.2On demandDownload8c2b7ff1…ba935e
2.1.0On demandDownload04adf880…c4d11a
2.1.1On demandDownloade79f75c7…ac8643
2.2.0On demandDownloadbb480245…09fa9c
3.0.0-nullsafety.1On demandDownload87cc4b5b…457d16
3.0.0-nullsafety.2On demandDownload4b966e80…fafa44
3.0.0-nullsafety.3On demandDownload4b114482…307e0b
4.0.0-nullsafety.0On demandDownload1341d8a7…38a927
4.0.0On demandDownloadd1b0964b…3a361d
4.1.0On demandDownloadec4d9df5…0292d6
4.2.0On demandDownloada1d56477…9ba0f7
5.0.0On demandDownload2432273a…04f974
5.0.1On demandDownload83161ce6…ca210d
5.0.2On demandDownload1b85b791…74e336
5.1.0On demandDownloadac0b3515…483cb6
5.1.1On demandDownload70ed1683…838635
5.1.2On demandDownload5c30b0a7…66f4be
5.1.3On demandDownload2f7280c1…b99e63
5.1.4On demandDownload318a6d20…dd4343
6.0.0On demandDownload18591bb3…1e85ff
6.0.1On demandDownload42bb75de…432dae
6.0.2On demandDownload72ba04ad…ec049b
6.1.0On demandDownloada8c4dcae…bec684
6.2.0On demandDownload1ca9acd7…802988
6.2.1On demandDownloadbe72301b…48f73a
6.2.2On demandDownload23645472…550bc6
6.2.3On demandDownload229d7642…af9bbb
6.3.0On demandDownloaddf534476…16a844
6.4.0On demandDownloadcf2a1d29…c1db5a
6.5.0On demandDownload9e372520…53793b
6.6.0On demandDownload57c5d731…9f24ec
6.7.0On demandDownload16eaed52…46c6e0
6.8.0On demandDownloade4ae5bc9…dd1613
6.9.0Cached · Upstream SHA-256 matchedDownload92c0fbab…f593ce

Dependencies

flutter { "sdk": "flutter" }

plugin_platform_interface "^2.1.7"