OpenTok.Publisher.Builder

public class Builder

Enclosing type: OpenTok.Publisher

Instantiate a Builder instance by calling the Builder() constructor. Then (optionally), set properties of the Builder object. Then call the Build() method to create a Publisher object.

Properties

#### Capturer

Type: IVideoCapturer

{ get; set; }

The video capturer to use for this publisher. If you do not specify a capturer, the Publisher uses the default video capturer, defined by the VideoCapturer class. This video capturer uses the first video device in the list of devices available on the system.

#### Name

Type: string

{ get; set; }

The name of the publisher video. The Stream.Name property for a stream published by this publisher will be set to this value (on all clients).

#### Renderer

Type: IVideoRenderer

{ get; set; }

The video renderer to use for this publisher. If you do not specify a renderer, the video isn't rendered locally.

#### HasAudioTrack

Type: bool

{ get; set; }

Whether to include an audio track in the published stream.

#### HasVideoTrack

Type: bool

{ get; set; }

Whether to include an video track in the published stream.

#### Stereo

Type: bool

{ get; set; }

Whether to enable stereo audio in the published stream.

#### AudioBitrate

Type: uint

{ get; set; }

Publisher audio bitrate. Setting it to 0 will fall back to the default value.

#### OpusDtx

Type: bool

{ get; set; }

Whether to enable Opus DTX in the published stream. Enabling Opus DTX can reduce bandwidth usage in streams that have long periods of silence.

#### AutoGainControl

Type: bool

{ get; set; }

Whether publisher has audio auto gain control enabled.

#### NoiseSuppression

Type: bool

{ get; set; }

Whether publisher has audio noise suppression enabled.

#### EchoCancellation

Type: bool

{ get; set; }

Whether publisher has audio echo cancellation enabled.

#### DisableAudioProcessing

Type: bool

{ get; set; }

If enabled, AutoGainControl, NoiseSuppression and EchoCancellation parameters will be ignored and considered disabled.

#### ScalableScreenshare

Type: bool

{ get; set; }

Whether to allow use of scalable video for a publisher that has the VideoSourceType set to Screen (true) or not (false, the default).

#### Context

Type: Context

{ get; set; }

The Context to use for this Publisher object.

#### SubscriberAudioFallback

Type: bool

{ get; set; }

Whether to enable subscriber audio-fallback.

#### PublisherAudioFallback

Type: bool

{ get; set; }

Whether to enable publisher audio fallback.

#### AllowAudioCaptureWhileMuted

Type: bool

{ get; set; }

If set to false, the microphone will be automatically switched off when all publishers have muted their audio. Microphone will be automatically switched on again when at least one

publisher unmutes their audio. If set to true, mic will always remain switched on even when all publishers have muted their audio. Be aware that when the microphone is switched off, callbacks like AudioLevel or AudioData will no longer be invoked for the publishers. The default value is false.

#### PreferredVideoCodecs

Type: PreferredVideoCodecs

{ get; set; }

Use this property to control which video codecs are prioritized during negotiation. Assign a OpenTok.PreferredVideoCodecs instance to specify whether codec selection should be automatic or to provide an explicit, ordered list of codecs.

  • Set to PreferredVideoCodecs.Automatic() to let the SDK select the most suitable codec order.
  • Set to new PreferredVideoCodecs(new List<PreferredVideoCodecs.Codec> { ... }) to specify a manual preference order.
  • Leave null to use the default codec preference as defined by project settings.

If an invalid codec list is provided (e.g., empty list), publisher initialization will fail. Supported codecs: VP8, H264, VP9.

#### HasSenderStatsTrack

Type: bool

{ get; set; }

Whether to enable sender statistics in the published stream. The default is false.

#### Dispatcher

Type: IDispatcher

{ get; set; }

Methods

Name Description
Builder(context)
Builder() Creates a new Builder instance.
Build() → {Publisher}

Builder(context)

Parameters:
Name Type Description
context Context The Context to use for the Publisher object.

Builder()

Creates a new Builder instance.

Build() → {Publisher}

Returns: