diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 50c528dbefc1..db92877bde8e 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.10.4+1 + +* Fix pedantic lints. This fixes some potential race conditions in cases where + futures within some video_player methods weren't being awaited correctly. + ## 0.10.4 * Port plugin code to use the federated Platform Interface, instead of a MethodChannel directly. diff --git a/packages/video_player/video_player/analysis_options.yaml b/packages/video_player/video_player/analysis_options.yaml deleted file mode 100644 index 4c1fcb727314..000000000000 --- a/packages/video_player/video_player/analysis_options.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# This is a temporary file to allow us to land a new set of linter rules in a -# series of manageable patches instead of one gigantic PR. It disables some of -# the new lints that are already failing on this plugin, for this plugin. It -# should be deleted and the failing lints addressed as soon as possible. - -include: ../../../analysis_options.yaml - -analyzer: - errors: - unawaited_futures: ignore diff --git a/packages/video_player/video_player/example/test_driver/video_player_test.dart b/packages/video_player/video_player/example/test_driver/video_player_test.dart index a72c6944cfbe..47f3867d9019 100644 --- a/packages/video_player/video_player/example/test_driver/video_player_test.dart +++ b/packages/video_player/video_player/example/test_driver/video_player_test.dart @@ -9,7 +9,7 @@ import 'package:test/test.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); tearDownAll(() async { - driver.close(); + await driver.close(); }); //TODO(cyanglaz): Use TabBar tabs to navigate between pages after https://github.com/flutter/flutter/issues/16991 is fixed. diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 3a4768fb256c..cb24ac8cb100 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -323,7 +323,7 @@ class VideoPlayerController extends ValueNotifier { if (!value.initialized || _isDisposed) { return; } - VideoPlayerPlatform.instance.setLooping(_textureId, value.isLooping); + await VideoPlayerPlatform.instance.setLooping(_textureId, value.isLooping); } Future _applyPlayPause() async { @@ -331,7 +331,7 @@ class VideoPlayerController extends ValueNotifier { return; } if (value.isPlaying) { - VideoPlayerPlatform.instance.play(_textureId); + await VideoPlayerPlatform.instance.play(_textureId); _timer = Timer.periodic( const Duration(milliseconds: 500), (Timer timer) async { @@ -347,7 +347,7 @@ class VideoPlayerController extends ValueNotifier { ); } else { _timer?.cancel(); - VideoPlayerPlatform.instance.pause(_textureId); + await VideoPlayerPlatform.instance.pause(_textureId); } } @@ -355,7 +355,7 @@ class VideoPlayerController extends ValueNotifier { if (!value.initialized || _isDisposed) { return; } - VideoPlayerPlatform.instance.setVolume(_textureId, value.volume); + await VideoPlayerPlatform.instance.setVolume(_textureId, value.volume); } /// The position in the current video. @@ -380,7 +380,7 @@ class VideoPlayerController extends ValueNotifier { } else if (position < const Duration()) { position = const Duration(); } - VideoPlayerPlatform.instance.seekTo(_textureId, position); + await VideoPlayerPlatform.instance.seekTo(_textureId, position); value = value.copyWith(position: position); } diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index e191377e5c99..4dde774f9112 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player description: Flutter plugin for displaying inline video with other Flutter widgets on Android and iOS. author: Flutter Team -version: 0.10.4 +version: 0.10.4+1 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index f0aac1280d48..d2a90b7182c9 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -153,7 +153,7 @@ void main() { ); expect(controller.textureId, isNull); expect(await controller.position, const Duration(seconds: 0)); - controller.initialize(); + await controller.initialize(); await controller.dispose();