2009-08-25 Eric Carlson <eric.carlson@apple.com>

        Reviewed by Simon Fraser.

        Setting the volume of a media element has no effect if called too early
        https://bugs.webkit.org/show_bug.cgi?id=28731

        * manual-tests/audio-volume.html: 
            Added.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::setVolume):
        (WebCore::MediaPlayerPrivate::setRate):
            Don't bail if metadata hasn't been loaded, it is fine to set rate and/or
            volume as soon as the movie has been created.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1e06d8b2
2009-08-25 Eric Carlson <eric.carlson@apple.com>
Reviewed by Simon Fraser.
Setting the volume of a media element has no effect if called too early
https://bugs.webkit.org/show_bug.cgi?id=28731
* manual-tests/audio-volume.html:
Added.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivate::setVolume):
(WebCore::MediaPlayerPrivate::setRate):
Don't bail if metadata hasn't been loaded, it is fine to set rate and/or
volume as soon as the movie has been created.
2009-08-25 David Levin <levin@chromium.org>
Reviewed by Maciej Stachowiak.
<html>
<script>
function load()
{
var url="http://movies.apple.com/movies/us/apple/ipoditunes/2007/touch/ads/apple_ipodtouch_touch_r640-9cie.mov";
var vid = document.getElementById('vid')
vid.src = url;
vid.volume = 0.05;
vid.load();
}
function setVolume(vol)
{
var vid = document.getElementById('vid')
vid.volume = vol;
}
</script>
<body>
<video id=vid controls autoplay>
</video>
<p>TEST: Audio volume should be 0.05 when the movie begins playing.</p>
<input type="button" value="Load movie" onclick="load()">
<br>
<input type="button" value="volume=1.0" onclick="setVolume(1.0)">
<input type="button" value="volume=0.05" onclick="setVolume(0.05)">
</body>
</html?
......@@ -730,16 +730,14 @@ bool MediaPlayerPrivate::hasAudio() const
void MediaPlayerPrivate::setVolume(float volume)
{
if (!metaDataAvailable())
return;
[m_qtMovie.get() setVolume:volume];
if (m_qtMovie)
[m_qtMovie.get() setVolume:volume];
}
void MediaPlayerPrivate::setRate(float rate)
{
if (!metaDataAvailable())
return;
[m_qtMovie.get() setRate:rate];
if (m_qtMovie)
[m_qtMovie.get() setRate:rate];
}
void MediaPlayerPrivate::setPreservesPitch(bool preservesPitch)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment