public static Object getMetadata(Object controllerObj) { return ((MediaController)controllerObj).getMetadata(); }
String getArtist() { if (controller.getMetadata() == null) return ""; String artist = controller.getMetadata().getString(MediaMetadata.METADATA_KEY_ALBUM_ARTIST); return artist != null ? artist : ""; }
String getAlbum() { if (controller.getMetadata() == null) return ""; String album = controller.getMetadata().getString(MediaMetadata.METADATA_KEY_ALBUM); return album != null ? album : ""; }
String getTitle() { if (controller.getMetadata() == null) return ""; String title = controller.getMetadata().getString(MediaMetadata.METADATA_KEY_TITLE); return title != null ? title : ""; }
public void forceUpdate() { if (this.mLastMediaController != null) { updateMetadata(this.mLastMediaController.getMetadata()); updatePlayback(this.mLastMediaController.getPlaybackState()); } }
private void updateMediaSessionCallback(MediaController activeController) { boolean clearing = false; if (activeController != this.mLastMediaController) { if (this.mLastMediaController != null) { this.mLastMediaController.unregisterCallback(this.mMediaSessionCallback); } if (activeController != null) { activeController.registerCallback(this.mMediaSessionCallback); } this.mLastMediaController = activeController; } if (this.mLastMediaController == null) { clearing = true; } if (this.mNowPlayCardListener != null) { this.mNowPlayCardListener.onClientChanged(clearing); } if (!clearing) { updateMetadata(this.mLastMediaController.getMetadata()); updatePlayback(this.mLastMediaController.getPlaybackState()); } }