How can I enable WebRTC, camera access, and microphone access?

Like a normal browser, 3D WebView blocks web pages from accessing the user's camera and microphone by default. However, most of the 3D WebView packages include a method for enabling camera and microphone access. Enabling camera and microphone access on those platforms enables support for WebRTC-based video conferencing sites, like Zoom, Google Meet, and GoToMeeting.

The following 3D WebView packages support WebRTC, camera access, and microphone access:

The following 3D WebView packages currently do not support WebRTC, camera access, or microphone access:

3D WebView for Windows and macOS

With 3D WebView for Windows and macOS, you can enable camera and microphone access by calling StandaloneWebView.SetAudioAndVideoCaptureEnabled() at the beginning of your application, like this:

void Start() {
  // Call this at the start of your application,
  // before webviews are initialized.
  StandaloneWebView.SetAudioAndVideoCaptureEnabled(true);
  // Now webviews can be initialized...
}

3D WebView for Android

With 3D WebView for Android, you can enable camera and microphone access by calling AndroidWebView.SetAudioAndVideoCaptureEnabled(), like this:

void Start() {
  #if UNITY_ANDROID && !UNITY_EDITOR
    AndroidWebView.SetAudioAndVideoCaptureEnabled(true);
  #endif
}

Additionally, your application's AndroidManifest.xml file must include the permissions listed here and request those permissions from the user at runtime.

3D WebView for Android with Gecko Engine

With 3D WebView for Android with Gecko Engine, you can enable camera and microphone access by calling AndroidGeckoWebView.SetAudioAndVideoCaptureEnabled(), like this:

void Start() {
  #if UNITY_ANDROID && !UNITY_EDITOR
    AndroidGeckoWebView.SetAudioAndVideoCaptureEnabled(true);
  #endif
}

Additionally, your application's AndroidManifest.xml file must include the permissions listed here and request those permissions from the user at runtime.

3D WebView for iOS

3D WebView for iOS doesn't currently include a method for enabling camera and microphone access. In order to support video on iOS, 3D WebView implements its own HTML5 video stack that supports playing videos from URLs but doesn't support rendering video from the device's camera. So, this currently makes it unsuitable for many WebRTC video applications.

3D WebView for UWP / Hololens

3D WebView for UWP / Hololens doesn't currently include a method for enabling camera and microphone access. Due to UWP platform limitations, the web framerate of the UWP plugin is currently relatively slow (< 10 FPS), which makes it unsuitable for video playback.