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

Unified Diff: webkit/media/webmediaplayer_ms.cc

Issue 15035013: Keep screen on when there is an active WebRTC session on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review: nits Created 7 years, 7 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 | « content/public/android/java/src/org/chromium/content/browser/ContentVideoViewContextDelegate.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_ms.cc
===================================================================
--- webkit/media/webmediaplayer_ms.cc (revision 201139)
+++ webkit/media/webmediaplayer_ms.cc (working copy)
@@ -142,18 +142,20 @@
DVLOG(1) << "WebMediaPlayerMS::play";
DCHECK(thread_checker_.CalledOnValidThread());
- if (video_frame_provider_ && paused_)
- video_frame_provider_->Play();
+ if (paused_) {
+ if (video_frame_provider_)
+ video_frame_provider_->Play();
- if (audio_renderer_ && paused_)
- audio_renderer_->Play();
+ if (audio_renderer_)
+ audio_renderer_->Play();
+ if (delegate_)
+ delegate_->DidPlay(this);
+ }
+
paused_ = false;
media_log_->AddEvent(media_log_->CreateEvent(media::MediaLogEvent::PLAY));
-
- if (delegate_)
- delegate_->DidPlay(this);
}
void WebMediaPlayerMS::pause() {
@@ -163,15 +165,17 @@
if (video_frame_provider_)
video_frame_provider_->Pause();
- if (audio_renderer_ && !paused_)
- audio_renderer_->Pause();
+ if (!paused_) {
+ if (audio_renderer_)
+ audio_renderer_->Pause();
+ if (delegate_)
+ delegate_->DidPause(this);
+ }
+
paused_ = true;
media_log_->AddEvent(media_log_->CreateEvent(media::MediaLogEvent::PAUSE));
-
- if (delegate_)
- delegate_->DidPause(this);
}
bool WebMediaPlayerMS::supportsFullscreen() const {
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentVideoViewContextDelegate.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698