Contact Us
Free Trial
Secure Video Conferencing LiveSwitch Cloud
Secure Video Conferencing LiveSwitch Cloud

Data Binding with WebSync 3.3

by Anton Venema, on November 10, 2010

One of the best new features of WebSync 3.3 is the ability to bind data to clients.  By attaching client-specific details to the WebSync clients, developing a rich user experience is easier than ever.

Consider the case where a client receives a message published by another client.  Previously, the receiving client would be able to see the ID of the publishing client, but nothing more.  Now, if the publishing client binds a display name to itself before publishing, that display name is available to the receiving client with the message.

Publishing client:

.
fm.websync.client.init().connect().bind({
record: { key: 'displayName', value: 'John Doe' }
}).publish({
channel: '/test',
data: {
text: 'Good morning!'
}
});

Receiving client:

fm.websync.client.init().connect().subscribe({
channel: '/test',
onReceive: function(args) {
alert(args.publishingClient.boundRecords['displayName'] + ' says "' + args.data.text + '");
}
});

For more information, check out http://docs.frozenmountain.com/#class=server-code-snippets-binding-data.

The same concept applies to the Subscribers extension.  Previously, only the client IDs of a channel's subscribers were available to other subscribed clients.  Now, any public bound data is also available, making it easy to build an informed user interface quickly and easily.  Just access the boundRecords property on each of the client objects passed into subscribe.onSuccess and subscribe.onSubscribersChange.

For more information, check out http://docs.frozenmountain.com/#class=server-extensions-the-subscribers-extension.

Websync Free Trial

Topics:WebSync

Anton Venema

As Frozen Mountain’s CTO, Anton is one of the world’s foremost experts on RTC solutions, as well as the technical visionary and prime architect of our products, IceLink, WebSync and LiveSwitch. Anton is responsible for ensuring that Frozen Mountain’s products exceed the needs of today and predict the needs of tomorrow.