fenix icon indicating copy to clipboard operation
fenix copied to clipboard

Videos should autorotate to correct orientation (portrait/landscape)

Open ekager opened this issue 5 years ago • 30 comments

Why/User Benefit/User Problem

Potrait videos are increasingly common so we should be able to detect potrait/landscape and auto rotate to the correct orientation for users

What/Requirements

Needs GV to give us some information about the video before launching full screen mode, and then probably AC to expose this information to Fenix Opened Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1600962

Acceptance Criteria (how do I know when I’m done?)

Potrait videos launch fullscreen in potrait orientation, landscape in landscape

┆Issue is synchronized with this Jira Task

ekager avatar Jan 10 '20 18:01 ekager

There are so so many related issues across GeckoView, Focus, Fenix and reference browser. It's also worth linking the equivalent Chromium issue too.

Poopooracoocoo avatar Jan 10 '20 23:01 Poopooracoocoo

So this one will fix the Instagram story issue? (Instagram stories playing sideways, forcing users to rotate their phone every time they want to watch an Instagram story)

willfs84 avatar Jan 22 '20 00:01 willfs84

So this one will fix the Instagram story issue? (Instagram stories playing sideways, forcing users to rotate their phone every time they want to watch an Instagram story)

firefox preview nightly version force potrait mode on all videos...

lindongbin avatar Feb 02 '20 02:02 lindongbin

@vesta0 @liuche How much do we want to push on this GV bug? We're relying on them to help us complete this bug.

darkwing avatar Feb 11 '20 21:02 darkwing

@boek You may be interested in pushing this forward.

darkwing avatar Feb 12 '20 21:02 darkwing

@boek @darkwing this is a great feature that we should put on GV team's radar but in my opinion it is not as urgent as use cases that break user flow and user cannot do anything about it. In this case user can tilt the screen to go into landscape mode.

vesta0 avatar Feb 13 '20 16:02 vesta0

https://bugs.chromium.org/p/chromium/issues/detail?id=326572 (can't believe that was 2013-2016!)

