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;
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');

View File

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