muddle/modules/amezing/components/video.spug
2026-10-23 08:53:07 -04:00

21 lines
940 B
Text

props
sources: { src: string, type?: string }[]
caption?: string
width?: number
height?: number
autoplay?: boolean
controls?: boolean
loop?: boolean
muted?: boolean
playsinline?: boolean
alt?: string
if caption
figure
video(preload="auto" aria-title=alt ?? '' width=width ?? false height=height ?? false autoplay=autoplay ?? false controls=controls ?? true loop=loop ?? false muted=muted ?? false playsinline=playsinline ?? false)
each source in sources
source(src=source.src type='video/' + (source.type ?? source.src.split('.').pop()))
figcaption!= caption
else
video(preload="auto" aria-title=alt ?? '' width=width ?? false height=height ?? false autoplay=autoplay ?? false controls=controls ?? true loop=loop ?? false muted=muted ?? false playsinline=playsinline ?? false)
each source in sources
source(src=source.src type='video/' + (source.type ?? source.src.split('.').pop()))