From 5bbfd42f592ee2d6138b3da0b734b3f743bd8f3a Mon Sep 17 00:00:00 2001 From: "P.J.Shand" Date: Mon, 12 Nov 2018 17:47:58 +1100 Subject: [PATCH] --autoplay-policy, no-user-gesture-required flags to allow video and audio to play without user input --- templates/electron/haxe/ElectronSetup.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/electron/haxe/ElectronSetup.hx b/templates/electron/haxe/ElectronSetup.hx index 60ebeeb56..3deb43790 100644 --- a/templates/electron/haxe/ElectronSetup.hx +++ b/templates/electron/haxe/ElectronSetup.hx @@ -46,6 +46,10 @@ class ElectronSetup { if (height == 0) height = 600; var frame:Bool = window.borderless == false; + var commandLine = Reflect.getProperty(electron.main.App, "commandLine"); + var appendSwitch:haxe.Constraints.Function = Reflect.getProperty(commandLine, "appendSwitch"); + appendSwitch('--autoplay-policy','no-user-gesture-required'); + electron.main.App.on( 'ready', function(e) { var config:Dynamic = { fullscreen: window.fullscreen,