Streaming audio problems

Are there really no current plugins for media streaming?? there are some suggestions in the docs and some cordova plugins. but most are obsolete and not working now…

If anyone has made a audio streaming app lately please tell me what you used! :slight_smile:

Not streaming specifically, but for just audio playing (mp3 files from a external URL), I ended up creating my own internal Capacitor plugin after trying many different options and searching far and wide for an existing solution that is maintained.

I first tried the standard HTML5 audio tag with the plyr package. However, I needed to play audio with background music and iOS doesn’t allow you to control the volume of the background music with HTML5. There were also some issues playing in the background.

I tried several existing Capacitor/Cordova plugins but all them either didn’t fit my needs or had issues. One issue was not handling interruptions as needed.

sounds a bit like a difficult solve…
I am maintaining a radio streaming app so i also need background, and the funny thing is that my app was working fine earlier and suddenly would not output any sound even while connecting to the stream.
I have tried going back to the commit from my last app store update as well but it has the same problem…
This leads me to suspect that some new changes have been made from apple that somehow block the sound.

What is the app currently using?

Hi Twestic, please, may i know how to did it ? Playing audio from external links. I tried it on web and it works, but on device, it doesn’t work

you don’t need a plugin to play media. Html has support for it.

Thanks Hills90210, but it doesn’t work in android apps built with ionic, using remote urls as source. I mean, urls like http://example.com/audio.mp3

Are you actually using http or are you using https? In today’s world, you should be using https for everything :smile:

If you are in fact using http and cannot use https, then you will need to make an exception in your Android security config to allow the host name as by default clear text traffic (http) is not permitted.

See Unable to carryout HTTP post on Android - #2 by twestrick on how to make an exception.

Also, Network security configuration  |  Android Developers.

1 Like

I tried using a resource with https://, and it works :laughing::laughing::grin:

Thank youuu :pray::grin::sparkles::sparkles:

1 Like

I think you are right.
I had the same problem but know by using this, it worked.

For current media streaming plugins, you might want to explore popular frameworks like React Native with libraries like React Native Track Player for audio streaming. Always check the community for the latest recommendations and updates to ensure compatibility with your project.

Hi,
I am making radio application using Radio.co API to stream the audio and I have two problems:

  1. play/pause through bluetooth headset controls is not working. I am using media-session plugin, however something is missing.

  2. on some devices the audio is glitchy when the phone is locked, however when the screen is active the audio is ok. On some phones the audio is glitchy if my radio application is in the background and the user is using WhatsApp or other application while the radio is playing. On some devices this issue does not exist.

I am using Ionic 7 and Capacitor 5.3.0. In AndroidManifest.xml I have the following permissions:
android.permission.INTERNET
android.permission.RECORD_AUDIO
android:name="android.permission.BLUETOOTH
android:name="android.permission.BLUETOOTH_ADMIN
android.permission.BLUETOOTH_CONNECT
android.permission.FOREGROUND_SERVICE

Does anyone have an idea/suggestion on how to solve these issues?