Opening device detection does not work for DEFAULT_MEDIA_RECEIVER_APPLICATION_ID

tried to try castHelloText-android-master sample in google sdk.

It seems like I cannot get device discovery to work if I changed MediaRouteSelector to look for CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID. The Cast button is not displayed. but if I change it to CastMediaControlIntent.CATEGORY_CAST, I can get a button to display.

The reason I do this is because I intend to use the default media receiver instead of deploying my own receiver.

I was wondering if there is a mistake here. or should I just stick with CATEGORY_CAST for detection. If you have a way to make it work, pls show me the way, thanks.

+4
source share
1 answer

These two static variables have different goals. According to the document http://developer.android.com/reference/com/google/android/gms/cast/CastMediaControlIntent.html : CATEGORY_CAST- The control category for detecting Cast devices. DEFAULT_MEDIA_RECEIVER_APPLICATION_ID- The application identifier for the Cast Default media receiver.

So, use CATEGORY_CASTfor discovery and use DEFAULT_MEDIA_RECEIVER_APPLICATION_IDin your call launchApplication.

+3
source

Source: https://habr.com/ru/post/1527158/


All Articles