Browse Source

cleaned up

pull/419/head
Felix Boehme 2 years ago
parent
commit
04f67df289
No known key found for this signature in database
GPG Key ID: 7EB0603E4E9642EA
  1. 10
      src/video/state/providers/castingStateProvider.ts

10
src/video/state/providers/castingStateProvider.ts

@ -151,14 +151,16 @@ export function createCastingStateProvider( @@ -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…
Cancel
Save