Index: media/blink/webmediaplayer_impl.cc |
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
index cdebe7739579127cc1db0a4aadd49269324e37b7..e67b8033e7dc0842e5bb4109aeb099e6a32a10f2 100644 |
--- a/media/blink/webmediaplayer_impl.cc |
+++ b/media/blink/webmediaplayer_impl.cc |
@@ -227,7 +227,8 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( |
suppress_destruction_errors_(false), |
can_suspend_state_(CanSuspendState::UNKNOWN), |
is_encrypted_(false), |
- underflow_count_(0) { |
+ underflow_count_(0), |
+ observer_(params.media_observer()) { |
DCHECK(!adjust_allocated_memory_cb_.is_null()); |
DCHECK(renderer_factory_); |
DCHECK(client_); |
@@ -334,11 +335,15 @@ void WebMediaPlayerImpl::DisableOverlay() { |
void WebMediaPlayerImpl::enteredFullscreen() { |
if (!force_video_overlays_ && !disable_fullscreen_video_overlays_) |
EnableOverlay(); |
+ if (observer_) |
+ observer_->OnEnteredFullscreen(); |
} |
void WebMediaPlayerImpl::exitedFullscreen() { |
if (!force_video_overlays_ && !disable_fullscreen_video_overlays_) |
DisableOverlay(); |
+ if (observer_) |
+ observer_->OnExitedFullscreen(); |
} |
void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
@@ -959,6 +964,9 @@ void WebMediaPlayerImpl::SetCdm(blink::WebContentDecryptionModule* cdm) { |
return; |
} |
+ if (observer_) |
+ observer_->OnSetCdm(cdm_context); |
+ |
// Keep the reference to the CDM, as it shouldn't be destroyed until |
// after the pipeline is done with the |cdm_context|. |
pending_cdm_ = std::move(cdm_reference); |
@@ -1112,6 +1120,9 @@ void WebMediaPlayerImpl::OnMetadata(PipelineMetadata metadata) { |
client_->setWebLayer(video_weblayer_.get()); |
} |
+ if (observer_) |
+ observer_->OnMetadataChanged(metadata); |
+ |
CreateWatchTimeReporter(); |
UpdatePlayState(); |
} |