Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2620433002: Inform MediaObserver when video natural size changes. (Closed)
Patch Set: Addressed comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index b6a56c2cd26dce38c4fc4676e610e77460f315e6..1c6857dbf39c4b57e0277144b27f700da1127a69 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1312,14 +1312,20 @@ void WebMediaPlayerImpl::OnVideoNaturalSizeChange(const gfx::Size& size) {
if (overlay_enabled_ && surface_manager_)
surface_manager_->NaturalSizeChanged(rotated_size);
- if (pipeline_metadata_.natural_size.IsEmpty()) {
+ gfx::Size old_size = pipeline_metadata_.natural_size;
+ pipeline_metadata_.natural_size = rotated_size;
+ if (old_size.IsEmpty()) {
// WatchTimeReporter doesn't report metrics for empty videos. Re-create
// |watch_time_reporter_| if we didn't originally know the video size.
CreateWatchTimeReporter();
}
-
- pipeline_metadata_.natural_size = rotated_size;
client_->sizeChanged();
+
+ if (observer_) {
+ PipelineMetadata metadata = pipeline_metadata_;
+ metadata.natural_size = size;
+ observer_->OnMetadataChanged(metadata);
+ }
}
void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698