|
7 | 7 | @param {string} [provider] The media provider: "youtube", "vimeo", or omit for HTML5. |
8 | 8 | @param {string} [type=video] The media type: "video" or "audio". |
9 | 9 | @param {bool} [autoplay=false] Whether to autoplay. |
10 | | - @param {bool} [muted=false] Whether to mute. |
| 10 | + @param {bool} [controls=true] Whether to show player controls. |
| 11 | + @param {string} [crossorigin] The CORS setting: "anonymous" or "use-credentials". |
11 | 12 | @param {bool} [loop=false] Whether to loop. |
12 | | - @param {string} [poster] The poster image URL (HTML5 video only). |
| 13 | + @param {bool} [muted=false] Whether to mute. |
| 14 | + @param {bool} [playsinline=true] Whether to play inline on mobile. |
| 15 | + @param {string} [preload=auto] The preload behavior: "none", "metadata", or "auto". |
13 | 16 |
|
14 | 17 | @example {{< media src="media/example.mp4" >}} |
15 | 18 | @example {{< media src="bTqVqk7FSmY" provider="youtube" >}} |
|
20 | 23 | {{- $provider := .Get "provider" | default "" -}} |
21 | 24 | {{- $type := .Get "type" | default "video" -}} |
22 | 25 | {{- $autoplay := .Get "autoplay" | default false -}} |
23 | | -{{- $muted := .Get "muted" | default false -}} |
| 26 | +{{- $controls := .Get "controls" | default true -}} |
| 27 | +{{- $crossorigin := .Get "crossorigin" | default "" -}} |
24 | 28 | {{- $loop := .Get "loop" | default false -}} |
25 | | -{{- $poster := .Get "poster" | default "" -}} |
26 | | - |
| 29 | +{{- $muted := .Get "muted" | default false -}} |
| 30 | +{{- $playsinline := .Get "playsinline" | default true -}} |
| 31 | +{{- $preload := .Get "preload" | default "auto" -}} |
27 | 32 | {{- if not $src -}} |
28 | 33 | {{- errorf "Media 'src' must be supplied" -}} |
29 | 34 | {{- end -}} |
|
47 | 52 | "src" $src |
48 | 53 | "provider" $provider |
49 | 54 | "type" $type |
50 | | - "autoplay" $autoplay |
51 | | - "muted" $muted |
52 | | - "loop" $loop |
53 | | - "poster" $poster |
| 55 | + "autoplay" $autoplay |
| 56 | + "controls" $controls |
| 57 | + "crossorigin" $crossorigin |
| 58 | + "loop" $loop |
| 59 | + "muted" $muted |
| 60 | + "playsinline" $playsinline |
| 61 | + "preload" $preload |
54 | 62 | ) -}} |
0 commit comments