| Index: media/blink/webmediaplayer_impl.cc
|
| diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
|
| index 4b8151a4076ce48a68c5b93fd2d18e267bb3d20f..e12813585a282ab060079c4496d47e3d765fc428 100644
|
| --- a/media/blink/webmediaplayer_impl.cc
|
| +++ b/media/blink/webmediaplayer_impl.cc
|
| @@ -1349,7 +1349,7 @@ void WebMediaPlayerImpl::OnHidden() {
|
| if (watch_time_reporter_)
|
| watch_time_reporter_->OnHidden();
|
|
|
| - if (IsBackgroundVideoTrackOptimizationEnabled()) {
|
| + if (!IsStreaming() && IsBackgroundVideoTrackOptimizationEnabled()) {
|
| if (ShouldPauseWhenHidden()) {
|
| // OnPause() will set |paused_when_hidden_| to false and call
|
| // UpdatePlayState(), so set the flag to true after and then return.
|
| @@ -1378,7 +1378,7 @@ void WebMediaPlayerImpl::OnShown() {
|
| base::Bind(&VideoFrameCompositor::SetForegroundTime,
|
| base::Unretained(compositor_), base::TimeTicks::Now()));
|
|
|
| - if (IsBackgroundVideoTrackOptimizationEnabled()) {
|
| + if (!IsStreaming() && IsBackgroundVideoTrackOptimizationEnabled()) {
|
| if (paused_when_hidden_) {
|
| paused_when_hidden_ = false;
|
| OnPlay(); // Calls UpdatePlayState() so return afterwards.
|
| @@ -1679,7 +1679,7 @@ void WebMediaPlayerImpl::StartPipeline() {
|
| // TODO(sandersd): FileSystem objects may also be non-static, but due to our
|
| // caching layer such situations are broken already. http://crbug.com/593159
|
| bool is_static = !chunk_demuxer_;
|
| - bool is_streaming = data_source_ && data_source_->IsStreaming();
|
| + bool is_streaming = IsStreaming();
|
| UMA_HISTOGRAM_BOOLEAN("Media.IsStreaming", is_streaming);
|
|
|
| // ... and we're ready to go!
|
| @@ -1768,7 +1768,7 @@ void WebMediaPlayerImpl::UpdatePlayState() {
|
| bool is_streaming = false;
|
| #else
|
| bool is_remote = false;
|
| - bool is_streaming = data_source_ && data_source_->IsStreaming();
|
| + bool is_streaming = IsStreaming();
|
| #endif
|
|
|
| bool is_suspended = pipeline_controller_.IsSuspended();
|
| @@ -2061,6 +2061,10 @@ bool WebMediaPlayerImpl::IsHidden() const {
|
| return delegate_ && delegate_->IsHidden();
|
| }
|
|
|
| +bool WebMediaPlayerImpl::IsStreaming() const {
|
| + return data_source_ && data_source_->IsStreaming();
|
| +}
|
| +
|
| bool WebMediaPlayerImpl::DoesOverlaySupportMetadata() const {
|
| return pipeline_metadata_.video_rotation == VIDEO_ROTATION_0;
|
| }
|
|
|