Skip to content

Commit

Permalink
fix: Default language to 'und' for native tracks (shaka-project#5464)
Browse files Browse the repository at this point in the history
Set default language to `und` for native audio/text tracks if missing.
  • Loading branch information
tykus160 committed Aug 15, 2023
1 parent 9a3ac18 commit 8cd3e2d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/util/stream_utils.js
Expand Up @@ -1425,13 +1425,15 @@ shaka.util.StreamUtils = class {
* @private
*/
static html5TrackToGenericShakaTrack_(html5Track) {
const language = html5Track.language;

/** @type {shaka.extern.Track} */
const track = {
id: shaka.util.StreamUtils.html5TrackId(html5Track),
active: false,
type: '',
bandwidth: 0,
language: shaka.util.LanguageUtils.normalize(html5Track.language),
language: shaka.util.LanguageUtils.normalize(language || 'und'),
label: html5Track.label,
kind: html5Track.kind,
width: null,
Expand Down Expand Up @@ -1462,7 +1464,7 @@ shaka.util.StreamUtils = class {
originalTextId: null,
originalImageId: null,
accessibilityPurpose: null,
originalLanguage: html5Track.language,
originalLanguage: language,
};

return track;
Expand Down

0 comments on commit 8cd3e2d

Please sign in to comment.