Add Picture-in-Picture support
Categories
(GeckoView :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: jonalmeida, Unassigned)
References
Details
Attachments
(1 file)
|
1.17 MB,
image/png
|
Details |
Currently, for PiP, we take the entire GeckoView and put into PiP-mode. This works well enough for now (you can see this in R-B by putting a video into fullscreen mode and then pressing the home button).
Product's request is to also be able to view a video while also being able to browse web content.
An API that would provide the media element in a View would be helpful in being able to do this.
A related WebView API that does this when an element goes in fullscreen, is to provide the element to the embedder.
I spent some time thinking about this a while back. Maybe something like the following?
class MediaElement {
...
void enterPiP() { ... }
boolean isPip() { ... }
void exitPip() { ... }
}
interface MediaElement.Delegate {
GeckoResult<Surface> onPipEnter();
void onPipExit();
}
We could then hook up the video controls to allow pip similar to desktop.
| Reporter | ||
Comment 2•6 years ago
|
||
Yes, that looks about right.
We could then hook up the video controls to allow pip similar to desktop.
We get the video controls for free already. :)
For cases like YouTube, the native controls overlap with the web content ones right now, so you sometimes see two sets of them although you can only interact with the native ones in PiP mode. Receiving a SurfaceView back, I assume that we only get the base video element back?
| Reporter | ||
Comment 3•6 years ago
|
||
What the controls overlap currently looks like.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Related to this ticket - UX is looking into a way to trigger PiP in Fenix without first fullscreening the app - similar to desktop. No exact plans yet, but maybe showing the PiP button on a tap on the embedded video.
Comment 5•3 years ago
|
||
Jonathan, is this bug still relevant? Does Fenix currently support PiP?
| Reporter | ||
Comment 6•3 years ago
|
||
Yes, this bug is still relevant. Comment 1 has a concept of what an API would look like to provide better browser PiP support that integrates with Android's native PiP support.
For example, currently we can be in PiP and not use the browser for anything else. If we're able to tell Android, "draw this video on this other surface" we would then be able to browse on a tab while using PiP for a video at the same time.
(In reply to Jonathan Almeida (:jonalmeida) from comment #6)
Yes, this bug is still relevant. Comment 1 has a concept of what an API would look like to provide better browser PiP support that integrates with Android's native PiP support.
For example, currently we can be in PiP and not use the browser for anything else. If we're able to tell Android, "draw this video on this other surface" we would then be able to browse on a tab while using PiP for a video at the same time.
How can we enter PiP mode in Geckoview now? I could not find documentation on this. I am trying to do this with YouTube, but have no idea how.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 10•1 year ago
|
||
Moving to P3 for bug organizational purposes. If this doesn’t seem right, please reset the priority back to the original value or set to — if you think the bug should be re-triaged.
Description
•