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

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

Issue 1079323002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from fs Created 4 years, 10 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: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index a10491cfbac6f7463e57e54240a6abec84fb8f2e..5a548842dd65eed14c3647a6b1ccc2b816670e15 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -328,6 +328,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_sentEndEvent(false)
, m_closedCaptionsVisible(false)
, m_havePreparedToPlay(false)
+ , m_didPerformAutomaticTrackSelection(false)
, m_tracksAreReady(true)
, m_processingPreferenceChange(false)
, m_remoteRoutesAvailable(false)
@@ -1173,6 +1174,11 @@ void HTMLMediaElement::textTrackModeChanged(TextTrack* track)
textTracks()->scheduleChangeEvent();
}
+void HTMLMediaElement::disableAutomaticTextTrackSelection()
+{
+ m_didPerformAutomaticTrackSelection = true;
philipj_slow 2016/03/01 13:01:16 This is a bit of a lie, automatic track selection
srivats 2016/03/30 00:46:42 Done.
+}
+
bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionIfInvalid)
{
if (!url.isValid()) {
@@ -2497,6 +2503,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