当前位置: 首页>>代码示例>>Java>>正文


Java MediaRouter.RouteInfo方法代码示例

本文整理汇总了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");
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:27,代码来源:VideoPlayerActivity.java

示例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());
    }
}
 
开发者ID:StylingAndroid,项目名称:PresenterLite,代码行数:28,代码来源:StandaloneDisplayActivity.java

示例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);
        }
    }
}
 
开发者ID:akexorcist,项目名称:Android-O-Feature,代码行数:14,代码来源:SecondaryDisplayActivity.java

示例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;
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:30,代码来源:abw.java

示例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();
}
 
开发者ID:Sherchen,项目名称:ApiDemos,代码行数:32,代码来源:PresentationWithMediaRouterActivity.java

示例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) {}
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:16,代码来源:abc.java

示例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");
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:28,代码来源:VideoPlayerActivity.java

示例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);
		}
	}
}
 
开发者ID:TheFakeMontyOnTheRun,项目名称:knightsofalentejo,代码行数:11,代码来源:GameActivity.java

示例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();
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:8,代码来源:VolumePanel.java

示例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();
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:8,代码来源:VolumePanel.java

示例11: onRouteRemoved

import android.media.MediaRouter; //导入方法依赖的package包/类
public void onRouteRemoved(MediaRouter paramMediaRouter, MediaRouter.RouteInfo paramRouteInfo)
{
  this.a.c(paramRouteInfo);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:aba.java

示例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);
	}
}
 
开发者ID:siva000000,项目名称:Pink-Music,代码行数:42,代码来源:Player.java

示例13: onRouteVolumeChanged

import android.media.MediaRouter; //导入方法依赖的package包/类
public void onRouteVolumeChanged(MediaRouter paramMediaRouter, MediaRouter.RouteInfo paramRouteInfo)
{
  this.a.e(paramRouteInfo);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:aba.java

示例14: onRoutePresentationDisplayChanged

import android.media.MediaRouter; //导入方法依赖的package包/类
public final void onRoutePresentationDisplayChanged(MediaRouter paramMediaRouter, MediaRouter.RouteInfo paramRouteInfo)
{
  ((abg)this.a).f(paramRouteInfo);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:abh.java

示例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);
}
 
开发者ID:TheFakeMontyOnTheRun,项目名称:knightsofalentejo,代码行数:5,代码来源:GameActivity.java


注:本文中的android.media.MediaRouter.RouteInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。