Agora RTC Objective-C API Reference  Refactor
Properties
AgoraDataStreamConfig Class Reference

Inherits <NSObject>.

Properties

BOOL ordered
 
BOOL syncWithAudio
 

Detailed Description

The following table shows the SDK behaviors under different parameter settings:

syncWithAudio ordered SDK behaviors
NO NO The SDK triggers the rtcEngine:receiveStreamMessageFromUid:streamId:data: callback immediately after the receiver receives a data packet.
YES NO If the data packet delay is within the audio delay, the SDK triggers the rtcEngine:receiveStreamMessageFromUid:streamId:data: callback when the synchronized audio packet is played out. If the data packet delay exceeds the audio delay, the SDK triggers the rtcEngine:receiveStreamMessageFromUid:streamId:data: callback as soon as the data packet is received.
NO YES If the delay of a data packet is less than five seconds, the SDK corrects the order of the data packet. If the delay of a data packet exceeds five seconds, the SDK discards the data packet.
YES YES If the delay of the data packet is within the range of the audio delay, the SDK corrects the order of the data packet. If the delay of a data packet exceeds the audio delay, the SDK discards this data packet.

Property Documentation

◆ ordered

- (BOOL) ordered
readwritenonatomicassign

Whether the SDK guarantees that the receiver receives the data in the sent order.

  • YES: Guarantee that the receiver receives the data in the sent order.
  • NO: Do not guarantee that the receiver receives the data in the sent order. Do not set this parameter as YES if you need the receiver to receive the data packet immediately.

◆ syncWithAudio

- (BOOL) syncWithAudio
readwritenonatomicassign

Whether to synchronize the data packet with the published audio packet.

  • YES: Synchronize the data packet with the audio packet. This setting is suitable for special scenarios such as lyrics synchronization.
  • NO: Do not synchronize the data packet with the audio packet. This setting is suitable for scenarios where data packets need to arrive at the receiving end immediately. When you set the data packet to synchronize with the audio, then if the data packet delay is within the audio delay, the SDK triggers the rtcEngine:receiveStreamMessageFromUid:streamId:data: callback when the synchronized audio packet is played out.