Problems with HTML5 video caption

1

I made this little code based on what I read on the internet, but the captions do not appear in any browser I've tested.

<div class="embed-responsive embed-responsive-16by9">
<video poster="filmes/A-cabana-HD.jpg" class="embed-responsive" controls autoload>
  <source src="filmes/filme.mp4" type="video/mp4">
  <track label="Português" kind="subtitles" srclang="PT-BR" src="filmes/legenda.vtt" default/>
  <b>Por favor: entre com um navegador que tenha suporte a HTML5</b>
</video>
</div>

What do I do to make captions work in HTML5?

    
asked by anonymous 27.07.2017 / 23:56

1 answer

2

There is not much of a secret in HTML5, but most problems occur because:

  • The user's browser / player simply does not offer subtitle support, even though it supports video.
  • The link to src is wrong, try manually downloading it at the indicated address to see what appears. Curiously yours is filmes/leghe da.vtt .
  • The VTT subtitle file exists, but it is not the expected format. Is not a masked STR with VTT extension?
  • Some browsers do not allow you to run locally, that is, you need to put it on the production server to work.
  • 28.07.2017 / 14:13