includeTextTracks | R Documentation |
video.js contains the ability to include tracks with the video, including subtitles,
captions and descriptions. includeTextTracks
will make sure that they are
included on load, and find the defaults to embed with the video.
includeTextTracks( video, files, language = "en", label = "English", kind = "subtitles", default = FALSE )
video |
A |
files |
A vector of WebVTT files that contain "cues" of when text should appear, hide and what text to display |
language |
The valid BCP 47 code for the language of the text track, e.g. "en" for English or "es" for Spanish. |
label |
Short descriptive text for the track that will used in the user interface. For example, in a menu for selecting a captions language. |
kind |
An optional vector to match the type of text tracks in
|
default |
The boolean |
All vectors must either be the same length as files
or of length 1. In the latter,
they will be applied to all files
supplied.
An updated video
with text tracks included
vid <- video("https://vjs.zencdn.net/v/oceans.mp4") includeTextTracks(vid, "url/to/subtitles.vtt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.