diff options
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r-- | Source/WebCore/html/HTMLMediaElement.cpp | 10 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLMediaElement.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp index 395aabe80..6d5d6ee72 100644 --- a/Source/WebCore/html/HTMLMediaElement.cpp +++ b/Source/WebCore/html/HTMLMediaElement.cpp @@ -265,6 +265,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum , m_readyState(HAVE_NOTHING) , m_readyStateMaximum(HAVE_NOTHING) , m_volume(1.0f) + , m_volumeInitialized(false) , m_lastSeekTime(0) , m_previousProgressTime(numeric_limits<double>::max()) , m_lastTimeUpdateEventWallTime(0) @@ -2736,6 +2737,7 @@ void HTMLMediaElement::setVolume(double vol, ExceptionCode& ec) if (m_volume != vol) { m_volume = vol; + m_volumeInitialized = true; updateVolume(); scheduleEvent(eventNames().volumechangeEvent); } @@ -4000,7 +4002,8 @@ void HTMLMediaElement::updateVolume() } m_player->setMuted(shouldMute); - m_player->setVolume(m_volume * volumeMultiplier); + if (m_volumeInitialized) + m_player->setVolume(m_volume * volumeMultiplier); } if (hasMediaControls()) @@ -5104,6 +5107,11 @@ void HTMLMediaElement::mediaPlayerPlay() play(); } +bool HTMLMediaElement::mediaPlayerPlatformVolumeConfigurationRequired() const +{ + return !m_volumeInitialized; +} + bool HTMLMediaElement::mediaPlayerIsPaused() const { return paused(); diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h index 66bd638b5..be8a7b1e8 100644 --- a/Source/WebCore/html/HTMLMediaElement.h +++ b/Source/WebCore/html/HTMLMediaElement.h @@ -504,6 +504,7 @@ private: virtual void mediaPlayerSetSize(const IntSize&) OVERRIDE; virtual void mediaPlayerPause() OVERRIDE; virtual void mediaPlayerPlay() OVERRIDE; + virtual bool mediaPlayerPlatformVolumeConfigurationRequired() const OVERRIDE; virtual bool mediaPlayerIsPaused() const OVERRIDE; virtual bool mediaPlayerIsLooping() const OVERRIDE; virtual HostWindow* mediaPlayerHostWindow() OVERRIDE; @@ -640,6 +641,7 @@ private: RefPtr<MediaError> m_error; double m_volume; + bool m_volumeInitialized; double m_lastSeekTime; unsigned m_previousProgress; |