0

I am trying to experiment the use of track element. I think my code and .vtt file are both valid. However I cannot see the subtitles when I run the page (even on the localhost.) I read that the server must be configured so that it can serve the .vtt file with the correct MIME type. I use Xampp locally what must I do to see the subtitles.

Here is my code and WebVTT file referring a video with the song Twinkle Twinkle Little Star

<!DOCTYPE html>
<html>
<head>
<title>Track</title>
</head>
<body>
<video controls>
    <source src="twinkle.mp4" type="video/mp4">
    <track src="altyazi_tr.vtt" kind="subtitles" srclang="tr" label="turkce" default>
</video>
</body>
</html>

WEBVTT

00:00:00,000 --> 00:00:03.000
Twinkle Twinkle Little Star

00:00:03,000 --> 00:00:06.000
How I wonder what you are
glennsl
  • 28,186
  • 12
  • 57
  • 75
Zalajbeg
  • 423
  • 1
  • 4
  • 13
  • First you need to check if your client really supports webvtt, e.g. http://www.iandevlin.com/html5test/webvtt/html5-video-webvtt-sample.html. Then you may check the apache log to see if there's any request to the vtt file, and see what's wrong. – Mine Oct 13 '14 at 07:15
  • Thanks for your help. I checked with the link and can see the subtitles. However I am a newbie about using a server. I checked the log files but couldn't see any request (It is possible that I am not looking at the right logs). Could you please explain me step by step how to check logs? – Zalajbeg Oct 13 '14 at 11:50

1 Answers1

2

With some research and experiment I have found the solution to the problem. To be able to add a MIME type to Apache server coming with Xampp:

  • Go to the directory ...\Xampp\apache\conf
  • Open the file mime.types with Notepad
  • Add the MIME type to the file (for this issue the line to be added was "text/vtt vtt")
  • Save the file and restart the server
Zalajbeg
  • 423
  • 1
  • 4
  • 13