Class: DataReceiver

wsc. DataReceiver

Represents the receiver of DataTransfer that can receive raw data over the underlying data channel.

new DataReceiver()

Instance created by DataTransfer. An object of this class is created by DataTransfer and set to the member dataReceiver.
The instance of this class can be obtained by calling {DataTransfer.getReceiver()}.

See:

Events

onMessage

Event handler called when a raw data object is received by the data channel of the DataTransfer object. Application should override this function to handle the received data by itself. If it is not overridden by the application, the received raw data object cannot be passed to the application to handle it.

Parameters:
Name Type Description
evt Object

The event object received by the data channel. It is passed to the function complete and unmodified. The raw data can be fetched by evt.data and supports the following data types:

  • Text string
  • BLOB raw data
  • ArrayBuffer
  • ArrayBufferView
Since other event attributes may be useful, this function retains all of them.

Example
var receiver = dataTransfer.getReceiver();
receiver.onMessage = function(evt) {
  var rcvdDataElm = document.getElementById("rcvData");
  rcvdDataElm.value = evt.data;
}
Oracle® Communications WebRTC Session Controller JavaScript API Reference, E55131-03
Copyright © 2013, 2015, Oracle and/or its affiliates. All rights reserved.