Skip to main content

DataTrack

A DataTrack represents data that a Participant can send/receive in a Room.

Kind: global class
Properties

NameTypeDescription
idstringThe ID of the DataTrack.
kindstringThe kind of the DataTrack (data).
namestringThe name of the DataTrack.
trackDatatrackThe DataTrack instance.
maxPacketLifeTimenumberIf non-null, this represents a time limit (in milliseconds) during which data will be transmitted or retransmitted if not acknowledged on the DataChannel.
maxRetransmitsnumberIf non-null, this represents the number of times the data will be retransmitted if not successfully received on the DataChannel.
orderedbooleanWhether or not the data should be transmitted in order.
reliablebooleanWhether or not the data should be transmitted reliably.
isSwitchedOffbooleanWhether or not the RemoteDataTrack is switched off.
isEnabledbooleanWhether or not the RemoteDataTrack is enabled.
priorityTrack.PriorityThe priority of the Remote DataTrack.
sidstringThe SID of the Remote DataTrack.

dataTrack.send(data, [to]) ⇒ void

Send a message over the local DataTrack.

Kind: instance method of DataTrack

ParamTypeDescription
datastring | Blob | ArrayBuffer | ArrayBufferViewThe message to be sent
[to]Participant.ID | Array.<Participant.ID>The Participant.ID of the RemoteParticipant to send the message to.

dataTrack.setPriority(priority) ⇒ DataTrack

Update the subscriber Track.Priority of the Remote DataTrack. Currently setPriority has no effect on data tracks.

Kind: instance method of DataTrack
Throws:

  • RangeError
ParamTypeDescription
priorityTrack.Prioritythe new Track.Priority to be set.