Bug 1673509 - part3 : stop controlled media when it unbind from DOM tree. r=chunmin
When we remove the media from DOM tree, we should not only pause it but also stop controlling it. Differential Revision: https://phabricator.services.mozilla.com/D95359
This commit is contained in:
@@ -4923,6 +4923,7 @@ void HTMLMediaElement::UnbindFromTree(bool aNullParent) {
|
||||
[self = RefPtr<HTMLMediaElement>(this)]() {
|
||||
if (!self->IsInComposedDoc()) {
|
||||
self->PauseInternal();
|
||||
self->mMediaControlKeyListener->StopIfNeeded();
|
||||
}
|
||||
});
|
||||
RunInStableState(task);
|
||||
|
||||
Reference in New Issue
Block a user