Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subtitles not showing using WebVTT

Tags:

html5-video

So I'm trying to add subtitles to a html5 video and found WebVTT. I've done some research on it and have even copied some example code to see if that'll work and yet I have no luck.

The subtitles just simply don't show up on the video.

Here's the HTML.

<video id="video"  class="video" controls>
              <source src="solar.mp4" type="video/mp4">
              <source src="client2.ogv" type="video/ogv">
              <source src="solar.webm" type="video/webm">
              <source src="solar.flv" type="video/flv">

              <track label="English Captions" kind="captions" srclang="en" src="english-subtitles.vtt">
        </video>

and the test VTT file.

WEBVTT

1
00:00:13,00 --> 00:00:16,000
Man did you see that awesome thing like last week -

2
00:00:16,100 --> 00:00:20,100
- and i said wow a lot of people are starting to talk about this.
like image 328
Purify Avatar asked Apr 18 '13 20:04

Purify


1 Answers

It doesn't work locally, you need to run it on a server.

like image 107
richbray89 Avatar answered Sep 28 '22 04:09

richbray89