mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 534571 - Fire video timeupdate event when starting a new load. r=roc,dolske a=blocking2.0
This commit is contained in:
parent
73b058163d
commit
f4072085aa
@ -478,7 +478,9 @@ void nsHTMLMediaElement::AbortExistingLoads()
|
||||
// with a different load ID to silently be cancelled.
|
||||
mCurrentLoadID++;
|
||||
|
||||
PRBool fireTimeUpdate = PR_FALSE;
|
||||
if (mDecoder) {
|
||||
fireTimeUpdate = mDecoder->GetCurrentTime() != 0.0;
|
||||
mDecoder->Shutdown();
|
||||
mDecoder = nsnull;
|
||||
}
|
||||
@ -505,7 +507,13 @@ void nsHTMLMediaElement::AbortExistingLoads()
|
||||
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING);
|
||||
mPaused = PR_TRUE;
|
||||
|
||||
// TODO: The current playback position must be set to 0.
|
||||
if (fireTimeUpdate) {
|
||||
// Since we destroyed the decoder above, the current playback position
|
||||
// will now be reported as 0. The playback position was non-zero when
|
||||
// we destroyed the decoder, so fire a timeupdate event so that the
|
||||
// change will be reflected in the controls.
|
||||
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("timeupdate"));
|
||||
}
|
||||
DispatchSimpleEvent(NS_LITERAL_STRING("emptied"));
|
||||
}
|
||||
|
||||
|
@ -448,6 +448,7 @@
|
||||
this.maxCurrentTimeSeen = 0;
|
||||
this.statusIcon.setAttribute("type", "throbber");
|
||||
this.isAudioOnly = (this.video instanceof HTMLAudioElement);
|
||||
this.setPlayButtonState(true);
|
||||
break;
|
||||
case "durationchange":
|
||||
var duration = Math.round(this.video.duration * 1000); // in ms
|
||||
|
Loading…
Reference in New Issue
Block a user