Viewing version 2.12.1. Open the latest package page.

video_player_avfoundation

2.12.1

iOS and macOS implementation of the video_player plugin.

Download archive

Readme

video_player_avfoundation

The iOS and macOS implementation of video_player.

Usage

This package is endorsed, which means you can simply use video_player normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

Changelog

2.12.1

  • Fixes a crash when a video track reports a zero minFrameDuration.
  • Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.

2.12.0

  • Routes video over AirPlay when an external screen is active, by setting usesExternalPlaybackWhileExternalScreenIsActive on the AVPlayer. Selecting an AirPlay route previously moved only the audio, leaving the video on the device while the receiver showed a mirrored screen.

2.11.1

  • Updates pigeon dev_dependency to ^27.3.2 for analyzer 14 compatibility.

2.11.0

  • Implements setPreventsDisplaySleepDuringVideoPlayback using AVPlayer.preventsDisplaySleepDuringVideoPlayback.

2.10.0

  • Implements getVideoTracks() and selectVideoTrack() methods for video track (quality) selection using AVFoundation.
  • Video track selection requires iOS 15+ / macOS 12+ for HLS streams.

2.9.7

  • Forces tone-mapping to SDR on iOS to prevent washed-out HDR video playback.

2.9.6

  • Adds a Swift version to fix a potential build issue when using CocoaPods.

2.9.5

  • Converts portions of the native code to Swift for improved maintainability.

2.9.4

  • Ensures that the display link does not continue requesting frames after a player is disposed.

2.9.3

  • Fixes a regression where HTTP headers were ignored.

2.9.2

  • Refactors for improved testability.

2.9.1

  • Refactors native code for improved testability.

2.9.0

  • Implements getAudioTracks() and selectAudioTrack() methods.
  • Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.

2.8.10

  • Improves compatibility with UIScene.
  • Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.

2.8.9

  • Resolve tracksWithMediaType: deprecations.
  • Use loadTracksWithMediaType:completionHandler: for iOS 15.0+/macOS 12.0+.

2.8.8

  • Refactors Dart internals for maintainability.

2.8.7

  • Updates to Pigeon 26.

2.8.6

  • Fixes a bug where the video player fails to initialize when AVFoundation reports a duration of zero.
  • Fixes a bug in the example app that some widgets stop updating after GlobalKey reparenting.
  • Updates the VideoProgressIndicator widget in the example app to handle zero-duration videos.

2.8.5

  • Updates minimum supported version to iOS 13 and macOS 10.15.
  • Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.

2.8.4

  • Simplifies native code.

2.8.3

  • Removes calls to self from init and dealloc, for maintainability.

2.8.2

  • Restructure internals of Dart notification of video player events.

2.8.1

  • Restructures internal logic to move more code to Dart.

2.8.0

  • Adds platform view support for macOS.

2.7.3

  • Restructures the communication between Dart and native code.

2.7.2

  • Uses CADisplayLink on macOS 14.0+.
  • Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
  • Refactors native code for improved testing.

2.7.1

  • Adds possibility to play videos at more than 30 FPS.
  • Fixes playing state not updating in some paths.

2.7.0

  • Adds support for platform views as an optional way of displaying a video.

2.6.7

  • Fixes playback speed resetting.

2.6.6

  • Fixes changing global audio session category to be collision free across plugins.
  • Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.

2.6.5

  • Bugfix to allow the audio-only HLS (.m3u8) on iOS.

2.6.4

  • Refactors native code structure.

2.6.3

  • Fixes VideoPlayerController.initialize() future never resolving with invalid video file.
  • Adds more details to the error message returned by VideoPlayerController.initialize().

2.6.2

  • Updates Pigeon for non-nullable collection type support.
  • Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.

2.6.1

  • Adds files to make include directory permanent.

2.6.0

  • Adds Swift Package Manager compatibility.

2.5.7

  • Adds frame availability checks on iOS.
  • Simplifies internal platform channel interfaces.
  • Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6.

2.5.6

  • Adds privacy manifest.

