<video id="player" controls></video>
<input type="file" id="videoFile" accept="video/*"><br><br> <input type="file" id="srtFile" accept=".srt"><br><br> tholi prema myanmar subtitle
<!DOCTYPE html> <html lang="my"> <head> <meta charset="UTF-8"> <title>Tholi Prema – Myanmar Subtitles Demo</title> <style> body font-family: sans-serif; margin: 2rem; video max-width: 100%; </style> </head> <body> video id="player" controls>
const text = await file.text(); // Convert SRT → VTT (browsers only understand VTT) const vtt = "WEBVTT\n\n" + text .replace(/\r?\n\r?\n/g, "\n\n") // normalize line breaks .replace(/^(\d+)\n/g, '') // drop line numbers .replace(/(\d2:\d2:\d2),(\d3)/g, '$1.$2'); // ms separator input type="file" id="videoFile" accept="video/*">
// Remove any old tracks first videoEl.textTracks?.[0]?.mode === 'disabled' && videoEl.removeChild(videoEl.querySelector('track'));