Upgrading video_player 0.9 to 0.10
Breaking0.9.0 → 0.10.12+5Breaking2Platform4Deprecated1New7Changed3Fixed17Other20
BreakingUpgrade verdict
2 breaking changes and 4 platform requirement changes.
In plain terms
- Android apps that still use the old Android Support Library must switch to AndroidX to keep using this plugin.
- Android builds no longer fall back to older dependency versions automatically.
- You must use Flutter 1.12.13+hotfix.5 or newer to use this version.
- You need a newer Flutter SDK to use this version.
Must act Top 5 of 7 that need code or config changes
video_player publishes an official migration guide for version 0.10. It covers more than the release notes do.
Also migrate ↗Dart SDK requirement changed in 0.10.10: >=2.0.0-dev.28.0 <3.0.0 → >=2.1.0 <3.0.0.
Flutter requirement changed in 0.10.9: >=0.2.5 <2.0.0 → >=1.12.13+hotfix.5 <2.0.0.
Adds video_player_platform_interface ^2.2.0, video_player_web >=0.1.1 <2.0.0.
What you must change
Breaking2
Migrates from the deprecated Android Support Library to AndroidX, requiring Android apps using the plugin to also migrate.
Removes the Android dependencies fallback.
Platform4
Requires Flutter SDK 1.12.13+hotfix.5 or greater.
Requires Flutter SDK 1.12.13+hotfix.4 or greater.
Requires Flutter SDK 1.10.0 or greater.
Bumps the minimum Flutter version to 1.5.0.
Deprecations to plan for
Deprecated1
Keeps handling deprecated Android v1 classes for backward compatibility.
API changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
class DurationRange - removed:
ctor DurationRange(this.start, this.end) - removed:
enum DataSourceType - removed:
field DurationRange.end: final Duration - removed:
field DurationRange.start: final Duration - removed:
member DataSourceType.asset - removed:
member DataSourceType.file - removed:
member DataSourceType.network - removed:
method DurationRange.endFraction(Duration duration): double - removed:
method DurationRange.startFraction(Duration duration): double - removed:
method DurationRange.toString(): String - changed:
ctor VideoPlayerController.asset(this.dataSource, {this.package}) → ctor VideoPlayerController.asset(this.dataSource, {this.package, this.closedCaptionFile, this.videoPlayerOptions}) - changed:
ctor VideoPlayerController.file(File file) → ctor VideoPlayerController.file(File file, {this.closedCaptionFile, this.videoPlayerOptions}) - changed:
ctor VideoPlayerController.network(this.dataSource) → ctor VideoPlayerController.network(this.dataSource, {this.formatHint, this.closedCaptionFile, this.videoPlayerOptions}) - changed:
ctor VideoPlayerValue({ @required this.duration, this.size, this.position = …, this.buffered = …, this.isPlaying = …, this.isLooping = …, this.isBuffering = …, this.volume = …, this.errorDescription, }) → ctor VideoPlayerValue({ @required this.duration, this.size, this.position = …, this.caption = …, this.buffered = …, this.isPlaying = …, this.isLooping = …, this.isBuffering = …, this.volume = …, this.errorDescription, }) - changed:
method VideoPlayerController.seekTo(Duration moment): Future<void> → method VideoPlayerController.seekTo(Duration position): Future<void> - changed:
method VideoPlayerValue.copyWith({ Duration duration, Size size, Duration position, List<DurationRange> buffered, bool isPlaying, bool isLooping, bool isBuffering, double volume, String errorDescription, }): VideoPlayerValue → method VideoPlayerValue.copyWith({ Duration duration, Size size, Duration position, Caption caption, List<DurationRange> buffered, bool isPlaying, bool isLooping, bool isBuffering, double volume, String errorDescription, }): VideoPlayerValue - added:
class Caption - added:
class ClosedCaption extends StatelessWidget - added:
class ClosedCaptionFile: abstract - added:
class SubRipCaptionFile extends ClosedCaptionFile - added:
ctor Caption({this.number, this.start, this.end, this.text}) - added:
ctor ClosedCaption({Key key, this.text, this.textStyle}) - added:
ctor SubRipCaptionFile(this.fileContents) - added:
field Caption.end: final Duration - added:
field Caption.number: final int - added:
field Caption.start: final Duration - added:
field Caption.text: final String - added:
field ClosedCaption.text: final String - added:
field ClosedCaption.textStyle: final TextStyle - added:
field SubRipCaptionFile.fileContents: final String - added:
field VideoPlayerController.closedCaptionFile: final Future<ClosedCaptionFile> - added:
field VideoPlayerController.formatHint: final VideoFormat - added:
field VideoPlayerController.videoPlayerOptions: final VideoPlayerOptions - added:
field VideoPlayerValue.caption: final Caption - added:
get ClosedCaptionFile.captions: List<Caption> - added:
get SubRipCaptionFile.captions: List<Caption> - added:
method ClosedCaption.build(BuildContext context): Widget