From 4f4c1bba90d62fe56e9858f0acb0b6d4536c3ff3 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 16 Jan 2025 10:21:58 +0100 Subject: [PATCH] fix: tracks lang and label conditions --- src/HTMLVideo/HTMLVideo.js | 4 ++-- src/TitanVideo/TitanVideo.js | 6 +++--- src/WebOsVideo/WebOsVideo.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/HTMLVideo/HTMLVideo.js b/src/HTMLVideo/HTMLVideo.js index 91cab91..5049970 100644 --- a/src/HTMLVideo/HTMLVideo.js +++ b/src/HTMLVideo/HTMLVideo.js @@ -188,8 +188,8 @@ function HTMLVideo(options) { .map(function(track, index) { return Object.freeze({ id: 'EMBEDDED_' + String(index), - lang: track.language.length > 0 ? track.language : null, - label: track.label.length > 0 ? track.label : null, + lang: track.language || null, + label: track.label || null, origin: 'EMBEDDED', embedded: true }); diff --git a/src/TitanVideo/TitanVideo.js b/src/TitanVideo/TitanVideo.js index ca92fa2..2a488dc 100644 --- a/src/TitanVideo/TitanVideo.js +++ b/src/TitanVideo/TitanVideo.js @@ -192,7 +192,7 @@ function TitanVideo(options) { return Object.freeze({ id: 'EMBEDDED_' + String(index), lang: track.language, - label: track.label.length > 0 ? track.label : null, + label: track.label || null, origin: 'EMBEDDED', embedded: true }); @@ -264,8 +264,8 @@ function TitanVideo(options) { .map(function(track, index) { return Object.freeze({ id: 'EMBEDDED_' + String(index), - lang: track.language, - label: track.label.length > 0 ? track.label : null, + lang: track.language || null, + label: track.label || null, origin: 'EMBEDDED', embedded: true }); diff --git a/src/WebOsVideo/WebOsVideo.js b/src/WebOsVideo/WebOsVideo.js index 080b339..3eeceea 100644 --- a/src/WebOsVideo/WebOsVideo.js +++ b/src/WebOsVideo/WebOsVideo.js @@ -392,7 +392,7 @@ function WebOsVideo(options) { audioTracks.push({ id: 'EMBEDDED_' + audioTrackId, lang: track.lang || 'eng', - label: track.label.length > 0 ? track.label : null, + label: track.label || null, origin: 'EMBEDDED', embedded: true, mode: audioTrackId === currentAudioTrack ? 'showing' : 'disabled',