本文整理汇总了Java中android.media.MediaRouter.RouteInfo方法的典型用法代码示例。如果您正苦于以下问题:Java MediaRouter.RouteInfo方法的具体用法?Java MediaRouter.RouteInfo怎么用?Java MediaRouter.RouteInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.media.MediaRouter
的用法示例。
在下文中一共展示了MediaRouter.RouteInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPresentation
import android.media.MediaRouter; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private void createPresentation() {
if (mMediaRouter == null || mEnableCloneMode)
return;
// Get the current route and its presentation display.
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(
MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
Display presentationDisplay = route != null ? route.getPresentationDisplay() : null;
if (presentationDisplay != null) {
// Show a new presentation if possible.
Log.i(TAG, "Showing presentation on display: " + presentationDisplay);
mPresentation = new SecondaryDisplay(this, presentationDisplay);
mPresentation.setOnDismissListener(mOnDismissListener);
try {
mPresentation.show();
} catch (WindowManager.InvalidDisplayException ex) {
Log.w(TAG, "Couldn't show presentation! Display was removed in "
+ "the meantime.", ex);
mPresentation = null;
}
} else
Log.i(TAG, "No secondary display detected");
}
示例2: updatePresentation
import android.media.MediaRouter; //导入方法依赖的package包/类
private void updatePresentation() {
MediaRouter.RouteInfo route = mediaRouter
.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
Display presentationDisplay = route != null ? route
.getPresentationDisplay() : null;
if (displayPresentation != null
&& displayPresentation.getDisplay() != presentationDisplay) {
displayPresentation.dismiss();
displayPresentation = null;
}
if (displayPresentation == null && presentationDisplay != null) {
displayPresentation = new DisplayPresentation(this, presentationDisplay);
displayPresentation.setOnDismissListener(
new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (dialog == displayPresentation) {
displayPresentation = null;
}
}
}
);
displayPresentation.show();
displayPresentation.go(displayLayout.getCurrentSlidePos(), displayLayout.getCurrentSlidePhase());
}
}
示例3: setupThing
import android.media.MediaRouter; //导入方法依赖的package包/类
private void setupThing() {
MediaRouter mediaRouter = (MediaRouter) getSystemService(Context.MEDIA_ROUTER_SERVICE);
if (mediaRouter != null) {
MediaRouter.RouteInfo routeInfo = mediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
if (routeInfo != null) {
Display presentationDisplay = routeInfo.getPresentationDisplay();
Bundle bundle = ActivityOptions.makeBasic().setLaunchDisplayId(presentationDisplay.getDisplayId()).toBundle();
Intent intent = new Intent(this, EachAnotherActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent, bundle);
}
}
}
示例4: h
import android.media.MediaRouter; //导入方法依赖的package包/类
protected void h(Object paramObject)
{
if (this.u == null) {
this.u = new abc();
}
abc localabc = this.u;
MediaRouter localMediaRouter = (MediaRouter)this.i;
MediaRouter.RouteInfo localRouteInfo = (MediaRouter.RouteInfo)paramObject;
if (((0x800000 & localRouteInfo.getSupportedTypes()) == 0) && (localabc.a != null)) {}
try
{
Method localMethod = localabc.a;
Object[] arrayOfObject = new Object[2];
arrayOfObject[0] = Integer.valueOf(8388611);
arrayOfObject[1] = localRouteInfo;
localMethod.invoke(localMediaRouter, arrayOfObject);
return;
}
catch (InvocationTargetException localInvocationTargetException)
{
localMediaRouter.selectRoute(8388611, localRouteInfo);
return;
}
catch (IllegalAccessException localIllegalAccessException)
{
label96:
break label96;
}
}
示例5: updatePresentation
import android.media.MediaRouter; //导入方法依赖的package包/类
private void updatePresentation() {
// Get the current route and its presentation display.
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(
MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
Display presentationDisplay = route != null ? route.getPresentationDisplay() : null;
// Dismiss the current presentation if the display has changed.
if (mPresentation != null && mPresentation.getDisplay() != presentationDisplay) {
Log.i(TAG, "Dismissing presentation because the current route no longer "
+ "has a presentation display.");
mPresentation.dismiss();
mPresentation = null;
}
// Show a new presentation if needed.
if (mPresentation == null && presentationDisplay != null) {
Log.i(TAG, "Showing presentation on display: " + presentationDisplay);
mPresentation = new DemoPresentation(this, presentationDisplay);
mPresentation.setOnDismissListener(mOnDismissListener);
try {
mPresentation.show();
} catch (WindowManager.InvalidDisplayException ex) {
Log.w(TAG, "Couldn't show presentation! Display was removed in "
+ "the meantime.", ex);
mPresentation = null;
}
}
// Update the contents playing in this activity.
updateContents();
}
示例6: abc
import android.media.MediaRouter; //导入方法依赖的package包/类
public abc()
{
if ((Build.VERSION.SDK_INT < 16) || (Build.VERSION.SDK_INT > 17)) {
throw new UnsupportedOperationException();
}
try
{
Class[] arrayOfClass = new Class[2];
arrayOfClass[0] = Integer.TYPE;
arrayOfClass[1] = MediaRouter.RouteInfo.class;
this.a = MediaRouter.class.getMethod("selectRouteInt", arrayOfClass);
return;
}
catch (NoSuchMethodException localNoSuchMethodException) {}
}
示例7: createPresentation
import android.media.MediaRouter; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private void createPresentation() {
if (mMediaRouter == null || mEnableCloneMode)
return;
// Get the current route and its presentation display.
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(
MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
Display presentationDisplay = route != null ? route.getPresentationDisplay() : null;
if (presentationDisplay != null) {
// Show a new presentation if possible.
Log.i(TAG, "Showing presentation on display: " + presentationDisplay);
mPresentation = new SecondaryDisplay(this, LibVLC(), presentationDisplay);
mPresentation.setOnDismissListener(mOnDismissListener);
try {
mPresentation.show();
mPresentationDisplayId = presentationDisplay.getDisplayId();
} catch (WindowManager.InvalidDisplayException ex) {
Log.w(TAG, "Couldn't show presentation! Display was removed in "
+ "the meantime.", ex);
mPresentation = null;
}
} else
Log.i(TAG, "No secondary display detected");
}
示例8: useBestRouteForGameplayPresentation
import android.media.MediaRouter; //导入方法依赖的package包/类
private void useBestRouteForGameplayPresentation() {
MediaRouter.RouteInfo mRouteInfo = findSecundaryDisplayRouter();
if (mRouteInfo != null) {
Display presentationDisplay = mRouteInfo.getPresentationDisplay();
if (presentationDisplay != null) {
useSecundaryDisplayForGameplayPresentation(presentationDisplay);
}
}
}
示例9: onRouteSelected
import android.media.MediaRouter; //导入方法依赖的package包/类
@Override
public void onRouteSelected(MediaRouter router, int type, MediaRouter.RouteInfo info) {
LOGD("MediaRouteListener", "onRouteSelected(" + type + ", " + info.getName() + ")");
mCurrentRouteInfo = info;
mCurrentRouteType = type;
refreshRoute();
}
示例10: onRouteUnselected
import android.media.MediaRouter; //导入方法依赖的package包/类
@Override
public void onRouteUnselected(MediaRouter router, int type, MediaRouter.RouteInfo info) {
LOGD("MediaRouteListener", "onRouteUnselected(" + type + ", " + info.getName() + ")");
mCurrentRouteInfo = null;
mCurrentRouteType = type;
refreshRoute();
}
示例11: onRouteRemoved
import android.media.MediaRouter; //导入方法依赖的package包/类
public void onRouteRemoved(MediaRouter paramMediaRouter, MediaRouter.RouteInfo paramRouteInfo)
{
this.a.c(paramRouteInfo);
}
示例12: registerMediaRouter
import android.media.MediaRouter; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private static void registerMediaRouter(Context context) {
final MediaRouter mr = (MediaRouter)context.getSystemService(MEDIA_ROUTER_SERVICE);
if (mr != null) {
mediaRouterCallback = new MediaRouter.Callback() {
@Override
public void onRouteVolumeChanged(MediaRouter router, MediaRouter.RouteInfo info) {
}
@Override
public void onRouteUnselected(MediaRouter router, int type, MediaRouter.RouteInfo info) {
}
@Override
public void onRouteUngrouped(MediaRouter router, MediaRouter.RouteInfo info, MediaRouter.RouteGroup group) {
}
@Override
public void onRouteSelected(MediaRouter router, int type, MediaRouter.RouteInfo info) {
}
@Override
public void onRouteRemoved(MediaRouter router, MediaRouter.RouteInfo info) {
}
@Override
public void onRouteGrouped(MediaRouter router, MediaRouter.RouteInfo info, MediaRouter.RouteGroup group, int index) {
}
@Override
public void onRouteChanged(MediaRouter router, MediaRouter.RouteInfo info) {
if (info.getPlaybackStream() == AudioManager.STREAM_MUSIC) {
//this actually works... nonetheless, I was not able to detected
//which is the audio sink used by this route.... :(
volumeStreamMax = info.getVolumeMax();
if (volumeStreamMax < 1)
volumeStreamMax = 1;
audioSinkChanged(false);
}
}
@Override
public void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo info) {
}
};
mr.addCallback(MediaRouter.ROUTE_TYPE_LIVE_AUDIO | MediaRouter.ROUTE_TYPE_USER, (MediaRouter.Callback)mediaRouterCallback);
}
}
示例13: onRouteVolumeChanged
import android.media.MediaRouter; //导入方法依赖的package包/类
public void onRouteVolumeChanged(MediaRouter paramMediaRouter, MediaRouter.RouteInfo paramRouteInfo)
{
this.a.e(paramRouteInfo);
}
示例14: onRoutePresentationDisplayChanged
import android.media.MediaRouter; //导入方法依赖的package包/类
public final void onRoutePresentationDisplayChanged(MediaRouter paramMediaRouter, MediaRouter.RouteInfo paramRouteInfo)
{
((abg)this.a).f(paramRouteInfo);
}
示例15: findSecundaryDisplayRouter
import android.media.MediaRouter; //导入方法依赖的package包/类
private MediaRouter.RouteInfo findSecundaryDisplayRouter() {
MediaRouter mMediaRouter = (MediaRouter) getSystemService(Context.MEDIA_ROUTER_SERVICE);
return mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
}