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 | Builder |
Used to create a Publisher instance. More... | |
class | ErrorEventArgs |
Defines arguments for the Error event. More... | |
class | PublisherRtcStats |
Represents RTC statistics for a media stream published by the publisher. More... | |
class | RtcStatsReportArgs |
Defines arguments for RtcStatsReport events. 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, bool opusDtx=false) | |
Creates a new Publisher instance. More... | |
void | GetRtcStatsReport () |
Gets the RTC stats report for the publisher. This is an asynchronous operation. When the stats are available, the RtcStatsReport message is sent. 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 | MuteForced |
Defines arguments for the MuteForced event. More... | |
EventHandler< StreamEventArgs > | StreamCreated |
Sent when the publisher's stream is created. More... | |
EventHandler< StreamEventArgs > | StreamDestroyed |
Sent when the publisher's stream is destroyed. More... | |
EventHandler< ErrorEventArgs > | Error |
Sent when the publisher fails. More... | |
EventHandler< AudioNetworkStatsEventArgs > | AudioStatsUpdated |
Invoked when the publisher has audio stats to share. More... | |
EventHandler< VideoNetworkStatsEventArgs > | VideoStatsUpdated |
Invoked when the publisher has video stats to share. More... | |
EventHandler< AudioLevelArgs > | AudioLevel |
Sent periodically to report the audio level of the publisher. More... | |
EventHandler< RtcStatsReportArgs > | RtcStatsReport |
Sent in response to a call to GetRtcStatsReport(). More... |
A publisher captures an audio-video stream from the sources you specify.
Use the Publisher.Builder class to create a Publisher instance. 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).
OpenTok.Publisher.Publisher | ( | Context | context, |
IVideoCapturer | capturer = null , |
||
string | name = null , |
||
IVideoRenderer | renderer = null , |
||
bool | hasAudioTrack = true , |
||
bool | hasVideoTrack = true , |
||
bool | stereo = false , |
||
bool | opusDtx = false |
||
) |
Creates a new Publisher instance.
Use the Session.Publish(Publisher) method to start streaming from this publisher into a session.
context | The Context to use for this Publisher object. |
capturer | 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 | 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 | The video renderer to use for this publisher. If you do not specify a renderer, the video isn't rendered locally. |
hasAudioTrack | Whether to include an audio track in the published stream. |
hasVideoTrack | Whether to include an video track in the published stream. |
stereo | Whether to enable stereo audio in the published stream. |
opusDtx | Whether to enable Opus DTX in the published stream. |
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).
void OpenTok.Publisher.GetRtcStatsReport | ( | ) |
Gets the RTC stats report for the publisher. This is an asynchronous operation. When the stats are available, the RtcStatsReport message is sent.
Also see AudioStatsUpdated, VideoStatsUpdated, and Subscriber.GetRtcStatsReport().
|
Whether the publisher is publishing audio.
|
|
The video capturer for the publisher.
|
The video renderer for the publisher.
|
The type of the stream (either camera or screen sharing), as defined by the OpenTok.VideoSourceType enum.
EventHandler<AudioLevelArgs> OpenTok.Publisher.AudioLevel |
Sent periodically to report the audio level of the publisher.
EventHandler<AudioNetworkStatsEventArgs> OpenTok.Publisher.AudioStatsUpdated |
Invoked when the publisher has audio stats to share.
EventHandler<ErrorEventArgs> OpenTok.Publisher.Error |
Sent when the publisher fails.
EventHandler OpenTok.Publisher.MuteForced |
Defines arguments for the MuteForced event.
EventHandler<RtcStatsReportArgs> OpenTok.Publisher.RtcStatsReport |
Sent in response to a call to GetRtcStatsReport().
EventHandler<StreamEventArgs> OpenTok.Publisher.StreamCreated |
Sent when the publisher's stream is created.
EventHandler<StreamEventArgs> OpenTok.Publisher.StreamDestroyed |
Sent when the publisher's stream is destroyed.
EventHandler<VideoNetworkStatsEventArgs> OpenTok.Publisher.VideoStatsUpdated |
Invoked when the publisher has video stats to share.