diff --git a/Directory.Build.props b/Directory.Build.props index 49227e6..4496722 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,7 +11,7 @@ $([System.DateTime]::Now.ToString('yyyy')) - 0.5.0-preview.2 + 0.5.0-preview.3 vvvv group diff --git a/VL.CEF/src/CefExtensions.cs b/VL.CEF/src/CefExtensions.cs index 7882888..baa1ac6 100644 --- a/VL.CEF/src/CefExtensions.cs +++ b/VL.CEF/src/CefExtensions.cs @@ -83,7 +83,7 @@ public static IResourceProvider GetRuntimeProvider() var args = Environment.GetCommandLineArgs(); var mainArgs = new CefMainArgs(args); - CefRuntime.Initialize(mainArgs, cefSettings, application: null, windowsSandboxInfo: default); + CefRuntime.Initialize(mainArgs, cefSettings, application: new App(), windowsSandboxInfo: default); var schemeName = "cef"; if (!CefRuntime.RegisterSchemeHandlerFactory(SchemeHandlerFactory.SCHEME_NAME, null, new SchemeHandlerFactory())) @@ -112,5 +112,16 @@ public static Vector2 LogicalToDevice(this Vector2 v, float scaleFactor) //{ // return viewport.Project((Vector3)v, view, projection, Matrix.Identity).XY(); //} + + class App : CefApp + { + protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine) + { + // Enable auto play (https://github.com/vvvv/VL.CEF/issues/12) + commandLine.AppendSwitch("autoplay-policy", "no-user-gesture-required"); + + base.OnBeforeCommandLineProcessing(processType, commandLine); + } + } } }