Open Bug 1750416 Opened 4 years ago Updated 7 months ago

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)

Firefox 96
Unspecified
All
defect

Tracking

(firefox118 wontfix, firefox119 wontfix, firefox120 wontfix)

Tracking Status
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:

  1. Created a new project with Android Studio 2020.3.1 and added GeckoView 96 as a dependency.
  2. Updated activity_main.xml to add a GeckoView centered in the screen that occupies 70% of the screen's width and height.
  3. Updated MainActivity.java to call GeckoSession.setContentDelegate() with a ContentDelegate, and made it so that a YouTube video is loaded.
  4. 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).

Attached image before-fullscreen.png
Severity: -- → S3
Priority: -- → P3

Any update on this issue? This is critical in VR.

Flags: needinfo?(amoya)

Hope for update. This is critical in VR.

Moving some media bugs to the new GeckoView::Media component.

Component: General → Media

This issue first appeared in GeckoView 81 (I didn't experience the issue with GeckoView 80).

Flags: needinfo?(amoya)
Keywords: regression

Any update on this bug?

Any update on this issue?

Is there really still no update on this issue?

Please, it would be good to have a statement about the progress, if any, on this issue. Thanks !

Flags: needinfo?(cpeterson)

Sorry, no update on this issue.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(cpeterson)

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

:kats, since you are the author of the regressor, bug 1656223, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(kats)

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.

Flags: needinfo?(kats)

(If we implement bug 1492081, we have a change to make breaking change for this API).

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.

I found a workaround for this issue for my use case:

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?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: