Skip to content

Commit

Permalink
Core - Remove RegisterWidevineCdm
Browse files Browse the repository at this point in the history
This is a breaking change. CEF will now automatically download the Widevine CDM component

Resolves #3767
  • Loading branch information
amaitland committed Aug 21, 2021
1 parent 74891e3 commit 11af69f
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 351 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public static void EnableWaitForBrowsersToClose() { }
public static void PreShutdown() { }
public static void QuitMessageLoop() { }
public static void RefreshWebPlugins() { }
public static void RegisterWidevineCdm(string path, CefSharp.IRegisterCdmCallback callback) { }
public static System.Threading.Tasks.Task<CefSharp.CdmRegistration> RegisterWidevineCdmAsync(string path) { throw null; }
public static bool RemoveCrossOriginWhitelistEntry(string sourceOrigin, string targetProtocol, string targetDomain, bool allowTargetSubdomains) { throw null; }
public static void RemoveDisposable(System.IDisposable item) { }
public static void RunMessageLoop() { }
Expand Down
70 changes: 0 additions & 70 deletions CefSharp.Core.Runtime/Cef.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "Internals/CefSharpApp.h"
#include "Internals/CefWebPluginInfoVisitorAdapter.h"
#include "Internals/CefTaskScheduler.h"
#include "Internals/CefRegisterCdmCallbackAdapter.h"
#include "CookieManager.h"
#include "CefSettingsBase.h"
#include "RequestContext.h"
Expand Down Expand Up @@ -763,75 +762,6 @@ namespace CefSharp
return cef_get_min_log_level();
}

/// <summary>
/// Register the Widevine CDM plugin.
///
/// The client application is responsible for downloading an appropriate
/// platform-specific CDM binary distribution from Google, extracting the
/// contents, and building the required directory structure on the local machine.
/// The <see cref="CefSharp::IBrowserHost::StartDownload"/> method class can be used
/// to implement this functionality in CefSharp. Contact Google via
/// https://www.widevine.com/contact.html for details on CDM download.
///
///
/// path is a directory that must contain the following files:
/// 1. manifest.json file from the CDM binary distribution (see below).
/// 2. widevinecdm file from the CDM binary distribution (e.g.
/// widevinecdm.dll on Windows).
/// 3. widevidecdmadapter file from the CEF binary distribution (e.g.
/// widevinecdmadapter.dll on Windows).
///
/// If any of these files are missing or if the manifest file has incorrect
/// contents the registration will fail and callback will receive an ErrorCode
/// value of <see cref="CefSharp::CdmRegistrationErrorCode::IncorrectContents"/>.
///
/// The manifest.json file must contain the following keys:
/// A. "os": Supported OS (e.g. "mac", "win" or "linux").
/// B. "arch": Supported architecture (e.g. "ia32" or "x64").
/// C. "x-cdm-module-versions": Module API version (e.g. "4").
/// D. "x-cdm-interface-versions": Interface API version (e.g. "8").
/// E. "x-cdm-host-versions": Host API version (e.g. "8").
/// F. "version": CDM version (e.g. "1.4.8.903").
/// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1").
///
/// A through E are used to verify compatibility with the current Chromium
/// version. If the CDM is not compatible the registration will fail and
/// callback will receive an ErrorCode value of <see cref="CdmRegistrationErrorCode::Incompatible"/>.
///
/// If registration is not supported at the time that Cef.RegisterWidevineCdm() is called then callback
/// will receive an ErrorCode value of <see cref="CdmRegistrationErrorCode::NotSupported"/>.
/// </summary>
/// <param name="path"> is a directory that contains the Widevine CDM files</param>
/// <param name="callback">optional callback - <see cref="IRegisterCdmCallback::OnRegistrationComplete"/>
/// will be executed asynchronously once registration is complete</param>
static void RegisterWidevineCdm(String^ path, [Optional] IRegisterCdmCallback^ callback)
{
CefRefPtr<CefRegisterCdmCallbackAdapter> adapter = nullptr;

if (callback != nullptr)
{
adapter = new CefRegisterCdmCallbackAdapter(callback);
}

CefRegisterWidevineCdm(StringUtils::ToNative(path), adapter);
}

/// <summary>
/// Register the Widevine CDM plugin.
///
/// See <see cref="RegisterWidevineCdm(String, IRegisterCdmCallback)"/> for more details.
/// </summary>
/// <param name="path"> is a directory that contains the Widevine CDM files</param>
/// <returns>Returns a Task that can be awaited to receive the <see cref="CdmRegistration"/> response.</returns>
static Task<CdmRegistration^>^ RegisterWidevineCdmAsync(String^ path)
{
auto callback = gcnew TaskRegisterCdmCallback();

RegisterWidevineCdm(path, callback);

return callback->Task;
}

