Spec-Zone.ru › Dart 2

dart:html

Поддержка свойства

bool supported

Проверяет, поддерживаются ли API реального времени связи (RTC) и включены ли они на текущей платформе.

Реализация

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 BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-html/RtcPeerConnection/supported.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API