mirror of
https://github.com/samsonjs/media.git
synced 2026-04-03 10:55:48 +00:00
remove deprecated usage of onPlayerStateChanged in ui components
PiperOrigin-RevId: 294182858
This commit is contained in:
parent
d8802df62e
commit
3dc9225bab
2 changed files with 25 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue