Skip to content

Commit

Permalink
chore: faster playback start
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Oct 20, 2023
1 parent 97c0140 commit 0378eb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/controller/audio_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,16 @@ class NamidaAudioVideoHandler<Q extends Playable> extends BasicAudioHandler<Q> {
}

final playerStoppingSeikoo = Completer<bool>(); // to prevent accidental stopping if getAvailableStreams was faster than fade effect
pause().then((_) async {
if (isPlaying) {
// wait for pausing only if playing.
pause().then((_) async {
await onDispose();
playerStoppingSeikoo.complete(true);
});
} else {
await onDispose();
playerStoppingSeikoo.complete(true);
});
}

await VideoController.vcontroller.dispose();

Expand Down

0 comments on commit 0378eb9

Please sign in to comment.