Skip to content

Commit

Permalink
fix: Default language to 'und' for native tracks (#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 authored and joeyparrish committed Aug 20, 2023
1 parent eca8436 commit aeda19d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/util/stream_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1325,13 +1325,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 @@ -1361,6 +1363,7 @@ shaka.util.StreamUtils = class {
originalAudioId: null,
originalTextId: null,
originalImageId: null,
originalLanguage: language,
};

return track;
Expand Down

0 comments on commit aeda19d

Please sign in to comment.