Skip Navigation

Enabling microphone and camera support with WebRTC

As of
BlackBerry Dynamics SDK
version 10.2, access to WebRTC is disabled by default. As a result, the following WebRTC API's are blocked:
  • getUserMedia
  • enumerateDevices
  • getSupportedConstraints
  • getDisplayMedia
  • RTCPeerConnection
  • RTCSessionDescription
  • RTCIceCandidate
  • RTCPeerConnectionIceEvent
  • RTCPeerConnectionIceErrorEvent
  • RTCCertificate
  • RTCRtpSender
  • RTCRtpReceiver
  • RTCRtpTransceiver
  • RTCDtlsTransport
  • RTCIceTransport
  • RTCTrackEvent
  • RTCSctpTranspor
  • RTCDataChannel
  • RTCDataChannelEvent
  • RTCDTMFSender
  • RTCDTMFToneChangeEvent
  • RTCStatsReport
  • RTCErrorEvent
You can use a setting in the app configuration to turn WebRTC on and off. By enabling WebRTC, you can provide microphone and camera support that is required for certain services (for example,
Zoom
or
WebEx
). When you enable WebRTC, users will be prompted to approve the use of the camera and microphone when they are using a supported service.
If you want to enable WebRTC in your app, you must select
Allow WebRTC
in the app configuration settings for your app on the
UEM
server. WebRTC traffic is routed directly to the internet instead of through the
BlackBerry Dynamics
secure tunnel regardless of the network connectivity profile settings because they do not apply to WebRTC traffic. Because WebRTC traffic is not secured by the SDK, there are potential security risks that can occur for users that approve the use of WebRTC. If you require the use of WebRTC and can accept this risk, you can implement an app policy to enable or disable WebRTC usage.
WebRTC policy changes cannot be applied during runtime. Any policy changes will be applied after the app is restarted or the WKWebView instance is reinitialized.
To add a WebRTC policy for your app, do the following:
  1. Create a
    BlackBerry Dynamics
    app policy definition file for your app. For implementation details and more information about the file format and elements, see the Application Policies Definition appendix in the API Reference and the BlackBerry Dynamics App Policies Technical Brief.
    (Optional) Provide an example. If you include a screen shot, include alt text in the alt element.
  2. Add a setting definition for the WebRTC. The name of the key must be
    k_allow_web_rtc
    , and the default value should be
    false
    . For example:
    <setting name="blackberry.security.EnableWebRTC"> <checkbox> <key>features.k_allow_web_rtc</key> <label>Enable WebRTC</label> <value>false</value> </checkbox> </setting>
  3. Include the WebRTC policy setting in the structural section of the file. The pview elements must not include a key attribute. For example:
    <pview> <pview type="tabbed"> <title>WebRTC (Real-Time Communication)</title> <desc>To improve security and privacy WebRTC is disabled in BlackBerry Dynamics. Optionally enable WebRTC connections to enable audio and video peer-peer communication from this application.</desc> <pe ref="blackberry.security.EnableWebRTC" /> </pview> </pview>
  4. Coordinate with the
    UEM
    administrator to upload the app policy for your app in
    UEM
    . For more information, see Manage settings for a BlackBerry Dynamics apps (App configuration > Upload a template).
The
UEM
administrator can now enable the WebRTC feature.