Red5ProSharedObject(name, connection)

Main entry for Shared Object associated with Publishers and Subscribers.

new Red5ProSharedObject(name, connection)

The API on this object is limited as it communicates along with message channel connection which you provide in the constuctor. This connection can either be a previously established Publisher, Subscriber or Red5ProSharedObjectSocket.

Event handlers should be assigned to new Red5ProSharedObject instances in order to handle notifications over the communication channel.

Parameters:
Name Type Description
name String

The name of the Shared Object to connect to.

connection Object

The connection delegate to send and receive Shared Object notifications on. This will either be a previously established Publisher or Subscriber instance.

Extends

Methods

close()

Request to close the established Shared Object connection. This does not close the underlying WebSocket connection.

getName() → {String}

Return the name of the Shared Object connected to.

Returns:
String

off(type, fn)

Remove a callback handler for an event type.

Parameters:
Name Type Description
type String
fn function
Inherited From:

on(type, fn)

Assign a callback handler to an event type.

Parameters:
Name Type Description
type String
fn function
Inherited From:

send(methodName, data)

Request to send notification to other connected clients using a target method name and object data.

Parameters:
Name Type Description
methodName String

The name of the method to attempt to invoke on receiving clients.

data Object

A data object to send along as the parameter of the target method.

setProperty(key, value)

Request to update a specific property on the connected Shared Object.

Parameters:
Name Type Description
key String

The property name to update.

value Object

The value object to update the property to.

trigger(event)

Dispatch an event to be handled by any assigned callbacks.

Parameters:
Name Type Description
event Event
Inherited From: