Suggestions

close search

StringeeCall2

public class StringeeCall2
extends Object



Represents a voice, video call.
Used to capture an audio-video stream from the device's microphone and camera for use to make or answer a call. Create a StringeeCall2 instance by calling the StringeeCall2 constructor.



Summary


Nested classes
public static class StringeeCallStats

Used to get the call's statistics.

public static enum SignalingState

Defines values for the state of the call.

public static enum MediaState

Defines values for the call media state.

public interface StringeeCallListener

Monitors the call's event.

public interface CallStatsListener

Monitors the call states and medias.

Public Constructors
StringeeCall2(StringeeClient client, String from, String to)

Creates a new StringeeCall2 instance to make a call.

Public methods
void answer()

Answers a call and starts the conversation.

void enableVideo(boolean enable)

Enables or disables the local video stream.

String getCallId()

Returns the id of the call.

int getCallStatus()

Returns the call's state.

String getCustomDataFromYourServer()

Returns the custom data from your server.

String getFrom()

Returns the caller's id or phone number.

org.webrtc.SurfaceViewRenderer getLocalView()

Returns the view which Stringee SDK renders local video to.

org.webrtc.SurfaceViewRenderer getRemoteView()

Returns the view which Stringee SDK renders remote video to.

void getStats(CallStatsListener statsListener)

Get the call's statistics.

String getTo()

Returns the callee's id or phone number.

void hangup()

Terminates a call.

void ringing(StatusListener listener)

Connect to call and send ringing signal.

boolean isVideoCall()

Check whether the call is a video call.

void makeCall()

Makes a call.

void mute(boolean mute)

Toggle audio on or off.

void reject()

Reject a call.

void renderLocalView(boolean isMediaOverlay)

Displays the caller's video.

void renderRemoteView(boolean isMediaOverlay)

Displays the callee's video.

void sendCallInfo(JSONObject info)

Sends any data in JSON format to other clients.

void setCustom(String custom)

Set a customizable text of the call. This text will be sent to Stringee server. Then Stringee server sends it to Your Server via the project's answer_url.

void setCallListener(StringeeCallListener callListener)

Set a StringeeCall2.StringeeCallListener object to monitor the call's event'.

void setQuality(int quality)

Set the video call's quality.

void setVideoCall(boolean videoCall)

By defalt, a Stringee call is a voice call.

void switchCamera(StatusListener listener)

Switches the device's camera.

void resumeVideo()

Resume local stream.

void startCaptureScreen(StringeeScreenCapture capture, StatusListener listener)

Start capture screen.

void startCaptureScreen(StringeeScreenCapture capture, int requestCode, StatusListener listener)

Start capture screen.

void stopCaptureScreen(StatusListener listener)

Stop capture screen.


Public constructors


StringeeCall2

StringeeCall2(StringeeClient client, String from, String to)

Creates a new StringeeCall2 instance to make a call.

Parameters
client

The client who wants to make or answer a call.

from

The caller's alias to be displayed to the callee (app-to-app call) or the number you've bought (app-to-phone call).

to

The user id of the callee.




Public methods


answer

void answer()

Answers a call and starts the conversation.



enableVideo

void enableVideo(boolean enable)

Enable or disable local video stream.

Parameters
enable

True to enable or false to disable video stream.



getCallId

String getCallId()

Returns the id of the call. The id is generated on Stringee server and passed to the caller via the StringeeCall2.StringeeCallStateListener.onStateChange interface or to callee via the StringeeConnectionListener.onIncomingCall interface.



getCallStatus

int getCallStatus()

Returns the call's state. The call's state can be StringeeConstant.STATE_CONNECTING, StringeeConstant.STATE_RINGING, StringeeConstant.STATE_START, StringeeConstant.STATE_BUSY, StringeeConstant.STATE_END



getCustomDataFromYourServer

String getCustomDataFromYourServer()

Returns the custom data from your server when a client makes a call or receives an incoming call.



getFrom

String getFrom()

Returns the caller's id or phone number.



getLocalView

org.webrtc.SurfaceViewRenderer getLocalView()

Returns the view which Stringee SDK renders local video to. You can add this view as a child of ViewGroup objects in your app.



getRemoteView

org.webrtc.SurfaceViewRenderer getRemoteView()

Returns the view which Stringee SDK renders remote video to. You can add this view as a child of ViewGroup objects in your app.



getStats

void getStats(CallStatsListener statsListener)

Get the call's statistics such as: bytesReceived, packetsReceived, packetsLost. The call statistics are returned in a StringeeCall2.StringeeCallStats object via statsListener.onCallStats(StringeeCallStats statsReport).

Parameters
statsListener

A CallStatsListener instance.



getTo

String getTo()

Returns the callee's id or phone number.



hangup

void hangup()

Terminates a call. This method must be called when you hangs up to release resources. Otherwise, the memory is leaked.



ringing

void ringing(StatusListener listener)

Connect to call and send ringing signal.

Parameters
StatusListener

A StatusListener instance.



isVideoCall

boolean isVideoCall()

Check whether the call is a video call.



makeCall

void makeCall()

Makes a call.



mute

void mute(boolean mute)

Toggle audio on or off

Parameters
mute

True to toggle audio off or false to toggle audio on.



reject

void reject()

Reject a call.



renderLocalView

void renderLocalView(boolean isMediaOverlay)

Displays the caller's video.

Parameters
isMediaOverlay

Control whether the video is placed on top of another regular surface view in the window.



renderRemoteView

void renderRemoteView(boolean isMediaOverlay)

Displays the callee's video.

Parameters
isMediaOverlay

Control whether the video is placed on top of another regular surface view in the window.



sendCallInfo

int sendCallInfo(JSONObject info)

Sends any data in JSON format to other clients.

Parameters
info

Data in JSON format to be sent.



setCustom

void setCustom(String custom)

Set a customizable text of the call. This text will be sent to Stringee server. Then Stringee server sends it to Your Server via the project's answer_url.

Parameters
custom

The customizable text.



setCallListener

void setCallListener(StringeeCallListener callListener)

Set a StringeeCall2.StringeeCallListener object to monitor the call's event.

Parameters
callListener

A StringeeCallListener instance.



setQuality

void setQuality(int quality)

Set the video call's quality. The quality can be: StringeeConstant.QUALITY_NORMAL, StringeeConstant.QUALITY_HD, StringeeConstant.QUALITY_FULLHD.

Parameters
quality

The quality of video.



setVideoCall

void setVideoCall(boolean videoCall)

By defalt, a Stringee call is a voice call. If you want to make a video call, call the setVideoCall(true) after instantiating a StringeeCall2 instance.

Parameters
videoCall

True for video call, false for audio call.



switchCamera

void switchCamera(StatusListener listener)

Switches the device's camera. By defalt, Stringee SDK uses the front camera.

Parameters
listener

A StatusListener instance.



resumeVideo

void resumeVideo()

Resume local stream.

startCaptureScreen (require android api >= 21)

void startCaptureScreen(StringeeScreenCapture capture, StatusListener listener)

Start capture screen.

Parameters
capture

A StringeeScreenCapture instance.

listener

A StatusListener instance.



startCaptureScreen (require android api >= 21)

void startCaptureScreen(StringeeScreenCapture capture, int requestCode, StatusListener listener)

Start capture screen.

Parameters
capture

A StringeeScreenCapture instance.

requestCode

A request code.

listener

A StatusListener instance.



stopCaptureScreen (require android api >= 21)

void stopCaptureScreen(StatusListener listener)

Stop capture screen.

Parameters
listener

A StatusListener instance.