Youtube Video Showcase

Example

Component Documentation

Component Name

YouTubeVideo

Builder Function Name

create_youtube_video_manager

Description

Embeds a YouTube video based on the provided video ID, handling loading states and error messages. Supports theme customization and responsive resizing.

Use like example

Config

PropertyTypeDefaultDescription
idstring or null

generated unique ID

A unique identifier for the YouTubeVideo component. If not provided, a unique ID is generated automatically.

video_idstring

The unique identifier of the YouTube video to embed. This is required for rendering the video.

is_dark_themeboolean

false

Determines the theme of the embedded video. If true, applies a dark theme; otherwise, a light theme is used.

Methods

MethodDescriptionParametersReturns
render_video

Attempts to load and render the YouTube video by checking the availability of the video thumbnail. Sets error messages if the video fails to load.

No Params

resize_video

Adjusts the size of the video container to maintain a 16:9 aspect ratio, ensuring responsiveness based on the container's width.

No Params

Returned Properties

PropertyTypeDescription
idstring

The unique identifier of the YouTubeVideo component.

video_idstring

The YouTube video ID being embedded.

themestring

The current theme of the embedded video ('dark' or 'light').

icon
Sponsored byContibase