Widevine is a type of DRM used by some websites to digitally protect content from being pirated and is commonly used by video and audio streaming sites like Spotify, YouTube, and Hulu. This article describes how to enable Widevine for the following 3D WebView packages:
- 3D WebView for Windows and macOS
- 3D WebView for Android
- 3D WebView for Android with Gecko Engine
- 3D WebView for iOS
- 3D WebView for visionOS
Limitations
Even with Widevine DRM enabled, some video streaming sites still do not play in 3D WebView because they only support playback in apps that have been explicitly approved via a program called Verified Media Path (VMP). For example, 3D WebView is unable to play video from Netflix because it requires VMP. On Android, iOS, visionOS, and UWP, 3D WebView is powered by those platforms' system webviews (i.e. android.webkit.WebView and WKWebView), which don't support WideVine VMP. On Windows and macOS, 3D WebView's Chromium browser engine also does not support VMP. I'm tracking this issue and will update this article if this changes in the future.
Enabling Widevine for Windows and macOS
3D WebView for Windows and macOS embeds Chromium as its browser engine. Within a few minutes of running an app with 3D WebView on a PC for the first time, Chromium automatically downloads the WideVine library to a subdirectory named WidevineCdm within the app's Chromium cache directory and then enables WideVine DRM for the app the next time that it is launched. With the default Chromium cache path, the path to the WideVine directory is the following:
{Application.persistentDataPath}/Vuplex.WebView/chromium-cache/WidevineCdm/{widevine_version_number}
Here's an example that shows the location and contents of an app's WidevineCdm folder on Windows:

You can verify that WideVine DRM is enabled for an app by loading this page in a webview and confirming that the value of the key "com.widevine.alpha" is not null.
Important note: most DRM protected video content uses proprietary video codecs (e.g. H.264), so you will likely also need to enable proprietary video codecs like described here. For example, the DRM Stream Test on this page requires proprietary video codecs to be enabled.
If you wish to force Chromium to download WideVine sooner, you can use Standalone.SetCommandLineArguments() to pass the option --component-updater=fast-update to Chromium, like this:
void Awake() {
StandaloneWebView.SetCommandLineArguments("--component-updater=fast-update");
}Enabling Widevine for Android
For 3D WebView for Android, an application can enable Widevine DRM by calling AndroidWebView.SetDrmEnabled() at the start of the app, like this:
void Awake() {
#if UNITY_ANDROID && !UNITY_EDITOR
AndroidWebView.SetDrmEnabled(true);
#endif
}After that, you can verify that DRM is enabled by viewing the DRM Stream Test on this page.
Enabling Widevine for Android Gecko
For 3D WebView for Android with Gecko Engine, an application can enable Widevine DRM by calling AndroidGeckoWebView.SetDrmEnabled() at the start of the app, like this:
void Awake() {
#if UNITY_ANDROID && !UNITY_EDITOR
AndroidGeckoWebView.SetDrmEnabled(true);
#endif
}After that, you can verify that DRM is enabled by viewing the DRM Stream Test on this page.
Enabling DRM for iOS or visionOS
iOS and visionOS don't support Widevine DRM, but FairPlay DRM is enabled by default for Native 2D Mode on iOS and for native windowed webviews on visionOS. Fairplay DRM is not supported in the default 3D rendering mode (i.e. when rendering web content to a texture) because it is not supported by 3D WebView's fallback video implementation.
