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) + "]");
|
Log.d(TAG, "repeatMode [" + getRepeatModeString(repeatMode) + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
Log.d(TAG, "shuffleModeEnabled [" + shuffleModeEnabled + "]");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPositionDiscontinuity() {
|
public void onPositionDiscontinuity() {
|
||||||
Log.d(TAG, "positionDiscontinuity");
|
Log.d(TAG, "positionDiscontinuity");
|
||||||
|
@ -501,6 +501,11 @@ public class PlayerActivity extends Activity implements OnClickListener, EventLi
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPositionDiscontinuity() {
|
public void onPositionDiscontinuity() {
|
||||||
if (inErrorState) {
|
if (inErrorState) {
|
||||||
|
@ -132,6 +132,11 @@ public class FlacPlaybackTest extends InstrumentationTestCase {
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
private void releasePlayerAndQuitLooper() {
|
private void releasePlayerAndQuitLooper() {
|
||||||
player.release();
|
player.release();
|
||||||
Looper.myLooper().quit();
|
Looper.myLooper().quit();
|
||||||
|
@ -566,6 +566,11 @@ public final class ImaAdsLoader implements Player.EventListener, VideoAdPlayer,
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(ExoPlaybackException error) {
|
public void onPlayerError(ExoPlaybackException error) {
|
||||||
if (playingAd) {
|
if (playingAd) {
|
||||||
|
@ -271,6 +271,11 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter {
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
// SimpleExoplayerView.Callback implementation.
|
// SimpleExoplayerView.Callback implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -619,6 +619,11 @@ public final class MediaSessionConnector {
|
|||||||
updateMediaSessionPlaybackState();
|
updateMediaSessionPlaybackState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// TODO: Support shuffle mode in MediaSessionConnector.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(ExoPlaybackException error) {
|
public void onPlayerError(ExoPlaybackException error) {
|
||||||
playbackException = error;
|
playbackException = error;
|
||||||
|
@ -132,6 +132,11 @@ public class OpusPlaybackTest extends InstrumentationTestCase {
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
private void releasePlayerAndQuitLooper() {
|
private void releasePlayerAndQuitLooper() {
|
||||||
player.release();
|
player.release();
|
||||||
Looper.myLooper().quit();
|
Looper.myLooper().quit();
|
||||||
|
@ -164,6 +164,11 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
private void releasePlayerAndQuitLooper() {
|
private void releasePlayerAndQuitLooper() {
|
||||||
player.release();
|
player.release();
|
||||||
Looper.myLooper().quit();
|
Looper.myLooper().quit();
|
||||||
|
@ -195,6 +195,9 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
|||||||
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
public void setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
if (this.shuffleModeEnabled != shuffleModeEnabled) {
|
if (this.shuffleModeEnabled != shuffleModeEnabled) {
|
||||||
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);
|
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}
|
* 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
|
* 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.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPositionDiscontinuity() {
|
public void onPositionDiscontinuity() {
|
||||||
updateAndPost();
|
updateAndPost();
|
||||||
|
@ -1079,6 +1079,11 @@ public class PlaybackControlView extends FrameLayout {
|
|||||||
updateNavigation();
|
updateNavigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// TODO: Update UI.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPositionDiscontinuity() {
|
public void onPositionDiscontinuity() {
|
||||||
updateNavigation();
|
updateNavigation();
|
||||||
|
@ -896,6 +896,11 @@ public final class SimpleExoPlayerView extends FrameLayout {
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(ExoPlaybackException e) {
|
public void onPlayerError(ExoPlaybackException e) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
|
@ -411,6 +411,11 @@ public abstract class Action {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(ExoPlaybackException error) {
|
public void onPlayerError(ExoPlaybackException error) {
|
||||||
|
|
||||||
|
@ -235,6 +235,11 @@ public abstract class ExoHostedTest implements HostedTest, Player.EventListener,
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onPlayerError(ExoPlaybackException error) {
|
public final void onPlayerError(ExoPlaybackException error) {
|
||||||
playerWasPrepared = true;
|
playerWasPrepared = true;
|
||||||
|
@ -360,6 +360,11 @@ public final class ExoPlayerTestRunner implements Player.EventListener {
|
|||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(ExoPlaybackException error) {
|
public void onPlayerError(ExoPlaybackException error) {
|
||||||
handleException(exception);
|
handleException(exception);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user