Bug 1309162 - part7 : wrap custom policy function. r=jwwang

MozReview-Commit-ID: EdjzMi90ukx
This commit is contained in:
Alastor Wu
2016-11-28 10:23:14 +08:00
parent d2ea8b2c55
commit b1b53dfa7c
2 changed files with 14 additions and 8 deletions

View File

@@ -3573,10 +3573,7 @@ HTMLMediaElement::Play(ErrorResult& aRv)
aRv.Throw(rv);
}
OpenUnsupportedMediaWithExternalAppIfNeeded();
if (mAudioChannelWrapper) {
mAudioChannelWrapper->NotifyPlayStarted();
}
UpdateCustomPolicyAfterPlayed();
}
nsresult
@@ -3665,10 +3662,7 @@ NS_IMETHODIMP HTMLMediaElement::Play()
return rv;
}
OpenUnsupportedMediaWithExternalAppIfNeeded();
if (mAudioChannelWrapper) {
mAudioChannelWrapper->NotifyPlayStarted();
}
UpdateCustomPolicyAfterPlayed();
return NS_OK;
}
@@ -6863,5 +6857,14 @@ HTMLMediaElement::MarkAsContentSource(CallerAPI aAPI)
this, isVisible, aAPI));
}
void
HTMLMediaElement::UpdateCustomPolicyAfterPlayed()
{
OpenUnsupportedMediaWithExternalAppIfNeeded();
if (mAudioChannelWrapper) {
mAudioChannelWrapper->NotifyPlayStarted();
}
}
} // namespace dom
} // namespace mozilla