fix: playback error if subtitle is not set

This commit is contained in:
Prayag Prajapati committed 2024-11-30 13:47:03 +05:30
1 parent 9d96667d60
commit 591fce7e5c
5 files changed
+79 -40

No files matched your search

+9 -1
View File
@@ -28,7 +28,6 @@ export default function getSubtitle(
(stream) => stream.Index === track,
);
const url = requiredSubtitle?.[0]?.DeliveryUrl;
console.log(track);
if (track) {
return {
track,
@@ -38,4 +37,13 @@ export default function getSubtitle(
url,
};
}
if (track === 0) {
return {
track: 0,
enable: false,
format: null,
allTracks: availableSubtitles,
url: null,
};
}
}