Page 1 of 1

(Closed) $50 Developer Bounty

PostPosted: Sat Feb 15, 2014 11:53 pm
by daneren2005
Alright, I'm at my wits end with this and it is fairly important to have this working for the release of Chromecast support. I need to be able to detect and block the standard volume key presses while outside of the app and when using a remote media player (either ChromeCast or Jukebox). I have found a couple of hacky ways to detect when the volume is changed outside of the app, but I can't figure out how to stop the default volume action from happening. It's pointless to be able to change the volume if you are also doing something unintended such as changing the ringer volume. Things I have tried so far:

Listening in the registerMediaButtonEventReceiver event. Volume keys don't seem to go through here at all.
ContentOberserver
Defining a custom broadcast receiver that listens for android.media.VOLUME_CHANGED_ACTION. Broadcast is not ordered though so it can't be cancelled.

I need this to work and I can't figure it out. I know it is possible because Play Music does it while casting just fine. I don't even need you to plug in all of the actual logic behind it, I just need a concrete way to both get which volume key was pressed, and to block the default system volume change while not in the activity. I am offering a $50 bounty for a fix to this issue, paid via Paypal.

Re: $40 Developer Bounty

PostPosted: Sun Feb 16, 2014 12:18 am
by daneren2005
Also willing to give partial bounties to anyone who gives just gives me information that leads to a working solution

Sent from my Nexus 5 using Tapatalk

Re: $40 Developer Bounty

PostPosted: Wed Feb 26, 2014 6:31 pm
by Fenny
Looks like the latest pandora works. (Volume changes on the device, but it is the media volume) I'll reverse their implementation if I have a moment later today.

Re: $50 Developer Bounty

PostPosted: Wed Feb 26, 2014 6:40 pm
by daneren2005
I sure hope you are able to. I just upped the bounty to $50...don't know why I had it at a weird number like 40 to being with.

Re: $50 Developer Bounty

PostPosted: Sat Mar 01, 2014 5:54 pm
by oggie
Is this related to the fact that whenever I start a chromecast, the volume is always at 100%? Even if the last time I connected I dropped it down only to have it at 100% again the next time?

Re: $50 Developer Bounty

PostPosted: Sat Mar 01, 2014 6:07 pm
by daneren2005
No that is another issue. I can probably craft a work around for that but there is a ticket open for Google to fix that.

Sent from my Nexus 5 using Tapatalk

Re: $50 Developer Bounty

PostPosted: Sun Mar 09, 2014 3:15 am
by Fenny
I have a workaround in mind. It involves playing a silent audio file locally on the device, and whenever media volume changes we push the new volume to the chromecast.

This solution would be pretty hackish, but it would certainly do the trick. I think we could create a silent PCM or wave stream easily enough, and with whatever length we require to match the length of the media playing on the chromecast for that matter.

Re: $50 Developer Bounty

PostPosted: Fri Apr 25, 2014 2:35 am
by daneren2005
Turns out this was stupidly trivial to do. I found the answer while deep diving the source code for the CastCompanionLibrary example Google has up. All you have to do is register the RemoteControlClient to the MediaRouter in use.