requestPlay method
Plays a video controller, pausing any previous one first.
Implementation
Future<void> requestPlay(OmniPlaybackController controller) async {
await _lock.synchronized(() async {
if (_currentVideoPlaying != controller) {
try {
await _currentVideoPlaying?.pause(useGlobalController: false);
_currentVideoPlaying = controller;
} catch (_) {}
}
if (_currentVolume > 0) {
controller.unMute();
} else if (_currentVolume == 0) {
controller.mute();
}
await controller.play(useGlobalController: false);
await WakelockPlus.enable();
_currentVideoPlaying = controller;
notifyListeners();
});
}