New issue
Advanced search Search tips

Issue 893062 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Oct 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

PiP window is black if video is not visible

Project Member Reported by fbeaufort@chromium.org, Oct 8

Issue description

Chrome Version       : 71.0.3567.0
OS Version: 11135.0.0

I've noticed a bug with PiP and SurfaceLayer Media Streams.
If <video> is not visible, the PiP window is always black.

Steps to reproduce:
1. Go to https://beaufortfrancois.github.io/sandbox/media/picture-in-picture-get-user-media.html
2. Click "Toggle Picture-in-Picture" button
3. PiP window shows up with camera stream video
4. Click "Toggle video visibility" button

What happens:
PiP window becomes black

What should happen:
video in PiP window should continue playing.
 
Owner: mlamouri@chromium.org
I looked into this while looking into https://bugs.chromium.org/p/chromium/issues/detail?id=893056. It seems that this problem is independent of surfaces, and I believe that somewhere along the way of creating the PiP window, we aren't correctly communicating the opacity. I don't really know much about how the PiP window is set up, so I'll defer this bug mlamouri@, but feel free to bounce it back onto me. 
Thanks for your feedback CJ!
I was able to reproduce without MediaStream.

If <video> is not visible, PiP window is black. In a non-MediaStream video, there is a play button in the PiP black window which allows user to start playback. In a MediaStream video, there is none. It means web developer has to call `video.play()` manually to start playback and video shows up in PiP window.


I'm not sure how to fix it. WDYT Mounir? 
Labels: -Pri-3 OS-Android OS-Mac OS-Windows Pri-1
Owner: lethalantidote@chromium.org
From mlamouri@ in an email, pasted here to keep track of all the info.

"I believe the issue comes from FrameDeliver which seems to be suspended when the page becomes hidden. I think I added in the VFS a flag to always submit frames and weirdly, we may want to do the same thing here and have another flag that will tell FrameDeliver to never suspend while we are in Picture-in-Picture."
Status: Started (was: Assigned)
So, from what I can tell, in the case that I'm testing (PiPing the MediaStream video in https://beaufortfrancois.github.io/sandbox/media/picture-in-picture-playground), no frames are being suspended, but the background is still black.

It could be that there are two different issues happening here. When I was tracking down this issue, it seemed to be a problem with PiP specific code, not at the mediaplayer level.
So the reason why the background is always black is because of this line
https://cs.chromium.org/chromium/src/chrome/browser/ui/views/overlay/overlay_window_views.cc?rcl=4667a219b729a7e3cb1dc6b31d3f5ca024715dd9&l=269

I don't understand fully what we would want it to be. I can pass opacity information through, and that solves the issue I'm looking at, but I'm not too sure what you all are trying to solve/would want things to look like.
*fully understand
Status: WontFix (was: Started)
This happens to be a side effect of using <video autplay muted>: they end up being paused when not visible which leads to this.
Description: Show this description
I've added steps to reproduce in the description.

Please re-open as I can reproduce without "muted". 
Status: Started (was: WontFix)
I think I've found the issue. See https://chromium-review.googlesource.com/c/chromium/src/+/1299003
Cc: lethalantidote@chromium.org
Owner: fbeaufort@chromium.org
Project Member

Comment 14 by bugdroid1@chromium.org, Oct 25

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

commit 0c7cd64aec528b8355ed040fe502ffc8c7dee33c
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Thu Oct 25 21:45:36 2018

Always show mediastream video if Picture-in-Picture

This CL makes sure that a mediastream video always get painted if it is
in Picture-in-Picture.

Bug:  893062 
Change-Id: I0bf5fbe744a98155135dcade83e6ba7646d2f6b3
Reviewed-on: https://chromium-review.googlesource.com/c/1299003
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Emircan Uysaler <emircan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602865}
[modify] https://crrev.com/0c7cd64aec528b8355ed040fe502ffc8c7dee33c/content/renderer/media/stream/webmediaplayer_ms.cc
[modify] https://crrev.com/0c7cd64aec528b8355ed040fe502ffc8c7dee33c/content/renderer/media/stream/webmediaplayer_ms.h

Labels: Merge-Request-71
Project Member

Comment 16 by sheriffbot@chromium.org, Oct 26

