diff options
Diffstat (limited to 'files/vi/web/api/webrtc_api/index.html')
-rw-r--r-- | files/vi/web/api/webrtc_api/index.html | 233 |
1 files changed, 0 insertions, 233 deletions
diff --git a/files/vi/web/api/webrtc_api/index.html b/files/vi/web/api/webrtc_api/index.html deleted file mode 100644 index 508df4945f..0000000000 --- a/files/vi/web/api/webrtc_api/index.html +++ /dev/null @@ -1,233 +0,0 @@ ---- -title: WebRTC API -slug: Web/API/WebRTC_API -tags: - - API - - Audio - - Conferencing - - Landing - - Media - - NeedsTranslation - - Networking - - TopicStub - - Video - - WebRTC - - WebRTC API - - streaming -translation_of: Web/API/WebRTC_API ---- -<div>{{WebRTCSidebar}}</div> - -<p><span class="seoSummary"><strong>WebRTC</strong> (Web Real-Time Communication) is a technology which enables Web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without requiring an intermediary.</span> The set of standards that comprise WebRTC makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software.</p> - -<p>WebRTC consists of several interrelated APIs and protocols which work together to achieve this. The documentation you'll find here will help you understand the fundamentals of WebRTC, how to set up and use both data and media connections, and more.</p> - -<h2 id="Interoperability">Interoperability</h2> - -<p>Because implementations of WebRTC are still evolving, and because each browser has <a href="/en-US/docs/Web/Media/Formats/WebRTC_codecs">different levels of support for codecs</a> and WebRTC features, you should <em>strongly</em> consider making use of <a href="https://github.com/webrtcHacks/adapter">the Adapter.js library</a> provided by Google before you begin to write your code.</p> - -<p>Adapter.js uses shims and polyfills to smooth over the differences among the WebRTC implementations across the environments supporting it. Adapter.js also handles prefixes and other naming differences to make the entire WebRTC development process easier, with more broadly compatible results. The library is also <a href="https://www.npmjs.com/package/webrtc-adapter">available as an NPM package</a>.</p> - -<p>To learn more about Adapter.js, see <a href="/en-US/docs/Web/API/WebRTC_API/adapter.js">Improving compatibility using WebRTC adapter.js</a>.</p> - -<h2 id="WebRTC_concepts_and_usage">WebRTC concepts and usage</h2> - -<p>WebRTC serves multiple purposes; together with the <a href="/en-US/docs/Web/API/Media_Streams_API">Media Capture and Streams API</a>, they provide powerful multimedia capabilities to the Web, including support for audio and video conferencing, file exchange, screen sharing, identity management, and interfacing with legacy telephone systems including support for sending {{Glossary("DTMF")}} (touch-tone dialing) signals. Connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without any intermediary servers.</p> - -<p>Connections between two peers are represented by the {{DOMxRef("RTCPeerConnection")}} interface. Once a connection has been established and opened using <code>RTCPeerConnection</code>, media streams ({{DOMxRef("MediaStream")}}s) and/or data channels ({{DOMxRef("RTCDataChannel")}}s) can be added to the connection.</p> - -<p>Media streams can consist of any number of tracks of media information; tracks, which are represented by objects based on the {{DOMxRef("MediaStreamTrack")}} interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapter names). Most streams consist of at least one audio track and likely also a video track, and can be used to send and receive both live media or stored media information (such as a streamed movie).</p> - -<p>You can also use the connection between two peers to exchange arbitrary binary data using the {{DOMxRef("RTCDataChannel")}} interface. This can be used for back-channel information, metadata exchange, game status packets, file transfers, or even as a primary channel for data transfer.</p> - -<p><em><strong>more details and links to relevant guides and tutorials needed</strong></em></p> - -<h2 id="WebRTC_interfaces">WebRTC interfaces</h2> - -<p>Because WebRTC provides interfaces that work together to accomplish a variety of tasks, we have divided up the interfaces in the list below by category. Please see the sidebar for an alphabetical list.</p> - -<h3 id="Connection_setup_and_management">Connection setup and management</h3> - -<p>These interfaces are used to set up, open, and manage WebRTC connections. Included are interfaces representing peer media connections, data channels, and interfaces used when exchanging information on the capabilities of each peer in order to select the best possible configuration for a two-way media connection..</p> - -<dl> - <dt>{{DOMxRef("RTCPeerConnection")}}</dt> - <dd>Represents a WebRTC connection between the local computer and a remote peer. It is used to handle efficient streaming of data between the two peers.</dd> - <dt>{{DOMxRef("RTCDataChannel")}}</dt> - <dd>Represents a bi-directional data channel between two peers of a connection.</dd> - <dt>{{DOMxRef("RTCDataChannelEvent")}}</dt> - <dd>Represents events that occur while attaching a {{DOMxRef("RTCDataChannel")}} to a {{DOMxRef("RTCPeerConnection")}}. The only event sent with this interface is {{event("datachannel")}}.</dd> - <dt>{{DOMxRef("RTCSessionDescription")}}</dt> - <dd>Represents the parameters of a session. Each <code>RTCSessionDescription</code> consists of a description {{DOMxRef("RTCSessionDescription.type", "type")}} indicating which part of the offer/answer negotiation process it describes and of the {{Glossary("SDP")}} descriptor of the session.</dd> - <dt>{{DOMxRef("RTCSessionDescriptionCallback")}}</dt> - <dd>The RTCSessionDescriptionCallback is passed into the {{DOMxRef("RTCPeerConnection")}} object when requesting it to create offers or answers.</dd> - <dt>{{DOMxRef("RTCStatsReport")}}</dt> - <dd>Provides information detailing statistics for a connection or for an individual track on the connection; the report can be obtained by calling {{DOMxRef("RTCPeerConnection.getStats()")}}. Details about using WebRTC statistics can be found in <a href="/en-US/docs/Web/API/WebRTC_Statistics_API">WebRTC Statistics API</a>.</dd> - <dt>{{DOMxRef("RTCIceCandidate")}}</dt> - <dd>Represents a candidate Internet Connectivity Establishment ({{Glossary("ICE")}}) server for establishing an {{DOMxRef("RTCPeerConnection")}}.</dd> - <dt>{{DOMxRef("RTCIceTransport")}}</dt> - <dd>Represents information about an ICE transport.</dd> - <dt>{{DOMxRef("RTCIceServer")}}</dt> - <dd>Defines how to connect to a single ICE server (such as a {{Glossary("STUN")}} or {{Glossary("TURN")}} server).</dd> - <dt>{{DOMxRef("RTCPeerConnectionIceEvent")}}</dt> - <dd>Represents events that occur in relation to ICE candidates with the target, usually an {{DOMxRef("RTCPeerConnection")}}. Only one event is of this type: {{event("icecandidate")}}.</dd> - <dt>{{DOMxRef("RTCRtpSender")}}</dt> - <dd>Manages the encoding and transmission of data for a {{DOMxRef("MediaStreamTrack")}} on an {{DOMxRef("RTCPeerConnection")}}.</dd> - <dt>{{DOMxRef("RTCRtpReceiver")}}</dt> - <dd>Manages the reception and decoding of data for a {{DOMxRef("MediaStreamTrack")}} on an {{DOMxRef("RTCPeerConnection")}}.</dd> - <dt>{{DOMxRef("RTCRtpContributingSource")}}</dt> - <dd>Contains information about a given contributing source (CSRC) including the most recent time a packet that the source contributed was played out.</dd> - <dt>{{DOMxRef("RTCTrackEvent")}}</dt> - <dd>The interface used to represent a {{domxref("RTCPeerConnection.track_event", "track")}} event, which indicates that an {{DOMxRef("RTCRtpReceiver")}} object was added to the {{DOMxRef("RTCPeerConnection")}} object, indicating that a new incoming {{DOMxRef("MediaStreamTrack")}} was created and added to the <code>RTCPeerConnection</code>.</dd> - <dt>{{DOMxRef("RTCConfiguration")}}</dt> - <dd>Used to provide configuration options for an <a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection" title="The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed."><code>RTCPeerConnection</code></a>.</dd> -</dl> - -<dl> - <dt>{{DOMxRef("RTCSctpTransport")}}</dt> - <dd>Provides information which describes a Stream Control Transmission Protocol (<strong>{{Glossary("SCTP")}}</strong>) transport and also provides a way to access the underlying Datagram Transport Layer Security (<strong>{{Glossary("DTLS")}}</strong>) transport over which SCTP packets for all of an <a href="/en-US/docs/Web/API/RTCPeerConnection" title="The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed."><code>RTCPeerConnection</code></a>'s data channels are sent and received.</dd> - <dt>{{DOMxRef("RTCSctpTransportState")}}</dt> - <dd>Indicates the state of an {{DOMxRef("RTCSctpTransport")}} instance.</dd> -</dl> - -<h3 id="Identity_and_security">Identity and security</h3> - -<p>The WebRTC API includes a number of interfaces which are used to manage security and identity.</p> - -<dl> - <dt>{{DOMxRef("RTCIdentityProvider")}}</dt> - <dd>Enables a user agent is able to request that an identity assertion be generated or validated.</dd> - <dt>{{DOMxRef("RTCIdentityAssertion")}}</dt> - <dd>Represents the identity of the remote peer of the current connection. If no peer has yet been set and verified this interface returns <code>null</code>. Once set it can't be changed.</dd> - <dt>{{DOMxRef("RTCIdentityProviderRegistrar")}}</dt> - <dd>Registers an identity provider (idP).</dd> - <dt>{{DOMxRef("RTCIdentityEvent")}}</dt> - <dd>Represents an identity assertion generated by an identity provider (idP). This is usually for an {{DOMxRef("RTCPeerConnection")}}. The only event sent with this type is {{event("identityresult")}}.</dd> - <dt>{{DOMxRef("RTCIdentityErrorEvent")}}</dt> - <dd>Represents an error associated with the identity provider (idP). This is usually for an {{DOMxRef("RTCPeerConnection")}}. Two events are sent with this type: {{event("idpassertionerror")}} and {{event("idpvalidationerror")}}.</dd> - <dt>{{DOMxRef("RTCCertificate")}}</dt> - <dd>Represents a certificate that an {{DOMxRef("RTCPeerConnection")}} uses to authenticate.</dd> -</dl> - -<h3 id="Telephony">Telephony</h3> - -<p>These interfaces are related to interactivity with Public-Switched Telephone Networks (PTSNs).</p> - -<dl> - <dt>{{DOMxRef("RTCDTMFSender")}}</dt> - <dd>Manages the encoding and transmission of Dual-Tone Multi-Frequency ({{Glossary("DTMF")}}) signaling for an {{DOMxRef("RTCPeerConnection")}}.</dd> - <dt>{{DOMxRef("RTCDTMFToneChangeEvent")}}</dt> - <dd>Used by the {{domxref("RTCDTMFSender.tonechange_event", "tonechange")}} event to indicate that a DTMF tone has either begun or ended. This event does not bubble (except where otherwise stated) and is not cancelable (except where otherwise stated).</dd> -</dl> - -<h2 id="Guides">Guides</h2> - -<dl> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Protocols">Introduction to WebRTC protocols</a></dt> - <dd>This article introduces the protocols on top of which the WebRTC API is built.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Connectivity">WebRTC connectivity</a></dt> - <dd>A guide to how WebRTC connections work and how the various protocols and interfaces can be used together to build powerful communication apps.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Session_lifetime">Lifetime of a WebRTC session</a></dt> - <dd>WebRTC lets you build peer-to-peer communication of arbitrary data, audio, or video—or any combination thereof—into a browser application. In this article, we'll look at the lifetime of a WebRTC session, from establishing the connection all the way through closing the connection when it's no longer needed.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation">Establishing a connection: The perfect negotiation pattern</a></dt> - <dd><strong>Perfect negotiation</strong> is a design pattern which is recommended for your signaling process to follow, which provides transparency in negotiation while allowing both sides to be either the offerer or the answerer, without significant coding needed to differentiate the two.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling">Signaling and two-way video calling</a></dt> - <dd>A tutorial and example which turns a WebSocket-based chat system created for a previous example and adds support for opening video calls among participants. The chat server's WebSocket connection is used for WebRTC signaling.</dd> - <dt><a href="/en-US/docs/Web/Media/Formats/WebRTC_codecs">Codecs used by WebRTC</a></dt> - <dd>A guide to the codecs which WebRTC requires browsers to support as well as the optional ones supported by various popular browsers. Included is a guide to help you choose the best codecs for your needs.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Using_data_channels">Using WebRTC data channels</a></dt> - <dd>This guide covers how you can use a peer connection and an associated {{DOMxRef("RTCDataChannel")}} to exchange arbitrary data between two peers.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Using_DTMF">Using DTMF with WebRTC</a></dt> - <dd>WebRTC's support for interacting with gateways that link to old-school telephone systems includes support for sending DTMF tones using the {{DOMxRef("RTCDTMFSender")}} interface. This guide shows how to do so.</dd> -</dl> - -<h2 id="Tutorials">Tutorials</h2> - -<dl> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/adapter.js">Improving compatibility using WebRTC adapter.js</a></dt> - <dd>The WebRTC organization <a href="https://github.com/webrtc/adapter/">provides on GitHub the WebRTC adapter</a> to work around compatibility issues in different browsers' WebRTC implementations. The adapter is a JavaScript shim which lets your code to be written to the specification so that it will "just work" in all browsers with WebRTC support.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Taking_still_photos">Taking still photos with WebRTC</a></dt> - <dd>This article shows how to use WebRTC to access the camera on a computer or mobile phone with WebRTC support and take a photo with it.</dd> - <dt><a href="/en-US/docs/Web/API/WebRTC_API/Simple_RTCDataChannel_sample">A simple RTCDataChannel sample</a></dt> - <dd>The {{DOMxRef("RTCDataChannel")}} interface is a feature which lets you open a channel between two peers over which you may send and receive arbitrary data. The API is intentionally similar to the <a href="/en-US/docs/Web/API/WebSocket_API">WebSocket API</a>, so that the same programming model can be used for each.</dd> -</dl> - -<h2 id="Resources">Resources</h2> - -<h3 id="Protocols">Protocols</h3> - -<h4 id="WebRTC-proper_protocols">WebRTC-proper protocols</h4> - -<ul> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-alpn/"><cite>Application Layer Protocol Negotiation for Web Real-Time Communications</cite></a></li> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-audio/"><cite>WebRTC Audio Codec and Processing Requirements</cite></a></li> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-data-channel/"><cite>RTCWeb Data Channels</cite></a></li> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-data-protocol/"><cite>RTCWeb Data Channel Protocol</cite></a></li> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-rtp-usage/"><cite>Web Real-Time Communication (WebRTC): Media Transport and Use of RTP</cite></a></li> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-security-arch/"><cite>WebRTC Security Architecture</cite></a></li> - <li><a href="http://datatracker.ietf.org/doc/draft-ietf-rtcweb-transports/"><cite>Transports for RTCWEB</cite></a></li> -</ul> - -<h4 id="Related_supporting_protocols">Related supporting protocols</h4> - -<ul> - <li><a href="https://tools.ietf.org/html/rfc5245">Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocol</a></li> - <li><a href="https://tools.ietf.org/html/rfc5389"><cite>Session Traversal Utilities for NAT (STUN)</cite></a></li> - <li><a href="https://tools.ietf.org/html/rfc7064"><cite>URI Scheme for the Session Traversal Utilities for NAT (STUN) Protocol</cite></a></li> - <li><a href="https://tools.ietf.org/html/rfc7065"><cite>Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers</cite></a></li> - <li><a href="https://tools.ietf.org/html/rfc3264"><cite>An Offer/Answer Model with Session Description Protocol (SDP)</cite></a></li> - <li><a href="https://datatracker.ietf.org/doc/draft-ietf-tram-turn-third-party-authz/"><cite>Session Traversal Utilities for NAT (STUN) Extension for Third Party Authorization</cite></a></li> -</ul> - -<h4 id="WebRTC_statistics"><cite>WebRTC statistics</cite></h4> - -<ul> - <li><a href="/en-US/docs/Web/API/WebRTC_Statistics_API">WebRTC Statistics API</a></li> -</ul> - -<h2 id="Specifications">Specifications</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('WebRTC 1.0')}}</td> - <td>{{Spec2('WebRTC 1.0')}}</td> - <td>The initial definition of the API of WebRTC.</td> - </tr> - <tr> - <td>{{SpecName('Media Capture')}}</td> - <td>{{Spec2('Media Capture')}}</td> - <td>The initial definition of the object conveying the stream of media content.</td> - </tr> - <tr> - <td>{{SpecName('Media Capture DOM Elements')}}</td> - <td>{{Spec2('Media Capture DOM Elements')}}</td> - <td>The initial definition on how to obtain stream of content from DOM Elements</td> - </tr> - </tbody> -</table> - -<p>In additions to these specifications defining the API needed to use WebRTC, there are several protocols, listed under <a href="#Protocols">resources</a>.</p> - -<h2 class="Related_Topics" id="See_also">See also</h2> - -<ul> - <li>{{DOMxRef("MediaDevices")}}</li> - <li>{{DOMxRef("MediaStreamEvent")}}</li> - <li>{{DOMxRef("MediaStreamConstraints")}}</li> - <li>{{DOMxRef("MediaStreamTrack")}}</li> - <li>{{DOMxRef("MessageEvent")}}</li> - <li>{{DOMxRef("MediaStream")}}</li> - <li><a href="/en-US/docs/Web/API/Media_Streams_API">Media Capture and Streams API</a></li> - <li><a href="https://hacks.mozilla.org/2015/06/firefox-multistream-and-renegotiation-for-jitsi-videobridge/">Firefox multistream and renegotiation for Jitsi Videobridge</a></li> - <li><a href="https://hacks.mozilla.org/2015/04/peering-through-the-webrtc-fog-with-socketpeer/">Peering Through the WebRTC Fog with SocketPeer</a></li> - <li><a href="https://hacks.mozilla.org/2014/04/inside-the-party-bus-building-a-web-app-with-multiple-live-video-streams-interactive-graphics/">Inside the Party Bus: Building a Web App with Multiple Live Video Streams + Interactive Graphics</a></li> - <li><a href="/en-US/docs/Web/Media">Web media technologies</a></li> -</ul> |