Public Member Functions

Builder owner (boolean isRoomOwner)
 
Builder streamLifeCycle (int lifecycle)
 
Builder size (int width, int height)
 
Builder frameRate (int framerate)
 
Builder bitRate (int bitrate)
 
Builder audioProfile (int audioSampleRate, int audioBitrate, int audioChannels)
 
Builder defaultLayout (int layoutStyle)
 
Builder publishUrl (String url)
 
Builder rawStreamUrl (String url)
 
Builder injectStream (String url, int width, int height)
 
Builder extraInfo (String optionalInfo)
 
PublisherConfiguration build ()
 

Detailed Description

Builder class.

Deprecated:

If you want to configure the push stream, Agora recommends using the setLiveTranscoding method.

Member Function Documentation

◆ owner()

Builder io.agora.rtc.PublisherConfiguration.Builder.owner ( boolean  isRoomOwner)

Sets the RTMP stream owner.

In the Builder Class, this method sets whether the current host is the RTMP stream owner.

Parameters
isRoomOwner
  • true: (Default) Set the current host as the RTMP stream owner. The push stream takes effect only when this parameter is set to true.
  • false: Do not set the current host as the RTMP stream owner. And the push-stream configuration does not take effect.
Returns
  • 0: Success.
  • < 0: Failure.

◆ streamLifeCycle()

Builder io.agora.rtc.PublisherConfiguration.Builder.streamLifeCycle ( int  lifecycle)

CDN live push-stream lifecycle.

You can choose:

  • STREAM_LIFE_CYCLE_BIND2CHANNEL(1): Binds the RTMP stream lifecycle to the channel lifecycle. If all hosts leave the channel, CDN live streaming stops after 30 seconds.
  • STREAM_LIFE_CYCLE_BIND2OWNER(2): Binds the RTMP stream lifecycle to the owner of the RTMP stream. If the owner leaves the channel, CDN live streaming stops immediately.

◆ size()

Builder io.agora.rtc.PublisherConfiguration.Builder.size ( int  width,
int  height 
)

Sets the CDN live stream's resolution.

In the Builder Class, this method sets the resolution of the CDN live output data stream.

Parameters
widthWidth of the CDN live output data stream. The default value is 360.
heightHeight of the CDN live output data stream. The default value is 640.
Returns
  • 0: Success.
  • < 0: Failure.

◆ frameRate()

Builder io.agora.rtc.PublisherConfiguration.Builder.frameRate ( int  framerate)

Sets the CDN live stream's frame rate.

In the Builder class, this method sets the frame rate of the CDN live output data stream.

Parameters
framerateFrame rate of the CDN live output data stream. The default value is 15 fps.
Returns
  • 0: Success.
  • < 0: Failure.

◆ bitRate()

Builder io.agora.rtc.PublisherConfiguration.Builder.bitRate ( int  bitrate)

Sets the CDN live stream's bitrate.

In the Builder class, this method sets the bitrate of the CDN live output data stream.

Parameters
bitrateBitrate of the CDN live output data stream. The default value is 500 Kbps.
Returns
  • 0: Success.
  • < 0: Failure.

◆ defaultLayout()

Builder io.agora.rtc.PublisherConfiguration.Builder.defaultLayout ( int  layoutStyle)

Sets the default layout.

In the Builder class, this method sets the default layout if you do not use flexible adjustment.

Parameters
layoutStyle
  • 0: Tile horizontally.
  • 1: Layered windows.
  • 2: Tile vertically.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishUrl()

Builder io.agora.rtc.PublisherConfiguration.Builder.publishUrl ( String  url)

Sets the publishing URL.

In the Builder class, this method configures the push-stream address for the picture-in-picture layouts.

Parameters
urlConfigures the push-stream address for the picture-in-picture layouts. The default value is null.
Returns
  • 0: Success.
  • < 0: Failure.

◆ rawStreamUrl()

Builder io.agora.rtc.PublisherConfiguration.Builder.rawStreamUrl ( String  url)

Sets the raw stream URL.

In the Builder class, this method sets the push-stream address of the original stream which does not require picture-blending.

Parameters
urlPush-stream URL address of the original stream not requiring picture-blending. The default value is null.
Returns
  • 0: Success.
  • < 0: Failure.

◆ injectStream()

Builder io.agora.rtc.PublisherConfiguration.Builder.injectStream ( String  url,
int  width,
int  height 
)

Sets the inject stream.

In the Builder class, this method injects a stream to the current channel.

Parameters
urlURL address of the injected stream in the channel.
widthWidth of the stream. N/A, set as 0.
heightHeight of the stream. N/A, set as 0.
Returns
  • 0: Success.
  • < 0: Failure.

◆ extraInfo()

Builder io.agora.rtc.PublisherConfiguration.Builder.extraInfo ( String  optionalInfo)

Adds extra information.

Parameters
optionalInfoReserved Field. The default value is NULL.
Returns
  • 0: Success.
  • < 0: Failure.