Skip to main content
esecharli
Participant
September 27, 2016
Question

Proximity Sensor stops playing audio

  • September 27, 2016
  • 2 replies
  • 466 views

Hi,

I develop an app that plays audio while doing some other things with sensors, because the background mode to play audio its restrict to only play audio i tell the user to put the device in his pocket in order to mantain sensors access when the screens go off, but if i activate proximity sensor using an extension (using proximityMonitoringEnabled), the audio stops playing when the screen turns off.

I develop a similar app years ago an the behavoir its not like that, when the screen turns off the audio stills plays.

Am i missing something in the code?

Thanks in advance

This topic has been closed for replies.

2 replies

esecharli
esecharliAuthor
Participant
September 28, 2016

I create a sample project with an extension to activate proximity sensor and a sound beeping, if you press the power off button beep stills plays, but if you put your hand in front the proximity sensor, the screen goes off, the sounds stops, i think that the swf movie stop playing or something

https://www.dropbox.com/s/rs5oeda52s3lsyj/_appTest.zip?dl=0

I made an app in Oct 2013, and when proximity sensor turns off the screen the audio stills plays and have full to all the phone so something changed, but i dont know what

deesharm
Adobe Employee
Adobe Employee
September 27, 2016

Hi Carlos,

Have you tried giving below tags under <InfoAdditions> tag in app.xml file:

<key>UIBackgroundModes</key>

  <array>

                <string>audio</string>

  </array>

Let us know if it helps you.

Thanks,

Adobe AIR Team

esecharli
esecharliAuthor
Participant
September 27, 2016

Yes, i try putting this one, and the audio plays if i press the home button or power button, but stops if the screen goes off due to proximity sensor behaviour