New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 873657 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Sep 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Picture-in-Picture video is stretched in window

Project Member Reported by fbeaufort@chromium.org, Aug 13

Issue description

Chrome Version       : 70.0.3519.3 (Official Build) canary (64-bit)

What steps will reproduce the problem?
1. The chrome://flags/#enable-surfaces-for-videos flag must be enabled.
2. Go to https://www.youtube.com/watch?v=hflnlhJz554
3. Right-click twice on video and click "Picture in picture"
4. Click on a video thumbnail that is NOT squared (1:1).

What is the expected result?
Video inside Picture-in-Picture window should sized properly.

What happens instead of that?
Video inside Picture-in-Picture window is stretched.
 
Screenshot 2018-08-13 at 4.29.16 PM.png
547 KB View Download
Owner: apaci...@chromium.org
Status: Assigned (was: Untriaged)
Labels: -Pri-3 Target-70 Pri-2
Labels: M-70
When switching between videos, YouTube doesn't update with a new surface ID, so there's no way for PiP to know to resize.
Owner: ----
Status: Untriaged (was: Assigned)
Owner: fbeaufort@chromium.org
Status: ExternalDependency (was: Untriaged)
Cc: mlamo...@google.com apaci...@google.com
Status: Assigned (was: ExternalDependency)
YouTube actually send surface IDs updates. The problem is the fact that PiP window is visible when asked about updating video size. See https://bugs.chromium.org/p/chromium/issues/detail?id=855059

void OverlayWindowViews::UpdateVideoSize(const gfx::Size& natural_size) {
  DCHECK(!natural_size.IsEmpty());
  natural_size_ = natural_size;
  SetAspectRatio(gfx::SizeF(natural_size_));

  if (IsVisible())
    return;

  // Update the views::Widget bounds to adhere to sizing spec. This will also
  // update the layout of the controls.
  SetBounds(CalculateAndUpdateWindowBounds());
}

We should find a way to update video bounds without resetting pip window to its default location.
Note that Safari does this perfectly.
Labels: OS-Linux OS-Mac OS-Windows
Status: Started (was: Assigned)
WIP at https://chromium-review.googlesource.com/c/chromium/src/+/1196363
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 31

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

commit cef06981ddddf998678accb950a697cbf08ddbbe
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Aug 31 19:52:08 2018

Keep Picture-in-Picture window size in sync with video size.

This makes sure Picture-in-Picture window always shows up inside the
work area when surface ID is updated.

Bug:  873657 
Change-Id: Ibc9a640d527f51e5311a411b86af23eb61617f37
Reviewed-on: https://chromium-review.googlesource.com/1196363
Reviewed-by: apacible <apacible@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#588130}
[modify] https://crrev.com/cef06981ddddf998678accb950a697cbf08ddbbe/chrome/browser/ui/views/overlay/overlay_window_views.cc

Labels: TE-Verified-71.0.3541.0 TE-Verified-M71
Able to reproduce this issue on reported version hence verifying the fix on latest canary 71.0.3541.0 using Mac 10.13.6, Windows 10 and Debian.

Now PiP video is sized accordingly when surface ID is udpated. Attaching screencast for reference.

As fix is working as expected adding Verified labels.

Thanks!
Sep 3 2018 5_04 PM.webm
7.7 MB View Download
Labels: Merge-Request-70
Status: Verified (was: Started)
Project Member

Comment 12 by sheriffbot@chromium.org, Sep 7

Labels: -Merge-Request-70 Hotlist-Merge-Approved Merge-Approved-70
Your change meets the bar and is auto-approved for M70. Please go ahead and merge the CL to branch 3538 manually. Please contact milestone owner if you have questions.
Owners: benmason@(Android), kariahda@(iOS), geohsu@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 13 by bugdroid1@chromium.org, Sep 7

Labels: -merge-approved-70 merge-merged-3538
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/190e606fab0d5bca4ed02e5b96d8357012862292

commit 190e606fab0d5bca4ed02e5b96d8357012862292
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Sep 07 07:54:34 2018

Keep Picture-in-Picture window size in sync with video size.

This makes sure Picture-in-Picture window always shows up inside the
work area when surface ID is updated.

Bug:  873657 
Change-Id: Ibc9a640d527f51e5311a411b86af23eb61617f37
Reviewed-on: https://chromium-review.googlesource.com/1196363
Reviewed-by: apacible <apacible@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Original-Commit-Position: refs/heads/master@{#588130}(cherry picked from commit cef06981ddddf998678accb950a697cbf08ddbbe)
Reviewed-on: https://chromium-review.googlesource.com/1212844
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/branch-heads/3538@{#127}
Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811}
[modify] https://crrev.com/190e606fab0d5bca4ed02e5b96d8357012862292/chrome/browser/ui/views/overlay/overlay_window_views.cc

Labels: TE-Verified-M70 TE-Verified-70.0.3538.16
Able to reproduce this issue on reported version hence verifying the fix on latest dev 70.0.3538.16 using Mac 10.13.6, Windows 10 and Debian.

Now PiP video is sized accordingly when surface ID is updated. Attaching screencast for reference.

As fix is working as expected adding Verified labels.

Thanks!
873657.mp4
2.9 MB View Download

Sign in to add a comment