Bug 1531863 - part2 : handle text track mode changed in MediaElement. r=jya
In order to make the implementation more fitting with the spec, move the implementation of `pending-text-track-change-notification-flag` from text track list to media element. In addition, it also help us not to expose the internal flag `show-poster` (which will be implemented in patch3) of media element when doing the related algorithm. Differential Revision: https://phabricator.services.mozilla.com/D21810
This commit is contained in:
@@ -7375,6 +7375,22 @@ already_AddRefed<Promise> HTMLMediaElement::SetSinkId(const nsAString& aSinkId,
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
void HTMLMediaElement::NotifyTextTrackModeChanged() {
|
||||
if (mPendingTextTrackChanged) {
|
||||
return;
|
||||
}
|
||||
mPendingTextTrackChanged = true;
|
||||
mAbstractMainThread->Dispatch(
|
||||
NS_NewRunnableFunction("HTMLMediaElement::NotifyTextTrackModeChanged",
|
||||
[this, self = RefPtr<HTMLMediaElement>(this)]() {
|
||||
mPendingTextTrackChanged = false;
|
||||
if (!mTextTrackManager) {
|
||||
return;
|
||||
}
|
||||
GetTextTracks()->CreateAndDispatchChangeEvent();
|
||||
}));
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
||||
Reference in New Issue
Block a user