Configurations of the media stream relay.

Since
   3.0.0

Use this interface to set the media stream relay when calling startChannelMediaRelay or updateChannelMediaRelay.

Hierarchy

  • ChannelMediaRelayConfiguration

Index

Methods

removeDestChannelInfo

  • removeDestChannelInfo(channelName: string): void
  • Removes the destination channel.

    example

    Sample code

    configuration.removeDestChannelInfo("cname")

    Parameters

    • channelName: string

      The name of the destination channel.

    Returns void

setDestChannelInfo

  • setDestChannelInfo(channelName: string, destInfo: any): void
  • Sets the information of the destination channel.

    To relay a media stream across multiple channels, call this method as many times (to a maximum of four).

    example

    Sample code

    var configuration = new AgoraRTC.ChannelMediaRelayConfiguration();
    configuration.setDestChannelInfo("cname", {
     channelName: "destChannel",
     uid: 123,
     token: "yourDestToken",
    })

    Parameters

    • channelName: string

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

    • destInfo: any

      The information of the destination channel:

      • channelName: String, the channel name.
      • uid: Number, the unique ID to identify the relay stream in the destination channel. A 32-bit unsigned integer with a value ranging from 0 to (232-1). If you set it as 0, the server assigns a random one. To avoid UID conflicts, this uid must be different from any other UIDs in the destination channel.
      • token: String, the token generated with the above channelName and uid. Do not set this parameter if you have not enabled token.

    Returns void

setSrcChannelInfo

  • setSrcChannelInfo(srcInfo: any): void
  • Sets the information of the source channel.

    example

    Sample code

    var configuration = new AgoraRTC.ChannelMediaRelayConfiguration();
    configuration.setSrcChannelInfo({
     channelName: "srcChannel",
     uid: 123,
     token: "yourSrcToken",
    })

    Parameters

    • srcInfo: any

      The information of the source channel:

      • channelName: String, the channel name.
      • uid: Number, the unique ID to identify the relay stream in the source channel. A 32-bit unsigned integer with a value ranging from 0 to (232-1). If you set it as 0, the server assigns a random one. To avoid UID conflicts, this value must be different from the UID of the current host.
      • token: String, the token generated with the above channelName and uid. Do not set this parameter if you have not enabled token.

    Returns void