Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3280 { | 3280 { |
| 3281 if (webMediaPlayer()) | 3281 if (webMediaPlayer()) |
| 3282 webMediaPlayer()->setVolume(playerVolume()); | 3282 webMediaPlayer()->setVolume(playerVolume()); |
| 3283 | 3283 |
| 3284 if (hasMediaControls()) | 3284 if (hasMediaControls()) |
| 3285 mediaControls()->updateVolume(); | 3285 mediaControls()->updateVolume(); |
| 3286 } | 3286 } |
| 3287 | 3287 |
| 3288 double HTMLMediaElement::playerVolume() const | 3288 double HTMLMediaElement::playerVolume() const |
| 3289 { | 3289 { |
| 3290 double volumeMultiplier = 1; | 3290 // Spec reference: http://whatwg.org/c#effective-media-volume |
| 3291 bool shouldMute = m_muted; | |
| 3292 | 3291 |
| 3293 if (m_mediaController) { | 3292 if (m_muted) |
| 3294 volumeMultiplier *= m_mediaController->volume(); | 3293 return 0; |
| 3295 shouldMute = m_mediaController->muted(); | |
|
acolwell GONE FROM CHROMIUM
2014/08/06 23:51:05
So is the bug here then? IIUC the media controller
philipj_slow
2014/08/07 07:34:23
Precisely, the media element's and the media contr
| |
| 3296 } | |
| 3297 | 3294 |
| 3298 return shouldMute ? 0 : m_volume * volumeMultiplier; | 3295 if (m_mediaController && m_mediaController->muted()) |
| 3296 return 0; | |
| 3297 | |
| 3298 double volume = m_volume; | |
| 3299 | |
| 3300 if (m_mediaController) | |
| 3301 volume *= m_mediaController->volume(); | |
| 3302 | |
| 3303 return volume; | |
| 3299 } | 3304 } |
| 3300 | 3305 |
| 3301 void HTMLMediaElement::updatePlayState() | 3306 void HTMLMediaElement::updatePlayState() |
| 3302 { | 3307 { |
| 3303 if (!m_player) | 3308 if (!m_player) |
| 3304 return; | 3309 return; |
| 3305 | 3310 |
| 3306 bool isPlaying = webMediaPlayer() && !webMediaPlayer()->paused(); | 3311 bool isPlaying = webMediaPlayer() && !webMediaPlayer()->paused(); |
| 3307 if (m_pausedInternal) { | 3312 if (m_pausedInternal) { |
| 3308 if (isPlaying) | 3313 if (isPlaying) |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3984 | 3989 |
| 3985 #if ENABLE(WEB_AUDIO) | 3990 #if ENABLE(WEB_AUDIO) |
| 3986 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3991 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
| 3987 { | 3992 { |
| 3988 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 3993 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
| 3989 audioSourceProvider()->setClient(0); | 3994 audioSourceProvider()->setClient(0); |
| 3990 } | 3995 } |
| 3991 #endif | 3996 #endif |
| 3992 | 3997 |
| 3993 } | 3998 } |
| OLD | NEW |