public interface TcrSession
Modifier and Type | Interface and Description |
---|---|
static class |
TcrSession.Event
Session event definitions.
|
static interface |
TcrSession.Observer
This interface represents the observer of TcrSession.
|
Modifier and Type | Method and Description |
---|---|
void |
changeSeat(java.lang.String userId,
MultiUser.Role targetRole,
int targetPlayerIndex,
AsyncCallback<java.lang.Void> callback)
Switch the role and seat of a user (`userID`) to `targetRole` and `targetPlayerIndex` respectively.
|
CustomDataChannel |
createCustomDataChannel(int port,
CustomDataChannel.Observer observer)
Creates a custom data channel.
|
Gamepad |
getGamepad()
Return the interface to interact with the cloud Mouse in this session.
|
Keyboard |
getKeyboard()
Return the interface to interact with the cloud keyboard in this session.
|
Mouse |
getMouse()
Return the interface to interact with the cloud Mouse in this session.
|
void |
pasteText(java.lang.String text)
Copy the text to the input box in the cloud application.
|
void |
pauseStreaming()
Pause the media stream.
|
void |
release()
Release the session.
|
void |
requestChangeSeat(java.lang.String userId,
MultiUser.Role targetRole,
int targetPlayerIndex,
AsyncCallback<java.lang.Void> callback)
Apply to the room owner to switch the role and seat of a player (`userID`) to `targetRole` and
`targetPlayerIndex` respectively.
|
void |
restartCloudApp()
Restart the cloud application process.
|
void |
resumeStreaming()
Resume the media stream.
|
void |
setEnableLocalAudio(boolean enableLocalAudio)
Enable or disable the local audio track that is captured from the mic.
|
void |
setEnableLocalVideo(boolean enableLocalVideo)
Enable or disable the local video track that is captured from the camera.
|
void |
setLocalVideoProfile(int width,
int height,
int fps,
int minBitrate,
int maxBitrate,
boolean isFrontCamera)
Set the local video profile.
|
void |
setMicMute(java.lang.String userID,
int micStatus,
AsyncCallback<java.lang.Void> callback)
Change the mic status of the `
userID ` user. |
void |
setRemoteAudioPlayProfile(float volume)
Set the playing profile of the remote audio.
|
void |
setRemoteAudioPlayProfile(java.lang.String roomID,
java.lang.String userID,
float volume)
Set the playing profile of the remote audio of the specific user.
|
void |
setRemoteDesktopResolution(int width,
int height)
Set the resolution of Cloud Desktop.
|
void |
setRemoteVideoProfile(int fps,
int minBitrate,
int maxBitrate,
AsyncCallback<java.lang.String> callback)
Set the remote video profile.
|
void |
setRenderView(TcrRenderView renderView)
Set the rendering view for this session, and thus the SDK will render the streaming content to the view.
|
boolean |
start(java.lang.String serverSession)
Starts the session.
|
void |
syncRoomInfo()
Refresh the information of all seats.
|
boolean start(java.lang.String serverSession)
serverSession
- The ServerSession
returned from CreateSession
API.void release()
void setRenderView(TcrRenderView renderView)
renderView
- The rendering view to be set. This can be null to remove any existing renderView.void pauseStreaming()
void resumeStreaming()
void setRemoteVideoProfile(int fps, int minBitrate, int maxBitrate, AsyncCallback<java.lang.String> callback)
fps
- The frame rate. Value range: [10,60]. Default value: `60`.minBitrate
- The minimum bitrate in Kbps. Value range: [1000,15000]. Default value: `1000`.maxBitrate
- The maximum bitrate in Kbps. Value range: [1000,15000]. Default value: `15000`.callback
- The callback for the call resultAsyncCallback.onSuccess(Object)
` will be called back if the success parameter is sent to the
cloud server. However, the eventual setting effect of this API is subject to the cloud settings. The
value set in the SDK can take effect only if it doesn't exceed the upper limit configured in the
cloud.AsyncCallback.onFailure(int, String)
` will be called back if the API call times out. The error
code is `TcrCode.ERR_TIMEOUT
`.void setRemoteAudioPlayProfile(float volume)
volume
- The volume scalar in the range of [0,10] that will be set on this remote audio stream.void setRemoteAudioPlayProfile(java.lang.String roomID, java.lang.String userID, float volume)
roomID
- The id of the room where the specific user is in.userID
- The specific user.volume
- The volume scalar in the range of [0,10] that will be set on this remote audio stream.void setLocalVideoProfile(int width, int height, int fps, int minBitrate, int maxBitrate, boolean isFrontCamera)
width
- The frame width. Suggested value: 640.height
- The frame height. Suggested value: 480.fps
- The frame rate. Suggested value: 30.minBitrate
- The minimum bitrate in kbps. Suggested value: 512.maxBitrate
- The maximum bitrate in kbps. Suggested value: 1024.isFrontCamera
- whether to use the front camera. Suggested value: true.void setEnableLocalVideo(boolean enableLocalVideo)
enableLocalVideo
- true to enable the local video, false otherwise.void setEnableLocalAudio(boolean enableLocalAudio)
enableLocalAudio
- true to enable the local audio, false otherwise.void restartCloudApp()
void pasteText(java.lang.String text)
text
- The text to be pastedvoid setRemoteDesktopResolution(int width, int height)
width
- Width of cloud desktop.height
- Height of cloud desktop.Keyboard getKeyboard()
Mouse getMouse()
Gamepad getGamepad()
CustomDataChannel createCustomDataChannel(int port, CustomDataChannel.Observer observer)
port
- The cloud port number uniquely identifying the data channel.observer
- The CustomDataChannel.Observer
.CustomDataChannel
void changeSeat(java.lang.String userId, MultiUser.Role targetRole, int targetPlayerIndex, AsyncCallback<java.lang.Void> callback)
AsyncCallback.onSuccess(Object)
` will be called back.
TcrCode.MULTI_PLAYER_ASSIGN_SEAT_FAILED
`
will be passed in to `code
` of the `AsyncCallback.onFailure(int, String)
` callback.
TcrCode.MULTI_PLAYER_NO_AUTHORIZED
` will be passed in to `code
` of the `AsyncCallback.onFailure(int, String)
` callback.
TcrCode.ERR_TIMEOUT
` will be passed in to
`code
` of the `AsyncCallback.onFailure(int, String)
` callback.userId
- The target user IDtargetRole
- The target role `MultiUser.Role
`targetPlayerIndex
- The target seat. This parameter can take effect only for the `Player` role and
will be `0` for the `Viewer` role.callback
- The callback for the setting result.
`AsyncCallback.onSuccess(Object)
` will be called back if the setting succeeds.
`AsyncCallback.onFailure(int, String)
` will be called back if the setting fails.void requestChangeSeat(java.lang.String userId, MultiUser.Role targetRole, int targetPlayerIndex, AsyncCallback<java.lang.Void> callback)
AsyncCallback.onSuccess(Object)
` will be called back.
TcrCode.MULTI_PLAYER_IGNORED_HOST_SUBMIT
` will be passed in to `code
` of the `AsyncCallback.onFailure(int, String)
` callback.
TcrCode.ERR_TIMEOUT
` will be passed in to
`code
` of the `AsyncCallback.onFailure(int, String)
` callback.userId
- The target player IDtargetRole
- The target role `MultiUser.Role
`targetPlayerIndex
- The target seat. This parameter can take effect only for the `Player` role and
will be `0` for the `Viewer` role.callback
- The callback for the setting result.void setMicMute(java.lang.String userID, int micStatus, AsyncCallback<java.lang.Void> callback)
userID
` user.
AsyncCallback.onSuccess(Object)
` will be called back.
userID
` of another user, `AsyncCallback.onFailure(int,
String)
` will be called back, and TcrCode.MULTI_PLAYER_NO_AUTHORIZED
will be passed in to `code
`.
userID
` is incorrect, `AsyncCallback.onFailure(int, String)
` will be called back, and
`TcrCode.MULTI_PLAYER_NO_SUCH_USER
` will be passed in to `code
`.micStatus
- The mic status. Valid values: `MultiUser.MIC_STATUS_DISABLE
`, `MultiUser.MIC_STATUS_OFF
`, `MultiUser.MIC_STATUS_ON
`.callback
- The callback for the setting result.void syncRoomInfo()
TcrSession.Event.MULTI_USER_SEAT_INFO
callback.