RTCIceCandidate.sdpMLineIndex

The read-only sdpMLineIndex property on the RTCIceCandidate interface is a zero-based index of the m-line describing the media associated with the candidate.

This property can be configured by specifying the value of the sdpMLineIndex property in the candidateInfo options object that is passed to the RTCIceCandidate() constructor. If you call the constructor with an m-line string instead of the options object, the value of sdpMLineIndex is extracted from the specified candidate m-line string.

Syntax

var sdpMLineIndex = RTCIceCandidate.sdpMLineIndex;

Value

A number containing a 0-based index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available.

Note: Attempting to add a candidate (using addIceCandidate()) that has a value of null for either sdpMid or sdpMLineIndex will throw a TypeError exception.

Example

...

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
sdpMLineIndex
23
15
22
No
15
11
≤37
25
Yes
14
11
1.5

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/sdpMLineIndex