flutter: audio: Change pause and seed(0) to stop
This commit is contained in:
parent
691f464fda
commit
36b422634c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue