samples icon indicating copy to clipboard operation
samples copied to clipboard

Is there a working autopictureinpicture sample?

Open jonnymaceachern opened this issue 4 years ago • 30 comments

There's a Auto Picture-in-Picture Sample page but it's not currently working (I'm on Chrome 81.0.4044.129 (Official Build) (64-bit)). Was this feature removed or am I missing something?

jonnymaceachern avatar May 09 '20 01:05 jonnymaceachern

Tried on Chromium 96.0.4661.0. Still not working.

guest271314 avatar Oct 03 '21 14:10 guest271314

@guest271314 Did you enable chrome://flags/#enable-experimental-web-platform-features?

beaufortfrancois avatar Oct 04 '21 07:10 beaufortfrancois

Yes. That flag is always used when launching Chromium, here.

guest271314 avatar Oct 04 '21 13:10 guest271314

And you installed it as a PWA?

beaufortfrancois avatar Oct 04 '21 13:10 beaufortfrancois

Yes. Even included the new id that was warned about at console. The PiP window does not automatically launch. I tried pictureInPicture as the specification uses and the pictureinpicture attribute already in this repository. Does the code do what it is supposed to on your machine? If so, can you create a screen capture video of it working as intended?

guest271314 avatar Oct 04 '21 13:10 guest271314

It works great for me on macOS. I've installed the PWA, launched it, saw my camera feed, minimized the PWA window, and the PiP window auto magically opened. See https://developer.chrome.com/blog/media-updates-in-chrome-73/#auto-pip

beaufortfrancois avatar Oct 04 '21 13:10 beaufortfrancois

Not working on Linux. Even when

minimized the PWA window

happens.

guest271314 avatar Oct 04 '21 13:10 guest271314

I've just tried it on Linux and it worked for me. Can you create a screen capture video and share it?

beaufortfrancois avatar Oct 04 '21 13:10 beaufortfrancois

Full code used and screen capture video autopip.zip

guest271314 avatar Oct 04 '21 13:10 guest271314

Can you reproduce with https://googlechrome.github.io/samples/auto-picture-in-picture/?

beaufortfrancois avatar Oct 04 '21 13:10 beaufortfrancois

Same result. PiP window does not auto launch. This warning appears at DevTools

manifest.json:1 Manifest: property 'scope' ignored. Start url should be within scope of scope URL.

guest271314 avatar Oct 04 '21 13:10 guest271314

It looks like your PWA window is not minimized from the screen capture you've shared. Can you try again?

beaufortfrancois avatar Oct 04 '21 14:10 beaufortfrancois

I am not sure what you mean by

minimized the PWA window

and

It looks like your PWA window is not minimized

?

I tried that, too, on my own.

How is a minimized window relevant to PiP window launching automatically?

guest271314 avatar Oct 04 '21 14:10 guest271314

Minimized window, no PiP. Screenshot_2021-10-04_07-10-27

guest271314 avatar Oct 04 '21 14:10 guest271314

Clicking the minimize [_] window button forces the page visibility event to fire. That's what's PiP autopicture uses.

In your screenshot, the window is not minimized. It is small ;) Click the [_] button on the left of the [+] button.

beaufortfrancois avatar Oct 04 '21 14:10 beaufortfrancois

Clicking the minimize [_] window button forces the page visibility event to fire. That's what's PiP autopicture uses.

In your screenshot, the window is not minimized. It is small ;) Click the [_] button on the left of the [+] button.

Well, that is not "automatic". That is in response to user action. What you wrote needs to be in the specification and instructions here. And, again, there is nothing "automatic" about that, just substituting one click for another. I might as well just click the PiP control.

guest271314 avatar Oct 04 '21 14:10 guest271314

I suspect this is a Linux specific issue as it works great on macOS for me. Maybe the "screen occlusion" feature did not launch on Linux. I'm not sure.

See the video on https://developer.chrome.com/blog/media-updates-in-chrome-73/#auto-pip It still works like that for me. Alt-tab, screen occlusion, minimized windows are actions that force page visibility to change.

Spec says: https://www.w3.org/TR/picture-in-picture/#auto-pip

Some pages may want to automatically enter and leave Picture-in-Picture for a video element; for example, video meeting web apps would benefit from some automatic Picture-in-Picture behavior when the user switches back and forth between the web app and other applications/tabs.

