• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Android: Volume media/ringer mode reseting on minimise

Guest
Feb 20, 2013 Feb 20, 2013

Copy link to clipboard

Copied

This is an existing bug that was recently noticed by a user. On android devices normally the volume buttons change the ringer volume. When a sound is played in air, it switches to a separate media volume setting as expected, and appears to stay this way for a few seconds afterward before switching back to ringer. The problem is when a user presses the home key to minimise the app before the cooldown period elapses to do something else, the volume gets stuck on media and stays that way, unless the user goes back to the app and the time elapses.

This is an issue for me since my app plays background music all the time, so the cooldown time never elapses and thus this bug always occurs on minimise. My guess is it has something to do with background music being enabled. Is there a way to disable background music?

TOPICS
Air beta

Views

2.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 28, 2013 Aug 28, 2013

Copy link to clipboard

Copied

Did you ever find a way to fix this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 28, 2013 Aug 28, 2013

Copy link to clipboard

Copied

Hi AdaptedArts,

You can use Event.DEACTIVATE event to stop the background music. Event.DEACTIVATE is called when the application loses focus e.g. phone call, press home button.

for example, if you have music playing in a sound channel then you can use the below code to stop music:

NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, deactivateMusic);

function deactivateMusic(event:Event):void {

      // application is now losing focus

      musicChannel.stop();    // stops the music, "musicChannel is a SoundChannel"

}

Also, if you want to start the music again, then use Event.ACTIVATE event.

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, activateMusic);

function activateMusic(event:Event):void {

      musicChannel = mySong.play();   

}

Hope this will helps.

Regards,

Nimit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2013 Sep 02, 2013

Copy link to clipboard

Copied

I don't think you quite understood the issue, nimitja... It's not that the music doesn't stop, but rather that when using the device's volume control buttons (the physical ones) the device adjusts the media volume even when the app is minimized (and thus not playing music anymore) instead of adjusting the ringer volume.

For the record, I'm already doing what you suggested to stop all sounds upon minimizing

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 19, 2013 Sep 19, 2013

Copy link to clipboard

Copied

okay, that means when application is in background and sound is stopped, even then the volume control buttons are able to adjusts the sound volume. Please correct me if I am wrong.

I will recheck it again and let you know.

Regards,

Nimit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 19, 2013 Sep 19, 2013

Copy link to clipboard

Copied

Yeap... App is in background, no sound is playing, but when you press the phone's physical volume button the Media volume is adjusted, not the Ringer volume as would be expected.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 20, 2013 Sep 20, 2013

Copy link to clipboard

Copied

We are able to reproduce the problem. Could you please open a new bug report on this over at bugbase.adobe.com? Please include sample media, code if possible. Once the bug has been added would you mind posting back with the URL so that others affected can add their votes and comments?

Regards,
Nimit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 20, 2013 Sep 20, 2013

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 19, 2013 Sep 19, 2013

Copy link to clipboard

Copied

Help, anyone? Please?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines