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

Unified Diff: Source/core/html/track/TextTrack.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/track/TextTrack.cpp
diff --git a/Source/core/html/track/TextTrack.cpp b/Source/core/html/track/TextTrack.cpp
index 3916eb7159ac8f3b29f831a64debde7c48ff5597..e87191fa7bcf03bd720931d2c6c26353efbc52dd 100644
--- a/Source/core/html/track/TextTrack.cpp
+++ b/Source/core/html/track/TextTrack.cpp
@@ -458,6 +458,14 @@ int TextTrack::trackIndexRelativeToRenderedTracks()
return m_renderedTrackIndex;
}
+bool TextTrack::isRenderable()
+{
+ // A track can be displayed when it's of kind captions or subtitles and hasn't failed to load
philipj_slow 2015/05/05 14:36:57 I guess this means that if the readinessState is N
fs 2015/05/05 15:32:44 Yes. Optionally I suppose one could "gray it out"
srivats 2016/02/23 01:39:27 Should we just exclude the NotLoaded tracks from b
philipj_slow 2016/03/01 11:21:04 I think what you have now in the other CL seems to
+ if ((kind() == captionsKeyword() || kind() == subtitlesKeyword()) && readinessState() != FailedToLoad)
+ return true;
+ return false;
+}
+
const AtomicString& TextTrack::interfaceName() const
{
return EventTargetNames::TextTrack;

Powered by Google App Engine
This is Rietveld 408576698