RTCPeerConnection()

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

Конструктор RTCPeerConnection() возвращает новый экземпляр объекта RTCPeerConnection, который представляет соединение между локальным устройством и удалённым пиром (участником соединения)

Синтаксис

pc = new RTCPeerConnection([configuration]);

Параметры

configuration Необязательный

Объект класса RTCConfiguration, предоставляющий свойства для конфигурации нового экземпляра соединения.

Возвращаемое значение

Экземпляр класса RTCPeerConnection , сконфигурированный по свойствам параметра configuration, если используется, иначе сконфигурированный по умолчанию.

Спецификации

Specification
WebRTC: Real-Time Communication in Browsers
# dom-peerconnection

Совместимость с браузерами

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
RTCPeerConnection() constructor
configuration.bundlePolicy parameter
configuration.certificates parameter
configuration.iceCandidatePoolSize parameter
configuration.iceServers parameter
configuration.iceServers.credentialType parameter
DeprecatedNon-standard
configuration.iceServers.credential parameter
configuration.iceServers.url parameter
Deprecated
configuration.iceServers.urls parameter
configuration.iceServers.username parameter
configuration.iceTransportPolicy parameter
configuration.peerIdentity parameter
configuration.rtcpMuxPolicy parameter

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.
See implementation notes.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Has more compatibility info.

Смотрите также