document-picture-in-picture icon indicating copy to clipboard operation
document-picture-in-picture copied to clipboard

Is it really necessary to have a title bar in PiP window? Videos don't have it

Open robbi73 opened this issue 2 years ago • 13 comments

Is it really necessary to have a title bar in PiP window? Also it would be nice to be able to further reduce the size of the window. At the moment I can't open a PiP window with size 200px x 200px

robbi73 avatar Apr 10 '23 11:04 robbi73

Thanks for the feedback, though this question is better suited for crbug.com than here. This repo is for the spec, and this spec doesn't enforce that the user agent have any title bar nor does it enforce a minimum PiP window size.

As far as the Chrome implementation goes, we decided to have the titlebar for anti-spoofing purposes. By always showing the origin, the user knows where the content is coming from. By having the titlebar, it less easily blends into whatever it's on top of. The reason we don't need it for video PiP is that video PiP isn't fully interactable content, so a user can't be spoofed to type their password for example.

For the sizing issue, I'll bring that up with our UX folks to see if there's a way to further reduce the minimum size while keeping necessary UI components.

steimelchrome avatar Apr 10 '23 17:04 steimelchrome

I was thinking about a possible solution for both window size and titlebar. One might think of a hidden title bar that appears only when the onmouseenter\over event is fired (above or below the window itself). Furthermore, if the window is too small to visualize the origin entirely, one could think of: a) a tooltip (the one that already appears when we position the mouse over the label of a card) b) or a scrolling writing (like marquee) inside the same title bar.

robbi73 avatar Jun 18 '23 09:06 robbi73

Agreed, in my experiments the minimum window size was 300 x 300. What happens if I want to make a player controller like the Apple Music mini bar? That's too large.

DiodeDan avatar Jun 23 '23 15:06 DiodeDan

I've noticed that the min. dimensions for a standard pop up window are much smaller, would it be possible to use the same minimum values for the width and height of the PIP windows? Screenshot 2023-07-21 at 11 35 48 AM

egm0121 avatar Jul 21 '23 15:07 egm0121

Thanks for the feedback. It seems likely that we'll end up making the minimum height significantly smaller than it currently is (on Chrome), but I'm not yet sure on the width.

steimelchrome avatar Jul 21 '23 20:07 steimelchrome

@steimelchrome - do you know when we could take smaller windows for a spin?

rlingineni avatar Aug 07 '23 22:08 rlingineni

@steimelchrome +1 for making the minimum window size smaller than 300x300

albertpratomo avatar Aug 22 '23 09:08 albertpratomo

There's an issue on some platforms where dialogs get clipped by browser windows, which blocks us from allowing a smaller height. I have a fix out for review to make them work for PiP, and once that lands I'll land a followup change to allow for a shorter height. If all goes well then it'd be in M118

steimelchrome avatar Aug 22 '23 09:08 steimelchrome

Hi, we're developing a chrome extension that wants to use Picture in Picture for pomodoro. But the window is too big now, we're hoping to have a compact PiP so it doesn't taking too much of the user's screen real estate. Is there any update on the custom size feature?

buditanrim avatar Sep 11 '23 03:09 buditanrim

Chrome 118 (Canary at the time) has reduced the minimum height to 52px: https://chromiumdash.appspot.com/commit/79d9b185bf4115c2bc6cbe919655f7a4cb940f24 Minimum width changes are coming soon after IIUC.

beaufortfrancois avatar Sep 11 '23 06:09 beaufortfrancois

@beaufortfrancois thank you. Quick question: Does the ratio still have to be 1:1? For example, I want to make the PiP size to be 210 x 150px, is this possible?

buditanrim avatar Sep 11 '23 09:09 buditanrim

The ratio is inferred from the width and height you pass to requestWindow():

  // Open a Picture-in-Picture window.
  const pipWindow = await documentPictureInPicture.requestWindow({
    width: 210,
    height: 150,
  });

It doesn't have to be 1:1. You can try in Chrome Canary:

image

beaufortfrancois avatar Sep 11 '23 09:09 beaufortfrancois

As far as the Chrome implementation goes, we decided to have the titlebar for anti-spoofing purposes. By always showing the origin, the user knows where the content is coming from. By having the titlebar, it less easily blends into whatever it's on top of.

If the desired usage of the dPIP is just a video element with a canvas overload for subtitles, the forced display of the title bar would be obnoxious. Would it be possible to only display the titlebar if elements that take user text input are present?

Xaekai avatar Sep 11 '23 17:09 Xaekai