From 5b641655eb3cb4f994775cf4925efa4713617b1b 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 d0c62cc3b5..21b07f0db8 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); } } }