I have written a feature list for Red5 scripting API for you to review. The list only contains the fundamental features referring to FMS2's API document. Please reply to this thread for any comments and suggestions. Hope this can be the basis for the following-on API design and API documentation.
1. Application
(1) Server host name can be retrieved. Host name of server for default virtual hosts and the virtual host name for non-default virtual hosts.
(2) Application context path can be retrieved. Each application has a context path that is appended after host name.
(3) Server platform and version info can be retrieved. This info includes Red5 version, JRE version as well as OS it runs on.
(4) Server configuration access. The configuration can be set in a separate file and be accessed in script via a configuration object.
(5) Scope tree access. All scopes can be obtained via direct attribute (for global scope) or scope lookup by name (for child scopes).
(6) Spring bean access.
(7) Provide handler before this application is loaded, unloaded.
2. Scope (corresponding to FMS's application instance)
(1) Scope management
(a) Scope tree access including parent scope and child scopes.
(b) Remove a child scope.
(c) Provide handler before a child scope is added or deleted.
(d) Provide handler before this scope is started, stopped.
(2) Connection management:
(a) Provide access to all connection objects that connected to the scope.
(b) Provide handler before a client is connected, disconnected.
(c) Provide handler before a connection is accepted, rejected.
(d) Accept or reject an incoming connection.
(e) Disconnect an active connection.
(3) Stream management
(a) Get a stream object of a specific name attached to this scope.
(b) Remove stream objects per specified path patterns in this scope.
(c) Provide handler before a stream is created, closed
(d) Provide handler before a stream is broadcasted, subscribed.
(e) Provide handler before a stream is played, stopped, paused, resumed, sought.
(4) SharedObject management
(a) Get a shared object of a specific name attached to this scope.
(b) Remove shared objects per specified path patterns in this scope.
(c) Provide handler before a shared object is created, cleared.
(5) Broadcast messages to all clients connected to this scope.
(6) Provide statistics for this scope. The data includes total bytes received and sent, RTMP messages received and sent, total client connected, total client disconnected. (FIXME how to calculate the data? Is the data only for the scope itself or the scope and its children)
(7) Status code handler.
3. Connection (corresponding to FMS's client)
(1) Provide access to client agent info, ip, protocol, referrer (swf location), secure (whether use SSL), uri (the connection uri)
(2) Provide access to the scope object it is attached to.
(3) Provide distinguishing of flash player client version info with "virtualKey". The server should also support the virtual stream path mapping to provide differently encoded FLV to differently versioned flash player clients.
(4) Call client's method.
(5) Bi-direction bandwidth settings.
(6) Provide statistics for this connection. The data includes total bytes received and sent, RTMP messages received and set, total client connected, total client disconnected.
(7) Ping the client.
(8) User defined function handler for client to call.
4. Stream
(1) Set and get the preferred buffer time for playing VOD.
(2) Record a live stream (both for client side and server side stream).
(3) Play a server side stream and arrange the playlist for it.
(4) Remove a recorded stream.
(5) Obtain the length and size of a recorded stream.
(6) Set virtual path mapping for differently encoded FLV streams.
(7) Stream status code handler.
(8) Send function call to all subscribers and publisher.
5. SharedObject
(1) Create both transient and persistent shared objects.
(2) Provide access to dirty flag, version number, resynch depth, autoCommit flag. The "autoCommit" flag could be set in the configuration file. The "resynch depth" is used to determine whether a deleted attribute should be removed from the persistent storage permanently.
(3) Broadcast message to all subscribers.
(4) Lock, unlock and modify a shared object on server side.
(5) Remove a shared object permanently.
(6) Remove a deleted attribute that is below a specific version number from the persistent storage.
(7) Retrieve the properties, property names and number of properties.
(8) User defined function handler for client to call.
(9) Server side onSync handler.
(10) Shared object status code handler.
6. Logging
(1) Support different log levels logging. The output log file can be specified in application's configuration file.
--
Best Regards
Steven Gong
_______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