I think we're good don't you think?

beaufortfrancois avatar Oct 04 '21 14:10 beaufortfrancois

I think we're good don't you think?

No.

You supplied specific instructions for user action, where without those instructions I would not have learned that on my own without testing hundreds if not thousands of times.

And as I said, that is by no means "automatic". That attribute name needs to be changed or actually be automatic, without user action, to avoid false advertising.

guest271314 avatar Oct 04 '21 14:10 guest271314

You supplied specific instructions for user action, where without those instructions I would not have learned that on my own without testing hundreds if not thousands of times.

Like I said, this issue seems specific to Linux. On working platforms, it works out of the box, without minimizing the window. Window simply has to be occluded.

And as I said, that is by no means "automatic". That attribute name needs to be changed or actually be automatic, without user action, to avoid false advertising.

How would you call it?

beaufortfrancois avatar Oct 04 '21 14:10 beaufortfrancois

On working platforms, it works out of the box, without minimizing the window. Window simply has to be occluded.

All of those details need to be clearly documented in the specification.

How would you call it?

From my perspective it is definitely not "automatic" by any stretch. I is no different from clicking the PiP control on the media element or calling requestPictureInPicture() based on user action.

I expected literal "automatic", not conditional changes based on further user gestures.

The procedure needs to be explained, preferably in the specification, definitely here, else there is no way for users to divine the specific instructions you posted.

guest271314 avatar Oct 04 '21 14:10 guest271314

On working platforms, it works out of the box, without minimizing the window. Window simply has to be occluded.

All of those details need to be clearly documented in the specification.

I kindly disagree. Specification text looks good to me. It uses page visibility API events.

How would you call it?

From my perspective it is definitely not "automatic" by any stretch. I is no different from clicking the PiP control on the media element or calling requestPictureInPicture() based on user action.

It's not true. Switching from a PWA window to another app may is not a user gesture in the spec world.

Do you mind filing a bug at crbug.com/new to explain that page visibility event is not fired when page becomes hidden?

beaufortfrancois avatar Oct 04 '21 14:10 beaufortfrancois

Well, you asked, and I gave my perspective.

It is definitely not "automatic".

What I expect by the naming convention is very simple: I get link to a site where PiP window is literally automatically launched, without any further action.

Do you mind filing a bug at crbug.com/new to explain that page visibility event is not fired when page becomes hidden?

I have filed issues re PiP in the past and been banned from the specification issue, re maximum PiP window size, which is certainly Chromium-specific.

I will file the issue anyway explaining what I consider should occur.

This is not "automatic", no matter how it is trying to be massaged or colored as such.

guest271314 avatar Oct 04 '21 14:10 guest271314

I suggest you include the exact steps necessary you posted (evidently on Linux) to get the PiP window - which is not "automatic" in this samples repository.

guest271314 avatar Oct 04 '21 14:10 guest271314

User gesture meaning what you advised for PiP to happen, minimize the PWA window. I am not sure how you can color that "automatic"?

guest271314 avatar Oct 04 '21 14:10 guest271314

Once again, how would you call it then?

beaufortfrancois avatar Oct 04 '21 14:10 beaufortfrancois

It is not special or even needed. It does not do anything requestPictureInPicture() does not do, so I am not sure why it is even being specified - since it is not "automatic". If you actually make it automatic then keep the name. Else, it can actually be removed from the specification, again, to avoid false advertising.

guest271314 avatar Oct 04 '21 14:10 guest271314

Perhaps 'minimizedPictureInPicture'?

guest271314 avatar Oct 04 '21 14:10 guest271314

Or 'minimizedWindowPictureInPicture', 'occludedWindowPictureInPicture'. 'automatic' on its own is not what is occurring and should cease and desist being advertised as such.

guest271314 avatar Oct 04 '21 14:10 guest271314

@beaufortfrancois https://bugs.chromium.org/p/chromium/issues/detail?id=1256603

guest271314 avatar Oct 05 '21 01:10 guest271314

Thank you really much @guest271314! I've pinged some folks at https://bugs.chromium.org/p/chromium/issues/detail?id=1256603#c3 and was able to reproduce with a small test case.

beaufortfrancois avatar Oct 05 '21 07:10 beaufortfrancois