Skip to content
Mika Berglund edited this page Feb 28, 2020 · 3 revisions

Embed Component

The Embed component is used to create responsive video or slideshow embeds.

Inheritance

Embed : BootstrapComponentBase

Parameters

Name Type Description
AspectRatio EmbedAspectRatio Specifies different aspect ratios for the embedded content. The default is 16 by 9.
Source string The source URL of the content to embed.

Examples

The examples below show you how to use the Embed component.

Simple YouTube video

The simples way to show an embedded YouTube video.

<Embed Source="https://www.youtube.com/embed/MetcuX1OHD0" />

You can also use a variable that specifies the source.

@code {
    string source = "https://www.youtube.com/embed/MetcuX1OHD0";
}
<Embed Source="@source" />

Aspect Ratios

The embeds below demonstrate different aspect ratios supported by the Embed component. The aspect ratio defaults to 16 by 9.

@code {
    string source = "https://www.youtube.com/embed/MetcuX1OHD0";
}

<Embed Source="@source" AspectRatio="EmbedAspectRatio.Ratio21by9" />
<Embed Source="@source" AspectRatio="EmbedAspectRatio.Ratio4by3" />
<Embed Source="@source" AspectRatio="EmbedAspectRatio.Ratio1by1" />

Clone this wiki locally