Initialize the Voxeet SDK
Two methods are currently available to initialize the SDK:
- Set the API keys in the app
- Use an OAuth2 server to provide the keys
initialize
with keys
Initialize the SDK with your Voxeet user information.
Parameters
context
ApplicationContext - A NonNull ApplicationContext.consumerKey
string - The consumer key for your app from your developer account dashboard.consumerSecret
string - The consumer secret for your app from your developer account dashboard.-
userInfo
object - A Nullable UserInfo object that contains custom user information.userInfo.name
string - The user name.userInfo.externalId
string - An external ID for the user.userInfo.avatarUrl
string - An avatar URL for the user.
Example
UserInfo externalInfo = new UserInfo(externalName, externalName, externalPhotoUrl);
VoxeetSdk.sdkInitialize(context, consumerKey, consumerSecret, externalInfo);
initialize
with OAuth2
Initialize the SDK with a valid token and a method to refresh it.
Parameters
context
ApplicationContext - A NonNull ApplicationContext.tokenAccess
string - A valid tokenAccess obtained from your own Oauth2 server.consumerSecret
callable- A callback which will return a valid tokenAccess when called from the SDK. -
userInfo
object - A Nullable UserInfo object that contains custom user information.userInfo.name
string - The user name.userInfo.externalId
string - An external ID for the user.userInfo.avatarUrl
string - An avatar URL for the user.
Example
UserInfo externalInfo = new UserInfo(externalName, externalName, externalPhotoUrl);
Callable<String> tokenRefresh = new Callable<String>() {
@Override
public String call() throws Exception {
//retrofitService is a valid proxy object from a Retrofit interface
return retrofitService.toBlocking().single();
}
};
VoxeetSdk.sdkInitialize(context, tokenAccess, tokenRefresh, externalInfo);
register
Register your app with the SDK.
Parameters
context
context - A NonNull Context.object
object - An object that will receive EventBus events.
VoxeetSdk.getInstance().register(context, object);
Parameters
context
context - A NonNull context.object
object - An object that will receive EventBus messages.
Conferences
Main access: VoxeetSdk.getInstance().getConferenceService()
create
Create a conference.
Returns
Promise<status: Boolean | Error>
- The conference is created.
Example
VoxeetSdk.getInstance().getConferenceService().create()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
join
Join a conference. If the conference doesn't exist, it is created.
If you previously used create
, the conference parameters in the joinConference
object are ignored.
Parameters
conference
string - The ID or alias of the conference to join.
Returns
Promise<status: Boolean | Error>
- The conference is joined.
Example
VoxeetSdk.getInstance().getConferenceService().join(conferenceAlias)
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
leaveConference
Leave the currently running conference.
Returns
Promise<status: Boolean | ConferenceLeftError>
- The conference is left or an error occurred.
If an error occurs, the session is properly left in the client. There is no need to recheck the leaveConference
status.
Example
VoxeetSdk.getInstance().getConferenceService().leave()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
listenConference
Listen to a conference without sharing your audio or video.
Parameters
conference
string - The ID or alias of the conference to listen to.
Returns
Promise<status: Boolean | InConferenceException | PromiseConferenceJoinedErrorException>
- The conference is joined in listener mode.
Example
VoxeetSdk.getInstance().getConferenceService().listenConference(conferenceAlias)
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
Replay conferences
replayConference
Replay a recorded conference.
Parameters
conferenceId
string - The ID of the conference you want to replay.
Returns
Promise<status: Boolean>
- The conference replay is starting.
Example
VoxeetSdk.getInstance().getConferenceService().listenConference(conferenceAlias)
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
Record conferences
startRecording
Record the current conference so you can replay it after it ends.
Returns
Promise<status: Boolean | Exception>
- Resolve if no network error occurred.
Example
VoxeetSdk.getInstance().getConferenceService().startRecording()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
stopRecording
Stop the current recording.
Returns
Promise<status: Boolean | Exception>
- Resolve if no network error occurred.
Example
VoxeetSdk.getInstance().getConferenceService().stopRecording()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
Audio and video devices
Main access: VoxeetSdk.getInstance().getConferenceService()
getAvailableRoutes
Retrieve the available routes the SDK can use.
Returns
List<Media.AudioRoute>
- A list of every AudioRoute.
Example
List<Media.AudioRoute> routes = VoxeetSdk.getInstance().getConferenceService().getAvailableRoutes();
getNameOfFrontFacingDevice
Retrieve the name of the front-facing camera.
Returns
String?
- The name of the device (or "null" if unavailable).
Example
String front = CameraEnumerationAndroid.getNameOfBackFacingDevice();
getNameOfBackFacingDevice
Retrieve the name of the back-facing camera.
Returns
String?
- The name of the device (or "null" if unavailable).
Example
String back = CameraEnumerationAndroid.getNameOfBackFacingDevice();
setDefaultCamera
Set the camera device to use during the conference.
The device must be set before starting the video.
Parameters
cameraName
string - The name of the camera device to use.
Example
VoxeetSdk.getInstance().getConferenceService()
.setDefaultCamera(CameraEnumerationAndroid.getNameOfBackFacingDevice());
setAudioRoute
Set the AudioRoute to use when the conference is already started.
The conference must be started to use this method.
Parameters
audioRoute
Media.AudioRoute - The valid AudioRoute to use.
Returns
boolean
- Whether the output can be changed.
Example
VoxeetSdk.getInstance().getConferenceService()
.setAudioRoute(Media.AudioRoute.ROUTE_SPEAKER);
mute
Mute the microphone currently in use in the conference.
The conference must be started to use this method.
Parameters
state
Boolean - Iftrue
, the microphone is currently muted. Otherwise,false
.
Returns
boolean
- Whether the microphone is mute.
Example
VoxeetSdk.getInstance().getConferenceService()
.muteConference(true);
muteUser
Mute or unmute the specified user.
The conference must be started to use this method.
Parameters
userId
string - The ID of the user you want to mute or unmute.state
Boolean -true
if the user is muted. Otherwise,false
.
Returns
boolean
- Whether the user is muted or unmuted.
Example
String userId = "d0d237d9-1b1a-47b4-8fae-ae9cb3ce20c9";
VoxeetSdk.getInstance().getConferenceService().muteUser(userId, true);
isVideoOn
Check whether the video (camera) is turned on.
The conference must be started to use this method.
Returns
boolean
- Whether the current camera is turned on.
Example
boolean video_on = VoxeetSdk.getInstance().getConferenceService().isVideoOn();
startVideo
Start the selected or default video (camera).
The conference must be started to use this method.
Returns
Promise<Boolean | Exception>
- A Promise to resolve with the result.
Example
VoxeetSdk.getInstance().getConferenceService().startVideo()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
stopVideo
Stop the current video (camera).
The conference must be started to use this method.
Returns
Promise<Boolean | Exception>
- A Promise to resolve with the result.
Example
VoxeetSdk.getInstance().getConferenceService().stopVideo()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
switchCamera
Change the device camera (front to back or back to front).
The conference must be started to use this method.
Returns
Promise<Boolean | Exception>
- A Promise to resolve with the result.
Example
VoxeetSdk.getInstance().getConferenceService().switchCamera()
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
Manage users
invite
Invite a list of users to the current conference.
The conference must be started to use this method.
Parameters
ids
List- A valid list of IDs for users to invite. The list can be empty.
Returns
Promise<List<ConferenceRefreshedEvent> | Exception>
- A Promise to resolve with the result for each user ID.
Example
List<String> ids = new ArrayList();
ids.add("c55754af-eb79-42bf-8205-142660e34610");
VoxeetSdk.getInstance().getConferenceService().invite(ids)
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable List<ConferenceRefreshedEvent> refreshed_list, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
setUserPosition
Set user position for the spatialized audio mode.
The conference must be started to use this method.
Parameters
id
string - The ID for the user whose position you want to set.angle
double - The user's X position. Must be a value between-1.0
and1.0
.distance
double - The user's Y position. Must be a value between0.0
and1.0
.
Returns
boolean
- If true
, the user's position was successfully changed. Otherwise, false
.
Example
VoxeetSdk.getInstance().getConferenceService().setUserPosition(ids, 3*Math.PI/4, 12);
getPeerVuMeter
Retrieve the current VU value for the specified user.
The conference must be started to use this method.
Parameters
id
String - The ID for the user whose VU value you want to retrieve.
Returns
int
- The user's current VU value.
Example
int value = VoxeetSdk.getInstance().getConferenceService().getPeerVuMeter("c55754af-eb79-42bf-8205-142660e34610");
Broadcast messages
sendConferenceMessage
Broadcast message to all conference participants.
Parameters
message
string - The message to broadcast.
Returns
Promise<status: Boolean | Exception>
- Resolve the current message status.
Example
VoxeetSdk.getInstance().getConferenceService().sendBroadcastMessage(message)
.then(new PromiseExec<Boolean, Object>() {
@Override
public void onCall(@Nullable Boolean aBoolean, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
File-sharing
convertFile
Convert files users select through an input file box.
Parameters
file
file - A file object.
Returns
Promise<status: FilePresentationConverted | Exception>
- A representation of the converted file.
Example
VoxeetSdk.getInstance().getFilePresentationService().convertFile(file)
.then(new PromiseExec<FilePresentationConverted, Object>() {
@Override
public void onCall(@Nullable FilePresentationConverted converted_object, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
startPresentation
Start a file presentation.
Parameters
file
file - A file object.position
integer - The page in the file to present.
Returns
Promise<status: FilePresentationStarted | Exception>
- Presentation started or exception.
Example
VoxeetSdk.getInstance().getFilePresentationService().startFilePresentation(converted_file)
.then(new PromiseExec<FilePresentationStarted, Object>() {
@Override
public void onCall(@Nullable FilePresentationStarted started_object, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
updatePresentation
Update the current file presentation.
Parameters
fileId
string - The ID of the file to update.offset
integer - The new page to present.
Returns
Promise<status: FilePresentationUpdated | Exception>
- The presentation updated.
Example
VoxeetSdk.getInstance().getFilePresentationService().updateFilePresentation(fileId)
.then(new PromiseExec<FilePresentationUpdated, Object>() {
@Override
public void onCall(@Nullable FilePresentationUpdated updated_presentation, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
stopPresentation
Stop the current file presentation.
Parameters
fileId
string - The ID of the file you want to stop presenting.
Returns
Promise<status: FilePresentationStopped | Exception>
- Presentation stopped or exception.
Example
VoxeetSdk.getInstance().getFilePresentationService().stopFilePresentation(fileId)
.then(new PromiseExec<FilePresentationStopped, Object>() {
@Override
public void onCall(@Nullable FilePresentationStopped stopped_object, @NonNull Solver<Object> solver) {
}
})
.error(new ErrorPromise() {
@Override
public void onError(@NonNull Throwable throwable) {
}
});
getThumbnail
Retrieve a thumbnail image URL for a file page.
Parameters
fileId
string - The ID for the corresponding file.pageNumber
integer - The file page number to retrieve.
Returns
String
- The valid URL.
Example
String thumbnail_url = VoxeetSdk.getInstance().getFilePresentationService().getThumbnail(fileId, pageId);
getImage
Retrive an image for a file page.
Parameters
fileId
string - The ID for the corresponding file.pageNumber
integer - The file page number to retrieve.
Returns
String
- The valid URL.
Example
String image_url = VoxeetSdk.getInstance().getFilePresentationService().getImage(fileId, pageId);
Events
Conference events
ConferenceCreationSuccess
Sent when the conference is successfully created.
ConferenceCreatedError
Sent when the conference creation fails.
ConferenceJoinedSuccessEvent
Sent when a user joins the conference.
ConferenceJoinedError
Sent when a user could not join the conference.
ConferenceLeftSuccessEvent
Sent when a user leaves the conference.
ConferenceLeftError
Sent when a user leaves the conference, but with errors.
ConferenceEndedEvent
Sent when the conference is ended.
GetConferenceStatusErrorEvent
Sent when the conference status could not be retrieved.
GetConferenceHistoryEvent
Sent with the history of the conference.
GetConferenceHistoryErrorEvent
Sent when the conference history could not be retrieved.
CameraSwitchSuccessEvent
Sent when a user's camera was successfully switched.
CameraSwitchErrorEvent
Sent when a user's camera could not be switched.
SubscribeConferenceEvent
Sent when a subscription to the specified conference is dispatched.
SubscribeConferenceErrorEvent
Sent when a subscription to the specified conference could not be dispatched.
UnSubscribeConferenceAnswerEvent
Sent when an unsubscribe request for the conference could not be dispatched.
UnSubscribeConferenceAnswerEvent
Sent with an unsubscribe request answer.
SubscribeForCallConferenceAnswerEvent
Sent with a subscription for call answers.
SubscribeForCallConferenceErrorEvent
Sent after a call subscription fails.
UnSubscribeFromConferenceAnswerEvent
Sent after a sucessful call unsubscribe request.
UnsubscribeFromCallConferenceErrorEvent
Sent after a call unsubscribe request fails.
SendBroadcastResultEvent
Sent with the result of a broadcast message.
QualityIndicators
Sent with the conference status.
ConferenceUserQualityUpdatedEvent
Sent with the quality of the specified user in the conference.
Participant events
ConferenceUserJoinedEvent
Sent when a user joins the conference.
ConferenceUserUpdatedEvent
Sent when a user is updated.
ConferenceUserLeftEvent
Sent when a user leaves the conference.
AddConferenceParticipantResultEvent
Sent when a specific user is added to the conference.
ConferenceRefreshedEvent
Sent when conference user information is refreshed.
ConferenceUsersInvitedEvent
Sent when the list of users is invited.
ConferenceUserCallDeclinedEvent
Sent when a user declines the conference.
DeclineConferenceResultEvent
Sent when the server declines a dispatch from the device.
Recording events
StartRecordingResultEvent
Sent when the conference recording starts.
StopRecordingResultEvent
Sent when the conference recording stops.
RecordingStatusUpdateEvent
Sent when the conference recording status is changed.
ReplayConferenceErrorEvent
Sent when the conference replay cannot start.
Video events
StartVideoAnswerEvent
Sent when the video starts.
StopVideoAnswerEvent
Sent when the video cannot start.
Screen-sharing events
ScreenStreamAddedEvent
Sent when screen-sharing from another conference participant is received.
ScreenStreamRemovedEvent
Sent when screen-sharing from another participant stops.
Permissions events
PermissionRefusedEvent
Sent when the app should request a specific user permission.
User events
SdkLogoutSuccessEvent
Sent when a user is successfully logged out from the SDK.
SdkLogoutErrorEvent
Sent in case of a logout with network issues.
In this case, the user can still receive push notifications in Firebase implementations.
File-sharing events
FileConvertedEvent
Sent when a file is converted.
FilePresentationStartEvent
Sent when a file presentation is dispatched from the server.
FilePresentationStopEvent
Sent when a file presentation stops from the server.