mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add player to getMediaDescription
This allows access to the timeline for example. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=193900798
This commit is contained in:
parent
d3cdf52591
commit
a07471ddef
1 changed files with 3 additions and 2 deletions
|
|
@ -73,10 +73,11 @@ public abstract class TimelineQueueNavigator implements MediaSessionConnector.Qu
|
||||||
/**
|
/**
|
||||||
* Gets the {@link MediaDescriptionCompat} for a given timeline window index.
|
* 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.
|
* @param windowIndex The timeline window index for which to provide a description.
|
||||||
* @return A {@link MediaDescriptionCompat}.
|
* @return A {@link MediaDescriptionCompat}.
|
||||||
*/
|
*/
|
||||||
public abstract MediaDescriptionCompat getMediaDescription(int windowIndex);
|
public abstract MediaDescriptionCompat getMediaDescription(Player player, int windowIndex);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getSupportedQueueNavigatorActions(Player player) {
|
public long getSupportedQueueNavigatorActions(Player player) {
|
||||||
|
|
@ -185,7 +186,7 @@ public abstract class TimelineQueueNavigator implements MediaSessionConnector.Qu
|
||||||
windowCount - queueSize);
|
windowCount - queueSize);
|
||||||
List<MediaSessionCompat.QueueItem> queue = new ArrayList<>();
|
List<MediaSessionCompat.QueueItem> queue = new ArrayList<>();
|
||||||
for (int i = startIndex; i < startIndex + queueSize; i++) {
|
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);
|
mediaSession.setQueue(queue);
|
||||||
activeQueueItemId = currentWindowIndex;
|
activeQueueItemId = currentWindowIndex;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue