From e01487ef9f3e708f4e626c9254ea973046cc3cf9 Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Mon, 30 Jan 2023 16:33:21 +0100 Subject: [PATCH] fix(HLS): IMSC1 subtitles not working in a HLS stream --- lib/hls/hls_parser.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index d0c62cc3b5b..3c75cf3515a 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -1195,6 +1195,8 @@ shaka.hls.HlsParser = class { } }); + const type = shaka.util.ManifestParserUtils.ContentType.TEXT;; + // Set the codecs for text streams. for (const tag of subtitleTags) { const groupId = tag.getRequiredAttrValue('GROUP-ID'); @@ -1204,6 +1206,9 @@ shaka.hls.HlsParser = class { if (textStreamInfos) { for (const textStreamInfo of textStreamInfos) { textStreamInfo.stream.codecs = codecs; + textStreamInfo.stream.mimeType = + this.guessMimeTypeBeforeLoading_(type, codecs) || + this.guessMimeTypeFallback_(type) } } }