Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

OpenTok Namespace Reference

Classes

struct  AudioData
 Defines several parameters related to an audio sample batch. More...
class  AudioDevice
 A class that includes methods for setting the audio device to be used by publishers and subscribers. More...
class  AudioDeviceSettings
 Defines the settings retrieved from the IAudioDevice.GetAudioCapturerSettings() and IAudioDevice.GetAudioRendererSettings() methods. More...
class  AudioTransformer
 Defines an audio transformation to be used in the Publisher.AudioTransformers array. More...
class  Capabilities
 Defines values for the Capabilities property of a Session object, based on the role assigned to the token used to connect to the session. More...
class  Connection
 Represents a connection between a client and an Vonage Video API session. More...
class  Context
 Used to manage resources for Session, Publisher, and Subscriber objects. More...
class  DedicatedWorkerDispatcher
 Implementation of IDispatcher that uses a dedicated worker thread to deliver events. Available for all application types. Delivery order is guaranteed. CPU-intensive or long-running tasks can be executed in the handlers, as the dedicated thread is not used for any other purpose. UI can't be manipulated directly in the handlers. If this is required, events must be scheduled first to the UI thread. More...
class  DirectDispatcher
 Implementation of IDispatcher that doesn't schedule events at all. It uses the same thread used by the lower layer to deliver events. Available for all application types. Delivery order is guaranteed. CPU-intensive or long-running tasks should not be executed in the handlers, as they would block the native API main thread and affect performance or responsiveness. UI can't be manipulated directly in the handlers. If this is required, events must be scheduled first to the UI thread. More...
interface  IAudioDevice
 Defines an Audio device to be used by all publishers and subscribers. More...
class  IceConfig
 A class for setting custom ICE configuration. More...
struct  IceServer
 Defines the object to add to the List for the CustomIceServers property of the IceConfig class. More...
interface  ICustomAudioTransformer
 Interface used to define a custom audio transformer to be used in the AudioTransformer(string name, ICustomAudioTransformer transformer) constructor. More...
interface  ICustomVideoTransformer
 Interface used to define a custom vidoe transformer to be used in used in the VideoTransformer.VideoTransformer(string name, ICustomVideoTransformer transformer) constructor. More...
interface  IDispatcher
 Interface for a class used by Session, Publisher, and Subscriber instances to schedule events to a different thread. More...
interface  IVideoCapturer
interface  IVideoFrameConsumer
 Defines a video frame consumer to be used by the VideoCapturer of a Publisher. More...
interface  IVideoRenderer
 Defines a video renderer to be used by a Publisher or Subscriber object. More...
class  Logger
 Helper class that allows setting log level used by the SDK optionally providing a custom callback for log handling. This class provides a safer way manage native logging than directly invoking the native C API via DllImport. WARNING: DO call Disable() before closing the application to avoid closing exceptions.
class  MMAudioDevice
 Custom audio device implementation based on mmdeviceapi. This custom audio device can be used instead of the default internal audio device provided by OpenTok.AudioDevice. More...
class  OpenTokException
 Defines errors thrown by the Vonage Video API Windows SDK. More...
class  Publisher
 A publisher captures an audio-video stream from the sources you specify. More...
class  Session
 Represents an Vonage Video API session in which the client is participating. More...
class  Stream
 Represents the state of an audio-video stream in an Vonage Video API session. To get the most updated information, use the Stream property of a Publisher or Subscriber before accessing any of the properties of the stream. More...
class  Subscriber
 Used to consume an audio-video stream in the Vonage Video API session. More...
class  ThreadPoolDispatcher
 Implementation of IDispatcher that uses different threads from the managed ThreadPool to deliver events. Available for all application types. Important: Delivery order is not guaranteed. CPU-intensive or long-running tasks can be executed in the handlers, as the underlying thread system is prepared to handle this. UI can't be manipulated directly in the handlers. If this is required, events must be scheduled first to the UI thread. More...
class  VideoCapturer
 A video capturer implementation that captures video from on of the cameras available on the system. More...
