How to create a custom Cast MediaRouter dialog

I am currently using CastCompanionLibrary in my project. It works well, however I need to adjust the behavior of the Cast button.

A dialog button is currently being displayed containing the cast devices (which is the expected behavior). In addition, metadata and a stop / start button are displayed during casting. I need to configure this. I do not want to show the stop / start buttons. How can i achieve this?

Here is part of my code:

<item
    android:id="@+id/media_route_menu_item"
    android:title="Google Cast"
    compat:actionProviderClass="android.support.v7.app.MediaRouteActionProvider"
    compat:showAsAction="always"/>

and

if (mCastManager != null) {
    mediaRouteMenuItem = mCastManager.addMediaRouterButton(menu, R.id.media_route_menu_item);
}
0
source share
1 answer

. -, , , , , " ". , CCL, "custom_media_route_controller_controls_dialog.xml" ( - ). , , CCL; MediaRouteDialogFactory, onCreateControllerDialogFragment() MediaRouteControllerDialog (. com.google.android.libraries.cast.companionlibrary.cast.dialog.video CCL) , , VideoCastManager getMediaRouteDialogFactory() factory.

0

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


All Articles