Playing music stream in background on mobile

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
jcv
Posts: 1
Joined: Tue Apr 21, 2020 8:22 pm

Playing music stream in background on mobile

Post by jcv » Tue Apr 21, 2020 9:33 pm

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

samuel.vannesteBUSGvXT
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 43
Joined: Wed Sep 19, 2012 6:32 pm
Location: Versailles, France

Re: Playing music stream in background on mobile

Post by samuel.vannesteBUSGvXT » Tue Jun 02, 2020 8:59 am

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

Post Reply

Return to “Multimedia”