Closed Bug 1927557 Opened 10 months ago Closed 6 months ago

Video rotates from landscape to portrait Firefox Android

Categories

(Firefox for Android :: Media, defect)

Firefox 133
All
Android
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: djshawon327, Unassigned)

References

Details

(Whiteboard: [qa-triaged][fxdroid][group4])

User Agent: Mozilla/5.0 (Android 12; Mobile; rv:133.0) Gecko/133.0 Firefox/133.0

Steps to reproduce:

Open A Video Playback Site...Ex https://detodopeliculas.nu/pelicula/venom-el-ultimo-baile-2024/ Click Play > FullScreen > Try To Take 10-15 Minutes Forward/Backward Using Slider & Notice Video Getting Portrait From Landscape

Actual results:

Happens within a few minutes/Seconds Of Playing Any Video In FireFox Android

Phone is configured with automatic rotation disabled. If I Play a video & click landscape after 5-6 seconds the video will rotate back to portrait.

Poco X3 Pro
A12(MiUi 13.0.9)
FF Android Nightly 133.0a1

Expected results:

Videos Should've Stayed In LandScape

The Bugbug bot thinks this bug should belong to the 'Fenix::Media' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Media

The severity field is not set for this bug.
:titouan, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)

I cannot reproduce this on a Samsung S24, Android 14, Fenix 134. :djshawon327, do you have a way to reproduce it reliably, or is it intermitent? 

Do you have any addon installed? 
Thanks for reporting.

Flags: needinfo?(tthibaud)
Flags: needinfo?(djshawon327)

I was unable to reproduce this issue on the 133.0 Firefox for android, or Nightly 135.0a1.
Tested with Samsung Galaxy Note 8 (Android 9), and Google Pixel 6 (Android 15).
We will also test on the Poco devices available.

Maybe the reporter will offer more details.

Whiteboard: [qa-triaged]

Unfortunately I was not able to reproduce this on Firefox Nightly 135.0a1 on Poco X6 Pro (Android 14).

Are you still able to reproduce this issue? If yes, could you please attach a short video with the bug? Thanks!

I appear to be having the same issue. There doesn't seem to be any consistant cause for it, it simply happens at random. I use a Galaxy S23 and Firefox and Android are both up-to-date as of writing.
If you truely want video evidence I'd be willing to screen-record my Youtube viewing habits; though I don't know how much it would help.

:54mf4r3k, which version of Android and Firefox are you using, and on which device? 

If you manage to take a screen-record showing the bug, it can definitely be useful.
Thanks a lot for your help here

Flags: needinfo?(54mf4r3k)

It looks like a standard screen flip, but the phone was stationary and auto-rotate is off.
Phone settings say Android is version 14, and according to the Play Store, Firefox is version 133.0.2

Flags: needinfo?(54mf4r3k)

This also has been happening to me for years on Redmi Note 10, Android 12 SKQ1.201908.001, firefox nightly 135.0a1.

playing any youtube video for ~30 seconds reliably reproduces the issue for me.

This is possibly related to

https://github.com/ajayyy/SponsorBlock/issues/1993

Many users reported it there as a bug for the SponsorBlock plugin.

