Skip to content

Commit

Permalink
update logic to fallback to und value
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 committed Oct 8, 2024
1 parent 816d5db commit 8688dcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/toM3u8.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export const organizeAudioPlaylists = (playlists, sidxMapping = {}, isAudioOnly
export const organizeVttPlaylists = (playlists, sidxMapping = {}) => {
return playlists.reduce((a, playlist) => {
const label = playlist.attributes.label || playlist.attributes.lang || 'text';
const language = playlist.attributes.lang || playlist.attributes.label || 'en';
const language = playlist.attributes.lang || 'und';

if (!a[label]) {
a[label] = {
Expand Down
6 changes: 3 additions & 3 deletions test/toM3u8.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ QUnit.test('playlists', function(assert) {
text: {
autoselect: false,
default: false,
language: 'en',
language: 'und',
playlists: [{
attributes: {
BANDWIDTH: 20000,
Expand Down Expand Up @@ -1115,7 +1115,7 @@ QUnit.test('playlists with segments', function(assert) {
text: {
autoselect: false,
default: false,
language: 'en',
language: 'und',
playlists: [{
attributes: {
BANDWIDTH: 20000,
Expand Down Expand Up @@ -1948,7 +1948,7 @@ QUnit.test('eventStreams with playlists', function(assert) {
text: {
autoselect: false,
default: false,
language: 'en',
language: 'und',
playlists: [{
attributes: {
BANDWIDTH: 20000,
Expand Down

0 comments on commit 8688dcd

Please sign in to comment.