From da4381687dab93e90684e6c589dc75219525982c Mon Sep 17 00:00:00 2001 From: bechen Date: Tue, 21 Feb 2017 15:44:10 +0800 Subject: [PATCH] Bug 1334112 -part3 : Trigger UpdateReadyState after unbind TrackElement's and TextTrack::SetReadyState. r=rillian MozReview-Commit-ID: pEeOzZSpak --HG-- extra : rebase_source : cf7759c746f3fa9221dcda03327fd6b3c5997ee7 --- dom/html/HTMLTrackElement.cpp | 1 + dom/media/TextTrack.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/dom/html/HTMLTrackElement.cpp b/dom/html/HTMLTrackElement.cpp index 758018f8d29f..1249b2e18212 100644 --- a/dom/html/HTMLTrackElement.cpp +++ b/dom/html/HTMLTrackElement.cpp @@ -392,6 +392,7 @@ HTMLTrackElement::UnbindFromTree(bool aDeep, bool aNullParent) // called. if (mTrack) { mMediaParent->RemoveTextTrack(mTrack); + mMediaParent->UpdateReadyState(); } mMediaParent = nullptr; } diff --git a/dom/media/TextTrack.cpp b/dom/media/TextTrack.cpp index afc24ef1053d..72890bef1511 100644 --- a/dom/media/TextTrack.cpp +++ b/dom/media/TextTrack.cpp @@ -263,6 +263,7 @@ TextTrack::SetReadyState(TextTrackReadyState aState) if (mediaElement && (mReadyState == TextTrackReadyState::Loaded|| mReadyState == TextTrackReadyState::FailedToLoad)) { mediaElement->RemoveTextTrack(this, true); + mediaElement->UpdateReadyState(); } }