diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index cea04751..9d03ac20 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -145,6 +145,7 @@ type FShutdownWaitTime : cardinal; FWidevinePath : ustring; FMustFreeLibrary : boolean; + FAutoplayPolicy : TCefAutoplayPolicy; FMustCreateResourceBundleHandler : boolean; FMustCreateBrowserProcessHandler : boolean; @@ -364,6 +365,7 @@ type property ShutdownWaitTime : cardinal read FShutdownWaitTime write FShutdownWaitTime; property WidevinePath : ustring read FWidevinePath write FWidevinePath; property MustFreeLibrary : boolean read FMustFreeLibrary write FMustFreeLibrary; + property AutoplayPolicy : TCefAutoplayPolicy read FAutoplayPolicy write FAutoplayPolicy; property ChildProcessesCount : integer read GetChildProcessesCount; property OnRegCustomSchemes : TOnRegisterCustomSchemesEvent read FOnRegisterCustomSchemes write FOnRegisterCustomSchemes; @@ -499,6 +501,7 @@ begin FShutdownWaitTime := 0; FWidevinePath := ''; FMustFreeLibrary := False; + FAutoplayPolicy := appDefault; FMustCreateResourceBundleHandler := False; FMustCreateBrowserProcessHandler := True; @@ -1318,6 +1321,20 @@ begin STATE_DISABLED : commandLine.AppendSwitch('--disable-smooth-scrolling'); end; + case FAutoplayPolicy of + appDocumentUserActivationRequired : + commandLine.AppendSwitchWithValue('--autoplay-policy', 'document-user-activation-required'); + + appNoUserGestureRequired : + commandLine.AppendSwitchWithValue('--autoplay-policy', 'no-user-gesture-required'); + + appUserGestureRequired : + commandLine.AppendSwitchWithValue('--autoplay-policy', 'user-gesture-required'); + + appUserGestureRequiredForCrossOrigin : + commandLine.AppendSwitchWithValue('--autoplay-policy', 'user-gesture-required-for-cross-origin'); + end; + if FFastUnload then commandLine.AppendSwitch('--enable-fast-unload'); diff --git a/source/uCEFTypes.pas b/source/uCEFTypes.pas index 40716d16..51bd1eaa 100644 --- a/source/uCEFTypes.pas +++ b/source/uCEFTypes.pas @@ -362,6 +362,12 @@ type TCefProxyScheme = (psHTTP, psSOCKS4, psSOCKS5); + TCefAutoplayPolicy = (appDefault, + appDocumentUserActivationRequired, + appNoUserGestureRequired, + appUserGestureRequired, + appUserGestureRequiredForCrossOrigin); + TCefWebRTCHandlingPolicy = ( hpDefault, hpDefaultPublicAndPrivateInterfaces,