Skip to content

Commit

Permalink
Merge pull request #435 from conversionxl/anoblet/fix/cxl-jw-player
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelkmpt authored Oct 9, 2024
2 parents 64b4d4b + 1ce7168 commit a33420a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,15 @@ export function BaseMixin(BaseClass) {
const { file } = chapters.length > 0 ? chapters[0] : '';
const response = await (await fetch(file)).text();

return parseSync(response);
let result = [];

try {
result = parseSync(response);
} catch (e) {
console.error(e);
}

return result;
}

async _getMedia() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ export function TranscriptMixin(BaseClass) {
});
}

return tracks;
const filteredTracks = tracks.map((track) => {
track.data.text = track.data.text.replace("<v ->", "").replace("</v>", "");

return track;
});

return filteredTracks;
}

_onCaptionClick(e) {
Expand Down

0 comments on commit a33420a

Please sign in to comment.