2.5.5

  • Fixes display of initial frame when paused.

2.5.4

  • Fixes new lint warnings.

2.5.3

  • Publishes an instance of the plugin to the registrar on macOS, as on iOS.

2.5.2

  • Fixes flickering and seek-while-paused on macOS.

2.5.1

  • Updates to Pigeon 13.

2.5.0

  • Adds support for macOS.

2.4.11

  • Updates Pigeon.
  • Changes Objective-C class prefixes to avoid future collisions.

2.4.10

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

2.4.9

2.4.8

  • Fixes missing isPlaybackLikelyToKeepUp check for iOS video player bufferingEnd event and bufferingStart event.

2.4.7

  • Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.
  • Adds iOS exception on incorrect asset path

2.4.6

  • Fixes hang when seeking to end of video.

2.4.5

  • Updates functions without a prototype to avoid deprecation warning.

2.4.4

  • Updates pigeon to fix warnings with clang 15.

2.4.3

  • Synchronizes VideoPlayerValue.isPlaying with AVPlayer.

2.4.2

  • Makes seekTo async and only complete when AVPlayer.seekTo completes.

2.4.1

  • Clarifies explanation of endorsement in README.
  • Aligns Dart and Flutter SDK constraints.

2.4.0

  • Updates minimum Flutter version to 3.3 and iOS 11.

2.3.9

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

2.3.8

  • Adds compatibilty with version 6.0 of the platform interface.
  • Fixes file URI construction in example.
  • Updates code for new analysis options.
  • Adds an integration test for a bug where the aspect ratios of some HLS videos are incorrectly inverted.
  • Removes an unnecessary override in example code.

2.3.7

  • Fixes a bug where the aspect ratio of some HLS videos are incorrectly inverted.
  • Updates code for no_leading_underscores_for_local_identifiers lint.

2.3.6

  • Fixes a bug in iOS 16 where videos from protected live streams are not shown.
  • Updates minimum Flutter version to 2.10.
  • Fixes violations of new analysis option use_named_constants.
  • Fixes avoid_redundant_argument_values lint warnings and minor typos.
  • Ignores unnecessary import warnings in preparation for upcoming Flutter changes.

2.3.5

  • Updates references to the obsolete master branch.

2.3.4

  • Removes unnecessary imports.
  • Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors lint warnings.

2.3.3

2.3.2

  • Applies the standardized transform for videos with different orientations.

2.3.1

  • Renames internal method channels to avoid potential confusion with the default implementation's method channel.
  • Updates Pigeon to 2.0.1.

2.3.0

  • Updates Pigeon to ^1.0.16.

2.2.18

  • Wait to initialize m3u8 videos until size is set, fixing aspect ratio.
  • Adjusts test timeouts for network-dependent native tests to avoid flake.

2.2.17

  • Splits from video_player as a federated implementation.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'video_player_avfoundation:2.12.1'
pubspec.yaml
name: video_player_avfoundation
description: iOS and macOS implementation of the video_player plugin.
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
version: 2.12.1

environment:
  sdk: ^3.11.0
  flutter: ">=3.41.0"

flutter:
  plugin:
    implements: video_player
    platforms:
      ios:
        dartPluginClass: AVFoundationVideoPlayer
        pluginClass: VideoPlayerPlugin
        sharedDarwinSource: true
      macos:
        dartPluginClass: AVFoundationVideoPlayer
        pluginClass: VideoPlayerPlugin
        sharedDarwinSource: true

dependencies:
  flutter:
    sdk: flutter
  meta: ^1.10.0
  video_player_platform_interface: ^6.8.0

dev_dependencies:
  build_runner: ^2.3.3
  flutter_test:
    sdk: flutter
  mockito: ^5.4.4
  pigeon: ^27.3.2

topics:
  - video
  - video-player

Version history

