Pass aspect ratio landscape/portrait of fullscreen content in onFullScreen
Categories
(GeckoView :: General, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: ekager, Assigned: agi, NeedInfo)
Details
(Whiteboard: [fenix:p1][geckoview:m76])
I think this is valid but feel free to close if this is already possible.
We want to be able to detect when fullscreen content should be displayed in potrait or landscape mode by default and I don't think there's currently a way for Fenix to do this without knowing about the content.
Emily, how soon do you folks need this?
| Reporter | ||
Comment 2•6 years ago
|
||
I don't think this a huge priority, but Andreas wanted me to look into it because on mobile vertical videos are much more common but people still watch a lot of other landscape videos and it's a nice feature to launch fullscreen in the correct orientation.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 3•5 years ago
|
||
Looks like we can listen to MediaElement.Delegate#onFullScreenChange to know when a video is fullscreen and MetaData#width and MetaData#height should give you enough information to determine if the video is in landscape mode or portrait.
So maybe we don't need an API change.
| Assignee | ||
Comment 4•5 years ago
|
||
This is waiting on the Fenix team to tell me if they need a new API for this or the existing one is good enough, Emily ni-ing you so that this doesn't get lost :)
Comment 5•5 years ago
|
||
(In reply to :Agi | ⏰ PST | he/him from comment #3)
Looks like we can listen to MediaElement.Delegate#onFullScreenChange to know when a video is fullscreen and MetaData#width and MetaData#height should give you enough information to determine if the video is in landscape mode or portrait.
So maybe we don't need an API change.
Emily tried that. But unfortunately we are seeing ContentDelegate.onFullScreen getting called before MediaElement.Delegate.onFullscreenChange().
Right now we handle switching to fullscreen mode in code that gets indirectly triggered by ContentDelegate.onFullScreen. At this time we did not receive the callback for the media, so we do not know which media is in fullscreen mode and can't look at the width/height.
Is the order something we can control and/or change?
Now that I am tyiping this... maybe another option is for us to handle fullscreen mode from ContentDelegate.onFullScreen and only do orientation locking later based on fullscreen changes of playing media elements?
Updated•5 years ago
|
| Assignee | ||
Comment 7•5 years ago
|
||
Thanks Emily.
Now that I am tyiping this... maybe another option is for us to handle fullscreen mode from ContentDelegate.onFullScreen and only do orientation locking later based on fullscreen changes of playing media elements?
Responded on slack too, but this was exactly my idea. It should work fine since both notifications are sent within milliseconds of each other. To be clear what I mean: use the ContentDelegate.onFullScreen to dictate the fullscreen state and MediaElement.Delegate.onFullscreenChange (when present) to lock the orientation.
| Assignee | ||
Comment 8•5 years ago
|
||
ni so that this doesn't get lost again :) can you let me know if the above works for you?
Updated•5 years ago
|
Comment 9•5 years ago
|
||
Emily worked on that in AC and I think already integrated it into Fenix? :)
| Reporter | ||
Comment 10•5 years ago
|
||
I integrated that recommended solution into Fenix for https://github.com/mozilla-mobile/fenix/issues/7602 and it was closed as QA verified, so seems to work! If we get a lot of reports of it not working on sites, we can rediscuss, but for now I think we can close this :)
Description
•