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

Video rotates from landscape to portrait Firefox Android #1993

Open
caeci11ius opened this issue Apr 1, 2024 · 26 comments
Open

Video rotates from landscape to portrait Firefox Android #1993

caeci11ius opened this issue Apr 1, 2024 · 26 comments

Comments

@caeci11ius
Copy link

This was working really nicely on the Android version of Firefox until about a week ago. Since then, it's been causing the video player to rotate back to portrait periodically during playback (sometimes seems associated with skips, but not always). Happens within a few minutes regardless.

Phone is configured with automatic rotation disabled. Commencing in portrait, Firefox will rotate to landscape when fullscreen playback is selected. After a few minutes of playback with sponsorblock running, the video will rotate back to portrait. Skipping forward/back using double tap restores landscape orientation, as does exiting and re-entering fullscreen. Disabling plugin fixes the issue.

Plugin version 5.5.9
Firefox version 124.1.0
Pixel 7 Pro 5 March 2024 firmware

@Wolfdv1
Copy link

Wolfdv1 commented Apr 1, 2024

+1 came to report the exact same behaviour, as well as doing so randomly and during skips, seems to sometimes react to touch input to the screen

Version Info:

{
"debug": {
    "userAgent": "Mozilla/5.0 (Android 13; Mobile; rv:124.0) Gecko/124.0 Firefox/124.0",
    "platform": "Linux armv81",
    "language": "en-GB",
    "extensionVersion": "5.5.9"
},
"config": {
    "allowScrollingToEdit": true,
    "autoSkipOnMusicVideosUpdate": true,
    "categoryPillUpdate": true,
    "chapterCategoryAdded": true,
    "dontShowNotice": false,
    "hideUploadButtonPlayerControls": true,
    "invidiousInstances": 33,
    "isVip": false,
    "minutesSaved": 953.4461867000002,
    "permissions": {
        "sponsor": true,
        "selfpromo": true,
        "exclusive_access": true,
        "interaction": true,
        "intro": true,
        "outro": true,
        "preview": true,
        "music_offtopic": true,
        "filler": true,
        "poi_highlight": true,
        "chapter": false
    },
    "showPopupDonationCount": 2,
    "showZoomToFillError2": false,
    "skipCount": 1201,
    "defaultCategory": "chooseACategory",
    "renderSegmentsAsChapters": false,
    "whitelistedChannels": 0,
    "forceChannelCheck": false,
    "sponsorTimesContributed": 0,
    "submissionCountSinceCategories": 0,
    "showTimeWithSkips": true,
    "disableSkipping": false,
    "muteSegments": true,
    "fullVideoSegments": true,
    "fullVideoLabelsOnThumbnails": true,
    "manualSkipOnFullVideo": false,
    "trackViewCount": true,
    "trackViewCountInPrivate": true,
    "trackDownvotes": true,
    "trackDownvotesInPrivate": false,
    "noticeVisibilityMode": 3,
    "hideVideoPlayerControls": false,
    "hideInfoButtonPlayerControls": false,
    "hideDeleteButtonPlayerControls": false,
    "hideSkipButtonPlayerControls": false,
    "hideDiscordLaunches": 0,
    "hideDiscordLink": false,
    "supportInvidious": false,
    "serverAddress": "Default server address",
    "minDuration": 0,
    "skipNoticeDuration": 4,
    "audioNotificationOnSkip": false,
    "checkForUnlistedVideos": false,
    "testingServer": false,
    "refetchWhenNotFound": true,
    "ytInfoPermissionGranted": false,
    "allowExpirements": true,
    "showDonationLink": true,
    "showUpsells": true,
    "showNewFeaturePopups": true,
    "donateClicked": 0,
    "autoHideInfoButton": true,
    "autoSkipOnMusicVideos": false,
    "scrollToEditTimeUpdate": false,
    "showChapterInfoMessage": true,
    "darkMode": true,
    "showCategoryGuidelines": true,
    "showCategoryWithoutPermission": false,
    "showSegmentNameInChapterBar": true,
    "useVirtualTime": true,
    "showSegmentFailedToFetchWarning": true,
    "deArrowInstalled": false,
    "showDeArrowPromotion": true,
    "showDeArrowInSettings": true,
    "shownDeArrowPromotion": false,
    "cleanPopup": false,
    "categoryPillColors": {},
    "skipKeybind": {
        "key": "Enter"
    },
    "skipToHighlightKeybind": {
        "key": "Enter",
        "ctrl": true
    },
    "startSponsorKeybind": {
        "key": ";"
    },
    "submitKeybind": {
        "key": "'"
    },
    "actuallySubmitKeybind": {
        "key": "'",
        "ctrl": true
    },
    "previewKeybind": {
        "key": ";",
        "ctrl": true
    },
    "nextChapterKeybind": {
        "key": "ArrowRight",
        "ctrl": true
    },
    "previousChapterKeybind": {
        "key": "ArrowLeft",
        "ctrl": true
    },
    "closeSkipNoticeKeybind": {
        "key": "Backspace"
    },
    "categorySelections": [
        {
            "name": "sponsor",
            "option": 2
        },
        {
            "name": "poi_highlight",
            "option": 1
        },
        {
            "name": "exclusive_access",
            "option": 0
        },
        {
            "name": "chapter",
            "option": 0
        }
    ],
    "payments": {
        "licenseKey": null,
        "lastCheck": 0,
        "lastFreeCheck": 0,
        "freeAccess": false,
        "chaptersAllowed": false
    },
    "colorPalette": {
        "red": "#780303",
        "white": "#ffffff",
        "locked": "#ffc83d"
    },
    "barTypes": {
        "preview-chooseACategory": {
            "color": "#ffffff",
            "opacity": "0.7"
        },
        "sponsor": {
            "color": "#00d400",
            "opacity": "0.7"
        },
        "preview-sponsor": {
            "color": "#007800",
            "opacity": "0.7"
        },
        "selfpromo": {
            "color": "#ffff00",
            "opacity": "0.7"
        },
        "preview-selfpromo": {
            "color": "#bfbf35",
            "opacity": "0.7"
        },
        "exclusive_access": {
            "color": "#008a5c",
            "opacity": "0.7"
        },
        "interaction": {
            "color": "#cc00ff",
            "opacity": "0.7"
        },
        "preview-interaction": {
            "color": "#6c0087",
            "opacity": "0.7"
        },
        "intro": {
            "color": "#00ffff",
            "opacity": "0.7"
        },
        "preview-intro": {
            "color": "#008080",
            "opacity": "0.7"
        },
        "outro": {
            "color": "#0202ed",
            "opacity": "0.7"
        },
        "preview-outro": {
            "color": "#000070",
            "opacity": "0.7"
        },
        "preview": {
            "color": "#008fd6",
            "opacity": "0.7"
        },
        "preview-preview": {
            "color": "#005799",
            "opacity": "0.7"
        },
        "music_offtopic": {
            "color": "#ff9900",
            "opacity": "0.7"
        },
        "preview-music_offtopic": {
            "color": "#a6634a",
            "opacity": "0.7"
        },
        "poi_highlight": {
            "color": "#ff1684",
            "opacity": "0.7"
        },
        "preview-poi_highlight": {
            "color": "#9b044c",
            "opacity": "0.7"
        },
        "filler": {
            "color": "#7300FF",
            "opacity": "0.9"
        },
        "preview-filler": {
            "color": "#2E0066",
            "opacity": "0.7"
        }
    }
}
}

