I am currently using the CastCompanionLibrary in my project. It is working well, however I need to customize the behaviour of the Cast button.
Currently, a dialog button containing the Cast devices is being shown (which is the expected behaviour). Also, when casting, the metadata and a stop/start button is shown. I need to customize this. I don't want to show the stop/start buttons. How can I achieve that?
Here are the related parts 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);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…