class  VideoCaptureSettings
 Defines the settings passed into the VideoCapturer.UpdateCaptureSettings(ref VideoCaptureSettings) method. More...
class  VideoFrame
 Defines a video frame for the IVideoRenderer.RenderFrame(VideoFrame) and IVideoFrameConsumer.Consume(VideoFrame) methods. More...
class  VideoTransformer
 Defines a video transformation to be used in the Publisher.VideoTransformers array. More...
class  WinFormsDispatcher
 Implementation of IDispatcher that uses the Windows Forms Main/UI thread to dispatch events. Available only for Windows Forms applications. Delivery order is guaranteed. CPU-intensive or long-running tasks should not be executed in the handlers, as they would block the UI thread and affect performance or responsiveness. More...
class  WPFDispatcher
 Implementation of IDispatcher that uses the WPF Main/UI thread to dispatch events. Available only for WPF applications. Delivery order is guaranteed. CPU-intensive or long-running tasks should not be executed in the handlers, as they would block the UI thread and affect performance or responsiveness. More...

Enumerations

enum  ErrorCode : int {
  ErrorCode.UnknownError = -1, ErrorCode.GenericSDKError = 1, ErrorCode.AuthorizationFailure = 1004, ErrorCode.InvalidSessionId = 1005,
  ErrorCode.ConnectionFailed = 1006, ErrorCode.NoMessagingServer = 1503, ErrorCode.ConnectionRefused = 1023, ErrorCode.SessionStateFailed = 1020,
  ErrorCode.P2PSessionMaxParticipants = 1403, ErrorCode.SessionConnectionTimeout = 1021, ErrorCode.SessionInternalError = 2000, ErrorCode.SessionInvalidSignalType = 1461,
  ErrorCode.SessionSignalDataTooLong = 1413, ErrorCode.SessionSignalTypeTooLong = 1414, ErrorCode.ConnectionDropped = 1022, ErrorCode.SessionDisconnected = 1010,
  ErrorCode.PublisherInternalError = 2000, ErrorCode.PublisherWebRTCError = 1610, ErrorCode.PublisherUnableToPublish = 1500, ErrorCode.PublisherUnexpectedPeerConnectionDisconnection = 1710,
  ErrorCode.PublisherCannotAccessCamera = 1650, ErrorCode.PublisherCameraAccessDenied = 1670, ErrorCode.ConnectionTimedOut = 1542, ErrorCode.SubscriberWebRTCError = 1600,
  ErrorCode.SubscriberServerCannotFindStream = 1604, ErrorCode.SubscriberStreamLimitExceeded = 1605, ErrorCode.SubscriberInternalError = 2000, ErrorCode.UnknownPublisherInstance = 2003,
  ErrorCode.UnknownSubscriberInstance = 2004, ErrorCode.SessionNullOrInvalidParameter = 1011, ErrorCode.VideoCaptureFailed = 3000, ErrorCode.CameraFailed = 3010,
  ErrorCode.VideoRenderFailed = 4000, ErrorCode.SessionSubscriberNotFound = 1112, ErrorCode.SessionPublisherNotFound = 1113, ErrorCode.PublisherTimeout = 1541,
  ErrorCode.SessionBlockedCountry = 1026, ErrorCode.SessionConnectionLimitExceeded = 1027, ErrorCode.SessionUnexpectedGetSessionInfoResponse = 2001, ErrorCode.SessionIllegalState = 1015,
  ErrorCode.SessionUnableToForceMute = 1540, ErrorCode.EncryptionSecretMissing = 6000, ErrorCode.EncryptionInternalError = 6001, ErrorCode.DecryptionInternalError = 6002,
  ErrorCode.EncryptionSecretMismatch = 6003, ErrorCode.InvalidEncryptionSecret = 6004, MediaTransformerInternalError = 0x0A000000, MediaTransformerInvalidType,
  MediaTransformerNameNotProvided, MediaTransformerCustomCallbackNotProvided, MediaTransformerPropertiesNotProvided, MediaTransformerModelNotFound,
  MediaTransformerOpenTokTransformersLibraryNotLoaded, MediaTransformerOpenTokTransformersSymbolNotFound, OpenTokTransformersInternalError = 0x0B000000, OpenTokTransformersInvalidParam,
  OpenTokTransformersNameNotProvided, OpenTokTransformersInvalidName, OpenTokTransformersPropertiesNotProvided, OpenTokTransformersInvalidPropertiesFormat,
  OpenTokTransformersModelFileNotFound, OpenTokTransformersRadiusPropertyNotProvided, OpenTokTransformersInvalidRadiusProperty, OpenTokTransformersCustomRadiusPropertyNotProvided,
  OpenTokTransformersInvalidCustomRadiusProperty, OpenTokTransformersImageFilePathPropertyNotProvided, OpenTokTransformersImageFilePathNotFound, OpenTokTransformersMlTransformerInitError
}
 Defines error code values for OpenTokException objects. More...
