Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Contributor
Posts: 17
Registered: ‎07-12-2012
My Device: BB10 Alpha Device
My Carrier: none

mmr volume change on email notification

Hi,

 

I'm using mmr to playback an mp3 file in my game, I had the game running and the screen locked before going to bed to check if I fixed a battery issue.  When the game loses focus, it simply sets music volume to 0.  Unfortunately, at 3am, I got an e-mail and noticed this issue.  The problem is, receiving an e-mail played the sound effect and vibrated the phone, but it also triggered the volume of my music to be something other than zero.  Touching the volume buttons(up or down) immediately silenced the music again and everything was back to normal.

 

Any idea why this would happen? Just in case it's relevant, I'm running 10.0.9.348.

 

Thanks,

Jimmy

Retired
Posts: 29
Registered: ‎03-19-2012
My Device: Z10
My Carrier: BELL

Re: mmr volume change on email notification

Thanks for posting!

 

I tested out a very similar sample and was not able to preproduce this issue on 10.0.10 and I was not able to reproduce this. Please let us know if you still have this issue.

 

Cheers, Ram

 

 

Contributor
Posts: 17
Registered: ‎07-12-2012
My Device: BB10 Alpha Device
My Carrier: none

Re: mmr volume change on email notification

Thanks for trying to repro the case, I still haven't been able to upgrade to the latest OS, so that might be the difference.  A simpler repro case i found is: in code, set the music volume to 0 then take a screenshot, that kicks the music back in(at the current system volume).

 

I fixed my previous issue by stopping the music when focus is lost and restarting it afterwards.  I didn't go the extra mile and continue the music where it left off, I'll do that in the future.  I'll also change it in the future to stop/start when I set the volume to zero/non-zero to avoid both the "screenshot" and "incoming email" issue(likely any system sound effect) while the app is running.

 

Jimmy

Retired
Posts: 29
Registered: ‎03-19-2012
My Device: Z10
My Carrier: BELL

Re: mmr volume change on email notification

I just tried the screenshot too but I cant seem to reproduce the game music kicking in. I suppose it is fixed then Smiley Happy

 

And yes! yes! the best practice we recommend would be to listen to the app lifecycle events and to put your music on a pause accordingly.

 

Cheers, Ram