IframeBlockRenderer
Ecng.Markdown.Extensions
HTML renderer for IframeBlock. A YouTube embed renders as a compact poster card instead of a full-width player: the thumbnail is a single image, so the page stays light, and the site script swaps in the real player — autoplaying, in a full-width overlay — once the reader clicks it. Any other embed keeps the plain iframe.
Наследует: HtmlObjectRenderer<IframeBlock>
Методы
TryGetPlayer
private static ValueTuple<string, string>? TryGetPlayer(string url)
result = IframeBlockRenderer.TryGetPlayer(url)
Recognises a video host and returns the player url plus a poster, or null when the embed is not a video at all — an embedded map or page is content to be seen in place, not hidden behind a play button, so it keeps the plain iframe.
Write
protected override void Write(HtmlRenderer renderer, IframeBlock obj)
iframeBlockRenderer.Write(renderer, obj)