Agora Java API Reference for Android
io.agora.rtc.video.ChannelMediaRelayConfiguration Class Reference

Public Member Functions

 ChannelMediaRelayConfiguration ()
 
void setSrcChannelInfo (ChannelMediaInfo srcInfo)
 
void setDestChannelInfo (String channelName, ChannelMediaInfo destInfo)
 
void removeDestChannelInfo (String channelName)
 
ChannelMediaInfo getSrcChannelMediaInfo ()
 
Map< String, ChannelMediaInfogetDestChannelMediaInfos ()
 

Detailed Description

Constructor & Destructor Documentation

◆ ChannelMediaRelayConfiguration()

io.agora.rtc.video.ChannelMediaRelayConfiguration.ChannelMediaRelayConfiguration ( )

The configuration of the channel media relay.

Since
v2.9.0.

Member Function Documentation

◆ setSrcChannelInfo()

void io.agora.rtc.video.ChannelMediaRelayConfiguration.setSrcChannelInfo ( ChannelMediaInfo  srcInfo)

Sets the information of the source channel.

Parameters
srcInfoThe information of the source channel: ChannelMediaInfo. It contains the following members:
  • channelName: The name of the source channel. The default value is NULL, 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 srcInfo.
    • If you have not enabled the App Certificate, set this parameter as the default value NULL, 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.

◆ setDestChannelInfo()

void io.agora.rtc.video.ChannelMediaRelayConfiguration.setDestChannelInfo ( String  channelName,
ChannelMediaInfo  destInfo 
)

Sets the information of the destination channel.

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

Parameters
channelNameThe name of the destination channel. Ensure that the value of this parameter is the same as that of the channelName member in destInfo.
destInfoThe information of the destination channel: ChannelMediaInfo. 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 destInfo.
    • If you have not enabled the App Certificate, set this parameter as the default value NULL, 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). To avoid UID conflicts, this uid must be different from any other UIDs in the destination channel. The default value is 0, which means the SDK generates a random UID. 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.

◆ removeDestChannelInfo()

void io.agora.rtc.video.ChannelMediaRelayConfiguration.removeDestChannelInfo ( String  channelName)

Removes the destination channel.

Parameters
channelNameThe name of the destination channel.

◆ getSrcChannelMediaInfo()

ChannelMediaInfo io.agora.rtc.video.ChannelMediaRelayConfiguration.getSrcChannelMediaInfo ( )

Gets the information of the source channel.

Returns
The information of the source channel.See ChannelMediaInfo.

◆ getDestChannelMediaInfos()

Map< String, ChannelMediaInfo > io.agora.rtc.video.ChannelMediaRelayConfiguration.getDestChannelMediaInfos ( )

Gets the information of the destination channel.

Returns
The information of the destination channel.See ChannelMediaInfo.