Does audioplayers 5.2.1 for Flutter support Bluetooth remote control:Play, Pause, etc?

40 Views Asked by At

I have read the Getting Started documentation and the Features Parity Table and I cannot find any references to Bluetooth remote control of the player. Is that because it does not support it or did I just miss it in your documentation?

I am not asking to play the audio over Bluetooth - just control it. The Expo Audio Player for React Native can play audio over Bluetooth but cannot control it. I have tested their audio player on the web and it sends audio to my bluetooth headphones fine.

Thanks.

1

There are 1 best solutions below

0
tomerpacific On

If you go over the Getting Started section, you will notice that they state there how to load an audio asset:

Sources

Each AudioPlayer is created empty and has to be configured with an audio source (and it can only have one; changing it will replace the previous source).

The source (cf. packages/audioplayers/lib/src/source.dart) is basically what audio you are playing (a song, sound effect, radio stream, etc), and it can have one of 4 types:

UrlSource:

get the audio from a remote URL from the Internet. This can be a direct link to a supported file to be downloaded, or a radio stream.

DeviceFileSource:

access a file in the user's device, probably selected by a file picker.

AssetSource:

play an asset bundled with your app, by default within the assets directory. To customize the prefix, see AudioCache.

BytesSource (only some platforms):

pass in the bytes of your audio directly (read it from anywhere).

So it does not support playing the audio file from Bluetooth.