-
Notifications
You must be signed in to change notification settings - Fork 11
Event Handling in a Handy Way
This fork provide you a handy way to add event handlers as well as more events than the original repo!
Simply define a handler function and add a decorator above the function with the event name. Something like this:
@Event.add("onConnect") # event name inside the bracket
def onConnect_handler(client, *args):
print("App '{0}' is connected!".format(client.path))
---
agent = FlashServer() # Before you create an instance of the server
Please note that, do not use this way to add event handlers together with the traditional way!
When a client connect to the server
- client: instance of the client connection
- *args: TODO
When a client disconnect from the server
- client: instance of the client connection
When a client (feed) started to broadcasting stream feed
- client: instance of the client connection
- stream: TODO
When a client (feed) stop broadcasting stream feed
- client: instance of the client connection
- stream: TODO
When a client (viewer) started to play the stream
- client: instance of the client connection
- stream: TODO
When a client (viewer) stop the play of a stream
- client: instance of the client connection
- stream: TODO
When a server received a command packet from a client
- client: instance of the client connection
- cmd: command sent by client
- *args: TODO
- client: instance of the client connection
- info: TODO
- client: instance of the client connection
- result: TODO
When the server received a media data packet
- client: instance of the client connection
- stream: TODO
- message: TODO
When the server sent a media data packet
- client: instance of the client connection
- stream: TODO
- message: TODO
When a stream is unpublish
- client: instance of the client connection
- cmd: command sent by client
When a stream being deleted
- client: instance of the client connection
- cmd: command sent by client