MeetingEngine is the public business entry point of the SMeeting Android SDK, created with MeetingEngine.create(application). It handles SDK initialization and release, pre-meeting management, entering and exiting meetings, in-meeting controls, local media, sharing, messages, and remote media subscription.
Usage notes
- Each call to
MeetingEngine.create(application)creates one Engine instance. Your app should hold a single instance in one place within the process and callrelease()when it’s no longer needed. - The current public API uses a single-meeting model: one Engine can have only one meeting that is being entered or active at a time; entering again returns
MeetingErrorCode.SESSION_ALREADY_ACTIVE. - A successful entry returns MeetingEnterInfo; in-meeting capabilities are then still called through the current
MeetingEngine. - All asynchronous result callbacks stay on the thread they actually come from; the main thread is not guaranteed. Switch to the main thread before updating the UI.
- The failure method of
MeetingResultCallback/MeetingValueResultCallback<T>isonFailure(errorCode, message).messageis for diagnostics only and shouldn’t be shown to users directly. roomEvent,userEvent,mediaEvent, andmessageEventare bound to the current meeting and cleared when you exit the meeting; assign them again to receive events for the next meeting. Engine, IM, and device events share the Engine’s lifecycle.
Creation and version
create(app)
MeetingEngine instance.
Parameters:
Returns: The newly created
MeetingEngine.
version()
x.y.z.
buildTime()
Manager properties
infosManager
rollCallManager
SESSION_NOT_ACTIVE through the callback. See RollCallManager.
signInManager
SESSION_NOT_ACTIVE through the callback. See SignInManager.
Event properties
Register a listener by assigning these properties directly; assignnull to remove it. For each event’s callback parameters and thread semantics, see the corresponding interface page.
Initialization and release
initSdk(meetToken, options, callback)
Returns: None (
Unit).
updateMediaOptions(options)
Returns: None (
Unit).
release()
Unit).
Media statistics and cloud recording capture
getMetric()
MediaMetric.Metric; null when not in a meeting or before the first sample (about 5 seconds) has been produced. For the fields, see Media quality.
enableClientCloudRecordCapture
TrackDesc.TRACK_SHARE track used by cloud recording. When enabled, you can get the custom video track through getShareCustomVideoTrack().
getShareCustomVideoTrack(preOpt)
Returns: The cached or newly created
LocalCustomVideoTrack; null when the underlying SRTC isn’t ready yet or the track can’t be created. enableClientCloudRecordCapture constrains the subsequent course recording publish flow; it doesn’t prevent getting and writing to this track in advance.
Current user info
getSelfInfo(callback)
Returns: None (the asynchronous result is delivered through the callback).
Host member controls
adminUpdateUserName(targetId, name, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateUserRole(targetId, role, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminMoveHost(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateUserDrawDisabled(targetId, drawDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateUserChatDisabled(targetId, chatDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminRequestUserOpenCamera(targetId, callback)
MeetingUserEvent.onRequestOpenCamera().
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
adminCloseUserCamera(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminDisableUserCamera(targetId, cameraDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
:::warning
This capability isn’t implemented in the current version; don’t rely on it for meeting controls. To turn off a camera immediately, use
adminCloseUserCamera().
:::
adminRequestUserOpenMic(targetId, callback)
MeetingUserEvent.onRequestOpenMic().
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
adminCloseUserMic(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminDisableUserMic(targetId, micDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
:::warning
This capability isn’t implemented in the current version; don’t rely on it for meeting controls. To turn off a mic immediately, use
adminCloseUserMic().
:::
adminRequestUserShare(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminStopRoomShare(callback)
Returns: None (the asynchronous result is delivered through the callback).
adminInviteAgent(agents, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminKickUserOut(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminConfirmHandUp(targetId, code, approve, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminGetOnlineMembers(meetingId, page, prePage, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomMCUMode()
Unit).
:::warning
This API isn’t implemented in the current version; calling it only logs a warning.
:::
Waiting room
adminWaitingRoomDisabled(waitingRoomDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminMoveOutWaitingRoom(uid, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminMoveInWaitingRoom(uid, nickName, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminGetWaitingRoomUsers(callback)
Returns: None (the asynchronous result is delivered through the callback).
Sub-meetings
createSubMeeting(subMeetingTitles, callback)
Returns: None (the asynchronous result is delivered through the callback).
updateSubMeetingTitle(id, title, callback)
Returns: None (the asynchronous result is delivered through the callback).
updateSubMeetingUsers(id, members, callback)
Returns: None (the asynchronous result is delivered through the callback).
deleteSubMeeting(ids, callback)
Returns: None (the asynchronous result is delivered through the callback).
getSubMeetingList(callback)
Returns: None (the asynchronous result is delivered through the callback).
startSubMeeting(ids, callback)
Returns: None (the asynchronous result is delivered through the callback).
stopSubMeeting(ids, callback)
Returns: None (the asynchronous result is delivered through the callback).
moveSubMeetingUser(fromId, toId, uid, callback)
Returns: None (the asynchronous result is delivered through the callback).
updateEnterBeforeHostDisabled(meetingId, enterBeforeHostDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
helpSubMeeting(meetingId, callback)
Returns: None (the asynchronous result is delivered through the callback).
Current user’s nickname
updateName(name, callback)
Returns: None (the asynchronous result is delivered through the callback).
Users, IM, and calls
getAgentList(types, keyword, page, perPage, callback)
Returns: None (the asynchronous result is delivered through the callback).
enableIm(callback)
imEvent.
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
disableIm()
MeetingImEvent.onImDisconnected().
Parameters: None.
Returns: None (Unit).
callUser(targetUids, callback)
Returns: None (the asynchronous result is delivered through the callback).
Pre-meeting management
createImmediateMeeting(title, option, callback)
Returns: None (the asynchronous result is delivered through the callback).
createScheduleMeeting(title, planTime, planDur, option, callback)
Returns: None (the asynchronous result is delivered through the callback).
updateMeetingBeforeStart(meetingId, option, callback)
Returns: None (the asynchronous result is delivered through the callback).
getMeetingList(page, perPage, callback)
Returns: None (the asynchronous result is delivered through the callback).
getHistoryMeetingList(page, perPage, callback)
Returns: None (the asynchronous result is delivered through the callback).
getMeetingDetail(meetingId, callback)
Returns: None (the asynchronous result is delivered through the callback).
getMeetingDetailByRoomNo(roomNo, callback)
Returns: None (the asynchronous result is delivered through the callback).
cancelMeetingBeforeStart(meetingId, callback)
Returns: None (the asynchronous result is delivered through the callback).
Entering and exiting meetings
enterMeeting(activity, roomNo, password, nick, avatar, streamVendor, isAudience, extendInfo, callback)
Returns: None (the asynchronous result is delivered through the callback).
enterMeetingByMeetingId(activity, meetingId, password, nick, avatar, streamVendor, isAudience, extendInfo, callback)
enterMeeting().
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
exitWaitingRoom(callback)
Returns: None (the asynchronous result is delivered through the callback).
exitMeeting()
Unit).
Host room controls
adminDestroyMeeting(callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateConferee(conferees, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomCameraState(selfUnMuteCameraDisabled, cameraDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomSelfUnmuteCameraDisabled(selfUnMuteCameraDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomMicState(selfUnMuteMicDisabled, micDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomSelfUnmuteMicDisabled(selfUnMuteMicDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomShareState(shareDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomChatDisabled(chatDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomScreenshotDisabled(screenshotDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomWatermarkDisabled(watermarkDisabled, callback)
Returns: None (the asynchronous result is delivered through the callback).
adminUpdateRoomLocked(locked, callback)
Returns: None (the asynchronous result is delivered through the callback).
Local camera
openCamera(view, preOption, callback)
preOption doesn’t take effect; to change parameters, call closeCamera() first. The device ID and facing in the start parameters are suggestions; if unavailable, RTC picks another automatically. If an in-flight start is canceled by a switch or close, the callback returns LOCAL_DEVICE_OPERATION_CANCELLED.
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
openCameraAndPublish(view, preOption, callback)
LOCAL_DEVICE_OPERATION_CANCELLED, which ends only the old publish transaction and doesn’t stop the new switch.
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
closeCamera()
Unit).
switchCamera(isFrontCamera)
closeCamera() (without publishing automatically). We recommend disabling the switch control while the camera is off.
When the request is canceled by a later switch or by closeCamera(), the callback returns MeetingErrorCode.LOCAL_DEVICE_OPERATION_CANCELLED. A cancellation represents a newer user intent—don’t recover in the cancellation callback. SDK release() clears the waiters and no longer delivers cancellation callbacks.
Parameters:
Returns: None (
Unit).
getCameraDevices()
switchCameraDevice(cameraId)
switchCamera.
For an exact recovery, call this method again with the getCurrentCameraId() snapshot taken before the switch; the suggestion semantics of openCamera can’t guarantee a return to the original device.
Parameters:
Returns: None (
Unit).
getCurrentCameraId()
App-level exact recovery example
Start the switch on the UI thread.cameraUiGeneration is maintained by your app and incremented each time the camera is turned off, switched again, or the screen is destroyed; cameraEnabled indicates that your app still wants capture, preventing late callbacks from reopening the device. runOnUiThread, updateCameraUi, and showCameraLost are your app’s own UI methods.
CameraFragment: it ignores repeated taps during switching and recovery, and calibrates the UI facing against the real device on final success.
switchFrontCameraMirror(open)
Returns: None (
Unit).
isFrontCameraMirrorOpen()
true means mirroring is on; currently on by default.
addPreview(view)
Returns:
true means binding succeeded; false means the view type is invalid or the current track is unavailable.
removePreview(view)
Returns: None (
Unit).
replacePreview(views)
Returns: None (
Unit).
getAllPreview()
Local mic
openMic(preOption, callback)
Returns: None (the asynchronous result is delivered through the callback).
openMicAndPublish(preOption, callback)
Returns: None (the asynchronous result is delivered through the callback).
closeMic()
Unit).
getMicVolume()
null when not capturing.
getMicDevices()
switchMicDevice(deviceId)
Returns: None (
Unit).
Screen sharing
initScreenShare(activity, notificationParam, preOpt)
Returns: None (
Unit). Capture state is delivered through screenCaptureEvent.
startScreenShare(hasBar, callback)
initScreenShare() first.
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
stopScreenShare()
Unit).
confirmStartScreenShareAgree(targetId, hasBar, callback)
Returns: None (the asynchronous result is delivered through the callback).
confirmStartScreenShareRefuse(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
Whiteboard sharing
requestShareBoard(callback)
Returns: None (the asynchronous result is delivered through the callback).
stopShareWhiteBoard()
Returns: None (
Unit).
confirmStartWhiteBoardShareAgree(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
confirmStartWhiteBoardShareRefuse(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
Room messages and raising hands
sendRoomChatMessage(targetId, msg, msgType, callback)
Returns: None (the asynchronous result is delivered through the callback).
sendRoomCustomMessage(targetId, msg, callback)
MeetingMessageEvent.onExtensionMessage().
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
getRoomChatMsgList(page, prePage, callback)
Returns: None (the asynchronous result is delivered through the callback).
requestHandUp(code, callback)
Returns: None (the asynchronous result is delivered through the callback).
cancelHandUp(code)
Returns: None (
Unit).
Replying to device requests
confirmOpenCameraAgree(targetId, view, preOpt, callback)
Returns: None (the asynchronous result is delivered through the callback).
confirmOpenCameraRefuse(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
confirmOpenMicAgree(targetId, preOpt, callback)
Returns: None (the asynchronous result is delivered through the callback).
confirmOpenMicRefuse(targetId, callback)
Returns: None (the asynchronous result is delivered through the callback).
Cloud recording and course recording
startCloudRecord(layoutData, callback)
Returns: None (the asynchronous result is delivered through the callback).
stopCloudRecord(callback)
Returns: None (the asynchronous result is delivered through the callback).
enableCourseRecordTrack(track, callback)
TRACK_SHARE, for course recording. This method only handles the media track; your app sends the recording business request separately.
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
disableCourseRecordTrack()
Unit).
Audio routing and remote audio
toggleRemoteAudioMute(mute)
Returns: None (
Unit).
getAudioRouterManager()
AudioRouterManager?; null when the SDK isn’t ready. Callers must not call its release() directly.
releaseAudioRouterManager()
Unit).
Remote member video
startPlayRemoteVideo(uid, trackDesc, view, event, callback)
RemoteVideoTrack control object is returned.
Parameters:
Returns: None (the asynchronous result is delivered through the callback).
stopPlayRemoteVideo(uid, trackDesc)
Returns: None (
Unit).
getRemoteVideoTrack(uid, trackDesc)
Returns: The matching
RemoteVideoTrack; null when not in a meeting or the control track hasn’t been created. For track rendering methods, see SRTC RemoteVideoTrack.
Remote composite stream
startPlayRemoteMixture(view, event, callback)
Returns: None (the asynchronous result is delivered through the callback).
stopPlayRemoteMixture()
Unit).
getRemoteMixtureTrack()
RemoteVideoTrack?; null when not in a meeting or not yet created.
Wangsu generic streams
:::warning The APIs in this group apply only to the Wangsu (WS) media streaming engine, and you must already have entered the meeting. Calling them with a non-WS engine returns an underlying “not supported” error or a null control track. :::subscribeWsVideoStream(streamName, uid, trackDesc, view, event, callback)
Returns: None (the asynchronous result is delivered through the callback).
subscribeWsAudioStream(streamName, uid, trackDesc, callback)
Returns: None (the asynchronous result is delivered through the callback).
unsubscribeWsVideoStream(streamName, uid, trackDesc)
Returns: None (
Unit).
unsubscribeWsAudioStream(streamName, uid, trackDesc)
Returns: None (
Unit).
getWsVideoStreamTrack(uid, trackDesc)
Returns:
RemoteVideoTrack?; null for audio streams, non-WS engines, or when not in a meeting.
Cast codes
registerCastCode(meetingId, callback)
Returns:
Unit; the business result is returned through the callback.
unregisterCastCode(callback)
Returns:
Unit; the result is returned through the callback.
startCast(code, option, callback)
canShare is true, goes on to request sharing. When the large screen is already in a meeting, the server ignores the roles and ownership in option.
Returns:
Unit; the business result is returned through the callback. For the related models, see the model types page; for ownership values, see the enums page.
Virtual background
Supported since2.0.39. First initialize the SDK and install the person segmentation model, then set blur or a background image, and finally turn the effect on. After camera capture or a switch succeeds, or after a successful reconnection, the meeting layer reapplies the cached configuration; release() clears the cache and releases the underlying resources.
installVirtualBackground(modelData)
Returns:
0 on success; MeetingErrorCode.SDK_NOT_READY when the SDK isn’t ready; other errors pass through RTC’s 102xxx error codes. Check the result before turning the effect on.
uninstallVirtualBackground()
Unit.
enabledVirtualBackground(enabled)
Returns:
0 on success; MeetingErrorCode.SDK_NOT_READY when the SDK isn’t ready; other errors pass through the RTC return value. Turning the effect off doesn’t uninstall the model.
setVirtualBackgroundBlur(level)
Returns:
Unit. Mutually exclusive with background image mode; whichever mode is set last takes effect. Setting the strength doesn’t turn on the main switch automatically.
setVirtualBackgroundImage(image)
Returns:
Unit. Mutually exclusive with blur mode; whichever mode is set last takes effect. Your app must first decode the image URI or file into a Bitmap; the meeting layer caches this object for configuration replay, so don’t recycle it while it’s in use. Setting the image doesn’t turn on the main switch automatically.
setVirtualBackgroundInferenceInterval(interval)
Returns:
Unit. For your app to configure according to device performance; we don’t recommend exposing it directly to end users.
setVirtualBackgroundMaskSync(on)
Returns:
Unit. Makes a difference only when the inference interval is greater than 1; it reduces mask misalignment trailing during fast motion.