0
我能够得到可用的投射设备列表中如何使用谷歌演员库
- 对动作条一个
MediaRouter
按钮, - 列表中的网络上的所有可用Chromecast,
- 连接&流到列出的设备。
我用下面的代码片段,列出了“真正的投设备”:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.browse, menu);
mediaRouteMenuItem = CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), menu,
R.id.media_route_menu_item);
return true;
}
但是使用这个,我已经得到了我想要显示的设备列表中没有控制/从列表对话框(由cast sdk编写)隐藏。该应用程序需要在“真正投射设备”之外的设备上投射视频和音频,如Roku和FireTV,为此我需要在设备列表中追加这些设备。
所以,我的问题可能有两个可能的解决方案:
- 访问哪些投SDK准备,这样我可以追加其他设备给它的对话框。
- 从cast sdk获取所有“真正的施法装置”,并且不让cast sdk准备对话。并准备我自己的对话框与所有启用的设备。
PS:真正投放装置是这是谷歌投的设备上启用。
更新1
挖掘到剧组的SDK,我发现这个类android.support.v7.app.MediaRouteDialogFactory
及其文件说
/**
* The media route dialog factory is responsible for creating the media route
* chooser and controller dialogs as needed.
* <p>
* The application can customize the dialogs by providing a subclass of the
* dialog factory to the {@link MediaRouteButton} using the
* {@link MediaRouteButton#setDialogFactory setDialogFactory} method.
* </p>
*/
我想,这正是我们所需要。有人可以建议如何自定义对话框?