New issue
Advanced search Search tips

Issue 922885 link

Starred by 2 users

Issue metadata

Status: Started
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocking:
issue 917303



Sign in to add a comment

Auto Picture-in-Picture should apply only to playing video

Project Member Reported by fbeaufort@chromium.org, Jan 17 (5 days ago)

Issue description

For now, we check that video has metadata loaded. This is not enough in the context Auto Picture-in-Picture. We should make sure Auto Picture-in-Picture applies only to video that are "potentially playing" as discussed with UX
See https://html.spec.whatwg.org/multipage/media.html#potentially-playing
 
Project Member

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

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

commit 0e6e4575bef92f075c44933afd78117487ef0f46
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Jan 18 15:29:03 2019

Auto Picture-in-Picture should apply only to playing video

This CL makes sure entering Auto Picture-in-Picture is only for video
that are actually playing (not paused).

Bug: 922885
Change-Id: I664378b59a39d9e890ab15a3f63922427ede6bca
Reviewed-on: https://chromium-review.googlesource.com/c/1421100
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624133}
[modify] https://crrev.com/0e6e4575bef92f075c44933afd78117487ef0f46/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
[modify] https://crrev.com/0e6e4575bef92f075c44933afd78117487ef0f46/chrome/test/data/extensions/auto_picture_in_picture/main.html
[modify] https://crrev.com/0e6e4575bef92f075c44933afd78117487ef0f46/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc

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

Cc: mlamouri@chromium.org
Status: Started (was: Available)
It works well with video that are not paused when hidden. Sadly when video is paused when hidden, even though playback is resumed when video enters Picture-in-Picture, it is not a candidate to enter Auto Picture-in-Picture as video is not paused since https://chromium-review.googlesource.com/c/chromium/src/+/1421100

mlamouri@ What do you think of this check for entering Auto Picture-in-Picture?
 
      (!AutoPictureInPictureElement()->paused() || AutoPictureInPictureElement()->PausedWhenHidden())

Comment 4 by dalecurtis@google.com, Today (12 hours ago)

Hmm, WebMediaPlayerImpl::PauseVideoIfNeeded() should result in paused() being true, is that not the case? See:
https://cs.chromium.org/chromium/src/media/blink/webmediaplayer_impl.cc?l=3365

That generates an OnPause which notifies the element.

Sign in to add a comment