Publisher.Builder

public static class Builder extends PublisherKit.Builder

Enclosing class: Publisher

Used to build a Publisher object. Instantiate a Builder object using the Publisher.Builder(Context context) constructor. Then call methods of the Builder instance to add settings for the publisher. (Note that the Publisher.Builder class inherits methods from the PublisherKit.Builder class.) Then call the build() method, which returns a Publisher object.

Use the Session#publish(PublisherKit publisher) method to start streaming from the publisher into a session.

Methods

Name Description
Builder(context) Instantiates a Publisher.Builder object.
allowAudioCaptureWhileMuted(allow) → {Publisher.Builder}
audioBitrate(bitsPerSecond) → {Publisher.Builder}
audioTrack(enabled) → {Publisher.Builder}
build() → {Publisher} Returns a new Publisher instance based on the Publisher.Builder settings.
capturer(capturer) → {Publisher.Builder} Sets the video capturer to use for the publisher.
enableOpusDtx(enable) → {Publisher.Builder}
frameRate(frameRate) → {Publisher.Builder} Sets the desired frame rate of the published video.
name(name) → {Publisher.Builder}
preferredVideoCodecs(preferredVideoCodecs) → {Publisher.Builder}
publisherAudioFallbackEnabled(enabled) → {Publisher.Builder}
renderer(renderer) → {Publisher.Builder} Sets the video renderer to use for the publisher.
resolution(resolution) → {Publisher.Builder} Sets the video resolution of the published video.
scalableScreenshare(enable) → {Publisher.Builder}
senderStatsTrack(allow) → {Publisher.Builder}
subscriberAudioFallbackEnabled(enabled) → {Publisher.Builder}
videoTrack(enabled) → {Publisher.Builder}

Builder(context)

Instantiates a Publisher.Builder object.

Parameters:
Name Type Description
context Context

allowAudioCaptureWhileMuted(allow) → {Publisher.Builder}

Parameters:
Name Type Description
allow boolean
Returns:

Publisher.Builder

audioBitrate(bitsPerSecond) → {Publisher.Builder}

Parameters:
Name Type Description
bitsPerSecond int
Returns:

Publisher.Builder

audioTrack(enabled) → {Publisher.Builder}

Parameters:
Name Type Description
enabled boolean
Returns:

Publisher.Builder

build() → {Publisher}

Returns a new Publisher instance based on the Publisher.Builder settings.

Returns:

Publisher

capturer(capturer) → {Publisher.Builder}

Sets the video capturer to use for the publisher. If you do not call this method, the publisher will use the default Publisher capturer.

Parameters:
Name Type Description
capturer BaseVideoCapturer
Returns:

Publisher.Builder

enableOpusDtx(enable) → {Publisher.Builder}

Parameters:
Name Type Description
enable boolean
Returns:

Publisher.Builder

frameRate(frameRate) → {Publisher.Builder}

Sets the desired frame rate of the published video. Set this to a value defined in the CameraCaptureFrameRate enum. If the device does not support the specified frame rate, it will use the closest supported frame rate. Note that in sessions that use the OpenTok Media Router (sessions with the media mode set to routed), lowering the frame rate proportionally reduces the bandwidth the stream uses. However, in sessions that have the media mode set to relayed, lowering the frame rate does not reduce the stream's bandwidth. (See

The OpenTok Media Router and media modes.)

Parameters:
Name Type Description
frameRate Publisher.CameraCaptureFrameRate
Returns:

Publisher.Builder

name(name) → {Publisher.Builder}

Parameters:
Name Type Description
name String
Returns:

Publisher.Builder

preferredVideoCodecs(preferredVideoCodecs) → {Publisher.Builder}

Parameters:
Name Type Description
preferredVideoCodecs PublisherKit.PreferredVideoCodecs
Returns:

Publisher.Builder

publisherAudioFallbackEnabled(enabled) → {Publisher.Builder}

Parameters:
Name Type Description
enabled boolean
Returns:

Publisher.Builder

renderer(renderer) → {Publisher.Builder}

Sets the video renderer to use for the publisher. If you do not call this method, the publisher will use the default Publisher renderer.

Parameters:
Name Type Description
renderer BaseVideoRenderer
Returns:

Publisher.Builder

resolution(resolution) → {Publisher.Builder}

Sets the video resolution of the published video. Set this to a value defined in the CameraCaptureResolution enum

Parameters:
Name Type Description
resolution Publisher.CameraCaptureResolution
Returns:

Publisher.Builder

scalableScreenshare(enable) → {Publisher.Builder}

Parameters:
Name Type Description
enable boolean
Returns:

Publisher.Builder

senderStatsTrack(allow) → {Publisher.Builder}

Parameters:
Name Type Description
allow boolean
Returns:

Publisher.Builder

subscriberAudioFallbackEnabled(enabled) → {Publisher.Builder}

Parameters:
Name Type Description
enabled boolean
Returns:

Publisher.Builder

videoTrack(enabled) → {Publisher.Builder}

Parameters:
Name Type Description
enabled boolean
Returns:

Publisher.Builder