requestPause method

Future<void> requestPause()

Pauses the current video and disables wakelock.

Implementation

Future<void> requestPause() async {
  await _lock.synchronized(() async {
    final player = _currentVideoPlaying;

    await WakelockPlus.disable();
    await player?.pause(useGlobalController: false);

    _currentVideoPlaying = null;
    notifyListeners();
  });
}