mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add set/getShuffleModeEnabled to Player interface.
And implement a basic version of the methods in all implementations. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=166041342
This commit is contained in:
parent
f1a97317d9
commit
c1d7e5bf9d
6 changed files with 67 additions and 0 deletions
|
|
@ -330,6 +330,17 @@ public final class CastPlayer implements Player {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
|
// TODO: Support shuffle mode.
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getShuffleModeEnabled() {
|
||||||
|
// TODO: Support shuffle mode.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TrackSelectionArray getCurrentTrackSelections() {
|
public TrackSelectionArray getCurrentTrackSelections() {
|
||||||
return currentTrackSelection;
|
return currentTrackSelection;
|
||||||
|
|
|
||||||
|
|
@ -396,6 +396,16 @@ public final class DynamicConcatenatingMediaSourceTest extends TestCase {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getShuffleModeEnabled() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLoading() {
|
public boolean isLoading() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
private boolean tracksSelected;
|
private boolean tracksSelected;
|
||||||
private boolean playWhenReady;
|
private boolean playWhenReady;
|
||||||
private @RepeatMode int repeatMode;
|
private @RepeatMode int repeatMode;
|
||||||
|
private boolean shuffleModeEnabled;
|
||||||
private int playbackState;
|
private int playbackState;
|
||||||
private int pendingSeekAcks;
|
private int pendingSeekAcks;
|
||||||
private int pendingPrepareAcks;
|
private int pendingPrepareAcks;
|
||||||
|
|
@ -87,6 +88,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
this.trackSelector = Assertions.checkNotNull(trackSelector);
|
this.trackSelector = Assertions.checkNotNull(trackSelector);
|
||||||
this.playWhenReady = false;
|
this.playWhenReady = false;
|
||||||
this.repeatMode = Player.REPEAT_MODE_OFF;
|
this.repeatMode = Player.REPEAT_MODE_OFF;
|
||||||
|
this.shuffleModeEnabled = false;
|
||||||
this.playbackState = Player.STATE_IDLE;
|
this.playbackState = Player.STATE_IDLE;
|
||||||
this.listeners = new CopyOnWriteArraySet<>();
|
this.listeners = new CopyOnWriteArraySet<>();
|
||||||
emptyTrackSelections = new TrackSelectionArray(new TrackSelection[renderers.length]);
|
emptyTrackSelections = new TrackSelectionArray(new TrackSelection[renderers.length]);
|
||||||
|
|
@ -189,6 +191,18 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
return repeatMode;
|
return repeatMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
|
if (this.shuffleModeEnabled != shuffleModeEnabled) {
|
||||||
|
this.shuffleModeEnabled = shuffleModeEnabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getShuffleModeEnabled() {
|
||||||
|
return shuffleModeEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLoading() {
|
public boolean isLoading() {
|
||||||
return isLoading;
|
return isLoading;
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,18 @@ public interface Player {
|
||||||
*/
|
*/
|
||||||
@RepeatMode int getRepeatMode();
|
@RepeatMode int getRepeatMode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether shuffling of windows is enabled.
|
||||||
|
*
|
||||||
|
* @param shuffleModeEnabled Whether shuffling is enabled.
|
||||||
|
*/
|
||||||
|
void setShuffleModeEnabled(boolean shuffleModeEnabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether shuffling of windows is enabled.
|
||||||
|
*/
|
||||||
|
boolean getShuffleModeEnabled();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the player is currently loading the source.
|
* Whether the player is currently loading the source.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -642,6 +642,16 @@ public class SimpleExoPlayer implements ExoPlayer {
|
||||||
player.setRepeatMode(repeatMode);
|
player.setRepeatMode(repeatMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
|
player.setShuffleModeEnabled(shuffleModeEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getShuffleModeEnabled() {
|
||||||
|
return player.getShuffleModeEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLoading() {
|
public boolean isLoading() {
|
||||||
return player.isLoading();
|
return player.isLoading();
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,16 @@ public class FakeSimpleExoPlayer extends SimpleExoPlayer {
|
||||||
return Player.REPEAT_MODE_OFF;
|
return Player.REPEAT_MODE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getShuffleModeEnabled() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLoading() {
|
public boolean isLoading() {
|
||||||
return isLoading;
|
return isLoading;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue