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

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: Removed container and 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/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
+ 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