Skip to content

Commit

Permalink
MediaSessionConnector: Document how to provide metadata asynchronously
Browse files Browse the repository at this point in the history
Issue: #6047
PiperOrigin-RevId: 255992898
  • Loading branch information
marcbaechinger authored and ojw28 committed Jul 9, 2019
1 parent 71e0f2e commit c4c7f4b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ public interface MediaMetadataProvider {
/**
* Gets the {@link MediaMetadataCompat} to be published to the session.
*
* <p>An app may need to load metadata resources like artwork bitmaps asynchronously. In such a
* case the app should return a {@link 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 {@link
* #invalidateMediaSessionMetadata()}. This causes this callback to be called again and the app
* can now return a {@link MediaMetadataCompat} object with all the resources included.
*
* @param player The player connected to the media session.
* @return The {@link MediaMetadataCompat} to be published to the session.
*/
Expand Down

0 comments on commit c4c7f4b

Please sign in to comment.