List of usage examples for android.app Activity getMediaController
public final MediaController getMediaController()
From source file:com.example.android.tvleanback2.ui.PlaybackOverlayFragment.java
@Override public void onAttach(Context context) { super.onAttach(context); Activity activity = (Activity) context; mMediaController = activity.getMediaController(); Log.d(TAG, "register callback of mediaController"); mMediaController.registerCallback(mMediaControllerCallback); }
From source file:com.aengbee.android.leanback.ui.PlaybackOverlayCustomFragment.java
private int getPlaybackState() { Activity activity = getActivity(); if (activity != null) { PlaybackState state = activity.getMediaController().getPlaybackState(); if (state != null) { return state.getState(); } else {/*ww w . jav a2 s . c o m*/ return PlaybackState.STATE_NONE; } } return PlaybackState.STATE_NONE; }
From source file:org.mythtv.android.presentation.view.fragment.TvPlaybackOverlayFragment.java
private int getPlaybackState() { Activity activity = getActivity(); if (activity != null) { PlaybackState state = activity.getMediaController().getPlaybackState(); if (state != null) { return state.getState(); } else {/*ww w. java 2s . c om*/ return PlaybackState.STATE_NONE; } } return PlaybackState.STATE_NONE; }