VersionPublishedArchiveSHA-256
2.2.17On demandDownload1162925e…95ce0b
2.2.18On demandDownload57ed9871…91808f
2.3.0On demandDownloade49d3999…025c41
2.3.1On demandDownloadd02369f0…68dee0
2.3.2On demandDownload76e71296…e4730e
2.3.3On demandDownload53712929…352175
2.3.4On demandDownload48bfaa42…504434
2.3.5On demandDownload667fe547…43ece1
2.3.6On demandDownload01bdeab6…7c291e
2.3.7On demandDownload3df55949…9e8cfa
2.3.8On demandDownloadd9f7a46d…6b97e9
2.3.9On demandDownload5df5411f…ef9446
2.4.0On demandDownloadc29bdae3…9d4d2f
2.4.1On demandDownload9d8585be…3ca01d
2.4.2On demandDownload90468226…49f700
2.4.3On demandDownloadaf308d08…299b7c
2.4.4On demandDownload75c6d68c…bc1927
2.4.5On demandDownload824dad3e…8615bb
2.4.6On demandDownload4c274e43…a19216
2.4.7On demandDownloada3bfaf08…223411
2.4.8On demandDownload49533034…3a34a9
2.4.9On demandDownloadf5f5b7fe…9cfc6c
2.4.10On demandDownloadc3b123a5…18f77d
2.4.11On demandDownloadbf1a1322…5845f0
2.5.0On demandDownload6387c2de…35e38f
2.5.1On demandDownloadfe73d636…f3ecac
2.5.2On demandDownloadbc923884…9124c2
2.5.3On demandDownload01a57940…8436ae
2.5.4On demandDownload08da9307…85c2aa
2.5.5On demandDownload752b783a…b39cdb
2.5.6On demandDownload309e3962…b040ed
2.5.7On demandDownload00c49b1d…a5070d
2.6.0On demandDownloadf42ee643…bbb16f
2.6.1On demandDownloadd1e9a824…f68a7c
2.6.2On demandDownloadcd5ab8a8…f3792f
2.6.3On demandDownload0b146e5d…405dfa
2.6.4On demandDownloadf498e44a…6322f3
2.6.5On demandDownload33224c19…19a2b7
2.6.6On demandDownload61c54fb0…7772de
2.6.7On demandDownload8a4e73a3…3458d3
2.7.0On demandDownload84b47527…bd75bc
2.7.1On demandDownload9ee764e5…c3f22f
2.7.2On demandDownload0d47db6c…21c49c
2.7.3On demandDownloadd22d83c5…70098e
2.8.0On demandDownload9fedd550…12f953
2.8.1On demandDownloadd716c279…848675
2.8.2On demandDownload509ef9cf…19e48e
2.8.3On demandDownloadf52261d1…205e41
2.8.4On demandDownloadf9a780aa…be71cd
2.8.5On demandDownload19ed1162…25432d
2.8.6On demandDownload03fc6d07…603f69
2.8.7On demandDownload6bced173…a6a77d
2.8.8On demandDownloade4d33b79…0fe78d
2.8.9On demandDownloadd1eb9704…971dd4
2.8.10On demandDownload2a7aaf2f…9fb937
2.9.0On demandDownload7cc0a925…1de269
2.9.1On demandDownloadf46e9e20…defb5b
2.9.2On demandDownload0d753e1d…7947a3
2.9.3On demandDownloadf93b93a3…e201a5
2.9.4On demandDownloadaf0e5b8a…1f259e
2.9.5On demandDownloade5371e9c…851a6a
2.9.6On demandDownloada39d6f28…369bf3
2.9.7On demandDownload9338f3ec…56ac58
2.10.0On demandDownload76097729…0466fd
2.11.0On demandDownloadc238f5f0…f7fff9
2.11.1On demandDownload436fd029…533bf0
2.12.0On demandDownload2fc56e53…461fd8
2.12.1Cached · Upstream SHA-256 matchedDownload4f8a8451…9dfd8b
2.12.2On demandDownload7dde83dd…7bbf88
2.12.3Cached · Upstream SHA-256 matchedDownload7d620d8c…024bc1

Dependencies

flutter { "sdk": "flutter" }

meta "^1.10.0"

video_player_platform_interface "^6.8.0"