Skip to content

Commit

Permalink
Merge pull request #570 from miroshQa/main
Browse files Browse the repository at this point in the history
fix(subtitle-reader): Handle a file with an extension .subrip as with .srt
  • Loading branch information
killergerbah authored Nov 24, 2024
2 parents 11eebb6 + 44d90af commit ffe114c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/subtitle-reader/subtitle-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class SubtitleReader {
}

async _subtitles(file: File, track: number): Promise<SubtitleNode[]> {
if (file.name.endsWith('.srt')) {
if (file.name.endsWith('.srt') || file.name.endsWith('.subrip')) {
const parser = new SrtParser({ numericTimestamps: true });
const nodes = parser.fromSrt(await file.text());
return nodes.map((node) => {
Expand Down

0 comments on commit ffe114c

Please sign in to comment.