Skip to content

Commit

Permalink
Bug 1224936 - AudioChannelAgent should be informed when HTMLMediaElem…
Browse files Browse the repository at this point in the history
…ent dispatches an error, r=roc
  • Loading branch information
bakulf committed Nov 17, 2015
1 parent 187dd31 commit 96905fb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ void HTMLMediaElement::NoSupportedMediaSourceError()
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
DispatchAsyncEvent(NS_LITERAL_STRING("error"));
ChangeDelayLoadStatus(false);
UpdateAudioChannelPlayingState();
}

typedef void (HTMLMediaElement::*SyncSectionFn)();
Expand Down Expand Up @@ -3521,6 +3522,7 @@ void HTMLMediaElement::Error(uint16_t aErrorCode)
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
}
ChangeDelayLoadStatus(false);
UpdateAudioChannelPlayingState();
}

void HTMLMediaElement::PlaybackEnded()
Expand Down Expand Up @@ -4747,6 +4749,11 @@ HTMLMediaElement::IsPlayingThroughTheAudioChannel() const
return false;
}

// If we have an error, we are not playing.
if (mError) {
return false;
}

// The volume should not be ~0
if (std::fabs(Volume()) <= 1e-7) {
return false;
Expand Down

0 comments on commit 96905fb

Please sign in to comment.