"correct orientation" is a bit unclear by the way. Here's Google's title: "Force rotation to match aspect ratio of full-screen HTML5 video on Android phones" (but even that title isn't exactly clear as it only affects the native player and not custom players such as JW Player who unfortunately turned down my request :( ). And as I said about a month ago (time goes by too quickly!), I'm pretty sure there are more issues related to this.

@vesta0 some users describe Fenix's native video player as "broken" because of this.

Poopooracoocoo avatar Feb 14 '20 01:02 Poopooracoocoo

@Poopooracoocoo that's good to know, thank you! Will try to bump it up in priority.

vesta0 avatar Feb 14 '20 16:02 vesta0

@vesta0 Awesomesauce! Could y'all also update the title of this?

Poopooracoocoo avatar Feb 17 '20 03:02 Poopooracoocoo

This is scheduled to be worked on and should be available in GeckoView 76.

fluffyemily avatar Mar 17 '20 16:03 fluffyemily

Question on underlying GV issue needs response. Question asked on 15th April 2020 by @agi90 for @pocmo .

https://bugzilla.mozilla.org/show_bug.cgi?id=1600962#c8

fluffyemily avatar May 12 '20 18:05 fluffyemily

Verified as fixed on the latest Nightly build from 5/22 with Samsung Galaxy Tab A6 (Android 5.1.1), OnePlus 5T (Android 9), Sony Xperia Z5 Premium (Android 7.1.1), and Google Pixel (Android 10). I've tested on several pages: youtube.com, instagram.com, vimeo.com, twitter.com, facebook.com.

lobontiumira avatar May 22 '20 12:05 lobontiumira

not working on http://m.imomoe.in/player/7379-0-0.html

lindongbin avatar Jun 05 '20 10:06 lindongbin

not working on https://www.cmdy5.com/play/24417.html?24417-1-1

lindongbin avatar Jun 06 '20 21:06 lindongbin

not working on https://www.nfmovies.com/video/?47243-1-0.html

lindongbin avatar Jun 06 '20 22:06 lindongbin

not working on iframe videos?

lindongbin avatar Jun 06 '20 22:06 lindongbin

The fix for this issue was handled in AC. Therefore this is not a GeckoView bug.

fluffyemily avatar Jun 09 '20 12:06 fluffyemily

This is working for me on version 5.2.0-beta.1 and Nightly 200611 06:01 on YouTube and Twitter.

ghost avatar Jun 11 '20 16:06 ghost

Yeah I believe this works on major sites I tested cnn, youtube, twitter, etc but looks like on certain sites I would guess we aren't getting the height/width metadata correctly (how I am calculating the predicted orientation). We can revisit this, but a future fix might require GV work.

ekager avatar Jun 11 '20 16:06 ekager

It happens randomly but I have experienced it on YouTube, the videos most of the time auto-rotate to landscape mode ( as most of the YouTube videos are on the channels I have subscribed to) but occasionally the videos don't auto-rotate/go landscape when the full-screen icon is clicked no matter how many time I click the button. The only way to make that particular video auto-rotate/go landscape is to reload the page. Why do you think it might be happening?

Device: Motorola One Power, Android 10. Fenix: 5.2.0-beta.1 and Nightly 200614 06:01.

ghost avatar Jun 15 '20 00:06 ghost

@ekager will do a quick investigation and ask GV if we need more GV work.

liuche avatar Jun 22 '20 19:06 liuche

Okay interesting - it's a slightly different issue than I was expecting. We are getting the height and width metadata, but we aren't getting the onFullscreenChange callback that triggers the orientation code.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1647522 with the GV team.

ekager avatar Jun 22 '20 23:06 ekager

@ekager are you talking to me? Or just replying to this issue's thread.

ghost avatar Jun 23 '20 00:06 ghost

Just updating this thread generally about those above links never working. Still not sure about the youtube videos intermittently not rotating, but it's quite possibly related.

ekager avatar Jun 23 '20 00:06 ekager

Is there a way to turn off this auto-rotation happiness? Since the update to the new app version (v79), YouTube videos with a landscape aspect ratio seem to be locked to landscape mode, but sometimes I prefer to watch them in portrait mode anyways. One use case, for example, is playing a video in the background while doing something else, so frame size is not that important, and it can save battery life on OLED screens. I think that full screen mode should respect the current rotation of the device rather than force-overriding it with what it thinks is best for video display. If I'm holding my device in portrait orientation, there's a reason for it. I see the value in auto-rotation, but at least make it optional.

fschneidereit avatar Aug 28 '20 23:08 fschneidereit

Another variant https://github.com/webcompat/web-bugs/issues/62199

karlcow avatar Jan 04 '21 06:01 karlcow

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 03 '21 07:07 stale[bot]

There are also fold devices to consider: the fold screen may have a seam in the middle, so some videos look better in portrait mode while others are better watched in landscape. Is there any way to force fullscreen video rotation or are there any plans to implement such switch?

I'm sorry if this repository or this particular issue is not the appropriate place to ask, but I could not find the better alternative.

quixoticaxis avatar May 20 '22 01:05 quixoticaxis

I believe that this behavior is already gated behind an about:config option: media.videocontrols.lock-video-orientation

Of course, the behavior is outright broken for the moment! Once fixed, though, fold users can choose to disable the behavior if they find it bothersome by toggling the aforementioned option to false.

chaorace avatar Jul 27 '22 03:07 chaorace

The issue is still reproducible using the latest build of Firefox Release and Nightly. The issue reproduces 8/10 times.

Tested with:

Browser / Version: Firefox Release 104.2.0 (2015902899-🦎104.0.2-20220902153754🦎 )/ Firefox Nightly 106.0a1 (2015904939-🦎106.0a1-20220918094414🦎)/ Chrome Mobile Version 105.0.5195.124 Operating System: Samsung A51 (Android 11) -1080 × 2400 pixels 20:9 aspect ratio (~405 ppi density) Operating System: Google Pixel 3 (Android 12) -1080 x 2160 pixels, 18:9 ratio (~443 ppi density)

Notes:

  1. Reproducible regardless of the status of ETP.
  2. Reproducible on the latest build of Firefox Nightly and Release.
  3. Works as expected using Chrome.

softvision-raul-bucata avatar Sep 20 '22 07:09 softvision-raul-bucata