Page 1 of 1

Autoplay-policy not being respected in Win 10 App

PostPosted: Thu Jun 10, 2021 12:02 pm
by diveecco63
We are experiencing an issue with auto-play on windows 10 machines.

We are initializing Cef as follows:we create a OverrideSettings object of type CefSettingsOverrideCefSettings = new CefSettings();

Then we add accepted langugue list settings and a variety of command line args:

OverrideCefSettings.AcceptLanguageList =$"{CultureInfo.CurrentCulture.Name}, {CultureInfo.CurrentCulture.Name.Substring(0, 2)}";OverrideCefSettings.CefCommandLineArgs["autoplay-policy"] = "no-user-gesture-required";OverrideCefSettings.CefCommandLineArgs.Add("enable-media-stream");OverrideCefSettings.CefCommandLineArgs.Add("disable-gpu");OverrideCefSettings.CefCommandLineArgs.Add("no-proxy-server");OverrideCefSettings.CefCommandLineArgs.Add("enable-experimental-web-platform-features");OverrideCefSettings.CefCommandLineArgs.Add("enable-p2papi");OverrideCefSettings.CefCommandLineArgs.Add("allow-running-insecure-content");OverrideCefSettings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing");OverrideCefSettings.CefCommandLineArgs.Add("enable-speech-input");OverrideCefSettings.CefCommandLineArgs.Add("allow-file-access-from-files");OverrideCefSettings.CefCommandLineArgs.Add("allow-http-screen-capture");OverrideCefSettings.CefCommandLineArgs.Add("auto-select-desktop-capture-source");OverrideCefSettings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream");OverrideCefSettings.CefCommandLineArgs.Add("use-mock-keychain");OverrideCefSettings.CefCommandLineArgs.Add("force-renderer-accessibility");The issue is the first one, the autoplay-policy does not seem to be respected on windows machines. This is a WPF app, and we are initializing cef in app.xaml.cs on Application_startup

Cef.Initialize(OverrideCefSettings);Are we missing something else? This is only an issue on windows - MacOs seems to handle this fine.

Re: Autoplay-policy not being respected in Win 10 App

PostPosted: Thu Jun 10, 2021 2:12 pm
by amaitland
What version are you using?

Try remove all your other command line args and just set autoplay-policy as a test.

Load chrome://version in the browser and confirm the command line arg is listed.

Re: Autoplay-policy not being respected in Win 10 App

PostPosted: Fri Jul 30, 2021 1:25 pm
by ValentinNikin
Hello, diveecco63.

I also develop application for Windows 10, and this option works fine for me.
Maybe you have some trouble with video codec. I came across the fact that proprietary codecs doesn't supported on Cef default configuration. You can see my question viewtopic.php?f=18&t=18540

Also, maybe you should try to change CefSettings console flags initialization

My code it looks like this
Code: Select all
var cefSettings = new CefSettings
            {
                RootCachePath = cache,
                CachePath = cache,
                CefCommandLineArgs = { ["disable-gpu-shader-disk-cache"] = "1", ["autoplay-policy"] = "no-user-gesture-required" },
                CommandLineArgsDisabled = true,
                WindowlessRenderingEnabled = true
            };