OpenTok Android SDK reference

The OpenTok Android SDK includes the following classes:

Class Description
AudioData
AudioDeviceManager You can only define a single audio capture source and rendering target for the app. You cannot set these individually for each publisher and subscriber. You can, however, set the audio bitrate for a published stream using the PublisherKit.Builder.audioBitrate(int) method.
BaseAudioDevice Call this method before you connect to a session.
BaseAudioDevice.AudioBus
BaseAudioDevice.AudioFocusManager On external audio focus management, Vonage SDK will not handle automatically the audio output routing. When using ConnectionServices, you should leverage the Telecom framework's built-in audio routing capabilities. The platform provides your app with a unified list of the audio routes which are avai
BaseAudioDevice.AudioSettings Currently, the only available sample format is signed 16-bit integer PCM.
BaseAudioDevice.BluetoothState
BaseAudioDevice.OutputMode
BaseVideoCapturer
BaseVideoCapturer.CaptureSettings
BaseVideoCapturer.CaptureSwitch If you are using a custom video capturer, implement the CaptureSwitch interface in the object that extends BaseVideoCapturer. Then implement the cycleCamera() method to define the behavior of the Publisher.cycleCamera() method for the Publisher object that uses the video capturer.
BaseVideoCapturer.VideoContentHint You can read more about these options in the W3C Working Draft .
BaseVideoRenderer You can extend this class and override this method to support other styles and behaviors.
BaseVideoRenderer.Frame
CaCertificates
Connection To initialize a session, call the Session() constructor, which returns the Session object. Then call the connect() method of the Session object to connect to the session. When the connection to the session is made, the Session.SessionListener.onConnected(Session session) method is called.
MediaUtils
MediaUtils.SupportedCodecs
MediaUtils.VideoCodecType
MuteForcedInfo
NetworkDegradationSource
NetworkDegradationSource.Source
OpentokError Check the values returned by getErrorCode() and getMessage() for details on the error.
OpentokError.Domain
OpentokError.ErrorCode
PermissionsUtils
Publisher When the view of a Publisher leaves the active window, the Publisher object is destroyed. This is the case for an activity that is stopped or paused.
Publisher.Builder Use the Session.publish(PublisherKit publisher) method to start streaming from the publisher into a session.
Publisher.CameraCaptureFrameRate Note that in sessions that use the OpenTok Media Router (sessions with the media mode set to routed), lowering the frame rate proportionally reduces the bandwidth the stream uses. However, in sessions that have the media mode set to relayed, lowering the frame rate does not reduce the stream's bandw
Publisher.CameraCaptureResolution
Publisher.CameraListener
PublisherKit Create a subclass of PublisherKit if you are interested in providing your own video capturing and rendering implementation. Otherwise, use the Publisher class, which includes a pre-built video capturer and renderer.
PublisherKit.AudioLevelListener
PublisherKit.AudioStatsListener
PublisherKit.AudioTransformer Important: In version 2.27.2+ of the Vonage Video client SDK for Android, you need to add the Vonage Media Library separately from the Vonage Video Android SDK. For details, see Vonage Media Library integration . Check additional information in the Transformers Package README.md file.
PublisherKit.Builder Use the Session.publish(PublisherKit publisher) method to start streaming from the publisher into a session.
PublisherKit.CustomAudioTransformer
PublisherKit.CustomVideoTransformer
PublisherKit.DegradationPreference
PublisherKit.MediaLinkStatsListener Called periodically to report media link statistics for the publisher. It provides transport-level metrics.
PublisherKit.MuteListener
PublisherKit.PreferredVideoCodecs
PublisherKit.PreferredVideoCodecs.Codec
PublisherKit.PublisherAudioStats
PublisherKit.PublisherKitVideoType
PublisherKit.PublisherListener
PublisherKit.PublisherMediaLinkStats Since video and audio share the same underlying transport, this class consolidates the local transport statistics into a single object.
PublisherKit.PublisherRtcStats Here is a partial sample:
PublisherKit.PublisherRtcStatsReportListener
PublisherKit.PublisherVideoStats
PublisherKit.VideoBitratePreset These presets apply predefined strategies to control video bitrate in the publisher's stream. Preset configurations and manual bitrate settings are mutually exclusive.
PublisherKit.VideoLayerStats In a simulcast configuration, each entry corresponds to one independent video encoding (for example, low-, medium-, and high-resolution streams sent in parallel). For SVC (Scalable Video Coding), the publisher typically sends a single video encoding, with scalability (temporal, spatial, or both) int
PublisherKit.VideoListener This method is mainly called when connection quality degrades.
PublisherKit.VideoStatsListener The PublisherKit.PublisherVideoStats object includes properties. properties for the video bytes received, video packets lost, and video packets received for the publisher.
PublisherKit.VideoTransformer Important: In version 2.27.2+ of the Vonage Video client SDK for Android, you need to add the Vonage Media Library separately from the Vonage Video Android SDK. For details, see Vonage Media Library integration . Check additional information in the Transformers Package README.md file.
Session When you create the Session instance, you pass in the OpenTok session ID, token, and API key. You get an API key when you sign up for an OpenTok account. For test purposes, you can generate test session IDs and tokens by logging in to your Vonage Video API account . Use the OpenTok server-side libra
Session.ArchiveListener
Session.Builder The default value is false .
Session.Builder.IceServer
Session.Builder.IncludeServers
Session.Builder.TransportPolicy
Session.Capabilities For example, if you connect to a session using a token that is assigned a Subscriber role, the canPublish property of this object is set to false (and the client does not have privileges to publish to the session). For more information, see the OpenTok token documentation.
Session.ConfigurableSessionOptions
Session.ConnectionListener
Session.MuteListener
Session.ReconnectionListener In response to this method being called, you may want to provide a user interface notification, to let the user know that the app is trying to reconnect to the session and that audio-video streams are temporarily disconnected.
Session.SessionListener This method is called if the attempt to connect to the session fails. It is also called if the connection to the session drops due to an error after a successful connection, and in this case the method is called just before the onDisconnected(Session session) method is called.
Session.SessionOptions
Session.SessionOptionsProvider
Session.SignalListener
Session.StreamCaptionsPropertiesListener
Session.StreamPropertiesListener
Stream The Session.SessionListener.onStreamDropped(Session session, Stream stream) method notifies when streams are unpublished the session.
Stream.StreamVideoType
Subscriber
Subscriber.Builder Use the Session.subscribe(SubscriberKit subscriber) method to start streaming video for the subscriber.
SubscriberKit The stream property references the stream that you have subscribed to. The SubscriberKit class includes methods that let you disable and enable local audio and video playback for the subscribed stream.
SubscriberKit.AudioLevelListener
SubscriberKit.AudioStatsListener
SubscriberKit.Builder Use the Session.subscribe(SubscriberKit subscriber) method to start streaming video for the subscriber.
SubscriberKit.CaptionsListener
SubscriberKit.MediaLinkStatsListener Called periodically to report media link statistics for the subscriber. It provides transport-level metrics for both the local subscriber and the remote publisher.
SubscriberKit.SenderStats
SubscriberKit.StreamListener In response to this method being called, you may want to provide a user interface notification, to let the user know that the audio-video stream is temporarily disconnected and the app is trying to reconnect to the stream.
SubscriberKit.SubscriberAudioStats
SubscriberKit.SubscriberListener
SubscriberKit.SubscriberMediaLinkStats
SubscriberKit.SubscriberRtcStatsReportListener Here is a partial sample:
SubscriberKit.SubscriberVideoStats
SubscriberKit.VideoListener This feature is only available in sessions that use the OpenTok Media Router (sessions with the media mode set to routed), not in sessions with the media mode set to relayed. (See The OpenTok Media Router and media modes ).
SubscriberKit.VideoStatsListener Listener for quality-related video events for a subscriber.
TransportStats
TransportStats.NetworkCondition
VideoUtils
VideoUtils.Size