Embedded audio and video

Are there any ideas on how to go about adding closed captions to videos and audio?

I’m developing an education platform where accessibility is pretty important (as it should be everywhere on the web). Users should have the option—and be encouraged—to add captioning to any uploads containing audio.

HTML has the <track> element to accommodate this, which you can add as a child element to <video> and <audio>:

<video controls src="/media/cc0-videos/friday.mp4">
  <track default kind="captions" srclang="en" src="/media/examples/friday.vtt" />
  Download the
  <a href="/media/cc0-videos/friday.mp4">MP4</a>
  video, and
  <a href="/media/examples/friday.vtt">subtitles</a>.
</video>

However I haven’t found a single markdown plugin which supports adding tracks to your videos.

I will probably end up writing a plugin my self with some syntax such as:

![Alt text](/path/to/video.webv en="/path/to/video.en.vtt")

which would compile to something like:

<video controls src="/path/to/video.webv">
  <track kind="captions" srclang="en" src="/path/to/video.en.vtt" />
  Alt Text
  Download the
  <a href="/path/to/video.webm">WEBM video</a>, and the
  <a href="/path/to/video.en.vtt">English subtitles</a>.
</video>

However I think any discussion about media embedding in Markdown should include the possibility of captioning in multiple languages.

1 Like