/// <summary>
/// Returns the mime type for the specified file extension or an empty string if unknown.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@
<ClInclude Include="Internals\CefFrameWrapper.h" />
<ClInclude Include="Internals\CefMenuModelWrapper.h" />
<ClInclude Include="Internals\CefPdfPrintCallbackWrapper.h" />
<ClInclude Include="Internals\CefRegisterCdmCallbackAdapter.h" />
<ClInclude Include="Internals\CefResolveCallbackAdapter.h" />
<ClInclude Include="Internals\CefResponseFilterAdapter.h" />
<ClInclude Include="Internals\CefResponseWrapper.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@
<ClInclude Include="Internals\CefCertificateCallbackWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Internals\CefRegisterCdmCallbackAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Internals\CefSetCookieCallbackAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
1 change: 0 additions & 1 deletion CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
<ClInclude Include="Internals\CefFrameWrapper.h" />
<ClInclude Include="Internals\CefMenuModelWrapper.h" />
<ClInclude Include="Internals\CefPdfPrintCallbackWrapper.h" />
<ClInclude Include="Internals\CefRegisterCdmCallbackAdapter.h" />
<ClInclude Include="Internals\CefResolveCallbackAdapter.h" />
<ClInclude Include="Internals\CefResponseFilterAdapter.h" />
<ClInclude Include="Internals\CefResponseWrapper.h" />
Expand Down
3 changes: 0 additions & 3 deletions CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@
<ClInclude Include="Internals\CefCertificateCallbackWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Internals\CefRegisterCdmCallbackAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Internals\CefSetCookieCallbackAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
52 changes: 0 additions & 52 deletions CefSharp.Core.Runtime/Internals/CefRegisterCdmCallbackAdapter.h

This file was deleted.

58 changes: 0 additions & 58 deletions CefSharp.Core/Cef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,64 +575,6 @@ public static LogSeverity GetMinLogLevel()
return (LogSeverity)severity;
}

/// <summary>
/// Register the Widevine CDM plugin.
///
/// The client application is responsible for downloading an appropriate
/// platform-specific CDM binary distribution from Google, extracting the
/// contents, and building the required directory structure on the local machine.
/// The <see cref="CefSharp.IBrowserHost.StartDownload"/> method class can be used
/// to implement this functionality in CefSharp. Contact Google via
/// https://www.widevine.com/contact.html for details on CDM download.
///
///
/// path is a directory that must contain the following files:
/// 1. manifest.json file from the CDM binary distribution (see below).
/// 2. widevinecdm file from the CDM binary distribution (e.g.
/// widevinecdm.dll on Windows).
/// 3. widevidecdmadapter file from the CEF binary distribution (e.g.
/// widevinecdmadapter.dll on Windows).
///
/// If any of these files are missing or if the manifest file has incorrect
/// contents the registration will fail and callback will receive an ErrorCode
/// value of <see cref="CefSharp.CdmRegistrationErrorCode.IncorrectContents"/>.
///
/// The manifest.json file must contain the following keys:
/// A. "os": Supported OS (e.g. "mac", "win" or "linux").
/// B. "arch": Supported architecture (e.g. "ia32" or "x64").
/// C. "x-cdm-module-versions": Module API version (e.g. "4").
/// D. "x-cdm-interface-versions": Interface API version (e.g. "8").
/// E. "x-cdm-host-versions": Host API version (e.g. "8").
/// F. "version": CDM version (e.g. "1.4.8.903").
/// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1").
///
/// A through E are used to verify compatibility with the current Chromium
/// version. If the CDM is not compatible the registration will fail and
/// callback will receive an ErrorCode value of <see cref="CdmRegistrationErrorCode.Incompatible"/>.
///
/// If registration is not supported at the time that Cef.RegisterWidevineCdm() is called then callback
/// will receive an ErrorCode value of <see cref="CdmRegistrationErrorCode.NotSupported"/>.
/// </summary>
/// <param name="path"> is a directory that contains the Widevine CDM files</param>
/// <param name="callback">optional callback - <see cref="IRegisterCdmCallback.OnRegistrationComplete"/>
/// will be executed asynchronously once registration is complete</param>
public static void RegisterWidevineCdm(string path, IRegisterCdmCallback callback = null)
{
Core.Cef.RegisterWidevineCdm(path, callback);
}

/// <summary>
/// Register the Widevine CDM plugin.
///
/// See <see cref="RegisterWidevineCdm(string, IRegisterCdmCallback)"/> for more details.
/// </summary>
/// <param name="path"> is a directory that contains the Widevine CDM files</param>
/// <returns>Returns a Task that can be awaited to receive the <see cref="CdmRegistration"/> response.</returns>
public static Task<CdmRegistration> RegisterWidevineCdmAsync(string path)
{
return Core.Cef.RegisterWidevineCdmAsync(path);
}

/// <summary>
/// Returns the mime type for the specified file extension or an empty string if unknown.
/// </summary>
Expand Down
4 changes: 0 additions & 4 deletions CefSharp.Example/CefExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser
// Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_ID", "");
// Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_SECRET", "");

// Widevine CDM registration - pass in directory where Widevine CDM binaries and manifest.json are located.
// For more information on support for DRM content with Widevine see: https://github.com/cefsharp/CefSharp/issues/1934
//Cef.RegisterWidevineCdm(@".\WidevineCdm");

//Chromium Command Line args
//http://peter.sh/experiments/chromium-command-line-switches/
//NOTE: Not all relevant in relation to `CefSharp`, use for reference purposes only.
Expand Down
25 changes: 0 additions & 25 deletions CefSharp/Callback/IRegisterCdmCallback.cs

This file was deleted.

63 changes: 0 additions & 63 deletions CefSharp/Callback/TaskRegisterCdmCallback.cs

This file was deleted.

33 changes: 0 additions & 33 deletions CefSharp/CdmRegistration.cs

This file was deleted.

Loading

0 comments on commit 11af69f

Please sign in to comment.