Skip to content

Commit

Permalink
Fix regression in screen rotation animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Aug 24, 2022
1 parent 5e094ab commit 8b7c785
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,14 @@ private boolean isAutoplayEnabled() {
}

private void tryAddVideoPlayerView() {
// do all the null checks in the posted lambda, since the player, the binding and the view
// could be set or unset before the lambda gets executed on the next main thread cycle
if (isPlayerAvailable() && getView() != null) {
// Setup the surface view height, so that it fits the video correctly; this is done also
// here, and not only in the Handler, to avoid a choppy fullscreen rotation animation.
setHeightThumbnail();
}

// do all the null checks in the posted lambda, too, since the player, the binding and the
// view could be set or unset before the lambda gets executed on the next main thread cycle
new Handler(Looper.getMainLooper()).post(() -> {
if (!isPlayerAvailable() || getView() == null) {
return;
Expand Down

0 comments on commit 8b7c785

Please sign in to comment.