From 1fb89e492c9e3cb9f86689595db177eeea305ab8 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Tue, 16 Feb 2021 12:22:03 +0800 Subject: [PATCH] flutter: audio: Fix Android mediaPlayer error (-38,0) Reference: https://blog.csdn.net/u014520745/article/details/46672327/ --- src/ui/flutter/lib/services/audios.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/flutter/lib/services/audios.dart b/src/ui/flutter/lib/services/audios.dart index a2ed009c..b9073793 100644 --- a/src/ui/flutter/lib/services/audios.dart +++ b/src/ui/flutter/lib/services/audios.dart @@ -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) {}