Upgrading video_player 1 to 2
Breaking1.0.1 → 2.14.1Platform13New5Changed6Fixed6Other9
Fetching 87 releases from GitHub…20 / 87
BreakingUpgrade verdict
13 platform requirement changes.
In plain terms
- You now need Flutter 3.41 or newer, which includes Dart 3.11 or newer, to use this package.
- You need Flutter 3.38 or newer and Dart 3.10 or newer to use this version.
- You now need Flutter 3.29 or newer, which includes Dart 3.7, to use this version.
- You need Flutter 3.27 or newer and Dart 3.6 or newer to use this version.
Must act Top 3 of 13 that need code or config changes
Dart SDK requirement changed in 2.12.0: >=2.8.0 <3.0.0 → ^3.12.0.
Flutter requirement changed in 2.12.0: >=1.12.13+hotfix.5 <2.0.0 → >=3.44.0.
Adds collection ^1.18.0, html ^0.15.0, video_player_android ^2.11.0, video_player_avfoundation ^2.11.0.
Drops meta.
Moves video_player_platform_interface ^2.2.0 → ^6.9.0, video_player_web >=0.1.4 <2.0.0 → ^2.1.0. Your build may pick other versions.
What you must change
Platform13
Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
Updates minimum iOS implementation version to include a privacy manifest.
Updates minimum supported SDK version to Flutter 3.16.6/Dart 3.2.3.
Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
Updates support matrix in README to indicate that iOS 11 is no longer supported.
Clients on Flutter versions that still support iOS 11 can keep using the package with iOS 11 but will not receive further iOS implementation updates.
Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
API changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
field VideoPlayerController.closedCaptionFile: final Future<ClosedCaptionFile> - removed:
get VideoPlayerController.textureId: int - removed:
get VideoPlayerValue.initialized: bool - changed:
ctor Caption({this.number, this.start, this.end, this.text}) → ctor Caption({required this.number, required this.start, required this.end, required this.text}) - changed:
ctor ClosedCaption({Key key, this.text, this.textStyle}) → ctor ClosedCaption({super.key, this.text, this.textStyle}) - changed:
ctor VideoPlayer(this.controller) → ctor VideoPlayer(this.controller, {super.key}) - changed:
ctor VideoPlayerController.asset(this.dataSource, {this.package, this.closedCaptionFile, this.videoPlayerOptions}) → ctor VideoPlayerController.asset( this.dataSource, { this.package, Future<ClosedCaptionFile>? closedCaptionFile, this.videoPlayerOptions, this.viewType = …, }) - changed:
ctor VideoPlayerController.file(File file, {this.closedCaptionFile, this.videoPlayerOptions}) → ctor VideoPlayerController.file( File file, { Future<ClosedCaptionFile>? closedCaptionFile, this.videoPlayerOptions, this.httpHeaders = …, String>{}, this.viewType = …, }) - changed:
ctor VideoPlayerController.network(this.dataSource, {this.formatHint, this.closedCaptionFile, this.videoPlayerOptions}) → ctor VideoPlayerController.network( this.dataSource, { this.formatHint, Future<ClosedCaptionFile>? closedCaptionFile, this.videoPlayerOptions, this.httpHeaders = …, String>{}, this.viewType = …, }) - changed:
ctor VideoPlayerValue({ @required this.duration, this.size, this.position = …, this.caption = …, this.buffered = …, this.isPlaying = …, this.isLooping = …, this.isBuffering = …, this.volume = …, this.playbackSpeed = …, this.errorDescription, }) → ctor VideoPlayerValue({ required this.duration, this.size = …, this.position = …, this.caption = …, this.captionOffset = …, this.buffered = …, this.isInitialized = …, this.isPlaying = …, this.isLooping = …, this.isBuffering = …, this.volume = …, this.playbackSpeed = …, this.rotationCorrection = …, this.errorDescription, this.isCompleted = …, this.preventsDisplaySleepDuringVideoPlayback = …, }) - changed:
ctor VideoProgressIndicator( this.controller, { VideoProgressColors colors, this.allowScrubbing, this.padding = …, }) → ctor VideoProgressIndicator( this.controller, { super.key, this.colors = …, required this.allowScrubbing, this.padding = …, }) - changed:
field ClosedCaption.text: final String → field ClosedCaption.text: final String? - changed:
field ClosedCaption.textStyle: final TextStyle → field ClosedCaption.textStyle: final TextStyle? - changed:
field VideoPlayerController.async: Future<Duration> get position → field VideoPlayerController.async: Future<Duration?> get position - changed:
field VideoPlayerController.dataSourceType: final DataSourceType → field VideoPlayerController.dataSourceType: final platform_interface.DataSourceType - changed:
field VideoPlayerController.formatHint: final VideoFormat → field VideoPlayerController.formatHint: final platform_interface.VideoFormat? - changed:
field VideoPlayerController.package: final String → field VideoPlayerController.package: final String? - changed:
field VideoPlayerController.videoPlayerOptions: final VideoPlayerOptions → field VideoPlayerController.videoPlayerOptions: final platform_interface.VideoPlayerOptions? - changed:
field VideoPlayerValue.buffered: final List<DurationRange> → field VideoPlayerValue.buffered: final List<platform_interface.DurationRange> - changed:
field VideoPlayerValue.errorDescription: final String → field VideoPlayerValue.errorDescription: final String? - changed:
method VideoPlayer.createState(): _VideoPlayerState → method VideoPlayer.createState(): State<VideoPlayer> - changed:
method VideoPlayerValue.copyWith({ Duration duration, Size size, Duration position, Caption caption, List<DurationRange> buffered, bool isPlaying, bool isLooping, bool isBuffering, double volume, double playbackSpeed, String errorDescription, }): VideoPlayerValue → method VideoPlayerValue.copyWith({ Duration? duration, Size? size, Duration? position, Caption? caption, Duration? captionOffset, List<platform_interface.DurationRange>? buffered, bool? isInitialized, bool? isPlaying, bool? isLooping, bool? isBuffering, double? volume, double? playbackSpeed, int? rotationCorrection, String? errorDescription = …, bool? isCompleted, bool? preventsDisplaySleepDuring… - changed:
method VideoProgressIndicator.createState(): _VideoProgressIndicatorState → method VideoProgressIndicator.createState(): State<VideoProgressIndicator> - added:
class VideoAudioTrack - added:
class VideoScrubber extends StatefulWidget - added:
class VideoTrack - added:
class WebVTTCaptionFile extends ClosedCaptionFile - added:
ctor VideoAudioTrack({ required this.id, required this.isSelected, this.label, this.language, this.bitrate, this.sampleRate, this.channelCount, this.codec, }) - added:
ctor VideoPlayerController.contentUri( Uri contentUri, { Future<ClosedCaptionFile>? closedCaptionFile, this.videoPlayerOptions, this.viewType = …, }) - added:
ctor VideoPlayerController.networkUrl( Uri url, { this.formatHint, Future<ClosedCaptionFile>? closedCaptionFile, this.videoPlayerOptions, this.httpHeaders = …, String>{}, this.viewType = …, }) - added:
ctor VideoScrubber({super.key, required this.child, required this.controller}) - added:
ctor VideoTrack({ required this.id, required this.isSelected, this.label, this.bitrate, this.width, this.height, this.frameRate, this.codec, }) - added:
ctor WebVTTCaptionFile(String fileContents) - added:
field VideoAudioTrack.bitrate: final int? - added:
field VideoAudioTrack.channelCount: final int? - added:
field VideoAudioTrack.codec: final String? - added:
field VideoAudioTrack.id: final String - added:
field VideoAudioTrack.isSelected: final bool - added:
field VideoAudioTrack.label: final String? - added:
field VideoAudioTrack.language: final String? - added:
field VideoAudioTrack.sampleRate: final int? - added:
field VideoPlayerController.httpHeaders: final Map<String, String> - added:
field VideoPlayerController.viewType: final platform_interface.VideoViewType - added:
field VideoPlayerValue.captionOffset: final Duration - added:
field VideoPlayerValue.isCompleted: final bool - added:
field VideoPlayerValue.isInitialized: final bool - added:
field VideoPlayerValue.preventsDisplaySleepDuringVideoPlayback: final bool - added:
field VideoPlayerValue.rotationCorrection: final int - added:
field VideoScrubber.child: final Widget - added:
field VideoScrubber.controller: final VideoPlayerController - added:
field VideoTrack.bitrate: final int? - added:
field VideoTrack.codec: final String? - added:
field VideoTrack.frameRate: final double? - added:
field VideoTrack.height: final int? - added:
field VideoTrack.id: final String - added:
field VideoTrack.isSelected: final bool - added:
field VideoTrack.label: final String? - added:
field VideoTrack.width: final int? - added:
get Caption.hashCode: int - added:
get VideoAudioTrack.hashCode: int - added:
get VideoPlayerController.closedCaptionFile: Future<ClosedCaptionFile>? - added:
get VideoPlayerController.playerId: int - added:
get VideoPlayerValue.hashCode: int - added:
get VideoTrack.hashCode: int - added:
get WebVTTCaptionFile.captions: List<Caption> - added:
method Caption.operator ==(Object other): bool - added:
method VideoAudioTrack.operator ==(Object other): bool - added:
method VideoAudioTrack.toString(): String - added:
method VideoPlayerController.getAudioTracks(): Future<List<VideoAudioTrack>> - added:
method VideoPlayerController.getVideoTracks(): Future<List<VideoTrack>> - added:
method VideoPlayerController.isAudioTrackSupportAvailable(): bool - added:
method VideoPlayerController.isVideoTrackSupportAvailable(): bool - added:
method VideoPlayerController.removeListener(VoidCallback listener): void - added:
method VideoPlayerController.selectAudioTrack(String trackId): Future<void> - added:
method VideoPlayerController.selectVideoTrack(VideoTrack? track): Future<void> - added:
method VideoPlayerController.setCaptionOffset(Duration offset): void - added:
method VideoPlayerController.setClosedCaptionFile(Future<ClosedCaptionFile>? closedCaptionFile): Future<void> - added:
method VideoPlayerController.setPreventsDisplaySleepDuringVideoPlayback( bool preventsDisplaySleepDuringVideoPlayback, ): Future<void> - added:
method VideoPlayerController.super( VideoPlayerValue( duration: Duration.zero, preventsDisplaySleepDuringVideoPlayback: videoPlayerOptions?.preventsDisplaySleepDuringVideoPlayback ?? true, ), ): , - added:
method VideoPlayerValue.operator ==(Object other): bool - added:
method VideoScrubber.createState(): State<VideoScrubber> - added:
method VideoTrack.operator ==(Object other): bool - added:
method VideoTrack.toString(): String - added:
static field Caption.none: const Caption - added:
static field VideoPlayerController.kUninitializedPlayerId: const int