// Load video file locally videoInput.onchange = () => const file = videoInput.files[0]; if (file) videoEl.src = URL.createObjectURL(file); ;
<!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> tholi prema myanmar subtitle
// Remove any old tracks first videoEl.textTracks?.[0]?.mode === 'disabled' && videoEl.removeChild(videoEl.querySelector('track')); // Load video file locally videoInput
videoEl.appendChild(track); ; </script>
// Load SRT and inject as a track srtInput.onchange = async () => const file = srtInput.files[0]; if (!file) return; const file = videoInput.files[0]
const blob = new Blob([vtt], type: 'text/vtt'); const track = document.createElement('track'); track.kind = 'subtitles'; track.label = 'Myanmar'; track.srclang = 'my'; track.src = URL.createObjectURL(blob); track.default = true;