adv.sendData()

call.adv.sendData() is used to transmit data to other end of a call using a data channel.

If no data channel is available it will open one automatically - there is no need for you to call call.adv.addDataChannel() manually. Further calls to call.adv.sendData() will use that same data channel.

Arguments

call.adv.sendData(data)

  • data - string containing data to be sent. In theory all kind of data could be transferred (even binary) but due to browser incompatibilities you should only send strings up to 16 KB in length.

Returns

Nothing.

Errors

If data channel is not supported error 311 will occur. Check call.is("dataChannelSupport") to avoid getting errors on browsers not supporting data channels.

Example

You should always check if data channel is supported before calling call.adv.sendData():

if call.is("dataChannelSupport")
  call.adv.sendData("HELLO");

This will trigger wrtc.onDataReceived() at the receiving end.

See also

ixnx/wrtc/js/api/call/adv.senddata.txt · Last modified: by tibor
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0