Code example for MediaRouter.RouteInfo

Methods: getPresentationDisplay

0
    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);