本文整理汇总了Java中android.support.v7.media.MediaRouter.RouteInfo.isSelected方法的典型用法代码示例。如果您正苦于以下问题:Java RouteInfo.isSelected方法的具体用法?Java RouteInfo.isSelected怎么用?Java RouteInfo.isSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.media.MediaRouter.RouteInfo
的用法示例。
在下文中一共展示了RouteInfo.isSelected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRouteSelectedEvent
import android.support.v7.media.MediaRouter.RouteInfo; //导入方法依赖的package包/类
@Override
protected void onRouteSelectedEvent(MediaRouter router, RouteInfo route) {
Log.d(TAG, "Selected route %s", route);
if (!route.isSelected()) return;
RecordCastAction.castPlayRequested();
RecordCastAction.remotePlaybackDeviceSelected(
RecordCastAction.DEVICE_TYPE_CAST_GENERIC);
installBroadcastReceivers();
if (getMediaStateListener() == null) {
showCastError(route.getName());
release();
return;
}
if (route != getCurrentRoute()) {
registerRoute(route);
clearStreamState();
}
mPositionExtrapolator.clear();
notifyRouteSelected(route);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:26,代码来源:DefaultMediaRouteController.java
示例2: getRoutes
import android.support.v7.media.MediaRouter.RouteInfo; //导入方法依赖的package包/类
private JSONArray getRoutes() {
JSONArray routeList = new JSONArray();
List<RouteInfo> routesInMedia = mMediaRouter.getRoutes();
final int l = routesInMedia.size();
if (l == 0) {
return routeList;
}
try {
for (int i = 0; i < l; i++) {
RouteInfo rInfo = routesInMedia.get(i);
CastDevice dInfo = getDevice(rInfo);
JSONObject jsonRoute = new JSONObject();
jsonRoute.put("id", rInfo.getId());
jsonRoute.put("name", rInfo.getName());
jsonRoute.put("description", rInfo.getDescription());
jsonRoute.put("isSelected", rInfo.isSelected());
jsonRoute.put("index", i);
jsonRoute.put("volume", rInfo.getVolume());
if (dInfo != null) {
jsonRoute.put("ipAddress", dInfo.getIpAddress());
List<WebImage> icons = dInfo.getIcons();
if ((icons != null) && !icons.isEmpty()) {
WebImage icon = icons.get(0);
jsonRoute.put("icon", icon.getUrl());
}
}
if (rInfo.isSelected()) {
jsonRoute.put("isConnected", mSelectedDevice != null);
}
/*if (mSelectedDevice != null) {
jsonRoute.put("ipAddress", mSelectedDevice.getIpAddress());
}*/
routeList.put(jsonRoute);
}
} catch (JSONException e) {
Log.d(TAG, "failed to get routes list");
}
return routeList;
}