@Bucketsmith
Copy link

I guess this is the problem I keep having on Android Firefox, as well.

@Wolfdv1
Copy link

Wolfdv1 commented Jun 9, 2024

Update:

Based on the time that I think this bug started happening, I found the firefox releases around that time and after trying v122 of Firefox android with sponsor block, the issue is not present. Must've been a change in Firefox Android 122.0.1+ that is causing this

In case anyone wants to rush using an outdated version to continue using sponsor block without this issue:
https://github.com/mozilla-mobile/firefox-android/releases/tag/fenix-v122.0.1 (you could also use a beta of 122 instead to have a separate app for just streaming videos with sponsor block)

@whitequark
Copy link

I'm also experiencing this issue.

@caeci11ius
Copy link
Author

caeci11ius commented Sep 14, 2024

As a semi-workaround, this still happens if you enable auto-rotation, but you won't notice it mostly. The exception is if your device is flat on a table or something where the orientation isn't clear (in which case picking it up will fix).

Annoying, but mostly does the job if you can handle having autorotation switched on (I found I mostly can, though can cause the odd issue using phone in bed). Still be nice if it was fixed though given it used to just work properly...might be why few people seem to have noticed though.

And while I'm here: still happening in Firefox 130.

@Wolfdv1
Copy link

Wolfdv1 commented Sep 15, 2024 via email

