supported property

bool supported

Checks if Real Time Communication (RTC) APIs are supported and enabled on the current platform.

Implementation

static bool get supported {
  // Currently in Firefox some of the RTC elements are defined but throw an
  // error unless the user has specifically enabled them in their
  // about:config. So we have to construct an element to actually test if RTC
  // is supported at the given time.
  try {
    new RtcPeerConnection({
      "iceServers": [
        {"url": "stun:localhost"}
      ]
    });
    return true;
  } catch (_) {
    return false;
  }
  return false;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-html/RtcPeerConnection/supported.html