src/utils.js
/** Generates an html snippet for a video file.
 * @param {string} videoName name used for video file. Also used as prefix
 * for the caption file.
 * @param {string} posterName name of file used as image poster, including file extension.
 * @returns {string} HTML snippet for video playback. Assumes 16x9 video content.
 */
Generates an html snippet for a video file.
@param {string} videoName name used for video file. Also used as prefix
for the caption file.
@param {string} posterName name of file used as image poster, including file extension.
@returns {string} HTML snippet for video playback. Assumes 16x9 video content.
Generates an html snippet for a video file . @param { string } videoName name used for video file . Also used as prefix for the caption file . @param { string } posterName name of file used as image poster including file extension . @returns { string } HTML snippet for video playback . Assumes 16x9 video content .
function generateVideoSnippet(videoName, posterName) {
  return `<div id="${videoName}" class="container" data-id="${videoName}">
    <figure class="image is-16by9">
      <video
        class="has-ratio"
        controls
        id="${videoName}-video"
        width="100%"
        height="100%"
        preload="metadata"
        poster="/assets/${posterName}"
      >
        <source src="/assets/${videoName}.webm" type="video/webm" />
        <source src="/assets/${videoName}.mp4" type="video/mp4" />
        <track kind="captions"  srcLang="en" label="English" src="/assets/${videoName}.en.vtt" />
        <track kind="subtitles" srcLang="es" label="Español" src="/assets/${videoName}.es.vtt" />
        Unfortunately your browser is old and does not support embedded videos. Please consider upgrading.
      </video>
    </figure></div>`;
}
function generateVideoSnippet ( videoName , posterName ) { return ` ${ videoName } ${ videoName } ${ videoName } ${ posterName } ${ videoName } ${ videoName } ${ videoName } {v ideoName} . ` ; }
Generates an html snippet for a video file.
Generates an html snippet for a video file .