From 69b77757e406c465c1d3b8f7baaec67b1dc041c2 Mon Sep 17 00:00:00 2001 From: nt4f04uNd Date: Wed, 3 Mar 2021 03:32:27 +0300 Subject: [PATCH 1/6] fixed docs --- .../lib/src/closed_caption_file.dart | 19 ++++++++++++------- .../video_player/lib/video_player.dart | 10 +++++----- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/video_player/video_player/lib/src/closed_caption_file.dart b/packages/video_player/video_player/lib/src/closed_caption_file.dart index eae9bf5dfabf..64ab1f6ca651 100644 --- a/packages/video_player/video_player/lib/src/closed_caption_file.dart +++ b/packages/video_player/video_player/lib/src/closed_caption_file.dart @@ -31,11 +31,12 @@ class Caption { /// /// This is not recommended for direct use unless you are writing a parser for /// a new closed captioning file type. - const Caption( - {required this.number, - required this.start, - required this.end, - required this.text}); + const Caption({ + required this.number, + required this.start, + required this.end, + required this.text, + }); /// The number that this caption was assigned. final int number; @@ -52,8 +53,12 @@ class Caption { /// A no caption object. This is a caption with [start] and [end] durations of zero, /// and an empty [text] string. - static const Caption none = - Caption(number: 0, start: Duration.zero, end: Duration.zero, text: ''); + static const Caption none = Caption( + number: 0, + start: Duration.zero, + end: Duration.zero, + text: '', + ); @override String toString() { diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 6a2af76fa547..4e7601fabde6 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -87,12 +87,10 @@ class VideoPlayerValue { /// A description of the error if present. /// - /// If [hasError] is false this is [null]. + /// If [hasError] is false this is `null`. final String? errorDescription; /// The [size] of the currently loaded video. - /// - /// Is null when [initialized] is false. final Size size; /// Indicates whether or not the video has been loaded and is ready to play. @@ -102,8 +100,10 @@ class VideoPlayerValue { /// [errorDescription] should have information about the problem. bool get hasError => errorDescription != null; - /// Returns [size.width] / [size.height] when size is non-null, or `1.0.` when - /// size is null or the aspect ratio would be less than or equal to 0.0. + /// Returns [size.width] / [size.height]. + /// + /// Will return `1.0.` if [isInitialized] is `false`, or aspect ratio would be + /// less than or equal to `0.0`. double get aspectRatio { if (!isInitialized || size.width == 0 || size.height == 0) { return 1.0; From 3491b3d4bc0728de42dad26e97377b8b8c2b7060 Mon Sep 17 00:00:00 2001 From: nt4f04uNd Date: Wed, 3 Mar 2021 16:43:37 +0300 Subject: [PATCH 2/6] changed aspectRatio doc --- packages/video_player/video_player/lib/video_player.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 4e7601fabde6..45add840c3e3 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -102,8 +102,10 @@ class VideoPlayerValue { /// Returns [size.width] / [size.height]. /// - /// Will return `1.0.` if [isInitialized] is `false`, or aspect ratio would be - /// less than or equal to `0.0`. + /// Will return `1.0` if: + /// * [isInitialized] is `false` + /// * either `size.width`, or `size.height` is equal to `0.0` + /// * aspect ratio would be less than or equal to `0.0` double get aspectRatio { if (!isInitialized || size.width == 0 || size.height == 0) { return 1.0; From 8d54dad5906a3230813367e49876ed1508184ca4 Mon Sep 17 00:00:00 2001 From: nt4f04uNd Date: Wed, 3 Mar 2021 16:44:31 +0300 Subject: [PATCH 3/6] removed either --- packages/video_player/video_player/lib/video_player.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 45add840c3e3..045e1a804fef 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -104,7 +104,7 @@ class VideoPlayerValue { /// /// Will return `1.0` if: /// * [isInitialized] is `false` - /// * either `size.width`, or `size.height` is equal to `0.0` + /// * `size.width`, or `size.height` is equal to `0.0` /// * aspect ratio would be less than or equal to `0.0` double get aspectRatio { if (!isInitialized || size.width == 0 || size.height == 0) { From de5e3e125701a6e98fd0ef0d176599a48e1fce32 Mon Sep 17 00:00:00 2001 From: nt4f04uNd Date: Wed, 3 Mar 2021 16:45:24 +0300 Subject: [PATCH 4/6] changed brances --- packages/video_player/video_player/lib/video_player.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 045e1a804fef..96dd73d3adea 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -104,7 +104,7 @@ class VideoPlayerValue { /// /// Will return `1.0` if: /// * [isInitialized] is `false` - /// * `size.width`, or `size.height` is equal to `0.0` + /// * [size.width], or [size.height] is equal to `0.0` /// * aspect ratio would be less than or equal to `0.0` double get aspectRatio { if (!isInitialized || size.width == 0 || size.height == 0) { From 785134448fe8f2ec981fcb007731efdef2350762 Mon Sep 17 00:00:00 2001 From: nt4f04uNd Date: Thu, 4 Mar 2021 00:50:24 +0300 Subject: [PATCH 5/6] bump up version --- packages/video_player/video_player/CHANGELOG.md | 4 ++++ packages/video_player/video_player/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 57ba54e0a7bc..bdc22f588c47 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.1 + +* Fix `VideoPlayerValue` size and aspect ratio documentation + ## 2.0.0 * Migrate to null safety. diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index fedc46c721b1..3c6a34c7f78c 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -1,7 +1,7 @@ name: video_player description: Flutter plugin for displaying inline video with other Flutter widgets on Android, iOS, and web. -version: 2.0.0 +version: 2.0.1 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: From 651d6960f03c2aebb471698396a2ac3b0616156c Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 10 Mar 2021 10:15:21 -0800 Subject: [PATCH 6/6] Update pubspec.yaml --- packages/video_player/video_player/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 3c6a34c7f78c..17442d7ec09a 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -1,7 +1,7 @@ name: video_player description: Flutter plugin for displaying inline video with other Flutter widgets on Android, iOS, and web. -version: 2.0.1 +version: 2.0.2 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: