mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1625615 - part4 : start listener if we haven't started listener yet. r=bryce
There is actually possible to start the listener already while running `SuspendOrResumeElement()`, so we should remove the assertion and use a check instead. Eg. JS can call `play()`, which would start the listener, before we run this method. This situation can be found when browsing Youtube on the GeckoView. Differential Revision: https://phabricator.services.mozilla.com/D69673
This commit is contained in:
parent
a4a77fb633
commit
7cd282b498
@ -6431,9 +6431,10 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aSuspendElement) {
|
||||
!AutoplayPolicy::IsAllowedToPlay(*this)) {
|
||||
MaybeNotifyAutoplayBlocked();
|
||||
}
|
||||
if (mMediaControlEventListener) {
|
||||
MOZ_ASSERT(!mMediaControlEventListener->IsStarted(),
|
||||
"We didn't stop listening event when we were in bfcache?");
|
||||
// If we stopped listening to the event when we suspended media element,
|
||||
// then we should restart to listen to the event if we haven't done so yet.
|
||||
if (mMediaControlEventListener &&
|
||||
!mMediaControlEventListener->IsStarted()) {
|
||||
StartListeningMediaControlEventIfNeeded();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user