Do not update queue when the queue did not actually change to avoid

unnecessary updates are broadcasted to all clients.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162728670
This commit is contained in:
bachinger 2017-07-21 04:48:03 -07:00 committed by Oliver Woodman
parent 89181cf4bc
commit 3bc3900dba

View file

@ -93,7 +93,12 @@ public abstract class TimelineQueueNavigator implements MediaSessionConnector.Qu
@Override
public void onCurrentWindowIndexChanged(Player player) {
publishFloatingQueueWindow(player);
if (activeQueueItemId == MediaSessionCompat.QueueItem.UNKNOWN_ID
|| player.getCurrentTimeline().getWindowCount() > maxQueueSize) {
publishFloatingQueueWindow(player);
} else if (!player.getCurrentTimeline().isEmpty()) {
activeQueueItemId = player.getCurrentWindowIndex();
}
}
@Override