mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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
|
@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();
|
updatePlayPauseButton();
|
||||||
updateProgress();
|
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)
|
@RequiresApi(23)
|
||||||
private static void configureEditModeLogoV23(Resources resources, ImageView logo) {
|
private static void configureEditModeLogoV23(Resources resources, ImageView logo) {
|
||||||
logo.setImageDrawable(resources.getDrawable(R.drawable.exo_edit_mode_logo, null));
|
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
|
// Player.EventListener implementation
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerStateChanged(boolean playWhenReady, @Player.State int playbackState) {
|
public void onPlaybackStateChanged(@Player.State int playbackState) {
|
||||||
updateBuffering();
|
updateBuffering();
|
||||||
updateErrorMessage();
|
updateErrorMessage();
|
||||||
if (isPlayingAd() && controllerHideDuringAds) {
|
updateControllerVisibility();
|
||||||
hideController();
|
}
|
||||||
} else {
|
|
||||||
maybeShowController(false);
|
@Override
|
||||||
}
|
public void onPlayWhenReadyChanged(
|
||||||
|
boolean playWhenReady, @Player.PlayWhenReadyChangeReason int reason) {
|
||||||
|
updateBuffering();
|
||||||
|
updateControllerVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue