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

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

Issue 1118613002: Hook up Android closed captions 'enabled' setting to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have the flag influence automatic track selection Created 5 years, 7 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 5558692f2650d0baa1f5ee8941d302f798161f0d..5f93cdf67a0f97c31d932cd46edeb5d4c963d4fd 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -2480,6 +2480,17 @@ void HTMLMediaElement::honorUserPreferencesForAutomaticTextTrackSelection()
if (m_closedCaptionsVisible)
configuration.forceEnableSubtitleOrCaptionTrack = true;
+#if OS(ANDROID)
+ // Determine captions and subtitles visibility based on OS captions state only if the platform
+ // is Android because the setting is currently only available on Android.
+ Settings* settings = document().settings();
+ if (settings) {
+ if (!settings->textTracksEnabled())
+ return;
+ configuration.forceEnableSubtitleOrCaptionTrack = true;
fs 2015/05/05 15:09:15 This flags forces _a_ track (any track) to be enab
philipj_slow 2015/05/06 09:54:27 This bit seems a bit odd to me as well. How about
srivats 2015/06/09 00:45:51 Done.
+ }
+#endif
+
AutomaticTrackSelection trackSelection(configuration);
trackSelection.perform(*m_textTracks);

Powered by Google App Engine
This is Rietveld 408576698