lihaosky / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Unable to MUTE Audio in ChromeCast #555

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Cast any audio from sender application to default receiver app.
2. Try to send MUTE signal from sender to receiver using "setStreamVolume()" 
api like below:
remoteMediaPlayer.setStreamVolume(googleApiClient, 0).setResultCallback(
                    new ResultCallback<RemoteMediaPlayer.MediaChannelResult>() {
                        @Override
                        public void onResult( MediaChannelResult result) {
                            Status status = result.getStatus();
                            Log.d(TAG, "MUTE status:"+status);
                        }
                    });
3. Observe that getting 2100 (STATUS_FAILED) status code in result callback and 
not able mute the audio in receiver application.

What is the expected output? What do you see instead?
Need to MUTE the audio in receiver app using "setStreamVolume()" api, instead 
its returning 2100 failure status code while executing this signal on 
RemoteMediaPlayer object.

Original issue reported on code.google.com by cp.strea...@gmail.com on 7 Apr 2015 at 2:54

GoogleCodeExporter commented 9 years ago
You should be using Device Volume instead of Stream Volume. See the mute method 
here: 
http://developer.android.com/reference/com/google/android/gms/cast/Cast.CastApi.
html#setMute(com.google.android.gms.common.api.GoogleApiClient,%20boolean).

Original comment by jonathan...@google.com on 7 Apr 2015 at 9:13

GoogleCodeExporter commented 9 years ago
Thanks for your response... Observed that volume bar displayed every time when 
I use device volume methods like setMute(), setVolume(). I don't want to see 
those volume controls displayed every time mute/UN-mute event executed in 
chromecast, that is the reason I tried to use alternative ways using stream 
volume methods. 

Even I'm enthusiastic to know the reason behind 2100 failed status code, why 
stream volume methods not working, could you please tell me the reason for 
failure notice?  

Original comment by cp.strea...@gmail.com on 8 Apr 2015 at 6:18

GoogleCodeExporter commented 9 years ago
Here is the StackOverFlow link for the same query: 
http://stackoverflow.com/questions/29494925/android-unable-to-mute-audio-in-chro
mecast

Original comment by cp.strea...@gmail.com on 8 Apr 2015 at 8:09