Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 1082533002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index d970453a0d86580201289e48f1229c31ec8e083d..d8821addf3e52abb1b01efa7908240fb52ec62d1 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -349,6 +349,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_closedCaptionsVisible(false)
, m_completelyLoaded(false)
, m_havePreparedToPlay(false)
+ , m_didPerformAutomaticTrackSelection(false)
, m_tracksAreReady(true)
, m_haveVisibleTextTrack(false)
, m_processingPreferenceChange(false)
@@ -1167,6 +1168,11 @@ void HTMLMediaElement::textTrackModeChanged(TextTrack* track)
textTracks()->scheduleChangeEvent();
}
+void HTMLMediaElement::disableAutomaticTextTrackSelection()
+{
+ m_didPerformAutomaticTrackSelection = true;
+}
+
bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionIfInvalid)
{
if (!url.isValid()) {
@@ -2481,6 +2487,9 @@ void HTMLMediaElement::honorUserPreferencesForAutomaticTextTrackSelection()
if (!m_textTracks || !m_textTracks->length())
return;
+ if (m_didPerformAutomaticTrackSelection)
+ return;
+
AutomaticTrackSelection::Configuration configuration;
if (m_processingPreferenceChange)
configuration.disableCurrentlyEnabledTracks = true;

Powered by Google App Engine
This is Rietveld 408576698