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:
alwu
2020-11-19 00:33:26 +00:00
parent 0e40eff13e
commit 16fd9485a6

View File

@@ -4923,6 +4923,7 @@ void HTMLMediaElement::UnbindFromTree(bool aNullParent) {
[self = RefPtr<HTMLMediaElement>(this)]() {
if (!self->IsInComposedDoc()) {
self->PauseInternal();
self->mMediaControlKeyListener->StopIfNeeded();
}
});
RunInStableState(task);