public class

MediaAdapter

extends Object
implements MediaListener
java.lang.Object
   ↳ sg.com.temasys.skylink.sdk.adapter.MediaAdapter

Summary

Public Constructors
MediaAdapter()
Public Methods
void onChangeLocalMedia(SkylinkMedia localMedia)
This is triggered when a local media has been changed.
void onChangeRemoteMedia(SkylinkMedia remoteMedia, String remotePeerId)
This is triggered when a specific remote peer has changed his media.
void onChangeVideoSize(Point size, SkylinkMedia media, String remotePeerId)
This is triggered when any of the given video streams' frame size changes.
void onCreateLocalMedia(SkylinkMedia localMedia)
This is triggered when the framework successfully captures the device's media input.
void onDestroyLocalMedia(SkylinkMedia localMedia)
This is triggered when a specific local media object is destroyed
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.
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.
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.
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(String, UserInfo, boolean) has been triggered.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sg.com.temasys.skylink.sdk.listener.MediaListener

Public Constructors

public MediaAdapter ()

Public Methods

public 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 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 void onChangeVideoSize (Point size, SkylinkMedia media, String remotePeerId)

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 was changed to.
media The media video object
remotePeerId The id of the peer. If null, it indicates self peer.

public 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, can be audio, video camera or video screen

public void onDestroyLocalMedia (SkylinkMedia localMedia)

This is triggered when a specific local media object is destroyed

Parameters
localMedia The local media object that was destroyed, the media state will be UNAVAILABLE

public 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 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 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 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(String, UserInfo, boolean) has been triggered.

Parameters
remoteMedia the remote media object, can be audio, video camera or video screen
remotePeerId The id of the remote peer