mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
cleaned up
This commit is contained in:
parent
eaf62c92a7
commit
04f67df289
1 changed files with 6 additions and 4 deletions
|
@ -151,14 +151,16 @@ export function createCastingStateProvider(
|
|||
if (state.source?.caption?.id) {
|
||||
let captionIndex: number | undefined;
|
||||
const linkedCaptions = state.meta?.captions;
|
||||
const captionId = state.source?.caption?.id;
|
||||
const captionLangIso = state.source?.caption?.id.slice(7);
|
||||
let trackContentId = "";
|
||||
|
||||
if (linkedCaptions) {
|
||||
linkedCaptions.forEach((caption, index) => {
|
||||
if (!captionIndex && captionId.includes(caption.langIso))
|
||||
for (let index = 0; index < linkedCaptions.length; index += 1) {
|
||||
if (captionLangIso === linkedCaptions[index].langIso) {
|
||||
captionIndex = index;
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (captionIndex) {
|
||||
trackContentId = linkedCaptions[captionIndex].url;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue