public static class PublisherKit.Builder
extends java.lang.Object
PublisherKit
object. Instantiate a Builder object using the
PublisherKit.Builder(Context context)
constructor. Then call methods of
the Builder
instance to add settings for the publisher. Then call the
build()
method, which returns a PublisherKit
object.
Use the Session.publish(PublisherKit publisher)
method to start streaming
from the publisher into a session.
Publishers cannot be reused. Instantiate a new PublisherKit
object each time you
want to publish a new stream.
Constructor and Description |
---|
Builder(android.content.Context context)
Instantiates a
PublisherKit.Builder object. |
Modifier and Type | Method and Description |
---|---|
PublisherKit.Builder |
audioBitrate(int bitsPerSecond)
Sets the desired bitrate for the published audio, in bits per second.
|
PublisherKit.Builder |
audioTrack(boolean enabled)
Sets whether to include an audio track in the published stream (
true ,
the default) or not (false ). |
PublisherKit |
build()
Returns a new
PublisherKit instance based on the PublisherKit.Builder
settings. |
PublisherKit.Builder |
capturer(BaseVideoCapturer capturer)
Sets the video capturer to use for the publisher.
|
PublisherKit.Builder |
enableOpusDtx(boolean enable)
|
PublisherKit.Builder |
name(java.lang.String name)
Sets the name of the published video.
|
PublisherKit.Builder |
renderer(BaseVideoRenderer renderer)
Sets the video renderer to use for the publisher.
|
PublisherKit.Builder |
scalableScreenshare(boolean enabled)
Whether to allow use of scalable video for a publisher that has the videoType
set to PublisherKitVideoTypeScreen (true) or not (false, the default).
|
PublisherKit.Builder |
videoTrack(boolean enabled)
Sets whether to include an video track in the published stream (
true ,
the default) or not (false ). |
public Builder(android.content.Context context)
PublisherKit.Builder
object.context
- The
android.content.Context for the publisher.public PublisherKit.Builder name(java.lang.String name)
name
property for a stream
published by this publisher will be set to this value (on all clients).public PublisherKit.Builder audioTrack(boolean enabled)
true
,
the default) or not (false
). Creating a publisher without an audio track
can save CPU resources and reduce the bandwidth used by the stream.
If you call this and pass in false
, the audio subsystem will not be
initialized for the publisher, and calling the
PublisherKit.setPublishAudio(boolean publishAudio)
method will have no effect.
If your application does not require the use of audio, it is recommended to use this
Builder setting rather than use the
PublisherKit.setPublishAudio(boolean publishAudio)
method, which only
temporarily disables the audio track.
public PublisherKit.Builder videoTrack(boolean enabled)
true
,
the default) or not (false
). Creating a publisher without a video track
can save CPU resources and reduce the bandwidth used by the stream.
If you call this and pass in false
, the video subsystem will not be
initialized for the publisher, and calling the
PublisherKit.setPublishVideo(boolean publishVideo)
method will have no effect.
If your application does not require the use of audio, it is recommended to use this
Builder setting rather than use the
PublisherKit.setPublishVideo(boolean publishVideo)
method, which only
temporarily disables the video track.
public PublisherKit.Builder capturer(BaseVideoCapturer capturer)
public PublisherKit.Builder renderer(BaseVideoRenderer renderer)
public PublisherKit.Builder audioBitrate(int bitsPerSecond)
The following are recommended settings:
The default value is 40,000.
To set other audio settings, see the AudioDeviceManager
class.
bitsPerSecond
- The desired bitrate of the audio, in bits per second.public PublisherKit.Builder enableOpusDtx(boolean enable)
true
) or not (false
, the default). Enabling Opus DTX
can reduce bandwidth usage in streams that have long periods of silence.
By default, Opus DTX is disabled. If this property is set to true
,
Opus DTX will be enabled for the publisher.
public PublisherKit.Builder scalableScreenshare(boolean enabled)
This is a beta feature.
public PublisherKit build()
PublisherKit
instance based on the PublisherKit.Builder
settings.