bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
1.98k stars 843 forks source link

Very subtle ios versus android bug? #236

Closed LarsDu closed 5 years ago

LarsDu commented 5 years ago

I was testing out my hobby app, and I found that if the isLocal flag is not explictly set to truefor audioPlayer.play() for a local file, the file will play just fine on Android, but won't do anything on ios.

The line in question can be demonstrated in my flutter app on ios Simulator iphone 8: https://github.com/LarsDu/simple_flutter_audio_recorder/blob/master/lib/audio_play_bar.dart

I was testing this on my Android One Plus 6T.

Perhaps this discrepancy could be mentioned in the documentation?

luanpotter commented 5 years ago

Yes, that is the case, as expected, because android doesn't require this flag at all. It is capable of figuring it out by itself so the flag is ignored. Only iOS is incapable of that, and thus requires the flag. Of course in order to work on both platforms the flag must be provided, there is no way around it. If you'd like to help out with a PR adding this detail to the docs, please do :)