This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 4 files changed +18
-2
lines changed
packages/video_player/video_player
4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
- ## NEXT
1
+ ## 2.4.5
2
2
3
3
* Ignores unnecessary import warnings in preparation for [ upcoming Flutter changes] ( https://github.com/flutter/flutter/pull/104231 ) .
4
+ * Fixes an exception when a disposed VideoPlayerController is disposed again.
4
5
5
6
## 2.4.4
6
7
Original file line number Diff line number Diff line change @@ -426,6 +426,10 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
426
426
427
427
@override
428
428
Future <void > dispose () async {
429
+ if (_isDisposed) {
430
+ return ;
431
+ }
432
+
429
433
if (_creatingCompleter != null ) {
430
434
await _creatingCompleter! .future;
431
435
if (! _isDisposed) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
3
3
widgets on Android, iOS, and web.
4
4
repository : https://github.com/flutter/plugins/tree/main/packages/video_player/video_player
5
5
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
6
- version : 2.4.4
6
+ version : 2.4.5
7
7
8
8
environment :
9
9
sdk : " >=2.14.0 <3.0.0"
Original file line number Diff line number Diff line change @@ -373,6 +373,17 @@ void main() {
373
373
expect (await controller.position, isNull);
374
374
});
375
375
376
+ test ('calling dispose() on disposed controller does not throw' , () async {
377
+ final VideoPlayerController controller = VideoPlayerController .network (
378
+ 'https://127.0.0.1' ,
379
+ );
380
+
381
+ await controller.initialize ();
382
+ await controller.dispose ();
383
+
384
+ expect (() async => await controller.dispose (), returnsNormally);
385
+ });
386
+
376
387
test ('play' , () async {
377
388
final VideoPlayerController controller = VideoPlayerController .network (
378
389
'https://127.0.0.1' ,
You can’t perform that action at this time.
0 commit comments