public interface

MediaListener

sg.com.temasys.skylink.sdk.listener.MediaListener
Known Indirect Subclasses

Class Overview

Listener comprises of callbacks related to audio / video manipulation during the call.

Summary

Public Methods
abstract void onChangeLocalMedia(SkylinkMedia localMedia)
This is triggered when a local media has been changed.
abstract void onChangeRemoteMedia(SkylinkMedia remoteMedia, String remotePeerId)
This is triggered when a specific remote peer has changed his media.
abstract void onChangeVideoSize(Point size, SkylinkMedia media, String peerId)
This is triggered when any of the given video streams' frame size changes.
abstract void onCreateLocalMedia(SkylinkMedia localMedia)
This is triggered when the framework successfully captures the device's media input.
abstract void onDestroyLocalMedia(SkylinkMedia localMedia)
This is triggered when a specific local media object is destroyed
abstract void onObtainInputVideoResolution(int width, int height, int fps, SkylinkCaptureFormat captureFormat, String mediaId)
This is triggered when a local camera starts to capture video, or when it's video dimension changes, if isReportVideoResolutionOnVideoChange() is true.
abstract void onObtainReceivedVideoResolution(int width, int height, int fps, String mediaId, String remotePeerId)
This is triggered when we receive a remote Peer's video, or when remote video dimension changes, if isReportVideoResolutionOnVideoChange() is true.
abstract void onObtainSentVideoResolution(int width, int height, int fps, String mediaId, String remotePeerId)
This is triggered when a local video stream starts being sent to a remote Peer, or when local video dimension changes, if isReportVideoResolutionOnVideoChange() is true.
abstract void onReceiveRemoteMedia(SkylinkMedia remoteMedia, String remotePeerId)
This is triggered upon receiving a media object of the remote peer if the connection is configured to have media configuration This will only be triggered after onConnectWithRemotePeer has triggered.

Public Methods

public abstract void onChangeLocalMedia (SkylinkMedia localMedia)

This is triggered when a local media has been changed. For eg, mute/unmute audio/video, stop/start video Note: - For destroyed local media, the callback onDestroyLocalMedia(SkylinkMedia) will be triggered

Parameters
localMedia The local media object with new value such as new state

public abstract void onChangeRemoteMedia (SkylinkMedia remoteMedia, String remotePeerId)

This is triggered when a specific remote peer has changed his media. For eg, mute/unmute audio/video, stop/start video, destroy audio/video Note: - For destroyed remote media, the remote media's state will be UNAVAILABLE

Parameters
remoteMedia The remote media object with new value such as new state
remotePeerId The id of the remote peer that the media comes from

public abstract void onChangeVideoSize (Point size, SkylinkMedia media, String peerId)

This is triggered when any of the given video streams' frame size changes. It includes the self stream also.

Parameters
size Size of the video frame
media The media video object
peerId The id of the peer. If null, it indicates self peer.

public abstract void onCreateLocalMedia (SkylinkMedia localMedia)

This is triggered when the framework successfully captures the device's media input. This may be at the start of media usage or when media source has been changed. It can happen only if the connection is configured to have a media configuration.

Parameters
localMedia the local media object

public abstract void onDestroyLocalMedia (SkylinkMedia localMedia)

This is triggered when a specific local media object is destroyed

Parameters
localMedia The local media object that was destroyed

public abstract void onObtainInputVideoResolution (int width, int height, int fps, SkylinkCaptureFormat captureFormat, String mediaId)

This is triggered when a local camera starts to capture video, or when it's video dimension changes, if isReportVideoResolutionOnVideoChange() is true. The current resolution of the video being captured by the local camera and the SkylinkCaptureFormat used will be provided. Note: This might be different from the resolution of the video actually sent to Peers as WebRTC may adjust resolution dynamically to try to match its bandwidth criteria. If a particular value is not available, , e.g. if video is not capturing, a negative integer or a null value will be provided.

Parameters
width Video width in pixels of local captured video.
height Video height in pixels of local captured video.
fps Video frame per second of local captured video.
captureFormat The SkylinkCaptureFormat that is currently used by the camera. Null when it cannot be obtained, for e.g. when user input wrong mediaId, or improper captureFormat
mediaId id of the local media that video resolution comes from

public abstract void onObtainReceivedVideoResolution (int width, int height, int fps, String mediaId, String remotePeerId)

This is triggered when we receive a remote Peer's video, or when remote video dimension changes, if isReportVideoResolutionOnVideoChange() is true. The current resolution of the video received from a specific Peer will be provided. If a particular value is not available, a negative integer will be provided.

Parameters
width Video width in pixels of remote Peer's video received by us.
height Video height in pixels of remote Peer's video received by us.
fps Video frame per second of remote Peer's video received by us.
mediaId id of the remote media object that the video resolution comes from
remotePeerId PeerId of the remote Peer whose Video Resolution we are obtaining.

public abstract void onObtainSentVideoResolution (int width, int height, int fps, String mediaId, String remotePeerId)

This is triggered when a local video stream starts being sent to a remote Peer, or when local video dimension changes, if isReportVideoResolutionOnVideoChange() is true. The current resolution of the video being sent to a specific Peer will be provided. Note: This might be different from the resolution of the video actually captured by local camera as WebRTC may adjust resolution dynamically to try to match its bandwidth criteria. If a particular value is not available, a negative integer will be provided.

Parameters
width Video width in pixels of local video sent to remote Peer.
height Video height in pixels of local video sent to remote Peer.
fps Video frame per second of local video sent to remote Peer.
mediaId id of the media that video resolution comes from
remotePeerId PeerId of the remote Peer whom we are obtaining Video Resolution for the video we are sending.

public abstract void onReceiveRemoteMedia (SkylinkMedia remoteMedia, String remotePeerId)

This is triggered upon receiving a media object of the remote peer if the connection is configured to have media configuration This will only be triggered after onConnectWithRemotePeer has triggered.

Parameters
remoteMedia the remote media object
remotePeerId The id of the remote peer