No dependencies subtitle merger.
✅ SRT support
$ npm i subtitle-merger
Example of merging subtitles.
import { merge } from "subtitle";
const subOne = `
1
00:00:00,498 --> 00:00:02,827
Hello, this is an example.
`;
const subTwo = `
1
00:00:00,498 --> 00:00:02,827
こんにちは。これはサンプルです。
`;
// it will return a Subtitle object.
const mergedSubtitle = merge(subOne, subTwo);
Getting the merged content as a text:
mergedSubtitle.content;
// Output:
// 1
// 00:00:00,498 --> 00:00:02,827
// Hello, this is an example.
// こんにちは。これはサンプルです。
Getting the merged content as a Blob:
mergedSubtitle.blob;