Skip to content

Commit

Permalink
fix(HLS): Fix display CEA-708 in HLS (#5694)
Browse files Browse the repository at this point in the history
Fixes #5627
  • Loading branch information
avelad authored Sep 29, 2023
1 parent 025502a commit 2097193
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,13 @@ shaka.hls.HlsParser = class {
goog.asserts.assert(tag.name == 'EXT-X-MEDIA',
'Should only be called on media tags!');
const languageValue = tag.getAttributeValue('LANGUAGE');
const language = this.getLanguage_(languageValue);
let language = this.getLanguage_(languageValue);
if (!languageValue) {
const nameValue = tag.getAttributeValue('NAME');
if (nameValue) {
language = nameValue;
}
}

// The GROUP-ID value is a quoted-string that specifies the group to which
// the Rendition belongs.
Expand All @@ -1802,7 +1808,9 @@ shaka.hls.HlsParser = class {
// The value of INSTREAM-ID is a quoted-string that specifies a Rendition
// within the segments in the Media Playlist. This attribute is REQUIRED
// if the TYPE attribute is CLOSED-CAPTIONS.
const instreamId = tag.getRequiredAttrValue('INSTREAM-ID');
// We need replace SERVICE string by our internal svc string.
const instreamId = tag.getRequiredAttrValue('INSTREAM-ID')
.replace('SERVICE', 'svc');
if (!this.groupIdToClosedCaptionsMap_.get(groupId)) {
this.groupIdToClosedCaptionsMap_.set(groupId, new Map());
}
Expand Down

0 comments on commit 2097193

Please sign in to comment.