nuxt-x-affiliate
Video Embed
YouTube / Vimeo / direct-video embed via privacy-enhanced youtube-nocookie iframe.
Video Embed
The XAFVideoEmbed component renders a responsive video embed — accepts a YouTube URL, Vimeo URL, or direct video URL. YouTube URLs are normalized to youtube-nocookie.com for privacy-enhanced embeds. Optional autoplay (muted) and configurable aspect ratio.
Components
<XAFVideoEmbed />
<XAFVideoEmbed
src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
title="Product demo"
poster="/img/demo-poster.jpg"
aspect-ratio="16/9"
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | required | YouTube, Vimeo, or direct video URL. |
title | string | required | Video title (used as iframe[title] for a11y). |
poster | string | — | Poster image URL (passed to iframe poster attribute when supported). |
aspectRatio | string | "16/9" | Aspect ratio (any CSS value, e.g. "4/3", "1/1"). |
autoplay | boolean | false | Auto-play muted. |
The iframe is rendered with loading="lazy", referrerpolicy="strict-origin-when-cross-origin", and the standard accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture allowlist. The title renders as a caption below the iframe.
AI Context
component: XAFVideoEmbed
package: "@xenterprises/nuxt-x-affiliate"
use-when: YouTube / Vimeo / direct-video embed via privacy-enhanced iframe with configurable aspect ratio.
