Repository: flutter
Issue: [video_player] `_isDisposed` in play/pause is checked too late. 
Labels: c: crash,p: video_player,package,team-ecosystem,P2,triaged-ecosystem

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case

<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe the alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->
I have a list of videos which **plays** whenever visible on screen and **pauses** if not on screen.
If visible: `videoPlayerController.play()`
else : `videoPlayerController.pause()`

The video is  **disposed**  whenever the widget disposes.

```@override
void dispose() {
    videoPlayerController.dispose();
    super.dispose();
}
```

I noticed sometimes the `videoPlayerController.pause()` is called after video is disposed, and it throws the following error:

>E/flutter (21016): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: A VideoPlayerController was used after being disposed.
E/flutter (21016): Once you have called dispose() on a VideoPlayerController, it can no longer be used.
E/flutter (21016): #0      ChangeNotifier._debugAssertNotDisposed.<anonymous closure> (package:flutter/src/foundation/change_notifier.dart:117:9)
E/flutter (21016): #1      ChangeNotifier._debugAssertNotDisposed (package:flutter/src/foundation/change_notifier.dart:123:6)
E/flutter (21016): #2      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:234:12)
E/flutter (21016): #3      ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:309:5)
E/flutter (21016): #4      VideoPlayerController.pause (package:video_player/video_player.dart:393:5)
E/flutter (21016): #5      _VideoWidgetState.build.<anonymous closure>.<anonymous closure> (package:XYZ/activities/posts_page.dart:738:41)
E/flutter (21016): #6      VisibilityDetectorLayer._fireCallback (package:visibility_detector/src/visibility_detector_layer.dart:268:24)
E/flutter (21016): #7      VisibilityDetectorLayer._processCallbacks (package:visibility_detector/src/visibility_detector_layer.dart:227:15)
E/flutter (21016): #8      _TaskEntry.run.<anonymous closure> (package:flutter/src/scheduler/binding.dart:80:34)
E/flutter (21016): #9      Timeline.timeSync (dart:developer/timeline.dart:163:22)
E/flutter (21016): #10     _TaskEntry.run (package:flutter/src/scheduler/binding.dart:77:16)
E/flutter (21016): #11     SchedulerBinding.handleEventLoopCallback (package:flutter/src/scheduler/binding.dart:460:15)
E/flutter (21016): #12     SchedulerBinding._runTasks (package:flutter/src/scheduler/binding.dart:438:9)
E/flutter (21016): #13     _rootRun (dart:async/zone.dart:1346:47)
E/flutter (21016): #14     _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (21016): #15     _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (21016): #16     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1202:23)
E/flutter (21016): #17     _rootRun (dart:async/zone.dart:1354:13)
E/flutter (21016): #18     _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (21016): #19     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1186:23)
E/flutter (21016): #20     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter (21016): #21     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
E/flutter (21016): #22     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
E/flutter (21016): #23     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

## Proposal

<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching images showing what you are imagining.

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->
I noticed there's a `_isDisposed` value in the  **video_player** package (lib/video_player.dart). But it `_isDisposed` is not accessible. 
I added a getter to `_isDisposed` and now it works for me! (does not throws error)
```
bool get isDisposed => _isDisposed;
```
Why is `_isDisposed` not available? Can we add a getter and use it?