3 * All arguments are optional, except for src which is where you define your video file
4 * This shortcode supports only webm video files.
6 * class: [string] The class(es) to give to the video block.
7 * width: [int] The width of the video
8 * height: [int] The height of the video
9 * autoplay: [bool] true or false for autoplay - defaults to false
10 * loop: [bool] true or false for loop - defaults to false
11 * mute: [bool] true or false for mute - defaults to false
14 * {{< video
src=
"my-awesome-video.mp4" width=
600 height=
600 autoplay=true loop=true mute=true
class=
"some class" >}}
17 *
<video class=
"some class" controls
preload=
"auto" width=
"600" height=
"600" autoplay loop muted
>
18 <source src=
"my-awesome-video.mp4" type=
"video/webm">
23 {{ $ext := (.Get
"src") | path.Ext }}
24 {{ $filetype := slicestr $ext
1}}
26 <video{{ with .Get
"class" }}
class=
"{{ . }}"{{ end }}
29 {{ with .Get
"width" }}
width=
"{{.}}"{{ end }}
30 {{ with .Get
"height" }}
height=
"{{.}}"{{ end }}
31 {{ if eq (.Get
"autoplay")
"true" }}autoplay {{ end }}
32 {{ if eq (.Get
"loop")
"true" }}loop {{ end }}
33 {{ if eq (.Get
"muted")
"true" }}muted {{ end }}
35 <source src=
"{{ ( .Get "src
" ) }}" type=
"video/{{ $filetype }}">