flutter: audio: Change pause and seed(0) to stop

This commit is contained in:
Calcitem 2021-02-27 12:54:27 +08:00
parent 691f464fda
commit 36b422634c
1 changed files with 2 additions and 5 deletions

View File

@ -41,11 +41,8 @@ class Audios {
_player = AudioPlayer();
}
await _player.pause();
await _player.seek(Duration.zero);
var duration = await _player.setAsset("assets/audios/" + fileName);
await _player.stop();
await _player.setAsset("assets/audios/" + fileName);
_player.play();
} on PlayerException catch (e) {
// iOS/macOS: maps to NSError.code