diff --git a/lib/text/vtt_text_parser.js b/lib/text/vtt_text_parser.js index 8590d58158..54379b8018 100644 --- a/lib/text/vtt_text_parser.js +++ b/lib/text/vtt_text_parser.js @@ -451,6 +451,11 @@ shaka.text.VttTextParser = class { */ static parseCueStyles(payload, rootCue, styles) { const VttTextParser = shaka.text.VttTextParser; + // Optimization for unstyled payloads. + if (!payload.includes('<')) { + rootCue.payload = VttTextParser.htmlUnescape_(payload); + return; + } if (styles.size === 0) { VttTextParser.addDefaultTextColor_(styles); }