phawind111 / google-cast-sdk

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

Recent hit and miss Google Cast discovery using CastMediaControlIntent.categoryForCast() (Android) #709

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Some apps use this construct to be notified of Google Cast device discovery:

MediaRouteSelector mediaRouteSelector = new MediaRouteSelector.Builder() 
.addControlCategory(CastMediaControlIntent.categoryForCast(APP_ID)).build();

Since some time (at least a few days), this doesn't work reliably anymore. The 
outcome is somewhat unpredictable and either:

1. you get no cast device discovered
2. you get only some devices discovered
3. you get all devices discovered

When the app is in the 1 or 2 state, launching Google Play Music and taping the 
cast button usually results in the app going in the 3 state.

So there's something broken in current Google Play Services with 
CastMediaControlIntent.categoryForCast().

For now, the workaround that 100% works (assuming an app that handle all Google 
Cast devices) is to use:

addControlCategory(CastMediaControlIntent.CATEGORY_CAST)

Although deprecated, it works and all Google Cast devices are consistently 
discovered.

Original issue reported on code.google.com by pujos.mi...@gmail.com on 16 Dec 2015 at 12:11

GoogleCodeExporter commented 8 years ago
If an app doesn't handle all Google Cast devices (for example video), it can 
still use the workaround and filter devices with CastDevice.hasCapability() in 
the relevant callback.

Original comment by pujos.mi...@gmail.com on 16 Dec 2015 at 12:27

GoogleCodeExporter commented 8 years ago
Could you give us more information about your testing environment: 
- Version of Google Play Services
- Android build
- Google Cast SDK version

Also, could you please reproduce the issue and share the receiver logs? 

Original comment by na...@google.com on 18 Dec 2015 at 7:48

GoogleCodeExporter commented 8 years ago
- Version of Google Play Services
Google Play services 8.4.89 (2428711-248)

- Android build
5.1.1, LMY48Y

- Google Cast SDK version
rev 27

A few days ago I had the same issue on my Nexus 5 with Android 6.0.
Since then I updated it to 6.0.1 and Play Services is now 8.4.89 (2428711-470).
I cannot reprod this issue on this device but this is because of another 
problem: only a single Guest cast devices is discovered out of 3 devices on my 
network. But that is a different issue than the one this bug wants to address.

Original comment by pujos.mi...@gmail.com on 19 Dec 2015 at 5:38

GoogleCodeExporter commented 8 years ago
We'll look into the issue. This ticket will be updated accordingly.

Original comment by na...@google.com on 22 Dec 2015 at 12:16

GoogleCodeExporter commented 8 years ago

Original comment by na...@google.com on 22 Dec 2015 at 12:17

GoogleCodeExporter commented 8 years ago
Is there any device you could reproduce this issue on? If so, please send a 
feedback report from the Chromecast app on that device after successfully 
reproducing the issue with the text "for Issue 709" in the description. 

Original comment by na...@google.com on 22 Dec 2015 at 11:28