enum  VideoContentHint : int { VideoContentHint.NONE = 0, VideoContentHint.MOTION = 1, VideoContentHint.DETAIL = 2, VideoContentHint.TEXT = 3 }
 Defines the settings passed into the VideoCapturer.SetVideoContentHint(VideoContentHint contentHint) method. More...
enum  VideoSourceType : int { VideoSourceType.Camera = 1, VideoSourceType.Screen = 2, VideoSourceType.Custom = 3 }
 Defines options for the Publisher.VideoSourceType property. More...
enum  ICEIncludeServers : int { All = 0, Custom = 1 }
 Defines values for the IncludeServers property of the IceConfig class. More...
enum  ICETransport : int { All = 0, Relayed = 1 }
 Defines values for the TransportPolicy property of the IceConfig class. More...
enum  PixelFormat : int {
  PixelFormat.Unknown = 0, PixelFormat.FormatYuv420p = 1, PixelFormat.FormatNv12 = 2, PixelFormat.FormatNv21 = 3,
  PixelFormat.FormatYuy2 = 4, PixelFormat.FormatUyvy = 5, PixelFormat.FormatArgb32 = 6, PixelFormat.FormatBgra32 = 7,
  PixelFormat.FormatRgb24 = 8, PixelFormat.FormatAbgr32 = 9, PixelFormat.FormatMjpeg = 10, PixelFormat.FormatRgba32 = 11
}
 The format of a video frame. More...

Functions

delegate void OnFrame (IntPtr frame)

Enumeration Type Documentation

◆ ErrorCode

enum OpenTok.ErrorCode : int

Defines error code values for OpenTokException objects.

Enumerator
UnknownError 

Used for an unknown error.

GenericSDKError 

Used for generic error. See provided error description.

AuthorizationFailure 

An invalid API key or token was provided.

InvalidSessionId 

Unable to connect: an invalid session ID was provided.

ConnectionFailed 

The session failed to connect.

NoMessagingServer 

There was an error connecting to the OpenTok messaging server.

ConnectionRefused 

A socket could not be opened to OpenTok the messaging server. Check that outbound ports 443 and 8080 are accessible.

SessionStateFailed 

The connection timed out while attempting to get the session's state. Check the network connection.

P2PSessionMaxParticipants 

A peer-to-peer enabled session can only have two participants.

SessionConnectionTimeout 

The connection timed out while attempting to connect to the session. Check the network connection.

SessionInternalError 

Internal error connecting to the session. Try connecting again.

SessionInvalidSignalType 

Invalid signal type.

SessionSignalDataTooLong 

Invalid signal – the data string is too long. The maximum length is 8196.

SessionSignalTypeTooLong 

Invalid signal – the type string is too long. The maximum length is 128.

ConnectionDropped 

The connection to the OpenTok messaging server was dropped. Check the network connection.

SessionDisconnected 

Attempting to publish to a disconnected session.

PublisherInternalError 

Internal error when publishing. Try publishing again.

PublisherWebRTCError 

Publisher WebRTC failure.

PublisherUnableToPublish 

The publisher is unable to publish.

PublisherUnexpectedPeerConnectionDisconnection 

The PeerConnection for the publisher's stream unexpectedly disconnected.

