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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 2475473002: Implement one-shot audio focus inside MediaSession (Closed)
Patch Set: fixed a case where removing the last one-shot player Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « content/common/media/media_player_delegate_messages.h ('k') | media/base/media_content_type.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 if (video_frame_provider_) 175 if (video_frame_provider_)
176 video_frame_provider_->Resume(); 176 video_frame_provider_->Resume();
177 177
178 compositor_->StartRendering(); 178 compositor_->StartRendering();
179 179
180 if (audio_renderer_) 180 if (audio_renderer_)
181 audio_renderer_->Play(); 181 audio_renderer_->Play();
182 182
183 if (delegate_) { 183 if (delegate_) {
184 // TODO(perkj, magjed): We use Uncontrollable type here to avoid creating an 184 // TODO(perkj, magjed): We use OneShot focus type here so that it takes
185 // interactive media session on Android. See http://crbug.com/596516 for 185 // audio focus once it starts, and then will not respond to further audio
186 // more details. 186 // focus changes. See http://crbug.com/596516 for more details.
187 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, 187 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false,
188 media::MediaContentType::Persistent); 188 media::MediaContentType::OneShot);
189 } 189 }
190 190
191 paused_ = false; 191 paused_ = false;
192 } 192 }
193 193
194 void WebMediaPlayerMS::pause() { 194 void WebMediaPlayerMS::pause() {
195 DVLOG(1) << __func__; 195 DVLOG(1) << __func__;
196 DCHECK(thread_checker_.CalledOnValidThread()); 196 DCHECK(thread_checker_.CalledOnValidThread());
197 197
198 should_play_upon_shown_ = false; 198 should_play_upon_shown_ = false;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 void WebMediaPlayerMS::ResetCanvasCache() { 561 void WebMediaPlayerMS::ResetCanvasCache() {
562 DCHECK(thread_checker_.CalledOnValidThread()); 562 DCHECK(thread_checker_.CalledOnValidThread());
563 video_renderer_.ResetCache(); 563 video_renderer_.ResetCache();
564 } 564 }
565 565
566 void WebMediaPlayerMS::TriggerResize() { 566 void WebMediaPlayerMS::TriggerResize() {
567 get_client()->sizeChanged(); 567 get_client()->sizeChanged();
568 } 568 }
569 569
570 } // namespace content 570 } // namespace content
OLDNEW
« no previous file with comments | « content/common/media/media_player_delegate_messages.h ('k') | media/base/media_content_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698