flutter: audio: Fix Android mediaPlayer error (-38,0)

Reference: https://blog.csdn.net/u014520745/article/details/46672327/
This commit is contained in:
Calcitem 2021-02-16 12:22:03 +08:00
parent a6e2694d69
commit 1fb89e492c
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ class Audios {
]);
}
await _fixedTonePlayer.stop();
//await _fixedTonePlayer.stop();
await _fixedTonePlayer.pause();
await _fixedTonePlayer.seek(Duration.zero);
//await release();
await _tonePlayer.play(fileName);
} catch (e) {}