New issue
Advanced search Search tips

Issue 917303 link

Starred by 6 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Feature


Sign in to add a comment

Implement Auto Picture-in-Picture for the Web

Project Member Reported by fbeaufort@chromium.org, Dec 21

Issue description

Some pages may want to automatically enter and leave Picture-in-Picture for
a video element; for example, video meetings web apps would benefit from
some automatic Picture-in-Picture behavior when user switches back and forth
between web app and other applications/tabs.
To support these use cases, a new autoPictureInPicture attribute is
added to the list of content attributes for video elements.

See https://github.com/WICG/picture-in-picture/pull/112
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4ccb547b7ff46b30a7a8fcc59e2ecc8f1094fef4

commit 4ccb547b7ff46b30a7a8fcc59e2ecc8f1094fef4
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Jan 11 14:40:32 2019

Fire page visibility events in Picture-in-Picture

This CL makes sure page visibility events are fired even if a video is
playing in Picture-in-Picture. This doesn't affect "disable rendering"
optimizations as those are turned off  already if media player is in
Picture-in-Picture.

https://github.com/WICG/picture-in-picture/issues/110

Bug: 917303
Change-Id: If3788ce89f55e22af59bc69a6a52cd2a3309c518
Reviewed-on: https://chromium-review.googlesource.com/c/1400803
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622002}
[modify] https://crrev.com/4ccb547b7ff46b30a7a8fcc59e2ecc8f1094fef4/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
[modify] https://crrev.com/4ccb547b7ff46b30a7a8fcc59e2ecc8f1094fef4/chrome/test/data/media/picture-in-picture/window-size.html
[modify] https://crrev.com/4ccb547b7ff46b30a7a8fcc59e2ecc8f1094fef4/content/browser/web_contents/web_contents_impl.cc

Believe it or not still catching up with email. :)

Thanks for this thread everyone. I didn't realize initially that auto pip
would be restricted to installed PWAs. I completely agree with the use case
Francois highlighted and it's an excellent example w.r.t risk of autopip at
a browser level.

One clarification point: would this mean auto pip is only triggered when
PWA is backgrounded? This makes me wonder if it's worth exploring auto pip
on browser not when tab switch occurs but when scroll even occurs (similar
to auto pip of some sites today).

Looking forward to chatting more tomorrow.

On Fri, Jan 11, 2019, 6:41 AM bugdroid1 via monorail <
monorail+v2.3275348242@chromium.org wrote:

Comment 3 by fbeaufort@chromium.org, Jan 17 (6 days ago)

Blockedon: 922884

Comment 4 by fbeaufort@chromium.org, Jan 17 (6 days ago)

Blockedon: 922885

Comment 5 by fbeaufort@chromium.org, Jan 17 (6 days ago)

