Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request landscape orientation when going full screen #3478

Closed
wants to merge 1 commit into from

Conversation

mtsyh
Copy link

@mtsyh mtsyh commented Aug 18, 2023

Task/Issue URL: #3250

Description

Steps to test this PR

  • Open a YouTube video
  • After playback starts, tap the full screen button
  • Observe full screen playback in landscape mode rather than portrait

Notes

  • Unfortunately, Android seems to have removed the onShowCustomView API
    which allowed the WebView to specify full screen orientation. In that case, we might want to force landscape, as in this PR, because our browser orientation seems to be locked in portrait.
  • I left the code which allows the WebView to specify the orientation, in case someone had feedback on another way we could find the requested orientation. If there is no longer any way to do this on Android, we can remove this code and just set landscape in toggleFullScreen without piping through BrowserViewState.

UI changes

Before After
Before - Portrait After - Landscape

@@ -56,7 +58,7 @@ class BrowserChromeClient @Inject constructor(
}

customView = view
webViewClientListener?.goFullScreen(view)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented code here demonstrates what was possible with the previous API. Since there isn't currently a way to retrieve requestedOrientation from the WebView we default to SCREEN_ORIENTATION_LANDSCAPE.

@cmonfortep
Copy link
Contributor

Sorry for the late response here. We are currently checking staled PRs, and we are closing this one as per our contributions guidelines, we only accept contributions for accepted issues and labeled as Help Wanted. Thanks

@cmonfortep cmonfortep closed this Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants