Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Abstract

Due to limitations in the Active/NPAPI interfaces, the plugin's DataChannel has limited support to different data types.

Sending a string

The plugin behaves exactly the same way as Chrome and Firefox when sending a string :

 var data = "My string data";
 mySendingChannel.send(data);

Sending ArrayBufferViews

The following ArrayBuffer types can be sent using the plugin:

  • Int8Array

  • Uint8Array

  • Int16Array

  • Uint16Array

  • Int32Array

  • Uint32Array

 var data = new Int8Array(10);
 mySendingChannel.send(data);

 

When you receive the data on the other side of the data channel, you can then use:

function onReceiveMessageCallback(event) { // was set as the receiving datachannel onmessage callback
	var data = new Int8Array(event.data);
	...
}

Sending ArrayBuffers

We suggest sending ArrayBuffers by transforming them in typed arrays first:

var AB   = new ArrayBuffer(8);
var data = new Int8Array(10);
mySendingChannel.send(data);

Sending Blobs

Temasys is actively considering options for blob sending. 
Follow our Google Group or our support portal to be update as soon as a solution is released.

Examples of how to use the data channel

Temasys provides a few samples apps to help users integrate the plugin into their application.

https://plugin.temasys.com.sg/demo/

  • No labels