зеркало из https://github.com/mozilla/pjs.git
Bug 495319. Fire 'timeupdate' with the correct final time when we finish playing. r=doublec
This commit is contained in:
Родитель
13e0a276af
Коммит
055caa25a5
|
@ -1721,6 +1721,9 @@ nsresult nsOggDecodeStateMachine::Run()
|
|||
continue;
|
||||
}
|
||||
|
||||
// Set the right current time
|
||||
mCurrentFrameTime += mCallbackPeriod;
|
||||
|
||||
mon.Exit();
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
NS_NEW_RUNNABLE_METHOD(nsOggDecoder, mDecoder, PlaybackEnded);
|
||||
|
@ -2185,6 +2188,7 @@ void nsOggDecoder::PlaybackEnded()
|
|||
if (mShuttingDown || mPlayState == nsOggDecoder::PLAY_STATE_SEEKING)
|
||||
return;
|
||||
|
||||
PlaybackPositionChanged();
|
||||
ChangeState(PLAY_STATE_ENDED);
|
||||
|
||||
if (mElement) {
|
||||
|
|
|
@ -74,6 +74,7 @@ _TEST_FILES += \
|
|||
test_bug493187.html \
|
||||
test_bug495145.html \
|
||||
test_bug495300.html \
|
||||
test_bug495319.html \
|
||||
test_can_play_type_ogg.html \
|
||||
test_closing_connections.html \
|
||||
test_contentDuration1.html \
|
||||
|
@ -112,6 +113,7 @@ _TEST_FILES += \
|
|||
contentDuration5.sjs \
|
||||
contentDuration6.sjs \
|
||||
seek.ogv \
|
||||
small-shot.ogg \
|
||||
sound.ogg \
|
||||
$(NULL)
|
||||
|
||||
|
|
Двоичный файл не отображается.
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=495319
|
||||
-->
|
||||
|
||||
<head>
|
||||
<title>Bug 495319 - playing back small audio files should fire timeupdate</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=495319">Mozilla Bug 495319</a>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
var v;
|
||||
var timeUpdateCount = 0;
|
||||
|
||||
function timeUpdate(event) {
|
||||
++timeUpdateCount;
|
||||
}
|
||||
|
||||
function done(event) {
|
||||
ok(timeUpdateCount > 0, "Should see at least one timeupdate: " + event.target.currentTime);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</pre>
|
||||
<audio src='small-shot.ogg' ontimeupdate="timeUpdate(event)" onended='done(event)' controls autoplay></video>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче