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 | VideoEventArgs |
Defines arguments for the VideoEnabled and VideoDisabled 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 Types | |
enum | VideoReason : int { VideoReason.PublishVideo = 1, VideoReason.Quality = 3 } |
Defines values for the VideoEventArgs.Reason and VideoEventArgs.Reason properties. 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, uint audioBitrate=48000, bool opusDtx=false, bool autoGainControl=true, bool noiseSuppression=true, bool echoCancellation=true, bool disableAudioProcessing=false, bool subscriberAudioFallback=true, bool publisherAudioFallback=false, bool scalableScreenshare=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 | |
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... | |
List< VideoTransformer > | VideoTransformers [get, set] |
List of VideoTransformer in the order to be applied to the stream. See the documentation on Using the Vonage Media Processor library and applying media tranformations. Getter returns a copy of the list. Adding or removing transformers from this copy will not affect the internal layers. More... | |
List< AudioTransformer > | AudioTransformers [get, set] |
List of AudioTransformer in the order to be applied to the stream. See the documentation on Using the Vonage Media Processor library and applying media tranformations. Getter returns a copy of the list. Adding or removing transformers from this copy will not affect the internal layers. More... | |
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 for this publisher. The properties of the Stream object are a snapshot of the stream state at the time this property is accessed, and will not be updated as the state of the stream changes. More... | |
bool | PublishCaptions [get, set] |
Whether the publisher is publishing captions. 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< VideoEventArgs > | VideoDisabled |
Called when the publisher stops sending video. More... | |
EventHandler< VideoEventArgs > | VideoEnabled |
Called when the publisher's video stream resumes (after video was disabled). More... | |
EventHandler | VideoDisableWarning |
Called when the publisher determines that the network congestion level has degraded and the video will be disabled if the congestion degrades further. More... | |
EventHandler | VideoDisableWarningLifted |
Called when the publisher determines that the network congestion level has improved to the point at which the video being disabled is not an immediate risk. 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 Vonage Video API 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).
|
Defines values for the VideoEventArgs.Reason and VideoEventArgs.Reason properties.
Enumerator | |
---|---|
PublishVideo | The event occured because the publisher of the stream started or stopped publishing video. |
Quality | The event was caused by a change in the network congestion level. When the video stream quality degrades due to network conditions, the Publisher sends the VideoDisabled event. When conditions improve, the video stream resumes, and the Publisher sends the VideoEnabled event. When the video stream is dropped, the Publisher continues to send the audio stream, if there is one. Moreover, the capturer corresponding to this publisher will not be disabled, and the captured frames will still be seen on the publisher side. |
OpenTok.Publisher.Publisher | ( | Context | context, |
IVideoCapturer | capturer = null , |
||
string | name = null , |
||
IVideoRenderer | renderer = null , |
||
bool | hasAudioTrack = true , |
||
bool | hasVideoTrack = true , |
||
bool | stereo = false , |
||
uint | audioBitrate = 48000 , |
||
bool | opusDtx = false , |
||
bool | autoGainControl = true , |
||
bool | noiseSuppression = true , |
||
bool | echoCancellation = true , |
||
bool | disableAudioProcessing = false , |
||
bool | subscriberAudioFallback = true , |
||
bool | publisherAudioFallback = false , |
||
bool | scalableScreenshare = 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. |
subscriberAudioFallback | Whether to enable subscriber audio fallback. |
publisherAudioFallback | Whether to enable publisher audio fallback. |
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().
EventHandler<AudioLevelArgs> OpenTok.Publisher.AudioLevel |
Sent periodically to report the audio level of the publisher.
|
List of AudioTransformer in the order to be applied to the stream. See the documentation on Using the Vonage Media Processor library and applying media tranformations. Getter returns a copy of the list. Adding or removing transformers from this copy will not affect the internal layers.
|
Whether the publisher is publishing audio.
|
Whether the publisher is publishing captions.
|
EventHandler<RtcStatsReportArgs> OpenTok.Publisher.RtcStatsReport |
Sent in response to a call to GetRtcStatsReport().
|
The stream for this publisher. The properties of the Stream object are a snapshot of the stream state at the time this property is accessed, and will not be updated as the state of the stream changes.
|
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.
|
List of VideoTransformer in the order to be applied to the stream. See the documentation on Using the Vonage Media Processor library and applying media tranformations. Getter returns a copy of the list. Adding or removing transformers from this copy will not affect the internal layers.
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<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<VideoEventArgs> OpenTok.Publisher.VideoDisabled |
Called when the publisher stops sending video.
Check the reason
property of the event arguments for the reason why the video stopped.
EventHandler OpenTok.Publisher.VideoDisableWarning |
Called when the publisher determines that the network congestion level has degraded and the video will be disabled if the congestion degrades further.
If the network degrades further, the Publisher disables the video and sends the AudioFallback message. If the stream quality improves, the Publisher sends the VideoDisableWarningLifted event.
This method is mainly called when the connection quality degrades.
EventHandler OpenTok.Publisher.VideoDisableWarningLifted |
Called when the publisher determines that the network congestion level has improved to the point at which the video being disabled is not an immediate risk.
This method is mainly called when the connection quality improves.
EventHandler<VideoEventArgs> OpenTok.Publisher.VideoEnabled |
Called when the publisher's video stream resumes (after video was disabled).
Check the reason
property of the event arguments for the reason why the video was enabled.
EventHandler<VideoNetworkStatsEventArgs> OpenTok.Publisher.VideoStatsUpdated |
Invoked when the publisher has video stats to share.