Add support for Widevine CDM csharp ( C# & C ) - CreateBrowser/AutoGetFeaturesCefSharpBrowserDesktopPC GitHub Wiki

Add support for Widevine CDM C#

Windows:

CefSharp.exe --enable-widevine-cdm --cache-path=C:\Project\WidevineCdm\temp\cache

CS > (C#)


        Cef.RegisterWidevineCdm(@"WidevineCdm");
        Cef.RegisterWidevineCdmAsync(@"WidevineCdm");

        settings.CefCommandLineArgs.Add("enable-widevine", "1");
        settings.CefCommandLineArgs.Add("enable-widevine-cdm", "1");

Add support for Widevine CDM C++

Add support for Widevine CDM

Widevine in a DRM system developed by Google and used by companies like YouTube and Netflix to protect HTML5 video. The binary component used by Chromium, called the Widevine CDM, is a Pepper plugin that is downloaded on Windows and OS X via the Chrome component updater [1] (download on Linux is not yet supported, see WIDEVINE_CDM_IS_COMPONENT usage). Automated download of the binary from Google is allowed but bundling of the Widevine CDM with third-party applications requires a license.

To add support for Widevine CDM in CEF the following changes will be required:

Add a dependency on /third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h and /components/components.gyp:cdm_renderer (cdm_browser is Android-only currently). Download the binaries [2] from Google, possibly using the component updater (see chrome/browser/component_updater/widevine_cdm_component_installer.cc, RegisterComponentsForUpdate in chrome/browser/chrome_browser_main.cc). Register the Pepper plugin. Implement ContentRendererClient::AddKeySystems (see AddChromeKeySystems in chrome/renderer/media/chrome_key_systems.cc). Additional logic related to content settings may also be required (see ShouldUseJavaScriptSettingForPlugin usage in chrome/renderer/chrome_content_renderer_client.cc and chrome/browser/plugins/plugin_info_message_filter.cc). Related variables include:

enable_pepper_cdms (GYP, on by default in common.gypi) WIDEVINE_CDM_AVAILABLE (defined in third_party/widevine/cdm/stub/widevine_cdm_version.h) WIDEVINE_CDM_IS_COMPONENT (defined in third_party/widevine/cdm/widevine_cdm_common.h, currently Windows and OS X only) [1] https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/browser/component_updater

[2] libwidevinecdm.dylib, widevinecdm.dll, libwidevinecdm.so, widevinecdmadapter.plugin, widevinecdmadapter.dll, libwidevinecdmadapter.so


Download


widevine.patch


  1. Build CEF/Chromium with support for proprietary codecs. set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome

  2. Run cefclient with CDM support and cache path.


Windows:

cefclient.exe --enable-widevine-cdm --cache-path=c:\temp\cache

OS X:

open cefclient.app --args --enable-widevine-cdm --cache-path=/Users/marshall/temp/cache

Linux:

cefclient --widevine-cdm-path=/opt/google/stable --widevine-cdm-version=1.4.8.824 --cache-path=/home/marshall/temp/cache