Skip to content

Commit

Permalink
Enables auto play (issue #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
azeno committed Sep 15, 2023
1 parent cb23736 commit 72c4b35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<!-- Version information -->
<Year>$([System.DateTime]::Now.ToString('yyyy'))</Year>
<Version>0.5.0-preview.2</Version>
<Version>0.5.0-preview.3</Version>

<!-- Package properties -->
<Authors>vvvv group</Authors>
Expand Down
13 changes: 12 additions & 1 deletion VL.CEF/src/CefExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static IResourceProvider<IDisposable> 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()))
Expand Down Expand Up @@ -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);
}
}
}
}

0 comments on commit 72c4b35

Please sign in to comment.