Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1329122 - should unregister agent when media element becomes inac…
Browse files Browse the repository at this point in the history
…tive. r=baku

We should remove the media control interface immediately when the document is inacitve, even it was paused by media control before.

MozReview-Commit-ID: GBDhzEFOTXE
  • Loading branch information
alastor0325 committed Mar 21, 2017
1 parent b9c2695 commit 12b2211
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,11 @@ class HTMLMediaElement::AudioChannelAgentCallback final :
return false;
}

// We should consider any bfcached page or inactive document as non-playing.
if (!mOwner->IsActive()) {
return false;
}

// It might be resumed from remote, we should keep the audio channel agent.
if (IsSuspended()) {
return true;
Expand All @@ -1040,11 +1045,6 @@ class HTMLMediaElement::AudioChannelAgentCallback final :
return false;
}

// We should consider any bfcached page or inactive document as non-playing.
if (!mOwner->IsActive()) {
return false;
}

// A loop always is playing
if (mOwner->HasAttr(kNameSpaceID_None, nsGkAtoms::loop)) {
return true;
Expand Down

0 comments on commit 12b2211

Please sign in to comment.