Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Background audio and earphones button listener (android)
Started by cognibird Mar 01 2019 10:07 PM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

cognibird

[GLOBAL: userInfoPane.html]
cognibird
  • Observer

  • 17 posts
  • Corona SDK

I want to continue playing audio when the phone is a sleep and also to control the audio with earphone buttons. Can I do this with Corona enterprise or Corona cards if I play the audio with native code? Is this possible at all?

[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,373 posts
  • Enterprise

Corona is not designed to run in the background. The Corona UI is expected to be in the foreground and if it's backgrounded, it's not been tested and we don't have any knowledge if it will work.

 

Rob



[TOPIC: post.html]
#3

cognibird

[GLOBAL: userInfoPane.html]
cognibird
  • Observer

  • 17 posts
  • Corona SDK

I thought that because with Corona Cards you have a native base you build on to, you can play the audio with native code and have that feature. As I understood from the scripts the Corona enterprise is the opposite, you add native code to Corona. I am new to all of this and just trying to figure stuff out.

Thank you Rob for the reply.

[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,373 posts
  • Enterprise

Sorry for restoring this. Normally we don't delete threads even when they are complete so others can learn from the answers.

 

 

Corona Native is taking an app that is Lua based and adding some native features to it, or using Xcode to do off-line builds.

CoronaCards assumes you have an existing native app and you want to add a Corona view to your existing app.

 

So you are correct about that, but if you have an existing native app, it likely has an existing native UI and you can background that, play your music and go on as long as your Corona View isn't showing. At that point, you're just a native app. 

 

But it sounds like you want to use Corona to build the UI to play your music, so if a song changes while the app is backgrounded, it might try to download some cover art, update the title, artist and duration inside the Corona View and that's just not something we've tested or guarantee to work. It's possible you could get it working today and we make an update to how the UI works and break your app in the future.

 

Rob



[TOPIC: post.html]
#5

cognibird

[GLOBAL: userInfoPane.html]
cognibird
  • Observer

  • 17 posts
  • Corona SDK

I deleted it by mistake, on the mobile forum, just wanted to send you if you can recover it. Sorry about that, I would never delete an answered topic.

Thank you for the detailed explanation, I have a more clear picture now of how things work. I needed this for one of my side projects, guess I need a different toolset.

All the best


[topic_controls]
[/topic_controls]