@Bucketsmith
Copy link

Tap forward or backward to move 10s, then the other way to come back where you left.
It will revert back to fullscreen landscape.

Sidenote, outdated versions run the risk of unpatched security flaws, it is not recommended to use them.

@whitequark
Copy link

I would have to destroy my Firefox profile to downgrade, since Android no longer allows downgrading applications over an old installation :(

@Wolfdv1
Copy link

Wolfdv1 commented Sep 16, 2024 via email

@whitequark
Copy link

Thanks for looking into the issue! Much appreciated.

@lukakostic
Copy link

Same issue here. I dont have any extensions. v133.0

Happens randomly over time or when tapping the video in fullscreen (to show time bar or to fast forward / back).
Rotation is locked. Happens on any fullscreen videos.

@whitequark
Copy link

It bothers me so much... I've been sick the last few weeks and youtube was kind of the only thing I had energy for, and the endless rotation bug was such an annoyance.

@PhoenixIV
Copy link

Workaround available

#1993 (comment)

In case anyone wants to rush using an outdated version of Firefox to continue using sponsor block without this issue: https://github.com/mozilla-mobile/firefox-android/releases/tag/fenix-v122.0.1

If you use Firefox as your daily driver (which you probably do as you are here in this thread) use Fennec 122.0.0 instead:
https://f-droid.org/archive/org.mozilla.fennec_fdroid_1220020.apk
(Also available trough the F-Droid ARCHIVE repository)

Make sure to set your stores to not update the app and do not use this browser for anything different than YouTube to prevent from security issues.

@caeci11ius
Copy link
Author

caeci11ius commented Dec 7, 2024

Surely using your phone with auto rotate enabled (which MOSTLY resolves this, providing your phone has clear orientation and isn't flat on a table) is a better workaround than using a long outdated version of a web browser. Don't get me wrong, this issue really sucks. But don't use a really old browser and lose every security fix that's been published in months. Frankly, disabling sponsorblock entirely and living with ads would be a better solution than that.

@whitequark
Copy link

If you use Firefox as your daily driver (which you probably do as you are here in this thread) use Fennec 122.0.0 instead:
https://f-droid.org/archive/org.mozilla.fennec_fdroid_1220020.apk
(Also available trough the F-Droid ARCHIVE repository)

Thanks much! Another option that I discovered recently is PipePipe (a NewPipe fork) which seems to work well for long-form videos, sans a few issues with subtitles. I will probably stick to the browser personally, but others who look up this thread might want to consider PipePipe instead.

Surely using your phone with auto rotate enabled (which MOSTLY resolves this, providing your phone has clear orientation and isn't flat on a table)

I end up lying in bed in one of the few ways that hurt somewhat less than the rest, and the phone ends up in whichever orientation it gets.

Don't get me wrong, this issue really sucks. But don't use a really old browser and lose every security fix that's been published in months. Frankly, disabling sponsorblock entirely and living with ads would be a better solution than that.

Risk acceptance is a perfectly reasonable option. (I would ask you to describe the threat model you're considering here, but that would be both pointless and off-topic.)

@lukakostic
Copy link

lukakostic commented Dec 10, 2024

disabling sponsorblock entirely

I dont have sponsor block yet still get the issue. I have no extensions.

@Wolfdv1
Copy link

Wolfdv1 commented Dec 10, 2024

I can't seem to reproduce this without extensions.

At the moment am looking at this change to FF: Mercurial / GitHub

Note that also seems to be not only sponsorblock that experiences this - have found a couple other extensions that can cause this on their own too, all extensions that attempt to add features to Fullscreen video (ImprovedTube for example)

As a side note, indeed risk acceptance is an option, I decided to stop using an older FF build as of this CVE however: https://www.mozilla.org/en-US/security/advisories/mfsa2024-51/ Even with the old build of FF being used for only YouTube (a bit like a PWA) with other domains blocked this RCE CVE could provide a serious risk of the extensions themselves having unauthorized code exec. -somewhat offtopic but thought would add this

@whitequark
Copy link

(If someone successfully compromises SponsorBlock or uBlock Origin, the only two extensions I use, via Firefox Store, in order to get code exec on my Android phone specifically I will take it as an exceptional degree of praise. It's such a staggeringly unlikely scenario that I don't think it's worth considering.)

@do-not-share-my-personal-information

There's a Firefox bug causing this on some phones even if you have no extensions: https://bugzilla.mozilla.org/show_bug.cgi?id=1927557

@PhoenixIV
Copy link

There's a Firefox bug...

Thanks. I now backlinked this issue here in the Firefox tracker.

@Wolfdv1
Copy link

Wolfdv1 commented Dec 14, 2024

@Wolfdv1
Copy link

Wolfdv1 commented Dec 15, 2024

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.

@Wolfdv1
Copy link

Wolfdv1 commented Dec 15, 2024

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.

@ajayyy
Copy link
Owner

ajayyy commented Dec 15, 2024

Mobile is where a non-persistence background script is very important. Running the background script even when YouTube is not open, and you are just browsing other sites, is not a good idea. I think this needs to be resolved in Firefox itself

@whitequark
Copy link

@Wolfdv1 Thanks for your PR! I've had to sign it myself because apparently there's no way to load an unsigned XPI on Andriod, but it works fine. It does seem to not change the color of the progress bar for some reason, but I also don't really care about that; it skips the sponsored segments and I'm happy with it.

sponsorblock-5.10.3.xpi.zip

@Wolfdv1
Copy link

Wolfdv1 commented Dec 16, 2024

@whitequark No problem, another lil workaround until it is fixed in Firefox itself.

It is almost certainly purely a bug on Mozillas end- did a test using one of their own example extensions as can be seen here, and it occurs also. Will update the bugzilla thread/report as needed.

Regarding the workaround, as Ajayyy said- having the background page be persistent does mean it will be loaded on all sites, the code seems trustworthy but still could have the theoretical potential risk to open up CORS vector issues.
Also the latest changes are included in this artifact which was generated after my last post, progress bar works fine there (still no future updates or signing however).

Fun fact also: On Firefox Nightly for android you can go to about:config and set ,,xpinstall.signatures.required" to false, and then go into Settings>About Firefox Nightly>Click on the logo 5x and then in settings under advanced 'Install add-on from local file' will allow an unsigned local zip to be permanently installed :) ofc know the potential risks etc etc and do at your own risk, but wanted to add this

Anyway, hope the FF Devs can fix this asap. I understand why Ajayyy wouldnt want the bg script to be persistent for all users (hence closed the PR after seeing the reply here) - btw thank you for all the hard work!

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

No branches or pull requests

8 participants