Bug 1302084 - the error checking should have highest priority. r=baku

MozReview-Commit-ID: 9QC5CG7p28M
This commit is contained in:
Alastor Wu
2016-10-06 12:07:33 +08:00
parent a840bd443c
commit d136c8375b

View File

@@ -5730,6 +5730,11 @@ HTMLMediaElement::MaybeCreateAudioChannelAgent()
bool
HTMLMediaElement::IsPlayingThroughTheAudioChannel() const
{
// If we have an error, we are not playing.
if (mError) {
return false;
}
// It might be resumed from remote, we should keep the audio channel agent.
if (IsSuspendedByAudioChannel()) {
return true;
@@ -5740,11 +5745,6 @@ HTMLMediaElement::IsPlayingThroughTheAudioChannel() const
return false;
}
// If we have an error, we are not playing.
if (mError) {
return false;
}
// We should consider any bfcached page or inactive document as non-playing.
if (!IsActive()) {
return false;