I am using a WinForms application and within that I created a WebView2 instance to play media content using HTML5. I have been looking into documentation to find some way by which I can Enable AutoPlay in WebView2 such that my desktop application will play videos without user's interaction.
Things that I have tried.
Thank you!
It can be so. It helped me
public MainWindow()
{
Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--autoplay-policy=no-user-gesture-required");
InitializeComponent();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With