audioplayers
audioplayers copied to clipboard
[android] Setting playermode within play method results in endless future
I tried the newest version 1.0.1 on android and my app is not playing any sounds anymore. I just upgraded from 0.20.2 to 1.0.1 without changing any code on my side.
The following example code seems to create an endless future and does not play any sound. When i remove the mode parameter everything just works fine again.
await player!.play(
DeviceFileSource(pathToSoundFile),
volume: volume ,
mode: PlayerMode.mediaPlayer,
);
The strange thing in this case is, that there is no error or any message displayed.
Device / Flutter info :
- Android Pixel 4a
- Android 12 version with the latest patch from June.
- Flutter 3.0.1
Same problem, but even without setting mode parameter.
print('1');
final player = AudioPlayer();
await player.play(AssetSource(AppAssets.errorSound));
print('2');
Console log after some minutes: I/flutter (16205): 1
Same problem here