audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

[android] Setting playermode within play method results in endless future

Open Ephenodrom opened this issue 3 years ago • 2 comments

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

Ephenodrom avatar Jun 20 '22 16:06 Ephenodrom

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

WillianSalceda avatar Jun 20 '22 20:06 WillianSalceda

Same problem here

WatchDogsDev avatar Jul 07 '22 06:07 WatchDogsDev