Add listener callback for shuffle mode changes.
The listener implementations do not do anything yet. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=166056933
This commit is contained in:
parent
52ec70dd80
commit
b9a6a40539
@ -99,6 +99,11 @@ import java.util.Locale;
|
||||
Log.d(TAG, "repeatMode [" + getRepeatModeString(repeatMode) + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
Log.d(TAG, "shuffleModeEnabled [" + shuffleModeEnabled + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPositionDiscontinuity() {
|
||||
Log.d(TAG, "positionDiscontinuity");
|
||||
|
@ -501,6 +501,11 @@ public class PlayerActivity extends Activity implements OnClickListener, EventLi
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPositionDiscontinuity() {
|
||||
if (inErrorState) {
|
||||
|
@ -132,6 +132,11 @@ public class FlacPlaybackTest extends InstrumentationTestCase {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
private void releasePlayerAndQuitLooper() {
|
||||
player.release();
|
||||
Looper.myLooper().quit();
|
||||
|
@ -566,6 +566,11 @@ public final class ImaAdsLoader implements Player.EventListener, VideoAdPlayer,
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(ExoPlaybackException error) {
|
||||
if (playingAd) {
|
||||
|
@ -271,6 +271,11 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
// SimpleExoplayerView.Callback implementation.
|
||||
|
||||
@Override
|
||||
|
@ -619,6 +619,11 @@ public final class MediaSessionConnector {
|
||||
updateMediaSessionPlaybackState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// TODO: Support shuffle mode in MediaSessionConnector.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(ExoPlaybackException error) {
|
||||
playbackException = error;
|
||||
|
@ -132,6 +132,11 @@ public class OpusPlaybackTest extends InstrumentationTestCase {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
private void releasePlayerAndQuitLooper() {
|
||||
player.release();
|
||||
Looper.myLooper().quit();
|
||||
|
@ -164,6 +164,11 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
private void releasePlayerAndQuitLooper() {
|
||||
player.release();
|
||||
Looper.myLooper().quit();
|
||||
|
@ -195,6 +195,9 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||
if (this.shuffleModeEnabled != shuffleModeEnabled) {
|
||||
this.shuffleModeEnabled = shuffleModeEnabled;
|
||||
for (Player.EventListener listener : listeners) {
|
||||
listener.onShuffleModeEnabledChanged(shuffleModeEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -527,3 +530,4 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,13 @@ public interface Player {
|
||||
*/
|
||||
void onRepeatModeChanged(@RepeatMode int repeatMode);
|
||||
|
||||
/**
|
||||
* Called when the value of {@link #getShuffleModeEnabled()} changes.
|
||||
*
|
||||
* @param shuffleModeEnabled Whether shuffling of windows is enabled.
|
||||
*/
|
||||
void onShuffleModeEnabledChanged(boolean shuffleModeEnabled);
|
||||
|
||||
/**
|
||||
* Called when an error occurs. The playback state will transition to {@link #STATE_IDLE}
|
||||
* immediately after this method is called. The player instance can still be used, and
|
||||
|
@ -93,6 +93,11 @@ public final class DebugTextViewHelper implements Runnable, Player.EventListener
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPositionDiscontinuity() {
|
||||
updateAndPost();
|
||||
|
@ -1079,6 +1079,11 @@ public class PlaybackControlView extends FrameLayout {
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// TODO: Update UI.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPositionDiscontinuity() {
|
||||
updateNavigation();
|
||||
|
@ -896,6 +896,11 @@ public final class SimpleExoPlayerView extends FrameLayout {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(ExoPlaybackException e) {
|
||||
// Do nothing.
|
||||
|
@ -411,6 +411,11 @@ public abstract class Action {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(ExoPlaybackException error) {
|
||||
|
||||
|
@ -235,6 +235,11 @@ public abstract class ExoHostedTest implements HostedTest, Player.EventListener,
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPlayerError(ExoPlaybackException error) {
|
||||
playerWasPrepared = true;
|
||||
|
@ -360,6 +360,11 @@ public final class ExoPlayerTestRunner implements Player.EventListener {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(ExoPlaybackException error) {
|
||||
handleException(exception);
|
||||
|
Loading…
x
Reference in New Issue
Block a user