Skip to content

Commit

Permalink
refactor(YouTube - Exit fullscreen mode): Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Dec 27, 2024
1 parent b61c8ec commit 6531273
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ public static void endOfVideoReached() {
}

if (PlayerType.getCurrent() == PlayerType.WATCH_WHILE_FULLSCREEN) {
if (Utils.isLandscapeOrientation()) {
if (mode == FullscreenMode.PORTRAIT) {
if (mode != FullscreenMode.PORTRAIT_LANDSCAPE) {
if (Utils.isLandscapeOrientation()) {
if (mode == FullscreenMode.PORTRAIT) {
return;
}
} else if (mode == FullscreenMode.LANDSCAPE) {
return;
}
} else if (mode == FullscreenMode.LANDSCAPE) {
return;
}

ImageView fullscreenButton = PlayerControlsPatch.fullscreenButtonRef.get();
if (fullscreenButton != null) {
if (fullscreenButton == null) {
Logger.printDebug(() -> "Fullscreen button is null, cannot click");
} else {
Logger.printDebug(() -> "Clicking fullscreen button");
fullscreenButton.performClick();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ private static boolean fullscreenButtonVisibilityCallbacksExist() {
*/
public static void setFullscreenCloseButton(ImageView imageButton) {
fullscreenButtonRef = new WeakReference<>(imageButton);
Logger.printDebug(() -> "Fullscreen button set");

if (!fullscreenButtonVisibilityCallbacksExist()) {
return;
Expand Down

0 comments on commit 6531273

Please sign in to comment.