Interface MediaSessionConnector.MediaMetadataProvider

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      android.support.v4.media.MediaMetadataCompat getMetadata​(Player player)
      Gets the MediaMetadataCompat to be published to the session.
      default boolean sameAs​(android.support.v4.media.MediaMetadataCompat oldMetadata, android.support.v4.media.MediaMetadataCompat newMetadata)
      Returns whether the old and the new metadata are considered the same.
    • Method Detail

      • getMetadata

        android.support.v4.media.MediaMetadataCompat getMetadata​(Player player)
        Gets the MediaMetadataCompat to be published to the session.

        An app may need to load metadata resources like artwork bitmaps asynchronously. In such a case the app should return a MediaMetadataCompat object that does not contain these resources as a placeholder. The app should start an asynchronous operation to download the bitmap and put it into a cache. Finally, the app should call MediaSessionConnector.invalidateMediaSessionMetadata(). This causes this callback to be called again and the app can now return a MediaMetadataCompat object with all the resources included.

        Parameters:
        player - The player connected to the media session.
        Returns:
        The MediaMetadataCompat to be published to the session.
      • sameAs

        default boolean sameAs​(android.support.v4.media.MediaMetadataCompat oldMetadata,
                               android.support.v4.media.MediaMetadataCompat newMetadata)
        Returns whether the old and the new metadata are considered the same.