---
title: "RTCRtpTransceiver | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

# Interface RTCRtpTransceiver

The WebRTC interface **`RTCRtpTransceiver`** describes a permanent pairing of an RTCRtpSender and an RTCRtpReceiver, along with some shared state.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver)

interface RTCRtpTransceiver {  
    [currentDirection](#currentdirection): [RTCRtpTransceiverDirection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.RTCRtpTransceiverDirection/) | null;  
    [direction](#direction): [RTCRtpTransceiverDirection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.RTCRtpTransceiverDirection/);  
    [mid](#mid): string | null;  
    [receiver](#receiver): [RTCRtpReceiver](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpReceiver/);  
    [sender](#sender): [RTCRtpSender](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpSender/);  
    [setCodecPreferences](#setcodecpreferences-1)(codecs: [RTCRtpCodec](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpCodec/)\[\]): void;  
    [setCodecPreferences](#setcodecpreferences-2)(codecs: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[RTCRtpCodec](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpCodec/)\>): void;  
    [stop](#stop-1)(): void;  
}

##### Index

### Properties[](#properties)

[currentDirection](#currentdirection) [direction](#direction) [mid](#mid) [receiver](#receiver) [sender](#sender)

### Methods[](#methods)

[setCodecPreferences](#setcodecpreferences) [stop](#stop)

## Properties[](#properties-1)

### `Readonly`currentDirection[](#currentdirection)

currentDirection: [RTCRtpTransceiverDirection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.RTCRtpTransceiverDirection/) | null

The read-only RTCRtpTransceiver property **`currentDirection`** is a string which indicates the current negotiated directionality of the transceiver.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/currentDirection)

### direction[](#direction)

direction: [RTCRtpTransceiverDirection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.RTCRtpTransceiverDirection/)

The RTCRtpTransceiver property **`direction`** is a string that indicates the transceiver's preferred directionality.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/direction)

### `Readonly`mid[](#mid)

mid: string | null

The read-only RTCRtpTransceiver interface's **`mid`** property specifies the negotiated media ID (mid) which the local and remote peers have agreed upon to uniquely identify the stream's pairing of sender and receiver.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/mid)

### `Readonly`receiver[](#receiver)

receiver: [RTCRtpReceiver](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpReceiver/)

The read-only **`receiver`** property of WebRTC's RTCRtpTransceiver interface indicates the RTCRtpReceiver responsible for receiving and decoding incoming media data for the transceiver's stream.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/receiver)

### `Readonly`sender[](#sender)

sender: [RTCRtpSender](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpSender/)

The read-only **`sender`** property of WebRTC's RTCRtpTransceiver interface indicates the RTCRtpSender responsible for encoding and sending outgoing media data for the transceiver's stream.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/sender)

## Methods[](#methods-1)

### setCodecPreferences[](#setcodecpreferences)

-   setCodecPreferences(codecs: [RTCRtpCodec](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpCodec/)\[\]): void[](#setcodecpreferences-1)
    
    The **`setCodecPreferences()`** method of the RTCRtpTransceiver interface is used to set the codecs that the transceiver allows for decoding received data, in order of decreasing preference.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/setCodecPreferences)
    
    #### Parameters
    
    -   codecs: [RTCRtpCodec](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpCodec/)\[\]
    
    #### Returns void
    
-   setCodecPreferences(codecs: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[RTCRtpCodec](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpCodec/)\>): void[](#setcodecpreferences-2)
    
    The **`setCodecPreferences()`** method of the RTCRtpTransceiver interface is used to set the codecs that the transceiver allows for decoding received data, in order of decreasing preference.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/setCodecPreferences)
    
    #### Parameters
    
    -   codecs: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[RTCRtpCodec](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RTCRtpCodec/)\>
    
    #### Returns void
    

### stop[](#stop)

-   stop(): void[](#stop-1)
    
    The **`stop()`** method in the RTCRtpTransceiver interface permanently stops the transceiver by stopping both the associated RTCRtpSender and RTCRtpReceiver.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/stop)
    
    #### Returns void
