direction is a string which indicates the transceiver's
Its value must be one of the strings defined in the table below.
The transceiver's current direction is indicated by the
A string whose value is one of the strings which are a member of the following values, indicating the transceiver's preferred direction.
||Offers to send RTP data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active.||Offers to receive RTP data, and does so if the other peer accepts.|
||Offers to send RTP data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active.||Does not offer to receive RTP data and will not do so.|
||Does not offer to send RTP data, and will not do so.||Offers to receive RTP data, and will do so if the other peer offers.|
||Does not offer to send RTP data, and will not do so.||Does not offer to receive RTP data and will not do so.|
When setting the value of
direction, the following exception can occur:
Thrown if either the receiver's
RTCPeerConnectionis closed or the
Setting the direction
When you change the value of
exception will occur if the connection is closed or the receiver is stopped.
If the new value of
direction is in fact different from the existing
value, renegotiation of the connection is required, so a
event is sent to the
Effect on offers and answers
The value of
direction is used by
RTCPeerConnection.createAnswer() in order to generate the SDP generated
by each of those methods. The SDP contains an a-line which specifies the directionality.
For example, if the
direction is specified as
corresponding SDP a-line is:
|WebRTC: Real-Time Communication in Browsers |
BCD tables only load in the browser