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

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 444173002: Let the effective media volume be 0 if the media element is muted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "config.h" 5 #include "config.h"
6 #include "web/WebMediaPlayerClientImpl.h" 6 #include "web/WebMediaPlayerClientImpl.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/html/HTMLMediaElement.h" 9 #include "core/html/HTMLMediaElement.h"
10 #include "core/html/TimeRanges.h" 10 #include "core/html/TimeRanges.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void WebMediaPlayerClientImpl::durationChanged() 99 void WebMediaPlayerClientImpl::durationChanged()
100 { 100 {
101 m_client->mediaPlayerDurationChanged(); 101 m_client->mediaPlayerDurationChanged();
102 } 102 }
103 103
104 void WebMediaPlayerClientImpl::sizeChanged() 104 void WebMediaPlayerClientImpl::sizeChanged()
105 { 105 {
106 m_client->mediaPlayerSizeChanged(); 106 m_client->mediaPlayerSizeChanged();
107 } 107 }
108 108
109 double WebMediaPlayerClientImpl::volume() const 109 double WebMediaPlayerClientImpl::volume() const
acolwell GONE FROM CHROMIUM 2014/08/07 15:52:59 I'm assuming a followup CL to remove this function
philipj_slow 2014/08/07 15:59:28 Exactly, this CL is how I noticed this oddity. It
110 { 110 {
111 return mediaElement().playerVolume(); 111 return mediaElement().effectiveMediaVolume();
112 } 112 }
113 113
114 void WebMediaPlayerClientImpl::playbackStateChanged() 114 void WebMediaPlayerClientImpl::playbackStateChanged()
115 { 115 {
116 m_client->mediaPlayerPlaybackStateChanged(); 116 m_client->mediaPlayerPlaybackStateChanged();
117 } 117 }
118 118
119 WebMediaPlayer::Preload WebMediaPlayerClientImpl::preload() const 119 WebMediaPlayer::Preload WebMediaPlayerClientImpl::preload() const
120 { 120 {
121 return static_cast<WebMediaPlayer::Preload>(m_preload); 121 return static_cast<WebMediaPlayer::Preload>(m_preload);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 KURL kurl(ParsedURLString, url); 205 KURL kurl(ParsedURLString, url);
206 m_webMediaPlayer = createWebMediaPlayer(this, kurl, frame); 206 m_webMediaPlayer = createWebMediaPlayer(this, kurl, frame);
207 if (!m_webMediaPlayer) 207 if (!m_webMediaPlayer)
208 return; 208 return;
209 209
210 #if ENABLE(WEB_AUDIO) 210 #if ENABLE(WEB_AUDIO)
211 // Make sure if we create/re-create the WebMediaPlayer that we update our wr apper. 211 // Make sure if we create/re-create the WebMediaPlayer that we update our wr apper.
212 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); 212 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider());
213 #endif 213 #endif
214 214
215 m_webMediaPlayer->setVolume(mediaElement().playerVolume()); 215 m_webMediaPlayer->setVolume(mediaElement().effectiveMediaVolume());
216 216
217 m_webMediaPlayer->setPoster(poster); 217 m_webMediaPlayer->setPoster(poster);
218 218
219 // Tell WebMediaPlayer about any connected CDM (may be null). 219 // Tell WebMediaPlayer about any connected CDM (may be null).
220 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia: :contentDecryptionModule(mediaElement())); 220 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia: :contentDecryptionModule(mediaElement()));
221 m_webMediaPlayer->load(loadType, kurl, corsMode); 221 m_webMediaPlayer->load(loadType, kurl, corsMode);
222 } 222 }
223 223
224 void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload) 224 void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload)
225 { 225 {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 308
309 void WebMediaPlayerClientImpl::AudioClientImpl::trace(Visitor* visitor) 309 void WebMediaPlayerClientImpl::AudioClientImpl::trace(Visitor* visitor)
310 { 310 {
311 visitor->trace(m_client); 311 visitor->trace(m_client);
312 } 312 }
313 313
314 #endif 314 #endif
315 315
316 } // namespace blink 316 } // namespace blink
OLDNEW
« LayoutTests/media/effective-media-volume.html ('K') | « Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698