Component: <embetty-video>
The <embetty-video>
component is used to embed videos from various platforms like YouTube, Vimeo, and Facebook.
Basic Usage
To embed a video, use the <embetty-video>
tag with the type
and video-id
attributes.
<embetty-video type="youtube" video-id="m6UOo2YGbIE"></embetty-video>
Attributes
type
(Required) The platform the video is hosted on.
- Type:
string
- Allowed Values:
youtube
,vimeo
,facebook
- Example:
type="youtube"
video-id
(Required) The unique identifier for the video on its platform.
- Type:
string
- Example:
video-id="m6UOo2YGbIE"
poster-image
(Optional) A URL to a custom poster image. If not provided, Embetty will use the default thumbnail fetched from the video platform (Note: Facebook does not provide a default poster image).
- Type:
string
(URL) - Example:
poster-image="https://example.com/my-poster.jpg"
start-at
(Optional) The time in seconds at which the video should start playing. This is only supported for youtube
and vimeo
types.
- Type:
string
(number of seconds) - Example:
start-at="96"
Platform Examples
YouTube
<embetty-video type="youtube" video-id="m6UOo2YGbIE" start-at="97"></embetty-video>
YouTube URLs use the youtube-nocookie.com
domain for enhanced privacy.
Vimeo
<embetty-video type="vimeo" video-id="1084537" start-at="97"></embetty-video>
Facebook does not provide a default poster image. It's highly recommended to specify one using the poster-image
attribute.
<embetty-video
type="facebook"
video-id="10156049485672318"
poster-image="https://example.com/fb-poster.png">
</embetty-video>