Preview YouTube Video

    A pasted YouTube embed can play on one machine and show a blank or static frame on another, with the same document, the same network, and the same URL. The difference is a single per-process registry value on the host machine, not the markup: WinFormHtmlEditor stores the <iframe> exactly as authored. This page shows how to verify the embed and how to set that value for your application.

    The SpiceLogic WinForms HTML Editor's WysiwygDesign authoring surface showing a YouTube video embed as a static, non playing frame, because the hosted browser control runs in legacy emulation by default.
    The SpiceLogic WinForms HTML Editor's WysiwygDesign authoring surface showing a YouTube video embed as a static, non playing frame, because the hosted browser control runs in legacy emulation by default.

    What is actually happening: IE7 emulation

    The editor's WYSIWYG and Preview modes are hosted by the standard WebBrowser control, which is a thin wrapper around MSHTML -- the Internet Explorer rendering engine. For backwards compatibility, hosted WebBrowser controls default to IE7 emulation regardless of which version of Internet Explorer is installed on the machine. YouTube's modern iframe embed assumes a current browser -- HTML5 video, modern JavaScript, current TLS ciphers -- and silently degrades or refuses to load on IE7-emulated MSHTML.

    A machine that already has a FEATURE_BROWSER_EMULATION registry value set - for example from an earlier WebView trial - plays the embed; a machine without that value does not, even with the same document and the same network. The editor itself cannot raise the emulation level at runtime -- Windows resolves it once when the WebBrowser is instantiated by reading the registry.

    Step 1: confirm playback works in Preview

    Authors should verify their embeds in EditorModes.ReadOnlyPreview, which renders the document the way an end user will see it. With the registry tweak below applied, Preview plays YouTube embeds the same as any modern browser. WYSIWYG mode is for authoring; Preview is for verification.

    // Toggle to Preview to verify a YouTube embed plays:
    
    htmlEditor1.EditorMode =
    
        SpiceLogic.HtmlEditor.Abstractions.EditorModes.ReadOnlyPreview;
    ReadOnlyPreview mode of the SpiceLogic WinForms HTML Editor playing the same YouTube embed after the FEATURE_BROWSER_EMULATION registry key is set for the host process.
    ReadOnlyPreview mode of the SpiceLogic WinForms HTML Editor playing the same YouTube embed after the FEATURE_BROWSER_EMULATION registry key is set for the host process.

    Step 2: register the executable for modern emulation

    Ship a registry entry that upgrades your application's WebBrowser host to IE11 edge mode. Add a DWORD value named after the exe filename (including the extension) with value 11001 decimal under FEATURE_BROWSER_EMULATION:

    Windows Registry Editor Version 5.00
    
    
    
    ; Per-user (no admin required):
    
    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
    
    "YourApp.exe"=dword:00002af9
    
    
    
    ; Per-machine (admin required):
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
    
    "YourApp.exe"=dword:00002af9

    Common decimal values: 11001 (IE11 edge), 11000 (IE11), 10001 (IE10 edge), 9999 (IE9). The hex equivalent of 11001 is 0x00002AF9. If the design surface should also render modern content for authors, register devenv.exe too - otherwise Visual Studio's design-time preview keeps using the legacy default even when the built application runs in IE11 mode.

    Step 3: ship it from the installer (or set it at startup)

    A WiX installer is the right place to write the registry key; a deployed field image picks it up automatically on next update. For shops without an installer pipeline, set the value at application startup before any WinFormHtmlEditor instance is constructed. The host process picks the emulation level up the first time it instantiates a WebBrowser:

    using Microsoft.Win32;
    
    static void SetIeEmulation()
    {
        string exe = System.IO.Path.GetFileName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
        using var key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION");
        key.SetValue(exe, 11001, RegistryValueKind.DWord);
    }

    With the value in place, YouTube, Vimeo, and the other major embed providers play in Preview on every machine that runs your application.

    Ask your AI to do this

    Let your assistant do this for you. With the SpiceLogic MCP server connected, paste this into Claude Code, Cursor, or VS Code Copilot in agent mode.

    Using the SpiceLogic WinForms HTML Editor already referenced in my project, help me figure out why a pasted YouTube embed plays fine on my dev machine but fails on end-user laptops: first verify playback by switching EditorMode to EditorModes.ReadOnlyPreview, and if it still fails there, write the per-user browser-emulation registry entry, keyed to my exe's filename, that pins the editor's hosting WebBrowser control to a modern rendering mode instead of its legacy default. Verify the EditorMode and EditorModes member names with the SpiceLogic MCP tools before making the change.

    Last updated on May 15, 2026

    Put this into practice.

    .NET WinForms HTML Editor Control ships with free C# and VB.NET sample projects and a 14-day evaluation.

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