Commit f0000a8e authored by jer.noble@apple.com's avatar jer.noble@apple.com
Browse files

2011-01-14 Jer Noble <jer.noble@apple.com>

        Reviewed by Eric Carlson.

        REGRESSION (r71842): Compass video is not playing in Safari welcome page
        https://bugs.webkit.org/show_bug.cgi?id=52506

        Test that a delay between loading and playing video does not break playback.

        * media/video-currentTime-delay-expected.txt: Added.
        * media/video-currentTime-delay.html: Added.
2011-01-14  Jer Noble  <jer.noble@apple.com>

        Reviewed by Eric Carlson.

        REGRESSION (r71842): Compass video is not playing in Safari welcome page
        https://bugs.webkit.org/show_bug.cgi?id=52506

        New test: LayoutTests/media/video-currentTime-delay.html

        Call invalidateCachedTime() every time one of the cached property dependencies changes,
        i.e. m_paused and m_playbackRate.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::prepareForLoad):
        (WebCore::HTMLMediaElement::setReadyState):
        (WebCore::HTMLMediaElement::setPlaybackRate):
        (WebCore::HTMLMediaElement::mediaPlayerRateChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4f5eeeb8
2011-01-14 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
REGRESSION (r71842): Compass video is not playing in Safari welcome page
https://bugs.webkit.org/show_bug.cgi?id=52506
Test that a delay between loading and playing video does not break playback.
* media/video-currentTime-delay-expected.txt: Added.
* media/video-currentTime-delay.html: Added.
2011-01-20 Ryosuke Niwa <rniwa@webkit.org>
 
Unreviewed Chromium test expectations fix.
......
Test a delay in playing the movie results in a canPlay event.
EVENT(canplaythrough)
EXPECTED (video.currentTime == '0') OK
RUN(video.currentTime = video.duration - 0.2)
EVENT(seeked)
RUN(video.play())
EVENT(ended)
END OF TEST
<html>
<body>
<video controls></video>
<p>Test a delay in playing the movie results in a canPlay event.</p>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
waitForEvent('canplaythrough',
function () {
waitForEventAndEnd('ended');
testExpected("video.currentTime", 0);
run("video.currentTime = video.duration - 0.2");
});
waitForEvent('seeked',
function () {
setTimeout(function() {
run("video.play()");
}, 400);
var timeout = 2000;
setTimeout(function () { logResult(false, "No 'ended' event in " + timeout/1000 + " seconds"); }, timeout);
});
video.src = findMediaFile("video", "content/test");
</script>
</body>
</html>
2011-01-14 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
REGRESSION (r71842): Compass video is not playing in Safari welcome page
https://bugs.webkit.org/show_bug.cgi?id=52506
New test: LayoutTests/media/video-currentTime-delay.html
Call invalidateCachedTime() every time one of the cached property dependencies changes,
i.e. m_paused and m_playbackRate.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::setPlaybackRate):
(WebCore::HTMLMediaElement::mediaPlayerRateChanged):
2011-01-20 Beth Dakin <bdakin@apple.com>
 
Reviewed by Geoffrey Garen.
......@@ -540,6 +540,7 @@ void HTMLMediaElement::prepareForLoad()
refreshCachedTime();
m_paused = true;
m_seeking = false;
invalidateCachedTime();
scheduleEvent(eventNames().emptiedEvent);
}
......@@ -991,6 +992,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
if (m_autoplaying && m_paused && autoplay()) {
m_paused = false;
invalidateCachedTime();
scheduleEvent(eventNames().playEvent);
scheduleEvent(eventNames().playingEvent);
}
......@@ -1300,6 +1302,7 @@ void HTMLMediaElement::setPlaybackRate(float rate)
if (m_playbackRate != rate) {
m_playbackRate = rate;
invalidateCachedTime();
scheduleEvent(eventNames().ratechangeEvent);
}
if (m_player && potentiallyPlaying() && m_player->rate() != rate)
......@@ -1404,6 +1407,7 @@ void HTMLMediaElement::playInternal()
if (m_paused) {
m_paused = false;
invalidateCachedTime();
scheduleEvent(eventNames().playEvent);
if (m_readyState <= HAVE_CURRENT_DATA)
......@@ -1891,6 +1895,7 @@ void HTMLMediaElement::mediaPlayerRateChanged(MediaPlayer*)
// Stash the rate in case the one we tried to set isn't what the engine is
// using (eg. it can't handle the rate we set)
m_playbackRate = m_player->rate();
invalidateCachedTime();
endProcessingMediaPlayerCallback();
}
......
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