MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

Terjemahan ini belum lengkap. Mohon bantu menerjemahkan artikel ini dari Bahasa Inggris.

WebRTC (Web Real-Time Communications) merupakan teknologi yang memungkinkan situs dan aplikasi berbasis web menangkap dan mengirimkan audio atau video, serta bertukar data antar peramban web tanpa memerlukan adanya perantara. Kumpulan standar di dalam WebRTC membuat pertukaran data dan telekonferensi secara peer-to-peer dapat terjadi tanpa perlu memasang plugins atau aplikasi pihak ketiga.

WebRTC terdiri dari berbagai API dan protokol yang saling terkait sehingga dapat bekerja sebagaimana mestinya. Dokumentasi ini akan membantu anda untuk memahami dasar-dasar WebRTC, bagaimana mengatur dan menggunakan sambungan data dan media, serta hal lainnya.

Konsep dan cara penggunaan WebRTC

WebRTC memiliki beberapa fungsi, begitu halnya juga dengan Media Capture and Streams (MediaDevices) API. Keduanya menghadirkan kemampuan multimedia di dalam web, misalnya audio dan video conferencing, pertukaran file, identity management, serta interaksi pada jaringan telepon dengan cara mengirimkan sinyal DTMF. Sambungan antar peer dapat terbentuk tanpa plugins tambahan, dan sering kali dapat terbentuk tanpa memerlukan server perantara.

Sambungan antar peer dibuat menggunakan - dan direpresentasikan oleh - RTCPeerConnection. Ketika sebuah sambungan telah terbentuk dan terbuka, stream media (MediaStream) atau channel data (RTCDataChannel) dapat ditambahkan ke dalam sambungan peer.

Stream media terdiri dari beberapa track media, yang direpresentasikan oleh sebuah objek MediaStreamTrack, yang berisi salah satu tipe media, yaitu audio, video, dan teks (misalnya subtitle atau nama judul). Umumnya stream terdiri dari setidaknya satu track audio bahkan juga satu track video, dan dapat digunakan untuk mengirim dan menerima media secara live atau dapat berupa rekaman media (misalnya streaming film).

Anda juga dapat menggunakan sambungan antar peer untuk bertukar sembarang data biner menggunakan RTCDataChannel. Sambungan ini dapat digunakan untuk informasi back-channel, metadatagamingfile transfer, bahkan sebagai jalur utama pertukaran data.

artikel ini memerlukan informasi yang lebih lanjut serta tautan untuk panduan dan tutorial yang relevan

WebRTC interfaces

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.

Connection setup and management

These interfaces are used to set up, open, and manage WebRTC connections.

RTCPeerConnection
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.
RTCDataChannel
Represents a bi-directional data channel between two peers of a connection.
RTCDataChannelEvent
Represents events that occur while attaching a RTCDataChannel to a RTCPeerConnection. The only event sent with this interface is datachannel.
RTCSessionDescription
Represents the parameters of a session. Each RTCSessionDescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session.
RTCStatsReport
Provides information detailing statistics for a connection or for an individual track on the connection; the report can be obtained by calling RTCPeerConnection.getStats().
RTCIceCandidate
Represents a candidate internet connectivity establishment (ICE) server for establishing an RTCPeerConnection.
RTCIceTransport
Represents information about an internet connectivity establishment (ICE) transport.
RTCPeerConnectionIceEvent
Represents events that occurs in relation to ICE candidates with the target, usually an RTCPeerConnection. Only one event is of this type: icecandidate.
RTCRtpSender
Manages the encoding and transmission of data for a MediaStreamTrack on an RTCPeerConnection.
RTCRtpReceiver
Manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection.
RTCTrackEvent
Indicates that a new incoming MediaStreamTrack was created and an associated RTCRtpReceiver object was added to the RTCPeerConnection object.

Identity and security

The WebRTC API includes a number of interfaces to manage security and identity.

RTCIdentityProvider
Enables a user agent is able to request that an identity assertion be generated or validated.
RTCIdentityAssertion
Represents the identity of the a remote peer of the current connection. If no peer has yet been set and verified this interface returns null. Once set it can't be changed.
RTCIdentityProviderRegistrar
Registers an  identity provider (idP).
RTCIdentityEvent
Represents an identity assertion generated by an identity provider (idP). This is usually for an RTCPeerConnection. The only event sent with this type is identityresult.
RTCIdentityErrorEvent
Represents an error associated with the identity provider (idP). This is usually for an RTCPeerConnection. Two events are sent with this type: idpassertionerror and idpvalidationerror.
RTCCertificate
Represents a certificate that an RTCPeerConnection uses to authenticate.

Telephony

These interfaces are related to interactivity with public-switched telephone networks (PTSNs).

RTCDTMFSender
Manages the encoding and transmission of dual-tone multi-frequency (DTMF) signaling for an RTCPeerConnection.
RTCDTMFToneChangeEvent
Indicates an occurrence of a of dual-tone multi-frequency (DTMF). This event does not bubble (except where otherwise stated) and is not cancelable (except where otherwise stated).

Guides

Introduction to WebRTC protocols
This article introduces the protocols on top of which the WebRTC API is built.
WebRTC connectivity
A guide to how WebRTC connections work and how the various protocols and interfaces can be used together to build powerful communication apps.
Lifetime of a WebRTC session
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.
Signaling and two-way video calling
A tutorial and example which turbs 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.
Using WebRTC data channels
This guide covers how you can use a peer connection and an associated RTCDataChannel to exchange arbitrary data between two peers.
Using DTMF with WebRTC
WebRTC's support for interacting with gateways that link to old-school telephone systems includes support for sending DTMF tones using the RTCDTMFSender interface. This guide shows how to do so.

Tutorials

Improving compatibility using WebRTC adapter.js
The WebRTC organization provides on GitHub the WebRTC adapter 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.
Taking still photos with WebRTC
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.
A simple RTCDataChannel sample
The 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 WebSocket API, so that the same programming model can be used for each.

Resources

Protocols

WebRTC-proper protocols

Specifications

Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browsers Working Draft The initial definition of the API of WebRTC.
Media Capture and Streams Editor's Draft The initial definition of the object conveying the stream of media content.
Media Capture from DOM Elements Editor's Draft The initial definition on how to obtain stream of content from DOM Elements

In additions to these specifications defining the API needed to use WebRTC, there are several protocols, listed under resources.

Tag Dokumen dan Kontributor

 Kontributor untuk laman ini: fitra
 Terakhir diperbarui oleh: fitra,