Blockedon: 921577
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 18 (5 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/27f886f044ded4e5db83612a44652a94bfdb885a

commit 27f886f044ded4e5db83612a44652a94bfdb885a
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Jan 18 05:20:12 2019

Create Picture-in-Picture controller when needed.

This CL makes sure the Picture-in-Picture blink controller gets created
only when it has to perform tasks to enter or leave Picture-in-Picture.

Bug: 917303
Change-Id: Icc0773cd257233a6b8898f4ded6d16680824596d
Reviewed-on: https://chromium-review.googlesource.com/c/1417473
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#624017}
[modify] https://crrev.com/27f886f044ded4e5db83612a44652a94bfdb885a/third_party/blink/renderer/core/frame/picture_in_picture_controller.cc
[modify] https://crrev.com/27f886f044ded4e5db83612a44652a94bfdb885a/third_party/blink/renderer/core/frame/picture_in_picture_controller.h
[modify] https://crrev.com/27f886f044ded4e5db83612a44652a94bfdb885a/third_party/blink/renderer/core/html/media/html_video_element.cc
[modify] https://crrev.com/27f886f044ded4e5db83612a44652a94bfdb885a/third_party/blink/renderer/core/html/media/video_wake_lock.cc
[modify] https://crrev.com/27f886f044ded4e5db83612a44652a94bfdb885a/third_party/blink/renderer/core/page/context_menu_controller.cc
[modify] https://crrev.com/27f886f044ded4e5db83612a44652a94bfdb885a/third_party/blink/renderer/modules/media_controls/elements/media_control_picture_in_picture_button_element.cc

Comment 7 by fbeaufort@chromium.org, Jan 18 (5 days ago)

Blockedon: 921478
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 18 (4 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0e27cee0958bb04cd14067c4a2b1eeca4b8b9f64

commit 0e27cee0958bb04cd14067c4a2b1eeca4b8b9f64
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Jan 18 13:21:35 2019

Don't throttle hidden tab in Picture-in-Picture

This CL makes sure a tab is not throttled when hidden if it has a
Picture-in-Picture video. Renderer is still informed though that the tab
was hidden.

Bug: 917303,  921460 ,  921478 
Change-Id: Ia0c5c4841b48d8f62f8ddbc12653522e0b59f6b5
Reviewed-on: https://chromium-review.googlesource.com/c/1419841
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#624096}
[modify] https://crrev.com/0e27cee0958bb04cd14067c4a2b1eeca4b8b9f64/content/browser/web_contents/web_contents_impl.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Jan 18 (4 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f09e446e4a5a905e972074c2fc4700a31533f25e

commit f09e446e4a5a905e972074c2fc4700a31533f25e
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Jan 18 14:34:51 2019

Add experimental support for Auto Picture-in-Picture

This CL adds the autoPictureinPicture attribute to the HTMLVideoElement
behind an experimental blink runtime flag so that web developers can
play with Auto Picture-in-Picture behaviour by running chrome with the
--enable-blink-features=AutoPictureInPicture switch.

Spec: https://github.com/WICG/picture-in-picture/pull/112

Note that video with no audio don't play in Auto Picture-in-Picture because
of background video optimizations. This will be addressed in an upcoming
CL.

Change-Id: I5aeb0e792ebf3b3ea32e0db8bebee660e640841f
Bug: 917303
Reviewed-on: https://chromium-review.googlesource.com/c/1380533
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#624115}
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/chrome/browser/ui/browser.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/chrome/browser/ui/browser.h
[add] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/chrome/test/data/extensions/auto_picture_in_picture/main.html
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/content/browser/web_contents/web_contents_impl_unittest.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/content/public/browser/web_contents_delegate.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/content/public/browser/web_contents_delegate.h
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/content/shell/browser/shell.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/content/shell/browser/shell.h
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/extensions/browser/app_window/app_window.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/extensions/browser/app_window/app_window.h
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/extensions/browser/extension_host.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/extensions/browser/extension_host.h
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/public/platform/web_feature.mojom
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/renderer/core/html/html_attribute_names.json5
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.idl
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/renderer/platform/runtime_enabled_features.json5
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/f09e446e4a5a905e972074c2fc4700a31533f25e/tools/metrics/histograms/enums.xml

Project Member

Comment 10 by bugdroid1@chromium.org, Jan 18 (4 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fec686f56d6b09962077a476342fe2af6e94387e

commit fec686f56d6b09962077a476342fe2af6e94387e
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Jan 18 17:12:49 2019

Set document visibilityState to hidden when window is occluded.

This CL allows web pages to know when window is occluded via the Page
Visibility API.

https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/C8QaK-TSrOY

Bug: 917303
Change-Id: I44b1a8a2714de38da2e4ecb6b88ca84081b9ecb6
Reviewed-on: https://chromium-review.googlesource.com/c/1408977
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624170}
[modify] https://crrev.com/fec686f56d6b09962077a476342fe2af6e94387e/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
[modify] https://crrev.com/fec686f56d6b09962077a476342fe2af6e94387e/content/browser/web_contents/web_contents_impl.cc

Comment 11 by fbeaufort@chromium.org, Yesterday (47 hours ago)

Blockedon: 919235

Comment 12 by fbeaufort@chromium.org, Yesterday (43 hours ago)

Blockedon: 923879

Sign in to add a comment