Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Nexmo APIs

Visit Nexmo

OpenTok.Publisher

A publisher captures an audio-video stream from the sources you specify. More...

Inherits IDisposable.

Classes

class  AudioLevelArgs
 Defines arguments for AudioLevel events. More...
class  AudioNetworkStats
 Defines an audio statistics object for the Stats property of a AudioNetworkStatsEventArgs object. More...
class  AudioNetworkStatsEventArgs
 Defines arguments for AudioStatsUpdated events. More...
class  ErrorEventArgs
 Defines arguments for the Error event. More...
class  StreamEventArgs
 Defines arguments for the StreamCreated and StreamDestroyed events. More...
class  VideoNetworkStats
 Defines a video statistics object for the Stats property of a VideoNetworkStatsEventArgs object. More...
class  VideoNetworkStatsEventArgs
 Defines arguments for VideoStatsUpdated events. More...

Public Member Functions

 Publisher (Context context, IVideoCapturer capturer=null, string name=null, IVideoRenderer renderer=null, bool hasAudioTrack=true, bool hasVideoTrack=true, bool stereo=false)
 Creates a new Publisher instance. More...
void Dispose ()
 Disposes of the Publisher object's resources. More...

Protected Member Functions

virtual void Dispose (bool disposing)

Properties

IVideoRenderer VideoRenderer [get]
 The video renderer for the publisher. More...
IVideoCapturer VideoCapturer [get]
 The video capturer for the publisher. More...
Stream Stream [get]
 The stream object corresponding the the Publisher's stream. More...
bool PublishAudio [get, set]
 Whether the publisher is publishing audio. More...
bool PublishVideo [get, set]
VideoSourceType VideoSourceType [get, set]
 The type of the stream (either camera or screen sharing), as defined by the OpenTok.VideoSourceType enum. More...

Events

EventHandler< StreamEventArgsStreamCreated
 Sent when the publisher's stream is created. More...
EventHandler< StreamEventArgsStreamDestroyed
 Sent when the publisher's stream is destroyed. More...
EventHandler< ErrorEventArgsError
 Sent when the publisher fails. More...
EventHandler< AudioNetworkStatsEventArgsAudioStatsUpdated
 Invoked when the publisher has audio stats to share. This is a beta feature. More...
EventHandler< VideoNetworkStatsEventArgsVideoStatsUpdated
 Invoked when the publisher has video stats to share. This is a beta feature. More...
EventHandler< AudioLevelArgsAudioLevel
 Sent periodically to report the audio level of the publisher. More...

Detailed Description

A publisher captures an audio-video stream from the sources you specify.

You can then publish the audio-video stream to an OpenTok session by calling the Session.Publish(Publisher) method.

The Publisher class implements the System.IDisposable interface. Be sure to call the Dispose() method of the Publisher object to release its resources when you no longer need the object (for example, when the Publisher is removed or when the app or window is closing).

Constructor & Destructor Documentation

◆ Publisher()

OpenTok.Publisher.Publisher ( Context  context,
IVideoCapturer  capturer = null,
string  name = null,
IVideoRenderer  renderer = null,
bool  hasAudioTrack = true,
bool  hasVideoTrack = true,
bool  stereo = false 
)

Creates a new Publisher instance.

Use the Session.Publish(Publisher) method to start streaming from this publisher into a session.

Parameters
contextThe Context to use for this Publisher object.
capturerThe 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.
nameThe 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).
rendererThe video renderer to use for this publisher. If you do not specify a renderer, the video isn't rendered locally.
hasAudioTrackWhether to include an audio track in the published stream.
hasVideoTrackWhether to include an video track in the published stream.
stereoWhether to enable stereo audio in the published stream.

Member Function Documentation

◆ Dispose()

void OpenTok.Publisher.Dispose ( )

Disposes of the Publisher object's resources.

Note that the Publisher's resources are not disposed of when you call the Session.Publish(Publisher) method. When you call Session.Publish(Publisher), the resources of the Publisher object are retained so that you can reuse it (to Publish again to the session).

Property Documentation

◆ PublishAudio

bool OpenTok.Publisher.PublishAudio

Whether the publisher is publishing audio.

◆ PublishVideo

bool OpenTok.Publisher.PublishVideo

◆ Stream

Stream OpenTok.Publisher.Stream

The stream object corresponding the the Publisher's stream.

◆ VideoCapturer

IVideoCapturer OpenTok.Publisher.VideoCapturer

The video capturer for the publisher.

◆ VideoRenderer

IVideoRenderer OpenTok.Publisher.VideoRenderer

The video renderer for the publisher.

◆ VideoSourceType

VideoSourceType OpenTok.Publisher.VideoSourceType

The type of the stream (either camera or screen sharing), as defined by the OpenTok.VideoSourceType enum.

Event Documentation

◆ AudioLevel

EventHandler<AudioLevelArgs> OpenTok.Publisher.AudioLevel

Sent periodically to report the audio level of the publisher.

◆ AudioStatsUpdated

EventHandler<AudioNetworkStatsEventArgs> OpenTok.Publisher.AudioStatsUpdated

Invoked when the publisher has audio stats to share. This is a beta feature.

◆ Error

EventHandler<ErrorEventArgs> OpenTok.Publisher.Error

Sent when the publisher fails.

◆ StreamCreated

EventHandler<StreamEventArgs> OpenTok.Publisher.StreamCreated

Sent when the publisher's stream is created.

◆ StreamDestroyed

EventHandler<StreamEventArgs> OpenTok.Publisher.StreamDestroyed

Sent when the publisher's stream is destroyed.

◆ VideoStatsUpdated

EventHandler<VideoNetworkStatsEventArgs> OpenTok.Publisher.VideoStatsUpdated

Invoked when the publisher has video stats to share. This is a beta feature.