|
|
@ -151,14 +151,16 @@ export function createCastingStateProvider( |
|
|
|
if (state.source?.caption?.id) { |
|
|
|
if (state.source?.caption?.id) { |
|
|
|
let captionIndex: number | undefined; |
|
|
|
let captionIndex: number | undefined; |
|
|
|
const linkedCaptions = state.meta?.captions; |
|
|
|
const linkedCaptions = state.meta?.captions; |
|
|
|
const captionId = state.source?.caption?.id; |
|
|
|
const captionLangIso = state.source?.caption?.id.slice(7); |
|
|
|
let trackContentId = ""; |
|
|
|
let trackContentId = ""; |
|
|
|
|
|
|
|
|
|
|
|
if (linkedCaptions) { |
|
|
|
if (linkedCaptions) { |
|
|
|
linkedCaptions.forEach((caption, index) => { |
|
|
|
for (let index = 0; index < linkedCaptions.length; index += 1) { |
|
|
|
if (!captionIndex && captionId.includes(caption.langIso)) |
|
|
|
if (captionLangIso === linkedCaptions[index].langIso) { |
|
|
|
captionIndex = index; |
|
|
|
captionIndex = index; |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (captionIndex) { |
|
|
|
if (captionIndex) { |
|
|
|
trackContentId = linkedCaptions[captionIndex].url; |
|
|
|
trackContentId = linkedCaptions[captionIndex].url; |
|
|
|
} |
|
|
|
} |
|
|
|