Insert and preview YouTube embeds

    Use the native YouTube authoring workflow to insert a supported video reference into HTML. External playback depends on your explicit resource policy and the deployed browser environment.

    Saved iframe markup and successful playback are different things; inspect both in your application.

    Actual Avalonia document preview with the native editor frame and view controls.
    Actual Avalonia document preview with the native editor frame and view controls.

    Use it in your application

    Open the YouTube dialog from the public Dialog service or built-in command. Use an intended public video URL.

    Keep external resources disabled unless the workflow requires them. When enabling them for preview, apply your own trusted-content and network policy.

    A sandboxed authoring surface does not grant arbitrary page navigation or script privileges. Test video availability and network restrictions in the deployed environment.

    await editor.Dialog.ShowYouTubeVideoInsertDialogAsync();

    Continue with

    Last updated on Oct 18, 2026

    Put this into practice.

    Start with the C# Avalonia sample. Restore this edition's package and install the native browser prerequisites before running it.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.