PublisherCannotAccessCamera 

The publisher cannot access the specified camera.

PublisherCameraAccessDenied 

The user denied access to the camera.

ConnectionTimedOut 

Subscriber timed out while attempting to connect to the stream. Try resubscribing to the stream.

SubscriberWebRTCError 

Subscriber WebRTC failure.

SubscriberServerCannotFindStream 

The subscriber failed due to the stream being missing. This can happen if the subscriber is created at the same time the stream is removed from the session.

SubscriberStreamLimitExceeded 

The subscriber failed due to the the limit to the number of subscribers the servers support.

SubscriberInternalError 

Internal error when subscribing. Try subscribing again.

UnknownPublisherInstance 

Cannot unpublish: An unknown Publisher instance was passed into the Session.Unpublish(Publisher) method.

UnknownSubscriberInstance 

Cannot unsubscribe: An unknown Subscriber instance was passed into the Session.Unsubscribe(Subscriber) method.

SessionNullOrInvalidParameter 

You passed an invalid parameter or the Session is null.

VideoCaptureFailed 

There was an error in the video capturer.

CameraFailed 

There was an error in acquiring video from the camera.

VideoRenderFailed 

There was an error in the video renderer.

SessionSubscriberNotFound 

The subscriber is unknown to this session. This is usually the result of calling Session.Unsubscribe(Subscriber) with a subscriber that is not associated with the session.

SessionPublisherNotFound 

The publisher is unknown to this session. This is usually the result of calling Session.Unpublish(Publisher) with a publisher that is not publishing a stream to the session.

PublisherTimeout 

Timeout while attempting to publish.

SessionBlockedCountry 

Unable to connect to the session. Terms of service violation: export compliance.

SessionConnectionLimitExceeded 

The connection failed due to the the limit to the number of connections the servers support.

SessionUnexpectedGetSessionInfoResponse 

Unable to connect to the session. Try connecting again.

SessionIllegalState 

Unable to connect to a session that is already connected. Or unable to subscribe to a stream that is no longer in the session.

SessionUnableToForceMute 

Unable to force mute, perhaps because the client's capabilities are limited.

EncryptionSecretMissing 

Tried to join an end-to-end encrypted session without an encryption secret

EncryptionInternalError 

Internal error while encrypting a packet

DecryptionInternalError 

Internal error while decrypting a packet

EncryptionSecretMismatch 

Secret mismatch while decrypting a packet

InvalidEncryptionSecret 

Invalid encryption secret

◆ ICEIncludeServers

Defines values for the IncludeServers property of the IceConfig class.

◆ ICETransport

Defines values for the TransportPolicy property of the IceConfig class.

◆ PixelFormat

enum OpenTok.PixelFormat : int

The format of a video frame.

Enumerator
Unknown 

Unknown format.

FormatYuv420p 

YUV420p.

FormatNv12 

NV12.

FormatNv21 

NV21.

FormatYuy2 

YUY2.

FormatUyvy 

UYVY.

FormatArgb32 

32-bit ARGB

FormatBgra32 

32-bit BGRA

FormatRgb24 

24-bit RGB

FormatAbgr32 

32-bit ABGR

FormatMjpeg 

M-JPEG.

FormatRgba32 

32-bit RGBA

◆ VideoContentHint

Defines the settings passed into the VideoCapturer.SetVideoContentHint(VideoContentHint contentHint) method.

Enumerator
NONE 

No hint is provided (the default).

MOTION 

The track should be treated as if it contains video where motion is important.

DETAIL 

The track should be treated as if video details are extra important. For example, you may use this setting for a stream that contains text content, painting, or line art.

TEXT 

The track should be treated as if video details are extra important, and that significant sharp edges and areas of consistent color can occur frequently. For example, you may use this settting for a stream that contains text content.

◆ VideoSourceType

Defines options for the Publisher.VideoSourceType property.

Enumerator
Camera 

A camera video source.

Screen 

A screen-sharing video source.

Custom 

A custom video source. The custom stream video type applies only to Web generated streams.