Page 1 of 1

Playing music stream in background on mobile

Posted: Tue Apr 21, 2020 9:33 pm
by jcv
Hello from Belgium,

Directly, sorry for my pore english.

I'm a new LiveCode man ;-)
I have discovered it 1 year ago but I never make real apps.

I would like to use it specially to create Mobile Apps.

Currently, I'm trying to create a simple webradio player (for mobile) with a simple button play/stop.
I can use a mp3 or m3u web stream url .

I tryed many things...

Kast time, I tryed with mobileControlCreate and the mp3 url. It runs.
But when I go in another app the music stops.
If I stay a moment without touching the screen, it stays on and the music continues.
If I turn off the screen, the music stops.

Have you an idea on how must I do to make player for my webradio.
I would like that the music continues until I stop the app or npress stop button so even when I change app, when I turn off the screen or when I do nothing for a moment.

Thank you for any help.

JC

Re: Playing music stream in background on mobile

Posted: Tue Jun 02, 2020 8:59 am
by samuel.vannesteBUSGvXT
Hello,
Android activities have some life cycle. When an app has been put in the background, the system may suspend it or kill it if necessary.
LC has some background capabilities relying on some Android services (not fully implemented).

Have you tried already to play your stream using "androidStartAudioPlayingInBackground" you can find it in the Dictionnay under "Android Background Audio". Good luck