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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 217103004: Ignore MediaController in the muted/volume controls logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: repaint in updateVolume Created 6 years, 9 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/MediaController.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 /* 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 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 { 2110 {
2111 WTF_LOG(Media, "HTMLMediaElement::setMuted(%s)", boolString(muted)); 2111 WTF_LOG(Media, "HTMLMediaElement::setMuted(%s)", boolString(muted));
2112 2112
2113 if (m_muted == muted) 2113 if (m_muted == muted)
2114 return; 2114 return;
2115 2115
2116 m_muted = muted; 2116 m_muted = muted;
2117 2117
2118 updateVolume(); 2118 updateVolume();
2119 2119
2120 if (hasMediaControls())
2121 mediaControls()->changedMute();
2122
2123 scheduleEvent(EventTypeNames::volumechange); 2120 scheduleEvent(EventTypeNames::volumechange);
2124 } 2121 }
2125 2122
2126 // The spec says to fire periodic timeupdate events (those sent while playing) e very 2123 // The spec says to fire periodic timeupdate events (those sent while playing) e very
2127 // "15 to 250ms", we choose the slowest frequency 2124 // "15 to 250ms", we choose the slowest frequency
2128 static const double maxTimeupdateEventFrequency = 0.25; 2125 static const double maxTimeupdateEventFrequency = 0.25;
2129 2126
2130 void HTMLMediaElement::startPlaybackProgressTimer() 2127 void HTMLMediaElement::startPlaybackProgressTimer()
2131 { 2128 {
2132 if (m_playbackProgressTimer.isActive()) 2129 if (m_playbackProgressTimer.isActive())
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2965 // return !paused() && m_readyState >= HAVE_FUTURE_DATA && [UA requires a dec itions from the user] 2962 // return !paused() && m_readyState >= HAVE_FUTURE_DATA && [UA requires a dec itions from the user]
2966 return false; 2963 return false;
2967 } 2964 }
2968 2965
2969 void HTMLMediaElement::updateVolume() 2966 void HTMLMediaElement::updateVolume()
2970 { 2967 {
2971 if (webMediaPlayer()) 2968 if (webMediaPlayer())
2972 webMediaPlayer()->setVolume(playerVolume()); 2969 webMediaPlayer()->setVolume(playerVolume());
2973 2970
2974 if (hasMediaControls()) 2971 if (hasMediaControls())
2975 mediaControls()->changedVolume(); 2972 mediaControls()->updateVolume();
2976 } 2973 }
2977 2974
2978 double HTMLMediaElement::playerVolume() const 2975 double HTMLMediaElement::playerVolume() const
2979 { 2976 {
2980 double volumeMultiplier = 1; 2977 double volumeMultiplier = 1;
2981 bool shouldMute = m_muted; 2978 bool shouldMute = m_muted;
2982 2979
2983 if (m_mediaController) { 2980 if (m_mediaController) {
2984 volumeMultiplier *= m_mediaController->volume(); 2981 volumeMultiplier *= m_mediaController->volume();
2985 shouldMute = m_mediaController->muted(); 2982 shouldMute = m_mediaController->muted();
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 { 3649 {
3653 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3650 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3654 } 3651 }
3655 3652
3656 bool HTMLMediaElement::isInteractiveContent() const 3653 bool HTMLMediaElement::isInteractiveContent() const
3657 { 3654 {
3658 return fastHasAttribute(controlsAttr); 3655 return fastHasAttribute(controlsAttr);
3659 } 3656 }
3660 3657
3661 } 3658 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/MediaController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698