Bug 1302350 - part2 : provide a method to check whether the agent was started. r=baku
Since the agent is created in beginning in patch1, we need another way to know whether we have already called notifyStartedPlaying(). MozReview-Commit-ID: 5YNhwEl5Xfp
This commit is contained in:
@@ -6430,7 +6430,9 @@ HTMLMediaElement::SetAudibleState(bool aAudible)
|
||||
void
|
||||
HTMLMediaElement::NotifyAudioPlaybackChanged(AudibleChangedReasons aReason)
|
||||
{
|
||||
if (!mAudioChannelAgent) {
|
||||
MOZ_ASSERT(mAudioChannelAgent);
|
||||
|
||||
if (!mAudioChannelAgent->IsPlayingStarted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6554,16 +6556,17 @@ HTMLMediaElement::SetMediaInfo(const MediaInfo& aInfo)
|
||||
void
|
||||
HTMLMediaElement::AudioCaptureStreamChangeIfNeeded()
|
||||
{
|
||||
// Window audio capturing only happens after creating audio channel agent.
|
||||
if (!mAudioChannelAgent) {
|
||||
return;
|
||||
}
|
||||
MOZ_ASSERT(mAudioChannelAgent);
|
||||
|
||||
// No need to capture a silence media element.
|
||||
if (!HasAudio()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mAudioChannelAgent->IsPlayingStarted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAudioCapturedByWindow && !mCaptureStreamPort) {
|
||||
nsCOMPtr<nsPIDOMWindowInner> window = OwnerDoc()->GetInnerWindow();
|
||||
if (!OwnerDoc()->GetInnerWindow()) {
|
||||
|
||||
Reference in New Issue
Block a user