Commit 44dd0d00 authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Use kOnDemand for MediaStream if player starts in PIP.

This fixes SurfaceLayer kOnDemand mode to work with
webmediaplayer_ms when the player starts in PIP.

Previously, the player wouldn't use SurfaceLayer, since it would
wait to enter PIP.  Now, it checks if the client is already in PIP,
and switches to SurfaceLayer immediately in kOnDemand mode.

Bug: 891619
Change-Id: I669003b512152cc22c3e0d1f7d69133304669108
Reviewed-on: https://chromium-review.googlesource.com/c/1301958Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603577}
parent 9a0f2af8
......@@ -1115,7 +1115,11 @@ void WebMediaPlayerMS::OnFirstFrameReceived(media::VideoRotation video_rotation,
OnRotationChanged(video_rotation);
OnOpacityChanged(is_opaque);
if (surface_layer_mode_ == blink::WebMediaPlayer::SurfaceLayerMode::kAlways) {
if (surface_layer_mode_ == blink::WebMediaPlayer::SurfaceLayerMode::kAlways ||
(surface_layer_mode_ ==
blink::WebMediaPlayer::SurfaceLayerMode::kOnDemand &&
client_->DisplayType() ==
WebMediaPlayer::DisplayType::kPictureInPicture)) {
ActivateSurfaceLayerForVideo();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment