Skip to content

Commit

Permalink
Add player to getMediaDescription
Browse files Browse the repository at this point in the history
This allows access to the timeline for example.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193900798
  • Loading branch information
andrewlewis authored and ojw28 committed May 7, 2018
1 parent d3cdf52 commit a07471d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ public TimelineQueueNavigator(MediaSessionCompat mediaSession, int maxQueueSize)
/**
* Gets the {@link MediaDescriptionCompat} for a given timeline window index.
*
* @param player The current player.
* @param windowIndex The timeline window index for which to provide a description.
* @return A {@link MediaDescriptionCompat}.
*/
public abstract MediaDescriptionCompat getMediaDescription(int windowIndex);
public abstract MediaDescriptionCompat getMediaDescription(Player player, int windowIndex);

@Override
public long getSupportedQueueNavigatorActions(Player player) {
Expand Down Expand Up @@ -185,7 +186,7 @@ private void publishFloatingQueueWindow(Player player) {
windowCount - queueSize);
List<MediaSessionCompat.QueueItem> queue = new ArrayList<>();
for (int i = startIndex; i < startIndex + queueSize; i++) {
queue.add(new MediaSessionCompat.QueueItem(getMediaDescription(i), i));
queue.add(new MediaSessionCompat.QueueItem(getMediaDescription(player, i), i));
}
mediaSession.setQueue(queue);
activeQueueItemId = currentWindowIndex;
Expand Down

0 comments on commit a07471d

Please sign in to comment.