1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Added widevine helper functions

This commit is contained in:
Salvador Díaz Fau
2017-09-07 22:56:51 +02:00
parent ae1c10aa03
commit f7ca8a7a93
5 changed files with 213 additions and 229 deletions

View File

@ -52,7 +52,8 @@ uses
{$ELSE}
Windows, Classes, SysUtils, Controls, ActiveX, Math,
{$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFResourceHandler, uCEFGetGeolocationCallback;
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFResourceHandler, uCEFGetGeolocationCallback,
uCEFRegisterCDMCallback;
const
Kernel32DLL = 'kernel32.dll';
@ -188,6 +189,9 @@ function GetDeviceScaleFactor : single;
function CefGetGeolocation(const aCallbackFunction : TOnLocationUpdate) : boolean;
procedure CefRegisterWidevineCdm(const path: ustring; const callback: ICefRegisterCdmCallback);
procedure CefFastRegisterWidevineCdm(const path: ustring; const callback: TCefRegisterCDMProc);
implementation
uses
@ -1238,4 +1242,17 @@ begin
Result := GetScreenDPI / 96;
end;
procedure CefRegisterWidevineCdm(const path: ustring; const callback: ICefRegisterCdmCallback);
var
str: TCefString;
begin
str := CefString(path);
cef_register_widevine_cdm(@str, CefGetData(callback));
end;
procedure CefFastRegisterWidevineCdm(const path: ustring; const callback: TCefRegisterCDMProc);
begin
CefRegisterWidevineCdm(path, TCefFastRegisterCdmCallback.Create(callback) as ICefRegisterCdmCallback);
end;
end.