Fullscreen video is cropped / incorrect size if the browser doesn't occupy the entire screen and a ContentDelegate is set
Categories
(GeckoView :: Media, defect, P3)
Tracking
(firefox118 wontfix, firefox119 wontfix, firefox120 wontfix)
People
(Reporter: nate, Unassigned)
References
(Regression)
Details
(Keywords: regression)
Attachments
(4 files)
Steps to reproduce:
Hello! I attached a minimal Android Studio project that reproduces the issue. Here are the steps I took to create it:
- Created a new project with Android Studio 2020.3.1 and added GeckoView 96 as a dependency.
- Updated activity_main.xml to add a GeckoView centered in the screen that occupies 70% of the screen's width and height.
- Updated MainActivity.java to call GeckoSession.setContentDelegate() with a ContentDelegate, and made it so that a YouTube video is loaded.
- When running the app, I play the video and then tap its fullscreen button to make it go fullscreen.
Also, some additional info:
- This issue first appeared in GeckoView 81 (I didn't experience the issue with GeckoView 80).
- I develop a library for using GeckoView in Unity VR applications, so for that use case, the browser is always a different size from the device's native screen size.
Actual results:
When a ContentDelegate is set with GeckoSession.setContentDelegate(), the fullscreen video is cropped to show only the top left corner of the video because the video's size is too large (shown in the attached image fullscreen-with-ContentDelegate.png). It appears that that the video's size is set to the size of the entire screen, however it should be smaller because the GeckoView doesn't occupy the entire screen.
Expected results:
Instead, the fullscreen video should correctly sized to the size of the GeckoView. For example, if the call to setContentDelegate() in MainActivity.java is commented out, the fullscreen video is sized correctly (shown in the attached image fullscreen-without-ContentDelegate.png).
Updated•4 years ago
|
Any update on this issue? This is critical in VR.
Comment 5•3 years ago
|
||
Hope for update. This is critical in VR.
Comment 6•3 years ago
|
||
Moving some media bugs to the new GeckoView::Media component.
Comment 7•3 years ago
|
||
This issue first appeared in GeckoView 81 (I didn't experience the issue with GeckoView 80).
Comment 8•3 years ago
|
||
Any update on this bug?
Comment 10•2 years ago
|
||
Is there really still no update on this issue?
Comment 11•2 years ago
|
||
Please, it would be good to have a statement about the progress, if any, on this issue. Thanks !
Comment 12•2 years ago
|
||
Sorry, no update on this issue.
Updated•2 years ago
|
Comment 13•2 years ago
|
||
FYI:
I've done some bisection based on the attachment project.
I found that
First Bad 81.0.20200816094524 01c8bc283e34f95f3550eb0641a3c82fdef7c443
Last Good 81.0.20200815093117 7dcb2bda35c7d725759ffa5f53578898e0256662
Digging the changelog https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=7dcb2bda35c7d725759ffa5f53578898e0256662&tochange=01c8bc283e34f95f3550eb0641a3c82fdef7c443
I guess the most suspicious one is https://hg.mozilla.org/mozilla-central/rev/0b3e25d09ce87fa79014a9b0bd92f59eb6830ee5 for Bug 1656223
Comment 14•2 years ago
|
||
:kats, since you are the author of the regressor, bug 1656223, could you take a look?
For more information, please visit BugBot documentation.
Comment 15•2 years ago
•
|
||
I have looked this sample. If fullscreen is requested, browser app should handle it. But sample app has no implementation for onFullscreen API. GeckoView expects this is implemented.
When I add the following (copy from GVE), it works fine.
@Override
public void onFullScreen(final GeckoSession session, final boolean fullScreen) {
getWindow()
.setFlags(
fullScreen ? WindowManager.LayoutParams.FLAG_FULLSCREEN : 0,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (fullScreen) {
getSupportActionBar().hide();
} else {
getSupportActionBar().show();
}
}
Of course, if it is possible to do breaking change, we can reject fullscreen when onFullscreen isn't implemented. But it is another issue.
Comment 16•2 years ago
•
|
||
(If we implement bug 1492081, we have a change to make breaking change for this API).
Reporter | ||
Comment 17•1 year ago
|
||
To clarify, adding FLAG_FULLSCREEN to the app's window doesn't make sense for our use case (VR / rendering to a texture). Here are the relevant details from my initial bug report:
I develop a library for using GeckoView in Unity VR applications, so for that use case, the browser is always a different size from the device's native screen size.
When a ContentDelegate is set with GeckoSession.setContentDelegate(), the fullscreen video is cropped to show only the top left corner of the video because the video's size is too large (shown in the attached image fullscreen-with-ContentDelegate.png). It appears that that the video's size is set to the size of the entire screen, however it should be smaller because the GeckoView doesn't occupy the entire screen.
Reporter | ||
Comment 18•8 months ago
|
||
I found a workaround for this issue for my use case:
- Listen to MediaSession.Delegate.onFullscreen() to get the width and height of the fullscreen element from MediaSession.ElementMetadata.
- Resize the Surface to which the application renders to match the dimensions of the fullscreen element.
Comment 19•7 months ago
|
||
Hi,
Just wanted to mention that this bug is present in Firefox Android and all Gecko-based browsers on Meta Quest devices and also likely on upcoming AndroidXR devices. Resizing the window triggers the fullscreened content to be fixed, but I haven't figured out how to manually trigger the relayout this is doing, but potentially this could be fixed without breaking changes to the API?
Description
•