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.
-
getMessageTransportController()
-
Returns the Message Transport Controller instance
-
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 typeString fnfunction - Overrides:
-
on(type, fn)
-
Assign a callback handler to an event type.
Parameters:
Name Type Description typeString fnfunction - Overrides:
-
send(methodName, data)
-
Request to send notification to other connected clients using a target method name and object data.
Parameters:
Name Type Description methodNameString The name of the method to attempt to invoke on receiving clients.
dataObject A data object to send along as the parameter of the target method.
-
setMessageTransportController(controller)
-
Assigns the Message Transport Controller which exposes the message transport layer on which all communication to and from the Shared Object is handled.
Parameters:
Name Type Description controllerObject The Controller for the Message Transport Layer. Exposes the method
getMessageTransportwhich returns the current message transport layer. -
setProperty(key, value)
-
Request to update a specific property on the connected Shared Object.
Parameters:
Name Type Description keyString The property name to update.
valueObject The value object to update the property to.
-
trigger(event)
-
Dispatch an event to be handled by any assigned callbacks.
Parameters:
Name Type Description eventEvent - Overrides: