AgoraChannelMediaRelayConfiguration Class Reference

Inherits from NSObject
Declared in AgoraObjects.h

Overview

The definition of AgoraChannelMediaRelayConfiguration.

  destinationInfos

The information of the destination channel: AgoraChannelMediaRelayInfo. It contains the following members:

@property (strong, nonatomic, readonly) NSDictionary<NSString*AgoraChannelMediaRelayInfo*> *destinationInfos

Discussion

  • channelName: The name of the destination channel.
  • token: The token for joining the destination channel. It is generated with the channelName and uid you set in destinationInfos.

    • If you have not enabled the App Certificate, set this parameter as the default value nil, which means the SDK applies the App ID.
    • If you have enabled the App Certificate, you must use the token generated with the channelName and uid.
  • uid: The unique ID to identify the relay stream in the destination channel. The value ranges from 0 to (232-1). Do not set this parameter as the uid of the host in the destination channel, and ensure that this uid is different from any other uid in the channel. The default value is 0, which means the SDK generates a random UID.

Declared In

AgoraObjects.h

  sourceInfo

The information of the source channel: AgoraChannelMediaRelayInfo. It contains the following members:

@property (strong, nonatomic) AgoraChannelMediaRelayInfo *sourceInfo

Discussion

  • channelName: The name of the source channel. The default value is nil, which means the SDK applies the name of the current channel.
  • token: The token for joining the source channel. It is generated with the channelName and uid you set in sourceInfo.

    • If you have not enabled the App Certificate, set this parameter as the default value nil, which means the SDK applies the App ID.
    • If you have enabled the App Certificate, you must use the token generated with the channelName and uid, and the uid must be set as 0.
  • uid: The unique ID to identify the relay stream in the source channel. The default value is 0, which means the SDK generates a random UID. You must set it as 0.

Declared In

AgoraObjects.h

– setDestinationInfo:forChannelName:

Sets the information of the destination channel.

- (BOOL)setDestinationInfo:(AgoraChannelMediaRelayInfo *_Nonnull)destinationInfo forChannelName:(NSString *_Nonnull)channelName

Parameters

destinationInfo

The information of the destination channel: AgoraChannelMediaRelayInfo. It contains the following members:

  • channelName: The name of the destination channel.
  • token: The token for joining the destination channel. It is generated with the channelName and uid you set in destinationInfo.

    • If you have not enabled the App Certificate, set this parameter as the default value nil, which means the SDK applies the App ID.
    • If you have enabled the App Certificate, you must use the token generated with the channelName and uid.
  • uid: The unique ID to identify the relay stream in the destination channel. The value ranges from 0 to (232-1). Do not set this parameter as the uid of the host in the destination channel, and ensure that this uid is different from any other uid in the channel. The default value is 0, which means the SDK generates a random UID.

channelName

The name of the destination channel. Ensure that the value of this parameter is the same as that of the channelName member in destinationInfo.

Return Value

  • YES: Success.
  • NO: Failure.

Discussion

If you want to relay the media stream to multiple channels, call this method as many times (at most four).

Declared In

AgoraObjects.h

– removeDestinationInfoForChannelName:

Removes the destination channel.

- (BOOL)removeDestinationInfoForChannelName:(NSString *_Nonnull)channelName

Parameters

channelName

The name of the destination channel.

Return Value

  • YES: Success.
  • NO: Failure.

Declared In

AgoraObjects.h