rename getPlaybackError

PiperOrigin-RevId: 294074348
This commit is contained in:
bachinger 2020-02-09 12:37:48 +00:00 committed by kim-vde
parent ecc04b2b6f
commit c02933ac0a
8 changed files with 36 additions and 3 deletions

View File

@ -9,6 +9,7 @@
* Add `Player.onPlayWhenReadyChanged` with reasons.
* Add `Player.onPlaybackStateChanged` and deprecate
`Player.onPlayerStateChanged`.
* Deprecate and rename getPlaybackError to getPlayerError for consistency.
* Make `MediaSourceEventListener.LoadEventInfo` and
`MediaSourceEventListener.MediaLoadData` top-level classes.
* Rename `MediaCodecRenderer.onOutputFormatChanged` to

View File

@ -337,9 +337,16 @@ public final class CastPlayer extends BasePlayer {
return Player.PLAYBACK_SUPPRESSION_REASON_NONE;
}
@Deprecated
@Override
@Nullable
public ExoPlaybackException getPlaybackError() {
return getPlayerError();
}
@Override
@Nullable
public ExoPlaybackException getPlayerError() {
return null;
}

View File

@ -752,7 +752,7 @@ public final class MediaSessionConnector {
customActionMap = Collections.unmodifiableMap(currentActions);
Bundle extras = new Bundle();
@Nullable ExoPlaybackException playbackError = player.getPlaybackError();
@Nullable ExoPlaybackException playbackError = player.getPlayerError();
boolean reportError = playbackError != null || customError != null;
int sessionPlaybackState =
reportError

View File

@ -240,9 +240,16 @@ import java.util.concurrent.TimeoutException;
return playbackSuppressionReason;
}
@Deprecated
@Override
@Nullable
public ExoPlaybackException getPlaybackError() {
return getPlayerError();
}
@Override
@Nullable
public ExoPlaybackException getPlayerError() {
return playbackInfo.playbackError;
}

View File

@ -755,6 +755,11 @@ public interface Player {
* @return The error, or {@code null}.
*/
@Nullable
ExoPlaybackException getPlayerError();
/** @deprecated Use {@link #getPlayerError()} instead. */
@Deprecated
@Nullable
ExoPlaybackException getPlaybackError();
/**

View File

@ -1163,11 +1163,18 @@ public class SimpleExoPlayer extends BasePlayer
return player.getPlaybackSuppressionReason();
}
@Deprecated
@Override
@Nullable
public ExoPlaybackException getPlaybackError() {
return getPlayerError();
}
@Override
@Nullable
public ExoPlaybackException getPlayerError() {
verifyApplicationThread();
return player.getPlaybackError();
return player.getPlayerError();
}
/** @deprecated Use {@link #prepare()} instead. */

View File

@ -1393,7 +1393,7 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
errorMessageView.setVisibility(View.VISIBLE);
return;
}
@Nullable ExoPlaybackException error = player != null ? player.getPlaybackError() : null;
@Nullable ExoPlaybackException error = player != null ? player.getPlayerError() : null;
if (error != null && errorMessageProvider != null) {
CharSequence errorMessage = errorMessageProvider.getErrorMessage(error).second;
errorMessageView.setText(errorMessage);

View File

@ -89,11 +89,17 @@ public abstract class StubExoPlayer extends BasePlayer implements ExoPlayer {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public ExoPlaybackException getPlaybackError() {
throw new UnsupportedOperationException();
}
@Override
public ExoPlaybackException getPlayerError() {
throw new UnsupportedOperationException();
}
/** @deprecated Use {@link #prepare()} instead. */
@Deprecated
@Override