ZegoRealTimeSequentialDataManager
ZegoRealTimeSequentialDataManager
Declared in ZegoExpressDefines.h
Methods
setEventHandler:
- (void)setEventHandler:(nullable id<ZegoRealTimeSequentialDataEventHandler>) handler;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| handler | nullable id<ZegoRealTimeSequentialDataEventHandler> | Event handler for real-time sequential data |
Details
Set up real-time sequential data callback to monitor callbacks such as sending data results, receiving data, etc.
- When to call: After create the [ZegoRealTimeSequentialDataManager] instance.
- Caution: Calling this function will overwrite the callback set by the last call to this function.
- Available since: 2.14.0
- Restrictions: None.
startBroadcasting:
- (void)startBroadcasting:(NSString *) streamID;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| streamID | NSString * | Stream ID, a string of up to 256 characters. Caution: 1. Need to be globally unique within the entire AppID (Note that it cannot be the same as the stream ID passed in [startPublishingStream]). If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 2. Only support numbers, English characters and '-', '_'. |
Details
This function allows users to broadcast their local real-time sequential data stream to the ZEGO RTC server, and other users in the same room can subscribe to the real-time sequential data stream for intercommunication through "streamID".
- Use cases: Before sending real-time sequential data, you need to call this function to start broadcasting.
- When to call: After creating the [ZegoRealTimeSequentialDataManager] instance.
- Caution: After calling this function, you will receive the [onPublisherStateUpdate] callback to tell you the broadcast state (publish state) of this stream. After the broadcast is successful, other users in the same room will receive the [onRoomStreamUpdate] callback to tell them this stream has been added to the room.
- Available since: 2.14.0
- Restrictions: None.
stopBroadcasting:
- (void)stopBroadcasting:(NSString *) streamID;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| streamID | NSString * | The ID of the stream that needs to stop broadcasting. |
Details
This function allows users to stop broadcasting their local real-time sequential data stream.
- Use cases: When you no longer need to send real-time sequential data, you need to call this function to stop broadcasting.
- When to call: After creating the [ZegoRealTimeSequentialDataManager] instance.
- Caution: After calling this function, you will receive the [onPublisherStateUpdate] callback to tell you the broadcast state (publish state) of this stream. After stopping the broadcast, other users in the same room will receive the [onRoomStreamUpdate] callback to tell them this stream has been deleted from the room.
- Available since: 2.14.0
- Restrictions: None.
sendRealTimeSequentialData:streamID:callback:
- (void)sendRealTimeSequentialData:(NSData *) data streamID:(NSString *) streamID callback:(nullable ZegoRealTimeSequentialDataSentCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| data | NSData * | The real-time sequential data to be sent. |
| streamID | NSString * | The stream ID to which the real-time sequential data is sent. |
| callback | nullable ZegoRealTimeSequentialDataSentCallback | Send real-time sequential data result callback. |
Details
This function can be used to send real-time sequential data on the stream currently being broadcast.
- Use cases: You need to call this function when you need to send real-time sequential data.
- When to call: After calling [startBroadcasting].
- Caution: None.
- Available since: 2.14.0
- Restrictions: None.
startSubscribing:
- (void)startSubscribing:(NSString *) streamID;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| streamID | NSString * | Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and '-', '_'. |
Details
This function allows users to subscribe to the real-time sequential data stream of remote users from the ZEGO RTC server.
- Use cases: When you need to receive real-time sequential data sent from other remote users, you need to call this function to start subscribing to the stream broadcasted by other remote users.
- When to call: After creating the [ZegoRealTimeSequentialDataManager] instance.
- Caution: After calling this function, you will receive the [onPlayerStateUpdate] callback to tell you the subscribe state (play state) of this stream.
- Available since: 2.14.0
- Restrictions: None.
stopSubscribing:
- (void)stopSubscribing:(NSString *) streamID;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| streamID | NSString * | The ID of the stream that needs to stop subscribing. |
Details
This function can be used to stop subscribing to the real-time sequential data stream.
- Use cases: When you no longer need to receive real-time sequential data sent by other users, you need to call this function to stop subscribing to the other user's stream.
- When to call: After creating the [ZegoRealTimeSequentialDataManager] instance.
- Caution: After calling this function, you will receive the [onPlayerStateUpdate] callback to tell you the subscribe state (play state) of this stream.
- Available since: 2.14.0
- Restrictions: None.
getIndex
- (NSNumber *)getIndex;ZegoExpressDefines.hIndex of the real-time sequential data manager.
