Commit 3dc9225b by bachinger Committed by kim-vde

remove deprecated usage of onPlayerStateChanged in ui components

PiperOrigin-RevId: 294182858
parent d8802df6
......@@ -1221,7 +1221,14 @@ public class PlayerControlView extends FrameLayout {
}
@Override
public void onPlayerStateChanged(boolean playWhenReady, @Player.State int playbackState) {
public void onPlaybackStateChanged(@Player.State int playbackState) {
updatePlayPauseButton();
updateProgress();
}
@Override
public void onPlayWhenReadyChanged(
boolean playWhenReady, @Player.PlayWhenReadyChangeReason int reason) {
updatePlayPauseButton();
updateProgress();
}
......
......@@ -1418,6 +1418,14 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
}
}
private void updateControllerVisibility() {
if (isPlayingAd() && controllerHideDuringAds) {
hideController();
} else {
maybeShowController(false);
}
}
@RequiresApi(23)
private static void configureEditModeLogoV23(Resources resources, ImageView logo) {
logo.setImageDrawable(resources.getDrawable(R.drawable.exo_edit_mode_logo, null));
......@@ -1532,14 +1540,17 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
// Player.EventListener implementation
@Override
public void onPlayerStateChanged(boolean playWhenReady, @Player.State int playbackState) {
public void onPlaybackStateChanged(@Player.State int playbackState) {
updateBuffering();
updateErrorMessage();
if (isPlayingAd() && controllerHideDuringAds) {
hideController();
} else {
maybeShowController(false);
}
updateControllerVisibility();
}
@Override
public void onPlayWhenReadyChanged(
boolean playWhenReady, @Player.PlayWhenReadyChangeReason int reason) {
updateBuffering();
updateControllerVisibility();
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment