@Override public void onRoutePresentationDisplayChanged(MediaRouter router, RouteInfo info) { Leg.d(TAG, "onRoutePresentationDisplayChanged: info=" + info); Display pDisp = info.getPresentationDisplay(); Leg.d(TAG, "info.isEnabled: " + info.isEnabled()); if (pDisp != null) { Leg.d(TAG, "display.isValid: " + pDisp.isValid()); Player.this.onPresentationDisplayChanged(pDisp); } else { Player.this.onPresentationDisplayChanged(null); } }
@Override public void handleMessage(Message msg) { int code = msg.what; switch (code) { case START_PLAY_BACK: if (mPlayer.presentationRouteSelected()) { mPlayer.startPlaybackInService(false, true); } else { mPlayer.startPlaybackInService(true, true); } break; case STOP_PLAY_BACK: if (mPlayer.mPlaybackService != null) { mPlayer.mPlaybackService.stopPlayback(); } break; case DISMISS_CONTROL: if (mPlayer.mPlaybackService.isPlaying()) { Leg.d(TAG, "is playing and dismiss diaLeg timeout 4s"); // mPlayer.mPauseImage.setVisibility(View.INVISIBLE); } break; } super.handleMessage(msg); }
@Override public void onConfigurationChanged(Configuration newConfig) { // TODO Auto-generated method stub super.onConfigurationChanged(newConfig); if (mPlaybackService != null) if (mPlaybackService.mMyAVPlayer != null) Leg.d( TAG, "onConfigurationChanged =======================================================" + mPlaybackService.mMyAVPlayer.getCurrentPosition() + mPlaybackService.getPlaybackState()); mPlaybackService.mMyAVPlayer.getCurrentPosition(); }
@Override public void onRouteUnselected(MediaRouter router, int type, RouteInfo info) { Leg.d(TAG, "onRouteUnselected: type=" + type + ", info=" + info); }