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

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: Addressed comments from fs 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 299905f7c3714f256eb3b03a50adc27a9ba2b08b..8e3867c081e406ea2f6cffeafb397082243ac060 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -363,6 +363,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_audioTracks(AudioTrackList::create(*this))
, m_videoTracks(VideoTrackList::create(*this))
, m_textTracks(nullptr)
+ , m_performAutomaticTextTrackSelection(true)
#if ENABLE(WEB_AUDIO)
, m_audioSourceNode(nullptr)
#endif
@@ -1167,6 +1168,11 @@ void HTMLMediaElement::textTrackModeChanged(TextTrack* track)
textTracks()->scheduleChangeEvent();
}
+void HTMLMediaElement::setAutomaticTextTrackSelection(bool enabled)
+{
+ m_performAutomaticTextTrackSelection = enabled;
+}
+
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_performAutomaticTextTrackSelection)
+ return;
+
AutomaticTrackSelection::Configuration configuration;
if (m_processingPreferenceChange)
configuration.disableCurrentlyEnabledTracks = true;

Powered by Google App Engine
This is Rietveld 408576698