Added GlobalCEFApp.AutoplayPolicy property

This commit is contained in:
Salvador Díaz Fau 2018-08-23 14:24:18 +02:00
parent 37518b318e
commit 5bc37a52ad
2 changed files with 23 additions and 0 deletions

View File

@ -145,6 +145,7 @@ type
FShutdownWaitTime : cardinal; FShutdownWaitTime : cardinal;
FWidevinePath : ustring; FWidevinePath : ustring;
FMustFreeLibrary : boolean; FMustFreeLibrary : boolean;
FAutoplayPolicy : TCefAutoplayPolicy;
FMustCreateResourceBundleHandler : boolean; FMustCreateResourceBundleHandler : boolean;
FMustCreateBrowserProcessHandler : boolean; FMustCreateBrowserProcessHandler : boolean;
@ -364,6 +365,7 @@ type
property ShutdownWaitTime : cardinal read FShutdownWaitTime write FShutdownWaitTime; property ShutdownWaitTime : cardinal read FShutdownWaitTime write FShutdownWaitTime;
property WidevinePath : ustring read FWidevinePath write FWidevinePath; property WidevinePath : ustring read FWidevinePath write FWidevinePath;
property MustFreeLibrary : boolean read FMustFreeLibrary write FMustFreeLibrary; property MustFreeLibrary : boolean read FMustFreeLibrary write FMustFreeLibrary;
property AutoplayPolicy : TCefAutoplayPolicy read FAutoplayPolicy write FAutoplayPolicy;
property ChildProcessesCount : integer read GetChildProcessesCount; property ChildProcessesCount : integer read GetChildProcessesCount;
property OnRegCustomSchemes : TOnRegisterCustomSchemesEvent read FOnRegisterCustomSchemes write FOnRegisterCustomSchemes; property OnRegCustomSchemes : TOnRegisterCustomSchemesEvent read FOnRegisterCustomSchemes write FOnRegisterCustomSchemes;
@ -499,6 +501,7 @@ begin
FShutdownWaitTime := 0; FShutdownWaitTime := 0;
FWidevinePath := ''; FWidevinePath := '';
FMustFreeLibrary := False; FMustFreeLibrary := False;
FAutoplayPolicy := appDefault;
FMustCreateResourceBundleHandler := False; FMustCreateResourceBundleHandler := False;
FMustCreateBrowserProcessHandler := True; FMustCreateBrowserProcessHandler := True;
@ -1318,6 +1321,20 @@ begin
STATE_DISABLED : commandLine.AppendSwitch('--disable-smooth-scrolling'); STATE_DISABLED : commandLine.AppendSwitch('--disable-smooth-scrolling');
end; 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 if FFastUnload then
commandLine.AppendSwitch('--enable-fast-unload'); commandLine.AppendSwitch('--enable-fast-unload');

View File

@ -362,6 +362,12 @@ type
TCefProxyScheme = (psHTTP, psSOCKS4, psSOCKS5); TCefProxyScheme = (psHTTP, psSOCKS4, psSOCKS5);
TCefAutoplayPolicy = (appDefault,
appDocumentUserActivationRequired,
appNoUserGestureRequired,
appUserGestureRequired,
appUserGestureRequiredForCrossOrigin);
TCefWebRTCHandlingPolicy = ( TCefWebRTCHandlingPolicy = (
hpDefault, hpDefault,
hpDefaultPublicAndPrivateInterfaces, hpDefaultPublicAndPrivateInterfaces,