Video

04 Jun 2023

Shortcodes for videos

1 minute reading time

#Video

#Usage

#Input

{{ video(src=["over9000.mp4", "over9000.webm"]) }}

#Output

<div class="video-local">
  <video controls>
      <source src="https://halve-z.netlify.app/posts/video/over9000.mp4" type="video/mp4"/>
      <source src="https://halve-z.netlify.app/posts/video/over9000.webm" type="video/webm"/>
      Your browser does not support the video formats in use.
  </video>
</div>

#Input

{{ video(src=["over9000.mp4"], muted="true") }}

#Output

<div class="video-local">
  <video controls muted=true>
      <source src="https://halve-z.netlify.app/posts/video/over9000.mp4" type="video/mp4"/>
      Your browser does not support the video formats in use.
  </video>
</div>

#Vimeo

#Usage

#Input

{{ vimeo(id="4340383") }}

#Output

<div class="video-embedded">
  <iframe
    src="https://player.vimeo.com/video/4340383?embedded=true&dnt=1"
    class="video-iframe"
    title="Vimeo"
    webkitallowfullscreen
    mozallowfullscreen
    allowfullscreen>
  </iframe>
</div>

#YouTube

#Usage

#Input

{{ youtube(id="frBzlP6t9Gw") }}

#Output

<div class="video-embedded">
  <iframe
    src="https://www.youtube-nocookie.com/embed/frBzlP6t9Gw"
    class="video-iframe"
    title="Youtube"
    webkitallowfullscreen
    mozallowfullscreen
    allowfullscreen>
  </iframe>
</div>