Labels: -Merge-Request-71 Hotlist-Merge-Review Merge-Review-71
This bug requires manual review: M71 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: benmason@(Android), kariahda@(iOS), kbleicher@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: vamshi.kommuri@chromium.org
Labels: Needs-Feedback
Tried checking the issue on latest chrome version 72.0.3592.0 using Mac 10.13.1 with the below mentioned steps.
1. Launched Chrome
2. Navigated to https://beaufortfrancois.github.io/sandbox/media/picture-in-picture-get-user-media.html
3. Clicked on "Toggle Picture-in-Picture" button
4. Then clicked on "Toggle video visibility" button
In step 3 after clicking "Toggle Picture-in-Picture" button, Still observing the black screen. Attaching the screen cast of the same for reference.

@François Beaufort: Could you please have a look at the screen cast and let us know if we have missed anything while testing the issue. And requesting you to help us in verifying the fix.

Thanks!
893062.mp4
1.8 MB View Download
 fbeaufort@, PTAL comment #17 and verify the bug on latest canary, also pls provide merge justification. Thank you.
Picture-in-Picture window (in the corner) is not black anymore. So we're good. Thanks for testing  vamshi.kommuri!

govind@, we're aiming to experiment with Picture-in-Picture for MediaStreams in Beta M71. The intent is to be able to use a finch experiment.

Labels: -Merge-Review-71 Merge-Approved-71
Thank you  fbeaufort@.

Approving merge to M71 branch 3578 based on comment #19. Pls merge  before 3:00 PM PT, Monday so we can pick it up for next week Beta release. Thank you.
Project Member

Comment 21 by bugdroid1@chromium.org, Oct 27

Labels: -merge-approved-71 merge-merged-3578
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f8d863a28d55d9369058e31a8715b554867f3836

commit f8d863a28d55d9369058e31a8715b554867f3836
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Sat Oct 27 06:31:30 2018

Always show mediastream video if Picture-in-Picture

This CL makes sure that a mediastream video always get painted if it is
in Picture-in-Picture.

Bug:  893062 
Change-Id: I0bf5fbe744a98155135dcade83e6ba7646d2f6b3
Reviewed-on: https://chromium-review.googlesource.com/c/1299003
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Emircan Uysaler <emircan@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#602865}(cherry picked from commit 0c7cd64aec528b8355ed040fe502ffc8c7dee33c)
Reviewed-on: https://chromium-review.googlesource.com/c/1303335
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/branch-heads/3578@{#358}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
[modify] https://crrev.com/f8d863a28d55d9369058e31a8715b554867f3836/content/renderer/media/stream/webmediaplayer_ms.cc
[modify] https://crrev.com/f8d863a28d55d9369058e31a8715b554867f3836/content/renderer/media/stream/webmediaplayer_ms.h

Labels: Merge-Merged-71-3578
The following revision refers to this bug: 
https://chromium.googlesource.com/chromium/src.git/+/f8d863a28d55d9369058e31a8715b554867f3836

Commit: f8d863a28d55d9369058e31a8715b554867f3836
Author: beaufort.francois@gmail.com
Commiter: beaufort.francois@gmail.com
Date: 2018-10-27 06:31:30 +0000 UTC

Always show mediastream video if Picture-in-Picture

This CL makes sure that a mediastream video always get painted if it is
in Picture-in-Picture.

Bug:  893062 
Change-Id: I0bf5fbe744a98155135dcade83e6ba7646d2f6b3
Reviewed-on: https://chromium-review.googlesource.com/c/1299003
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Emircan Uysaler <emircan@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#602865}(cherry picked from commit 0c7cd64aec528b8355ed040fe502ffc8c7dee33c)
Reviewed-on: https://chromium-review.googlesource.com/c/1303335
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/branch-heads/3578@{#358}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
Status: Verified (was: Started)
Labels: TE-Verified-M71 TE-Verified-M71.0.3578.30
Able to reproduce the issue on chrome version# 71.0.3578.20(Build without fix)
Verified the fix on Mac 10.12.6 and Windows-10 on Chrome version #71.0.3578.30 as per the comment#0
Attaching screen cast for reference.
Observed "video in PIP window continued playing"
Hence, the fix is working as expected.
Adding the verified label.

Thanks!


893062.mp4
1007 KB View Download

Sign in to add a comment