Commit 92619d7e authored by Tommy Steimel's avatar Tommy Steimel Committed by Commit Bot

Only show default poster when the controls attr is set

TBR=mlamouri@chromium.org

Bug: 831688
Change-Id: I2086288cef72e2c2cc7ba581d4b7fb4f00562969
Reviewed-on: https://chromium-review.googlesource.com/1007887Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarBecca Hughes <beccahughes@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550056}
parent 71ab74de
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6"
}, },
{ {
"name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source use-default-poster'", "name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source'",
"bounds": [100, 100] "bounds": [100, 100]
}, },
{ {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6"
}, },
{ {
"name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source use-default-poster'", "name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source'",
"bounds": [100, 100] "bounds": [100, 100]
}, },
{ {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6"
}, },
{ {
"name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source use-default-poster'", "name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source'",
"bounds": [100, 100] "bounds": [100, 100]
}, },
{ {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6"
}, },
{ {
"name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source use-default-poster'", "name": "LayoutFlexibleBox (relative positioned) DIV class='phase-pre-ready state-no-source'",
"bounds": [100, 100] "bounds": [100, 100]
}, },
{ {
......
...@@ -676,7 +676,8 @@ void MediaControlsImpl::UpdateCSSClassFromState() { ...@@ -676,7 +676,8 @@ void MediaControlsImpl::UpdateCSSClassFromState() {
StringBuilder builder; StringBuilder builder;
builder.Append(kStateCSSClasses[state]); builder.Append(kStateCSSClasses[state]);
if (MediaElement().IsHTMLVideoElement() && !is_acting_as_audio_controls_ && if (MediaElement().ShouldShowControls() &&
MediaElement().IsHTMLVideoElement() && !is_acting_as_audio_controls_ &&
!VideoElement().HasAvailableVideoFrame() && !VideoElement().HasAvailableVideoFrame() &&
VideoElement().PosterImageURL().IsEmpty() && VideoElement().PosterImageURL().IsEmpty() &&
state <= ControlsState::kLoadingMetadata) { state <= ControlsState::kLoadingMetadata) {
...@@ -847,6 +848,7 @@ void MediaControlsImpl::MaybeShow() { ...@@ -847,6 +848,7 @@ void MediaControlsImpl::MaybeShow() {
loading_panel_->OnControlsShown(); loading_panel_->OnControlsShown();
timeline_->OnControlsShown(); timeline_->OnControlsShown();
UpdateCSSClassFromState();
} }
void MediaControlsImpl::Hide() { void MediaControlsImpl::Hide() {
...@@ -870,6 +872,8 @@ void MediaControlsImpl::Hide() { ...@@ -870,6 +872,8 @@ void MediaControlsImpl::Hide() {
EndScrubbing(); EndScrubbing();
} }
timeline_->OnControlsHidden(); timeline_->OnControlsHidden();
UpdateCSSClassFromState();
} }
bool MediaControlsImpl::IsVisible() const { bool MediaControlsImpl::IsVisible() const {
......
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