From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/ko/web/api/rtcsessiondescription/index.html | 129 ++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 files/ko/web/api/rtcsessiondescription/index.html (limited to 'files/ko/web/api/rtcsessiondescription/index.html') diff --git a/files/ko/web/api/rtcsessiondescription/index.html b/files/ko/web/api/rtcsessiondescription/index.html new file mode 100644 index 0000000000..927204c7da --- /dev/null +++ b/files/ko/web/api/rtcsessiondescription/index.html @@ -0,0 +1,129 @@ +--- +title: RTCSessionDescription +slug: Web/API/RTCSessionDescription +tags: + - API + - Audio + - Experimental + - Interface + - Media + - NeedsTranslation + - Reference + - TopicStub + - Video + - Web + - WebRTC +translation_of: Web/API/RTCSessionDescription +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

The RTCSessionDescription interface describes one end of a connection—or potential connection—and how it's configured. Each RTCSessionDescription 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.

+ +

The process of negotiating a connection between two peers involves exchanging RTCSessionDescription objects back and forth, with each description suggesting one combination of connection configuration options that the sender of the description supports. Once the two peers agree upon a configuration for the connection, negotiation is complete.

+ +

Properties

+ +

The RTCSessionDescription interface doesn't inherit any properties.

+ +
+
{{domxref("RTCSessionDescription.type")}} {{ReadOnlyInline}}
+
An enum of type {{anch("RTCSdpType")}} describing the session description's type.
+
+ +
+
{{domxref("RTCSessionDescription.sdp")}} {{ReadOnlyInline}}
+
A {{domxref("DOMString")}} containing the {{Glossary("SDP")}} describing the session.
+
+ +

Constants

+ +

RTCSdpType

+ +

This enum defines strings that describe the current state of the session description, as used in the {{domxref("RTCSessionDescription.type", "type")}} property. The session description's type will be specified using one of these values.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
answerThe SDP contained in the {{domxref("RTCSessionDescription.sdp", "sdp")}} property is the definitive choice in the exchange. In other words, this session description describes the agreed-upon configuration, and is being sent to finalize negotiation.
offerThe session description object describes the initial proposal in an offer/answer exchange. The session negotiation process begins with an offer being sent from the caller to the callee.
pranswerThe session description object describes a provisional answer; that is, a response to a previous offer that is not the final answer. It is usually employed by legacy hardware.
rollbackThis special type with an empty session description is used to roll back to the previous stable state.
+ +

Methods

+ +

The RTCSessionDescription doesn't inherit any methods.

+ +
+
{{domxref("RTCSessionDescription.RTCSessionDescription", "RTCSessionDescription()")}} {{deprecated_inline}}
+
This constructor returns a new RTCSessionDescription. The parameter is a RTCSessionDescriptionInit dictionary containing the values to assign the two properties.
+
{{domxref("RTCSessionDescription.toJSON()")}}
+
Returns a {{Glossary("JSON")}} description of the object. The values of both properties, {{domxref("RTCSessionDescription.type", "type")}} and {{domxref("RTCSessionDescription.sdp", "sdp")}}, are contained in the generated JSON.
+
+ +

Example

+ +
signalingChannel.onmessage = function (evt) {
+    if (!pc)
+        start(false);
+
+    var message = JSON.parse(evt.data);
+    if (message.sdp)
+        pc.setRemoteDescription(new RTCSessionDescription(message), function () {
+            // if we received an offer, we need to answer
+            if (pc.remoteDescription.type == "offer")
+                pc.createAnswer(localDescCreated, logError);
+        }, logError);
+    else
+        pc.addIceCandidate(new RTCIceCandidate(message.candidate),
+            function () {}, logError);
+};
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('WebRTC 1.0', '#rtcsessiondescription-class', 'RTCSessionDescription') }}{{Spec2('WebRTC 1.0')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.RTCSessionDescription")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf