Tabnine Logo
MediaControllerCompat$Callback.onMetadataChanged
Code IndexAdd Tabnine to your IDE (free)

How to use
onMetadataChanged
method
in
android.support.v4.media.session.MediaControllerCompat$Callback

Best Java code snippets using android.support.v4.media.session.MediaControllerCompat$Callback.onMetadataChanged (Showing top 7 results out of 315)

origin: lizixian18/StarrySky

@Override
public void onMetadataChanged(MediaMetadataCompat metadata) {
  super.onMetadataChanged(metadata);
  mMetadata = metadata;
  Notification notification = createNotification();
  if (notification != null) {
    mNotificationManager.notify(NOTIFICATION_ID, notification);
  }
}
origin: lizixian18/StarrySky

@Override
public void onMetadataChanged(MediaMetadataCompat metadata) {
  super.onMetadataChanged(metadata);
  mMetadata = metadata;
  Notification notification = createNotification();
  if (notification != null) {
    mNotificationManager.notify(NOTIFICATION_ID, notification);
  }
}
origin: googlesamples/android-MediaBrowserService

  @Override
  public void perform(@NonNull Callback callback) {
    callback.onMetadataChanged(metadata);
  }
});
origin: lizixian18/StarrySky

@Override
public void onMetadataChanged(MediaMetadataCompat metadata) {
  super.onMetadataChanged(metadata);
  nowPlaying = metadata != null ? metadata : NOTHING_PLAYING;
  //状态监听
  CopyOnWriteArrayList<OnPlayerEventListener> mPlayerEventListeners = MusicManager.getInstance().getPlayerEventListeners();
  if (metadata != null) {
    SongInfo songInfo = null;
    for (OnPlayerEventListener listener : mPlayerEventListeners) {
      List<SongInfo> songInfos = MusicProvider.getInstance().getSongInfos();
      for (SongInfo info : songInfos) {
        if (info.getSongId().equals(metadata.getString(MediaMetadataCompat.METADATA_KEY_MEDIA_ID))) {
          songInfo = info;
          break;
        }
      }
      listener.onMusicSwitch(songInfo);
    }
  }
}
origin: googlesamples/android-MediaBrowserService

public void registerCallback(Callback callback) {
  if (callback != null) {
    mCallbackList.add(callback);
    // Update with the latest metadata/playback state.
    if (mMediaController != null) {
      final MediaMetadataCompat metadata = mMediaController.getMetadata();
      if (metadata != null) {
        callback.onMetadataChanged(metadata);
      }
      final PlaybackStateCompat playbackState = mMediaController.getPlaybackState();
      if (playbackState != null) {
        callback.onPlaybackStateChanged(playbackState);
      }
    }
  }
}
origin: kingargyle/adt-leanback-support

  @Override
  public void onMetadataChanged(Object metadataObj) {
    Callback.this.onMetadataChanged(
        MediaMetadataCompat.fromMediaMetadata(metadataObj));
  }
}
origin: googlesamples/android-MediaBrowserService

@Override
public void onMetadataChanged(MediaMetadataCompat metadata) {
  super.onMetadataChanged(metadata);
  final int max = metadata != null
      ? (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION)
      : 0;
  setProgress(0);
  setMax(max);
}
android.support.v4.media.sessionMediaControllerCompat$CallbackonMetadataChanged

Javadoc

Override to handle changes to the current metadata.

Popular methods of MediaControllerCompat$Callback

  • onSessionDestroyed
    Override to handle the session being destroyed. The session is no longer valid after this call and c
  • onPlaybackStateChanged
    Override to handle changes in playback state.
  • onQueueChanged
  • onSessionEvent
    Override to handle custom events sent by the session owner without a specified interface. Controller

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now