Stream event notification

Event notification related to audio and video channels

1 Create GLOBAL_PUBLIC CHANNEL

{"action":"AEC_LIVE_CREATE_CHANNEL_GLOBAL_PUBLIC","userId":"xxx","roomId":"xxx","channelId":"xxx","conCurrentNumber":"200","extra" : "xxx"}
//return {"status":"x"}

If you createglobalcahnnel,Uploaders need to log in,Viewers do not need to log in or have other permissions to watch the view。
userId: User ID for applying to create a channel
roomId: The chat room ID corresponding to this channel. If there is no chat function, there is no roomId parameter.
channelId: cahneel ID
conCurrentNumber: Maximum number of people in this room
extra: (Optional) Custom data sent from the client SDK

2 Create LOGIN_PUBLIC CHANNEL

{"action":"AEC_LIVE_CREATE_CHANNEL_LOGIN_PUBLIC","userId":"xxx","roomId":"xxx","channelId":"xxx","conCurrentNumber":"200","extra":"xxx"}
//return {"status":"x"}

If you create the channel which is only visible to logged in users ,Uploaders and viewers need to log in to participate or watch.
userId: User ID for applying to create a channel
roomId: The chat room ID corresponding to this channel. If there is no chat function, there is no roomId parameter.
conCurrentNumber: Maximum number of people in this room
extra: (Optional) Custom data sent from the client SDK

3 Create GROUP_PUBLIC CHANNEL

{"action":"AEC_LIVE_CREATE_CHANNEL_GROUP_PUBLIC","userId":"xxx","groupId":"xxx","channelId":"xxx","extra":"xxx"}
//return {"status":"x"}

If you create a channel that can only be viewed in the group . Uploaders and viewers are required to participate or watch in this group.
userId: User ID for applying to create a channel
roomId: The chat room ID corresponding to this channel. If there is no chat function, there is no roomId parameter.
conCurrentNumber: Maximum number of people in this room
extra: (Optional) Custom data sent from the client SDK

4 Apply for upload

{"action":"AEC_LIVE_APPLY_UPLOAD_CHANNEL","userId":"xxx","channelId":"xxx"}
//return {"status":"x","data":{"conCurrentNumber":"xxx","groupId(optional)":"xxxx"}}

Apply to upload audio and video streams
userId: the user ID of who applying for upload

In the json of the returned data field, conCurrentNumber represents the maximum number of people in the channel. If the channelId type is group live (AEC_LIVE_CREATE_CHANNEL_GROUP_PUBLIC), the corresponding groupId also needs to be returned.

5 Set the uploader

{"action":"AEC_LIVE_SET_CHANNEL_UPLOADER","userId":"xxx","channelId":"xxx"}
//return {"status":"x"}

The broadcaster applies to set the upload permission of a user. If it is a public (AEC_LIVE_CREATE_CHANNEL_GLOBAL_PUBLIC) type of room, the user only needs to log in to apply for uploading, which does not need the broadcaster to give the permission. If it is another type of room. It needs that the broadcaster assigns the user to the uploader actively, then the uploader can apply for upload.
userId: User ID of who needs to set upload permissions.

6 Cancel the upload permission

{"action":"AEC_LIVE_UNSET_CHANNEL_UPLOADER","userId":"xxx","channelId":"xxx"}
//return {"status":"x"}

The broadcaster requests to cancel the upload permission of a user.
userId: User ID that needs to cancel the upload permission.

7 Uploader disconnect (Leave away)

{"action":"AEC_LIVE_UPLOADER_DISCONNECT","userId":"xxx","channelId":"xxx"}
//return {"status":"x"}

userId: The user ID who wants to disconnect.

8 Uploader is uploading

{"action" : "AEC_LIVE_UPLOADER_UPLOADING","userId" : "xxx","channelId" : "xxx"}
//return {"status":"x"}

The uploader is uploading, which is called once every minute, and the return value will be determined by the business logic. If the user balance is insufficient, the user can be terminated uploading by this event.
userId: the user who is uploading

9 Close audio and video stream

{"action":"AEC_LIVE_CLOSE_CHANNEL","userId":"xxx","channelId":"xxx"}
//return {"status":"x"}

The user requests to close the audio and video stream.
userId: The user ID of who requests to close the audio and video stream

10 Delete audio and video streams

{"action":"AEC_LIVE_DELETE_CHANNEL","userId":"xxx","channelId":"xxx"}
//return {"status":"x"}

The user requests to delete the audio and video stream.
userId: the user ID Who requests to delete the audio and video stream

11 The user starts watching

{"action":"AEC_LIVE_USER_ONLINE","userId":"xxx","channelId":"xxx","time":"xxx"}

User balances can be checked in this event.

12 It be called once a minute when the user watch the video.

{"action":"AEC_LIVE_USER_PLAYING","userId":"xxx","channelId":"xxx","time":"xxx","discharge":"xxx"}

This event is called back every minute to inform the user that they are watching audio and video.
User balances can be checked in this event. If the balance is not enough, you can prevent users from continuing to watch.

Discharge represents the bytes of traffic consumed in one minute .

13 A User stop watching

{"action":"AEC_LIVE_USER_OFFLINE","userId":"xxx","channelId":"xxx","time":"xxx","discharge":"xxx"}

14 Create LOGIN_SPECIFY CHANNEL

Not yet open

{"action" : "AEC_LIVE_CREATE_CHANNEL_LOGIN_SPECIFY","userId" : "xxx","roomId" : "xxx", "channelId" : "xxx","conCurrentNumber" : "200","extra(可选)" : "xxxx","specify" : "xxxx"}

15 Create GROUP_SPECIFY CHANNEL

Not yet open

{"action" : "AEC_LIVE_CREATE_CHANNEL_GROUP_SPECIFY","userId" : "xxx","groupId" : "xxx","channelId" : "xxx","extra(可选)" : "xxxx","specify" : "xxxx"}

16 Create LIVEPROXY_GLOBAL_PUBLIC CHANNEL

Create a pulling stream channel
{“action” : “AEC_LIVE_LIVEPROXY_CREATE_CHANNEL_GLOBAL_PUBLIC”,”roomId” : “xxx”,”channelId” : “xxx”,”conCurrentNumber” : “200”,”extra(可选)” : “xxxx”}

17 Apply for streaming forwarding

{"action" : "AEC_LIVE_LIVEPROXY_APPLY_UPLOAD_CHANNEL","channelId" : "xxx"}
返回 {"status":"x","data":{"conCurrentNumber":"xxx"}}

18 close pulling stream channel

{"action" : "AEC_LIVE_LIVEPROXY_CLOSE_CHANNEL","channelId" : "xxx"}
返回 {"status":"x"}

19 Delete pulling stream channel

{"action" : "AEC_LIVE_LIVEPROXY_DELETE_CHANNEL","channelId" : "xxx"}
返回 {"status":"x"}