(In reply to Tobias H from comment #10)

This is possibly related to

https://github.com/ajayyy/SponsorBlock/issues/1993

Many users reported it there as a bug for the SponsorBlock plugin.

The issue seems to happen with all extensions disabled.

(In reply to greenscarf005 from comment #11)

(In reply to Tobias H from comment #10)

This is possibly related to

https://github.com/ajayyy/SponsorBlock/issues/1993

Many users reported it there as a bug for the SponsorBlock plugin.

The issue seems to happen with all extensions disabled.

To add to this, in some free time I have been looking into this SponsorBlock issue-

Personally I can only reproduce it with extensions that work with Fullscreen video enabled, SponsorBlock being one but also have found a couple others that trigger it.
Might be related, on my device can easily reproduce with extensions however others devices may face it without any.

For reference when debugging with remote via usb the phone UI and such will revert to portrait when it triggers, then any input with the Fullscreen video will send it back to landscape.
Happens randomly, sometimes when the extension skips a segment, and have also been able to force the bug by setting a system alarm and when it goes off, the bug triggers.
(again for me, Xiaomi 14, Firefox Nightly, Android 14, HyperOS 1.0.22.0, bit also with FF prod since around march, FF 124 ish, only with these extensions enabled).

Examples: both videos with rotation lock on (auto rotate disabled) with device held in landscape orientation. Using the alarm interaction to trigger it:

Extension Off
Extension On

have tried exploring DOM updates with USB debugging but have found nothing noteworthy so far

(In reply to dan from comment #13)

Examples: both videos with rotation lock on (auto rotate disabled) with device held in landscape orientation. Using the alarm interaction to trigger it:

Extension Off
Extension On

have tried exploring DOM updates with USB debugging but have found nothing noteworthy so far

Debugging/Exploring callstack video

Adding this, in case it is related it helps. For this issue it has been found that the bug can be triggered when a non persistent backround script goes from being inactive to active during Fullscreen video playback with phone autorotation disabled, as described here:

I believe the cause may be rooted in the background script being unloaded/removed, am currently testing with this change to help confirm, which just sets the background script to be persistent.
Not ideal in the long term, however for now running this artifact from local install on FF nightly and having had around 4hrs of videos played- the rotation issue is gone.

Correction: Not when it is removed, only when the runtime reloads it back in.

So when the background script (or 'event page' as it is referred to when persistence is false) is not running and an event (interacting with video controls, segment updates, or a segment skip etc) is called that requires a message to be handled and the script becomes active - this bug occurs.

Have experimented with narrowing down what about loafing the script causes this but haven't had much success- the event listeners that make up most of the script seem to all follow mdn web docs recommendations and practice, could be elsewhere in the utils or even node/react -Dom etc but I am not familiar enough with these to locate it. Could even be a FF issue more generally.

My reccomendation would be to simply set persistence to true as this mitigates the issue until more info, or there is an update for https://bugzilla.mozilla.org/show_bug.cgi?id=1927557. I would've liked to have found a fix that maintains inpersistance and therefore is manifest V3 ready, but since the script spends most of its time loaded on YT anyway and for Firefox Android there are no plans to remove V2 support I think I'll open a PR for this. At least then we can not have to use workarounds such as old vulnerable versions of FF, local addons, using autorotate etc.

(if a separate bug report is warranted/needed since this comment involves extension interaction, feel free to inform me)

To add to this, I took a mdn example extension and tested this- the same behaviour occours when the background script is loaded during Fullscreen video playback with autorotate off. Tested on an emulated Android 15 Google Pixel 9 Pro XL and my physical device. In both as soon as the backround script/even page was loaded either by the engine via the alarm, or manual reload in about:debugging, the bug occours and the video incorrectly rotates to portrait, with then any interaction with the media controls fixing this.
Example: https://youtu.be/2N7W9PvZfc0

This is using this extension which is only modified from the example one to have background "persistent": false in the manifest, would act the same if the manifest version was set to V3 also.
(and the alarm duration set down to 1 min from 5 to make demo/testing quicker)

Version wise I first noticed this with extension around this April, for sure this has been present since 124, and it is not present in 122.

See Also: → 1937603

https://bugzilla.mozilla.org/show_bug.cgi?id=1937603

most annoying bug I experienced on FF android so far.

Updated to S2 as PM has pointed this out as a top 2024 user issue.

Severity: -- → S2
Whiteboard: [qa-triaged] → [qa-triaged][fxdroid][group4]

QA and Android team wasn't able to reproduce this.

Status: UNCONFIRMED → RESOLVED
Closed: 6 months ago
Flags: needinfo?(djshawon327)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.