Comments (9)
For users who regularly view using PIP, sticky position/size would be nice. Do we generally expect UAs to do this, or as with something like mute do we expect the site to persist this across API invocations? If the latter, how do sites read this information so that they can persist it?
The idea here is that the website can recommend a size and position to the UA which can follow or ignore this recommendation. It might also not be able to follow it because of system recommendations: the system APIs might not offer this option. I would be interested to see if system APIs allow the caller to move the PIP window after it was created. It sounds unlikely but if it's the case, we could consider exposing this. We would also need to report the current position to the website in order to allow the feature you suggested.
Do we expect to expose any control over whether users can resize PIP windows? (On desktop this seems particularly useful).
The UI should be left as an implementation details. The specification should recommend to have some controls but, for example, resizing might make sense in some contexts (desktop) but not on mobile. Also, implementations re-using system APIs will have not much controls over this.
If users can resize PIP windows, how do we expose this to the page? ABR logic that decides among multiple possible encodes with different resolutions often depends on this.
I think that's an interesting use case. I wonder if native APIs expose this.
How do we handle multiple displays? Especially if they have different properties (e.g. DPI) that affect content rendering?
I guess multiple displays should be handled like for any window.
In general, it sounds like you would be interested to have PIP handled closer to a Window
instead of a display mode. Do I understand this correctly?
from picture-in-picture.
For users who regularly view using PIP, sticky position/size would be nice. Do we generally expect UAs to do this, or as with something like mute do we expect the site to persist this across API invocations? If the latter, how do sites read this information so that they can persist it?
I would prefer that pip window position/size suggested by websites would be ignored if user moved or resized it later on:
- Website A
video.requestPictureInPicture({top: 100, left: 100, width: 640, height: 480});
open a 640x480 pip window at 100,100. - User moves pip window at 200,200
- Website A
video.requestPictureInPicture({top: 100, left: 100, width: 640, height: 480});
open a 640x480 pip window at 200,200 (because user set it before). - Website B
video.requestPictureInPicture({top: 100, left: 100, width: 640, height: 480});
open a 640x480 pip window at 100,100 (because it is the first time Website B asks for a pip video)
If that makes sense, I can add it to the spec.
If users can resize PIP windows, how do we expose this to the page? ABR logic that decides among multiple possible encodes with different resolutions often depends on this.
FYI, macOS doesn't seem to expose pip window size and changes.
Note that its pip window can't be larger than a quarter of the display though.
Shall we add an event to handle ABR case though?
video.addEventListener('resizepictureinpicture', function(event) {
// User resized element in Picture-In-Picture mode.
console.log('New video width:' + event.data.videoWidth);
console.log('New video height:' + event.data.videoHeight);
});
from picture-in-picture.
It sounds to me that we could split this issue in two:
- position/size set by the website/user/system, it'l similar to #5
- ABR related requirements: window size, screen capabilities
from picture-in-picture.
Regarding the ABR case, instead of having a resizepictureinpicture
how about something like this?
const pipWindow = await video.requestPictureInPicture();
console.log(pipWindow.width); // PiP window width
console.log(pipWindow.height); // PiP window height
pipWindow.addEventListener('resize', event => {
// User resized PiP window.
console.log(event.target.width, event.target.height);
});
(edit: s/pipVideo/pipWindow
)
from picture-in-picture.
I find this more elegant and flexible than the resizepictureinpicture
event. What type of obejct would pipVideo
be here? Could we imagine this being a PictureInPictureWindow
or something like that with some properties/events that we would need/want to expose?
(edit: renaming interface stub name to avoid confusion)
from picture-in-picture.
@jernoble, what do you think of this way of handling PiP window resizing?
from picture-in-picture.
Does requestPictureInPicture() have the possibility of being rejected? If so, requestPictureInPicture() may want to return a Promise that resolves to a PiPWindow object (or PictureInPictureContext, if the Window nomenclature is too overloaded).
from picture-in-picture.
Thanks @jernoble. Sounds like we are completely aligned as your comment matches @beaufortfrancois's above. We will send a PR soon.
from picture-in-picture.
from picture-in-picture.
Related Issues (20)
- Multiple picture-in-picture. HOT 7
- disablePictureInPicture interoperability HOT 34
- leavepictureinpicture event should be fired with the Picture-in-Picture window HOT 4
- Remove monkey patch sections HOT 5
- Add progress bar and allow to control it in PiP HOT 4
- Adjust Volume HOT 3
- im am so sorry HOT 1
- Default size of Picture in Picture HOT 2
- No options to change default position for picture in picture window HOT 2
- No option to change PiP window shape HOT 1
- PiP resize window not working on linux HOT 1
- Picture in Picture with getUserMedia on iPhone Safari HOT 2
- Clicking anywhere except on control should toggle playback HOT 1
- How to determine the correct video size? HOT 1
- Simultaneous Video and Canvas PIP HOT 2
- Type Error video.requestPictureInPicture is not a function in Cordova android and iOS app HOT 1
- CSS-styling vs. respecting <video> element styles for PiP (Firefox → the latter, Webkit → ??) HOT 1
- Page Visibility spec has been merged into HTML HOT 1
- Candidate Recommendation tracking issue
- Extend PiP standard to non-video content types HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picture-in-picture.