Static Public Member Function | Function Name |
---|---|
static synchronized ThunderEngine | createEngine(Context context, String appId, long sceneId, ThunderEventHandler handler) |
static synchronized ThunderEngine | createWithLoop(Context context, String appId, long sceneId, ThunderEventHandler handler, Looper loop) |
static synchronized void | destroyEngine() |
static String | getVersion() |
static int | setLogLevel(int filter) |
static int | setLogFilePath(String filePath) |
static int | setLogCallback(IThunderLogCallback callback) |
public Member Functions | Function Name |
---|---|
void | open(String path) |
void | close() |
void | play() |
void | stop() |
void | pause() |
void | resume() |
void | seek(long timeMS) |
long | getTotalPlayTimeMS() |
long | getCurrentPlayTimeMS() |
void | setPlayVolume(int volume) |
int | setPlayerLocalVolume(int volume) |
int | setPlayerPublishVolume(int volume) |
int | getPlayerLocalVolume() |
int | getPlayerPublishVolume() |
int | getAudioTrackCount() |
int | selectAudioTrack(int audioTrack) |
void | setSemitone(int val) |
int | setLooping(int cycle) |
void | enablePublish(boolean enable) |
void | setTempo(float tempo) |
void | setPosition(int azimuth) |
synchronized void | setPlayerNotify(IThunderAudioFilePlayerCallback callback) |
synchronized void | enableVolumeIndication(boolean enable, int interval) |
synchronized void | setMixStandard(boolean standard) |
synchronized boolean | isMixStandard() |
Note:
If the return value of API is int, unless otherwise specified, 0 indicates a successful call, and less than 0 indicates a failed call. For detailed return code, see ThunderRtcConstant.ThunderRet
public static synchronized ThunderEngine createEngine(Context context,
String appId,
long sceneId,
ThunderEventHandler handler)
Create ThunderEngine and initialize ThunderEngine instance.
Note:
- Only users of the same AppId can communicate with each other.
Parameter | Description |
---|---|
context | The context of the Android Application |
appId | The signed AppId for applications |
sceneId | The scene Id customized by the developer can subdivide business scenes; if unnecessary, fill 0 |
handler | ThunderEventHandler is a abstract object providing default implementation, by which SDK can report events to applications when SDK is running. |
public static synchronized ThunderEngine createWithLoop(Context context,
String appId,
long sceneId,
ThunderEventHandler handler,
Looper loop)
Create ThunderEngine and initialize ThunderEngine instance.
Note:
- Users of the same AppId can communicate with each other.
Parameter | Description |
---|---|
context | The context of the Android Application |
appId | AppID signed for application developers |
sceneId | The scene Id customized by the developer can subdivide business scenes; if unnecessary, fill 0 |
handler | ThunderEventHandler is an abstract object providing default implementation, by which SDK can call back events from applications when SDK is running. |
loop | Looper objects correlated with thread can assign handler callback function to be performed in Associated thread. |
public static synchronized void destroyEngine()
Destroy ThunderEngine instance object
Note:
- The created file player object ThunderAudioFilePlayer will also be released.
public static String getVersion()
Get SDK version information.
public static int setLogFilePath(String filePath)
Set path of log files (open log and save its information).
Note:
- Ensure that the specified directory has write permission.
Parameter | Description |
---|---|
filePath | Path for saving logs |
public static int setLogCallback(IThunderLogCallback callback)
Set log callback.
Parameter | Description |
---|---|
callback | For the callback API instances, refer to IThunderLogCallback API for detail |
public static int setLogLevel(int filter)
Set log level.
Parameter | Description |
---|---|
filter | Use the attributes of constants ThunderRtcConstant.ThunderLogLevel to set log level |
public void setSceneId(long sceneId)
Set scenario ID.
Parameter | Description |
---|---|
sceneId | The scene Id customized by the developer can subdivide business scenes; If unnecessary, fill 0 |
public int setMediaMode(int mode)
Set media mode.
Note:
- Call it before joining room (joinRoom).
- It can only be reset when destroyEngine is performed.
Parameter | Description |
---|---|
mode | Media mode. See ThunderRtcConstant.ThunderRtcProfile for details |
public int setRoomMode(int mode)
Set room mode.
Note:
- It can only be reset when destroyEngine is performed.
- The optional value of parameters can only be ThunderRtcConstant.RoomConfig options listed in the document.
Parameter | Description |
---|---|
mode | Room mode. See ThunderRtcConstant.RoomConfig for details |
public int setArea(int area)
Set country and area of users.
To accommodate to different laws and regulations at home and abroad, Jocloud NETWORK provides both domestic (by default) and international central systems. Set it by referring to the following points:
Note:
- Only call it before the joinRoom can be valid. It is necessary for abroad users but not for domestic users.
- The optional value of parameters can only be ThunderRtcConstant.RoomConfig options listed in the document.
- It can only be reset when destroyEngine is performed.
Parameter | Description |
---|---|
area | User’s area. See ThunderRtcConstant.AreaType for details |
public int joinRoom(byte[] token, String roomName, String uid)
Join a room.
Note:
- The applications cannot communicate with each other when using different appId.
- Successful function return only indicates that the request is executed successfully. After receiving the callback on ThunderEventHandler.onJoinRoomSuccess , it can indicate the success of joining room.
Name | Description |
---|---|
token | For the requirements of authentication, see Authentication Access Manual for details |
roomName | Room name (unique for each AppId) only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
uid | User ID only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
public int leaveRoom()
Leaving room indicates hang off or exiting conversation.
Note:
public int updateToken(byte[] token)
Update token.
Token is used for business authentication. The format is suggested as follows. See Authentication Access Manual for detail
uint16 | uint32 | uint64 | uint64 | uint32 | uint16 | nBytes | 20 Bytes |
---|---|---|---|---|---|---|---|
TokenLen | AppId | uid | TimeStamp(ms) | ValidTime(s) | BizExtInfoLen | BizExtInfoData | DigitalSignature |
Refer to the following descriptions:
Parameter | Description |
---|---|
token | For requirements of authentication, refer to "User Authentication Description" for detail |
public int setAudioConfig(int profile, int commutMode, int scenarioMode)
It is used to set audio parameter and application scene.
Note:
- Call it before playing audio stopLocalAudioStream .
Parameter | Description |
---|---|
profile | Audio type. See ThunderRtcConstant.AudioConfig for details |
commuMode | Interactive mode. See ThunderRtcConstant.CommutMode for details |
scenarioMode | Scenario mode. See ThunderRtcConstant.ScenarioMode for details (Reserved) |
public int enableVoicePosition(boolean enable)
Enable/Disable voice stereo of remote users.
Note:
- Call this API before joining a room by calling joinRoom.
Parameter | Description |
---|---|
enable | true: enable voice stereo of remote users false: disable voice stereo of remote users |
public int setRemoteUidVoicePosition(String uid, int azimuth, int gain)
Set spatial location and volume of remote user's voice.
Parameter | Description |
---|---|
uid | uid of remote user |
azimuth | Set the position where the remote user’s voice appears, with value range of [-90,90]. 0: voice appears in the right ahead. (default) -90: voice appears in the left side. 90: voice appears in the right side. |
gain | Set the voice volume of remote user, with value range of [0,100]. The default value is 100.0, indicating user’s original volume. The smaller the value, the lower the volume |
public int enableLoudspeaker(boolean enabled)
Enable/Disable loudspeaker.
Parameter | Description |
---|---|
enabled | true: play by loudspeaker false: play by receiver |
public boolean isLoudspeakerEnabled()
Query the enabled status of loudspeaker.
public int setLoudSpeakerVolume(int volume)
Set loudspeaker volume.
Parameter | Description |
---|---|
volume | Volume value [0-400] |
public int setAudioVolumeIndication(int interval,
int moreThanThd,
int lessThanThd,
int smooth)
Enable volume indication for speaker.
Note:
- It can only be reset when destroyEngine is performed.
- The voice volume collected by local microphone or playing file is not included.
Parameter | Description |
---|---|
interval | The callback interval (unit: millisecond) is <=0: The volume indication is disabled, >0: Use this numerical value as volume indication of interval enabling. The interval of more than 200 milliseconds is recommended, which is 0 by default. |
moreThanThd | From >= moreThanThd to < moreThanThd, immediately call back once (is not restricted by interval) <= 0 invalid, range: [0,100], default value: 0 |
lessThanThd | From >= lessThanThd to < lessThanThd, immediately call back once (is not restricted by interval) <= 0 invalid, range: [0,100], default value: 0 |
smooth | Invalid momentarily. Fill 0 |
public int enableCaptureVolumeIndication(int interval,
int moreThanThd,
int lessThanThd,
int smooth)
Enable/Disable collected volume callback.
Parameter | Description |
---|---|
interval | The callback interval (unit: millisecond) is <=0: The volume indication is disabled, > 0: Use this numerical value as capture volume indication of interval enabling, which is 0 by default |
moreThanThd | From >= moreThanThd to < moreThanThd, immediately call back once (is not restricted by interval) <= 0 invalid, range: [0,100], default value: 0 |
lessThanThd | From >= lessThanThd to < lessThanThd, immediately call back once (is not restricted by interval) <= 0 invalid, range: [0,100], default value: 0 |
smooth | Invalid momentarily. Fill 0 |
public boolean startAudioSaver(String fileName, int saverMode, int fileMode)
Start saving audio data as aac format file.
Parameter | Description |
---|---|
fileName | The save path of file must be full path including file name with postfix of .aac. The directory for saving file must be created in advance, and the folder cannot be created by this API. For example: /sdcard/helloworld.aac |
saverMode | Audio saving mode. See [ThunderRtcConstant.AudioSaverMode].(#ThunderRtcConstant.AudioSaverMode) for details |
fileMode | Audio writing mode. See ThunderRtcConstant.AudioSaverWfMode for details |
public boolean stopAudioSaver()
Stop saving audio data as aac format file.
public void setSoundEffect(int mode)
Set sound effect mode.
Parameter | Description |
---|---|
mode | sound effect mode. See ThunderRtcConstant.SoundEffectMode for details |
public void setVoiceChanger(int mode)
Set voice change mode.
Parameter | Description |
---|---|
mode | Voice change mode. See ThunderRtcConstant.VoiceChangerMode for details |
public int stopLocalAudioStream(boolean stop)
Enable/Disable the capture, encode and upstream of local audio.
Note:
- Call this method after calling joinRoom successfully.
Parameter | Description |
---|---|
stop | true: disable the capture, encode and upstream of local audio false: enable the capture, encode and upstream of local audio |
public int stopRemoteAudioStream(String uid, boolean stop)
Stop/Resume receiving audio stream of a specified user.
Note:
- Subscription configuration is only reset when destroyEngine is performed
- After stopping receiving the specified audio stream, you can receive all audio streams through stopAllRemoteAudioStreams and vice versa.
- This API has no priority relationship with stopAllRemoteAudioStreams, and the API called later will be valid.
Parameter | Description |
---|---|
uid | uid of remote users |
Stop | True: stop receiving audio stream of specified remote user false: start receiving audio stream of specified remote user |
public int stopAllRemoteAudioStreams(boolean stop)
Stop/Resume receiving all remote audio streams. Process this API based on the following rules:
Note:
- Subscription configuration is only reset when destroyEngine is performed.
- This API has no priority relationship with stopRemoteAudioStream , and which API called later will be valid.
Parameter | Description |
---|---|
stop | true: stop receiving all remote audios false: resume receiving all remote audios |
public int setMicVolume(int volume)
Set microphone volume.
Parameter | Description |
---|---|
volume | Volume value [0-400] |
public int setRemoteAudioStreamsVolume(String uid, int volume)
Set the volume of the remote audio stream.
Parameter | Description |
---|---|
uid | uid of remote user |
volume | Volume value [0-400] |
public ThunderAudioFilePlayer createAudioFilePlayer()
Create instance object of audio file player.
public void destroyAudioFilePlayer(ThunderAudioFilePlayer audioFilePlayer)
Destroy instance object of audio file player.
Parameter | Description |
---|---|
audioFilePlayer | Instance object of audio file player ThunderAudioFilePlayer ) |
public int setEnableEqualizer(boolean enabled)
Enable/Disable local voice equalizer.
Parameter | Description |
---|---|
enabled | true: Enable false: Disable |
public int setEqGains(final int[] gains)
Set voice equalizer parameters.
Parameter | Description |
---|---|
gains | The value range of each element: -12 <= gains[i] <= 12, in which the value range of i: -12 <= gains[i] <= 12 |
public int setEnableReverb(boolean enabled)
Enable/Disable local voice reverberation.
Parameter | Description |
---|---|
enabled | true: Enable false: Disable |
public int setReverbExParameter(ThunderRtcConstant.ReverbExParameter param)
Set local voice reverberation parameters
Parameter | Description |
---|---|
param | The parameters of voice reverberation, refer to ThunderRtcConstant.ReverbExParameter for details |
public int setEnableCompressor(boolean enabled)
Enable/Disable audio compressor.
Parameter | Description |
---|---|
enabled | true: Enable false: disable |
public int setCompressorParam(ThunderRtcConstant.CompressorParam param)
Set audio compressor parameters.
Parameter | Description |
---|---|
param | The parameters of audio compressor, refer to ThunderRtcConstant.CompressorParam for details |
public int setEnableLimiter(boolean enabled)
Enable/Disable limiter.
Parameter | Description |
---|---|
enabled | true: Enable false: Disable |
public int setLimiterParam(ThunderRtcConstant.LimterParam param)
Set limiter parameters.
Parameter | Description |
---|---|
param | The parameters of limiter, refer to ThunderRtcConstant.LimterParam for details |
public int setVoicePitch(float pitch)
Set the voice pitch.
Note:
- This API can be called after initialization and be reset only by calling destroyEngine.
- The samller the value, the lower the voice pitch.
Parameter | Description |
---|---|
pitch | Voice pitch, range: [-12,12]; default value: 0 |
public void enableAudioPlaySpectrum(boolean enable)
Enable/Disable data callback on audio play spectrum.
The ThunderEventHandler.onAudioPlaySpectrumData function will be called back after it is enabled.
Parameter | Description |
---|---|
enable | true: Enable false: Disable (default) |
public void setAudioPlaySpectrumInfo(int spectrumLen, int notifyIntervalMS)
Set callback information of audio play spectrum data.
Parameter | Description |
---|---|
spectrumLen | The length of spectrum is [12 - 256], and is 256 by default |
notifyIntervalMS | The interval of spectrum callback must be the multiple of 10, and is 30MS by default |
public int sendUserAppMsgData(byte[] msgData)
Sending developer's custom broadcast messages in room.
This API sends messages through media UDP channel with features of low-lantency and unreliability. Specified constraints are as follows:
Get the reason for failed sending of msg through ThunderEventHandler.onSendAppMsgDataFailedStatus API function. Get the custom broadcast messages from other users through ThunderEventHandler.onRecvUserAppMsgData API function.
Parameter | Description |
---|---|
msgData | Message sent |
public int sendMediaExtraInfo(java.nio.ByteBuffer data, int dataLen)
Send media extra information. Use video channel when uploading video, otherwise use audio channel.
Specified constraints are as follows:
Get the reason for failed sending of media extra information through IThunderMediaExtraInfoCallback.onSendMediaExtraInfoFailedStatus. Receive the media extra information from other users through IThunderMediaExtraInfoCallback.onRecvMediaExtraInfo API function.
Parameter | Description |
---|---|
Date | The media extra information data to be transmitted which must be created using ByteBuffer.allocateDirect(int) |
dataLen | The length of media extra information data. If there is only audio publishing (publishing in a pure audio mode or only audio publishing in an audio/video mode), the size of extra information shall be no more than 200 bytes. If there is video publishing in audio/video mode, the extra information shall be no more than 2048 bytes |
public int setMediaExtraInfoCallback(IThunderMediaExtraInfoCallback callback)
Set callback monitoring of media extra information.
Parameter | Description |
---|---|
callback | The callback instance object of media extra information, refer to IThunderMediaExtraInfoCallback for details |
public int enableMixVideoExtraInfo(boolean enable)
Enable mixed video carry media extra information, for example, mixed video carry layout information. After it is enabled, the callback on IThunderMediaExtraInfoCallback.onRecvMixVideoInfo can be received when this mixed video stream is played in audience terminal.
Parameter | Description |
---|---|
enable | true: Enable false: Disable (default) |
public void setAudioSourceType(int sourceType)
Set the audio source type.
Parameter | Description |
---|---|
sourceType | Audio source type. See ThunderRtcConstant.SourceType for details |
public int setEnableInEarMonitor(boolean enable)
Enable/Disable in-ear monitor.
Parameter | Description |
---|---|
enabled | true: enable false: disable (default) |
public int setVideoEncoderConfig(ThunderVideoEncoderConfiguration yyVideoConfig)
Set video encoding configuration.
Parameter | Description |
---|---|
yyVideoConfig | For the video encoding configuration, refer to ThunderVideoEncoderConfiguration for details |
public int setLocalVideoCanvas(ThunderVideoCanvas local)
Set local view. If this view is not set, the preview and publishing can also be enabled. The local collected picture can seen after setting this view.
Parameter | Description |
---|---|
local | The video rendering canvas instance, refer to ThunderVideoCanvas for details |
public int setRemotePlayType(int remotePlayType)
Set the playing type of remote video. The default is the common audience view.
Note:
- Call it before joining room.
Parameter | Description |
---|---|
remotePlayType | Playing type of remote video. For the optional value, refer to ThunderRtcConstant.ThunderRtcRemotePlayType |
public int setMultiVideoViewLayout(ThunderMultiVideoViewParam params)
Set the layout parameters of the multi videos on the view
This function is mostly used for scenario of multiplayer interaction. Under this situation, the multi-channel video streams shall be displayed in the same view to reduce performance consumption. This function is called to set the locations where the multi-channel video streams are placed respectively.
Support setting background image and its display location.
Parameter | Description |
---|---|
params | The layout parameters of multiplayer interaction video in rendering view, refer to ThunderMultiVideoViewParam for details |
public int setRemoteVideoCanvas(ThunderVideoCanvas remote)
Set the user position for co-hosting.
Parameter | Description |
---|---|
remote | The display view instance, refer to ThunderVideoCanvas for details |
public int setLocalCanvasScaleMode(int mode)
Set the scale mode of the local video stream on the canvas.
Parameter | Description |
---|---|
mode | Local view scale mode. For the optional value, refer to ThunderRtcConstant.ThunderVideoRenderMode |
public int setRemoteCanvasScaleMode(String uid, int mode)
Set the scale mode of the remote video stream on the canvas.
Parameter | Description |
---|---|
uid | uid of remote user |
mode | Remote specified view scale mode. For the optional value, refer to ThunderRtcConstant.ThunderVideoRenderMode |
public int startVideoPreview()
Start video preview of local camera.
public int stopVideoPreview()
Stop video preview of local camera.
public int enableLocalVideoCapture(boolean enable)
Enable/Disable local video capture.
Parameter | Description |
---|---|
enabled | true: enable local video capture false: disable local video capture (default) |
public int stopLocalVideoStream(boolean stop)
Disable/Enable local video sending.
**Caution: **
- Call this API after join in the room via joinRoom.
Parameter | Description |
---|---|
Stop | true: stop sending local video (default) false: start sending local video |
public int stopRemoteVideoStream(String uid, boolean stop)
Stop/Resume receiving video stream of a specified user.
Parameter | Description |
---|---|
uid | uid of remote user |
Stop | true: stop receiving specified video stream false: receive specified video stream |
public int stopAllRemoteVideoStreams(boolean stop)
Stop/Receive all remote videos
Parameter | Description |
---|---|
Stop | true: stop receiving all video streams false: resume receiving all video streams (clear all configuration records of stopRemoteVideoStream at the same time) |
public int registerVideoCaptureTextureObserver(IGPUProcess observer)
Register observer object for capturing video texture data, which is used for beautification etc.
Parameter | Description |
---|---|
observer | The observer object instance for collecting video texture data can obtain and process rendering texture data of video’s each frame. See IGPUProcess for details. If the null is transmitted, cancel registration. |
public int registerVideoCaptureFrameObserver(IVideoCaptureObserver observer)
Register observer object for collecting data of camera.
Parameter | Description |
---|---|
observer | The observer object instance for collecting data of camera can obtain and render collected data of video camera yuv. See IVideoCaptureObserver for details. If the null is transmitted, cancel registration. |
public int registerVideoDecodeFrameObserver(String uid, IVideoDecodeObserver observer)
Register the decoded YUV (I420) video data observer object for the specified user.
Parameter | Description |
---|---|
uid | uid needing to be monitored. |
observer | The decoded observer object for video data can obtain and process decoded video data. See IVideoDecodeObserver for details. If the null is transmitted, cancel registration. |
public int registerAudioFrameObserver(IAudioFrameObserver observer)
Register audio observer object.
Parameter | Description |
---|---|
observer | The observer object for audio frame data can obtain and process audio frame data. See IAudioFrameObserver for details. If the null is transmitted, cancel registration. |
public int setMixedAudioFrameParameters(int sampleRate, int channels, int samplesPerCall)
Set the audio data mixed with the captured data and the playback data.
Parameter | Description |
---|---|
sampleRate | Sample rate |
channels | Audio channel: 1-Mono, 2-Stereo |
samplesPerCall | The number of samples per channel |
public int setRecordingAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall)
Set the format of captured audio data which will report.
Parameter | Description |
---|---|
sampleRate | Specify sampling rate of audio callback data, and it can be set as 8000, 16000, 32000, 44100 or 48000 |
channel | Number of audio channels:1-single track, 2-dual track |
mode | Specify operation mode of audio callback data. See ThunderRtcConstant.ThunderAudioRawFrameOperationMode for details |
samplesPerCall | Specify number of samples for audio callback data. For example, the RTMP in push flow is always 1024. samplesPerCall = (int)(sampleRate × sampleInterval), in which: sampleInterval ≥ 0.01, in seconds. |
public int setPlaybackAudioFrameParameters(int sampleRate, int channel, int mode, int samplesPerCall)
Set the format of playing audio data which will report.
Parameter | Description |
---|---|
sampleRate | Specify sampling rate of audio callback data, and it can be set as 8000, 16000, 32000, 44100 or 48000 |
channel | Number of audio channels:1-single track, 2-dual track |
mode | Specify operation mode of audio callback data. See ThunderRtcConstant.ThunderAudioRawFrameOperationMode for details |
samplesPerCall | Specify number of samples for audio callback data. For example, the RTMP in push flow is always 1024. samplesPerCall = (int)(sampleRate × sampleInterval), in which: sampleInterval ≥ 0.01, in seconds. |
public int setVideoWatermark(ThunderBoltImage watermark)
Set watermark of local video.
Parameter | Description |
---|---|
watermark | The watermark pictures to be added into local live video, refer to ThunderBoltImage for details. The settings of null indicates canceling watermark |
public int setCustomAudioSource(boolean enabled, int sampleRate, int channel)
Set parameters of external audio source.
Parameter | Description |
---|---|
enabled | true: enable external audio capture false: disable external audio capture (default) |
sampleRate | The sampling rate of external audio source can be 8000, 16000, 32000, 44100 or 48000 |
channel | Number of channels for external audio source (support two at most) |
public int pushCustomAudioFrame(byte[] data, long timeStamp)
Push external audio frame.
Parameter | Description |
---|---|
Date | External PCM audio frame data |
timeStamp | Timestamp of external audio frame is used to synchronize external video source |
public int setCustomVideoSource(ThunderCustomVideoSource videoSource)
Set customized video source.
Parameter | Description |
---|---|
videoSource | Operation API for external video source |
public int addPublishOriginStreamUrl(String url)
Add a publishing address of source stream.
Parameter | Description |
---|---|
url | Stream publishing address, with the format of RTMP. The special characters such as Chinese cannot be supported, and the address length cannot be more than 512 bytes. Note: some CDN manufacturers may not support 512 bytes, for example, the Aliyun only supports 256 bytes. |
public int removePublishOriginStreamUrl(String url)
Remove the publishing address of source stream.
Parameter | Description |
---|---|
url | The address to stop pushing stream, the format is RTMP. The special characters such as Chinese cannot be supported, and the address length cannot be more than 512 bytes. Note: some CDN manufacturers may not support 512 bytes, for example, the Aliyun only supports 256 bytes. |
public int setLiveTranscodingTask(String taskId, LiveTranscoding transcoding)
Add or update transcoding task.
Parameter | Description |
---|---|
taskId | Task ID for stream mixing and transcoding tasks is generated and managed by the developer. It shall be unique in a room and supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
transcoding | The configuration information of stream mixing and transcoding, refer to LiveTranscoding for details |
public int removeLiveTranscodingTask(String taskId)
Remove a transcoding task.
Parameter | Description |
---|---|
taskId | Task ID for stream mixing and transcoding tasks is generated and managed by the developer. It shall be unique in a room and supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
public int addPublishTranscodingStreamUrl(String taskId, String url)
Add a publishing address of transcoding stream.
Parameter | Description |
---|---|
taskId | The transcoding task ID is generated and managed by users. It shall be unique globally, and only supports character set composed of a-zA-Z0-9 with length of no more than 20 characters. |
url | Stream publishing address, with the format of RTMP. The special characters such as Chinese cannot be supported, and the address length cannot be more than 512 bytes. Note: some CDN manufacturers may not support 512 bytes, for example, the Aliyun only supports 256 bytes |
public int removePublishTranscodingStreamUrl(String taskId, String url)
Remove the publishing address of the transcoding stream.
Parameter | Description |
---|---|
taskId | The transcoding task ID is generated by application. It shall be unique globally, and only supports character set composed of a-zA-Z0-9 with length of no more than 20 characters. |
url | The publishing stream address to be deleted, the format is RTMP. The special characters such as Chinese cannot be supported, and the address length cannot be more than 512 bytes. Note: some CDN manufacturers may not support 512 bytes, for example, the Aliyun only supports 256 bytes. |
public int addSubscribe(String roomId, String uid)
Subscribe stream of specified user across the room.
Parameter | Description |
---|---|
roomId | Room ID only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
uid | User ID, the corresponding anchor uid of audio/video to be subscribed |
public int removeSubscribe(String roomId, String uid)
Remove the subscription of stream of specified user across the room.
Parameter | Description |
---|---|
roomId | Room ID only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
uid | User ID, the corresponding anchor uid of audio/video to be unsubscribed |
public int switchFrontCamera(boolean bFront)
Switch to front/rear camera.
Parameter | Description |
---|---|
bFront | true: enable front camera (default) false: switch to rear camera |
public int setVideoCaptureOrientation(int orientation)
Set the capture angle of camera (landscape/portrait).
Parameter | Description |
---|---|
orientation | The capture orientation of camera. For the optional value, refer to ThunderRtcConstant.ThunderVideoCaptureOrientation for details |
public int setLocalVideoMirrorMode(int mode)
Set local video mirror mode.
Parameter | Description |
---|---|
mode | Mirror mode. For the optional value, seeThunderRtcConstant.ThunderVideoMirrorMode for details |
public int enableWebSdkCompatibility(boolean enabled)
Enable/Disable WebSDK compatibility.
Parameter | Description |
---|---|
enabled | true: Compatible false: Incompatible (default) |
public ThunderVideoEncodeParam getVideoEncoderParam(ThunderVideoEncoderConfiguration videoConfig)
Get encoding inforamtion (including width, height, frame rate, bit rate, etc.) by calling the API.
Prameter | Description |
---|---|
videoConfig | Video encoding configuration, see details in ThunderVideoEncoderConfiguration |
public int getConnectionStatus()
Search for network connection status, and this API can be called after initializing SDK.
public int enableEchoDetector(boolean enabled)
Enable/disable echo detection.
Note:
This API should be called after initialization and reset by calling destroyEngine. The detection results will be reported via the callback onEchoDetectResult.
Parameter | Description |
---|---|
enabled | Whether to enable echo detection: "true"-enable, "false"(default)-disable |
public int enableHowlingDetector(boolean enabled)
Whether to enable howling detection.
Note:
This API should be called after initialization and reset by calling destroyEngine. The detection results will be reported via the callback onHowlingDetectResult.
Parameter | Description |
---|---|
enabled | Whether to enable howling detection: "true"-enable, "false"-disable (default) |
public void open(final String path)
Open the file to be played, and the following formats are supported: mp3, aac, wav.
Parameter | Description |
---|---|
path | Audio file path |
public void close()
Close play file, and ThunderAudioFilePlayer.open can be called again.
public void play()
Start playing.
public void stop()
Stop playing, and call ThunderAudioFilePlayer.play to play again.
public void pause()
Suspend playing, and call ThunderAudioFilePlayer.resume to continue.
public void resume()
Continue to play.
public void seek(final long timeMS)
Skip to specified play time.(Only support local audio files)
Parameter | Description |
---|---|
timeMS | The time (in seconds), shall be no more than the value obtained by ThunderAudioFilePlayer.getTotalPlayTimeMS |
public long getTotalPlayTimeMS()
Get the total play time of files.
public long getCurrentPlayTimeMS()
Get the time which has been played.
public void setPlayVolume(int volume)
Set play volume of current music files locally (anchor) and remotely (audience).
Parameter | Description |
---|---|
volume | Play volume [0-100] |
public int setPlayerLocalVolume(int volume)
Adjust the local volume of music files. Call this method in the room.
Parameter | Description |
---|---|
volume | Play volume [0-100] |
public int setPlayerPublishVolume(int volume)
Adjust remote volume of music files. Call this method in the room.
Parameter | Description |
---|---|
volume | Play volume [0-100] |
public int getPlayerLocalVolume()
Get the local volume of music files.
public int getPlayerPublishVolume()
Get the remote volume of music files.
public int getAudioTrackCount()
Get the number of tracks of audio files.
Caution:
- Call this API after receiving the callback function of file open success "AUDIO_PLAY_EVENT_OPEN" of onAudioFileStateChange。
public int selectAudioTrack(int audioTrack)
Switch to specified audio track.
Parameter | Description |
---|---|
audiotrack | Specified audio track to be switch to. 0 indicates the first audio track |
public void setSemitone(int val)
Set a tone for audio playing.
Parameter | Description |
---|---|
val | Optional value of tone quantity: -5, -4, -3, -2, -1, 0(normal), 1, 2, 3, 4, 5 |
public int setLooping(int cycle)
Sets times of loop playbacks.
Parameter | Description |
---|---|
cycle | -1: indicates infinite loop 0: No loop (default value); Positive integer: Loop times |
public void enablePublish(boolean enable)
Whether to use this currently played audio file as the live accompaniment.
Parameter | Description |
---|---|
enable | true: Enable false: disable (default) |
public void setTempo(float tempo)
Set the audio playback speed.
Parameter | Description |
---|---|
tempo | Playback speed: 0.5f, 0.75f, 1.0f, 1.25f, 1.5f, 2.0f |
public void setPosition(int azimuth)
Set the audio playback position
Parameter | Description |
---|---|
azimuth | Poistion, -90~90 |
public synchronized void setPlayerNotify(IThunderAudioFilePlayerCallback callback)
Set callback API of audio file player.
Parameter | Description |
---|---|
callback | The callback API of audio file player, refer to ThunderAudioFilePlayer.IThunderAudioFilePlayerCallback for details |
public synchronized void enableVolumeIndication(boolean enable, int interval)
Enable the volume callback on audio file playing.
Parameter | Description |
---|---|
enable | true: Enable false: disable (default) |
interval | Callback interval (in seconds). More than 200 ms is recommended; if <=0, reset it as 200ms. |
public synchronized void setMixStandard(boolean standard)
Set whether audio file is a mixed video standard stream.
Parameter | Description |
---|---|
standard | true: Standard stream false: Non-standard stream (default) |
public synchronized boolean isMixStandard()
Query whether audio file is a mixed video standard stream.
public static final class RoomConfig
Room mode
Constant (Default Value) | Description |
---|---|
THUNDER_ROOMCONFIG_LIVE(0) | Live streaming mode, where quality is prioritized and delay is large. Applicable to viewer or audience scenario. When audience publishes audio/video and becomes anchors, the value changes to communication mode. |
THUNDER_ROOMCONFIG_COMMUNICATION(1) | Communication mode is applicable for 1v1 communication and group conversation due to its short time delay and fluent communication. |
THUNDER_ROOMCONFIG_MULTIAUDIOROOM(4) | Audio room mode is applicable for group audio room due to its low time delay and low bandwidth occupied |
public static final class AudioConfig
Audio Profiles
Constant (Default Value) | Description |
---|---|
THUNDER_AUDIO_CONFIG_DEFAULT(0) | Default settings. which is 1 in communication mode, and 3 in live mode. |
THUNDER_AUDIO_CONFIG_SPEECH_STANDARD(1) | Specify the sampling rate of 16 KHz, and the audio encode, single track and encoding rate of 18 kbps SILK |
THUNDER_AUDIO_CONFIG_MUSIC_STANDARD_STEREO(2) | Specify the sampling rate of 44.1 KHz, and the music encode, dual track and encoding rate of 24 kbps SILK. The encode is long in time delay, EAAC+ |
THUNDER_AUDIO_CONFIG_MUSIC_STANDARD(3) | Specify the sampling rate of 48 KHz, and the music encode, single track and encoding rate of 40 kbps SILK. The encode is low in time delay, ELD AAC |
THUNDER_AUDIO_CONFIG_MUSIC_HIGH_QUALITY_STEREO(4) | Specify the sampling rate of 44.1 KHz, and the music encode, dual track and encoding rate of 128 kbps, AAC LC |
THUNDER_AUDIO_CONFIG_MUSIC_HIGH_QUALITY_STEREO_192(5) | Specify the sampling rate of 44.1 KHz, and the music encode, dual track and encoding rate of 192 kbps, NET_AAC_192K |
public static final class CommutMode
Interactive mode
Constant (Default Value) | Description |
---|---|
THUNDER_COMMUT_MODE_DEFAULT(0) | Default mode, equals to THUNDER_COMMUT_MODE_HIGH(1) |
THUNDER_COMMUT_MODE_HIGH(1) | High interactive mode |
THUNDER_COMMUT_MODE_LOW(2) | Low interactive mode |
public static final class ScenarioMode
Scenario mode
Constant (Default Value) | Description |
---|---|
THUNDER_SCENARIO_MODE_DEFAULT(0) | Default mode, equals to THUNDER_SCENARIO_MODE_STABLE_FIRST(1) |
THUNDER_SCENARIO_MODE_STABLE_FIRST(1) | Fluent priority: applicable for stable education |
THUNDER_SCENARIO_MODE_QUALITY_FIRST(2) | Tone quality priority: applicable for show field with a few or without interaction |
public static final class AreaType
Scenario mode
Constant (Default Value) | Description |
---|---|
THUNDER_AREA_DEFAULT(0) | Default value (China), which is equivalent to THUNDER_AREA_RESERVED(1) |
THUNDER_AREA_FOREIGN(1) | Overseas |
public static final class AuthResult
Authentication results
Constant (Default Value) | Description |
---|---|
THUNDER_AUTHRES_SUCCUSS(0) | Authentication succeeded |
THUNDER_AUTHRES_ERR_SERVER_INTERNAL(10000) | Server internal error, try again |
THUNDER_AUTHRES_ERR_NO_TOKEN(10001) | If there is no token, call ThunderEngine.updateToken |
THUNDER_AUTHRES_ERR_TOKEN_ERR(10002) | Token authentication failed (incorrect digital signature), which may be caused by incorrect appSecret |
THUNDER_AUTHRES_ERR_APPID(10003) | appid in token is inconsistent with appid when execute authentication |
THUNDER_AUTHRES_ERR_UID(10004) | uid in token is inconsistent with uid when execute authentication |
THUNDER_AUTHRES_ERR_TOKEN_EXPIRE(10005) | token has expired |
THUNDER_AUTHRES_ERR_NO_APP(10006) | App does not exist, which is not registered in the management background |
THUNDER_AUTHRES_ERR_TOKEN_WILL_EXPIRE(10007) | token is about to expire |
THUNDER_AUTHRES_ERR_BAND(10008) | The user is baned |
public static final class UserOfflineReason
Offline reason for user
Constant (Default Value) | Description | |
---|---|---|
THUNDER_OFFLINE_QUIT(1) | The user is offline actively | |
THUNDER_OFFLINE_DROPPED(2) | 因过长时间收不到对方数据包,超时掉线。注意:由于 SDK 使用的是不可靠通道,也有可能对方主动离开本方没收到对方离开消息而误判为超时掉线 | The packet could not be received for long time, lost connection due to timeout. Note: Because SDK uses unreliable channel, the counterpart may leave our side actively. So it is misjudged as timeout offline |
THUNDER_OFFLINE_BECOME_AUDIENCE(3) | User status is switched from anchor to audience (live mode) |
public static final class NetworkQuality
Network quality
Constant (Default Value) | Description |
---|---|
THUNDER_QUALITY_UNKNOWN(0) | Unknown quality |
THUNDER_QUALITY_EXCELLENT(1) | Excellent network quality |
THUNDER_QUALITY_GOOD(2) | Good network quality |
THUNDER_QUALITY_POOR(3) | The network quality is poor, but the communication is not affected even the user can feel its defects. |
THUNDER_QUALITY_BAD(4) | The network quality is bad, and the communication can be barely made but is not smooth |
THUNDER_QUALITY_VBAD(5) | The network quality is very bad, the communication cannot be made basically |
THUNDER_QUALITY_DOWN(6) | The network has been disconnected, and the communication cannot be made at all |
public static final class SourceType
Audio publishing mode
Constant (Default Value) | Description |
---|---|
THUNDER_PUBLISH_MODE_MIC(0) | Microphone (only microphone capture is published to room) |
THUNDER_PUBLISH_MODE_FILE(1) | Accompaniment (only file play is published to room) |
THUNDER_PUBLISH_MODE_MIX(2) | Mix (the microphone capture and file play are published to room) |
THUNDER_PUBLISH_MODE_NONE(10) | Stop all upstream audio data |
public static final class SoundEffectMode
Sound effect mode
Constant (Default Value) | Description |
---|---|
THUNDER_SOUND_EFFECT_MODE_NONE() | Disable mode |
THUNDER_SOUND_EFFECT_MODE_VALLEY() | VALLEY mode |
THUNDER_SOUND_EFFECT_MODE_RANDB() | R&B mode |
THUNDER_SOUND_EFFECT_MODE_KTV() | KTV mode |
THUNDER_SOUND_EFFECT_MODE_CHARMING() | CHARMING mode |
THUNDER_SOUND_EFFECT_MODE_POP() | Pop mode |
THUNDER_SOUND_EFFECT_MODE_HIPHOP() | Hip-hop mode |
THUNDER_SOUND_EFFECT_MODE_ROCK() | Rock mode |
THUNDER_SOUND_EFFECT_MODE_CONCERT() | Concert mode |
THUNDER_SOUND_EFFECT_MODE_STUDIO() | Studio mode |
public static final class VoiceChangerMode
Voice changing mode
Constant (Default Value) | Description |
---|---|
THUNDER_VOICE_CHANGER_MODE_NONE(0) | Disable mode |
THUNDER_VOICE_CHANGER_MODE_ETHEREAL(1) | Ethereal |
THUNDER_VOICE_CHANGER_MODE_THRILLER(2) | Thriller |
THUNDER_VOICE_CHANGER_MODE_LUBAN(3) | Luban |
THUNDER_VOICE_CHANGER_MODE_LORIE(4) | Lorie |
THUNDER_VOICE_CHANGER_MODE_UNCLE(5) | Uncle |
THUNDER_VOICE_CHANGER_MODE_DIEFAT(6) | Die-fat |
THUNDER_VOICE_CHANGER_MODE_BADBOY(7) | Bad boy |
THUNDER_VOICE_CHANGER_MODE_WRACRAFT(8) | Warcraft |
THUNDER_VOICE_CHANGER_MODE_HEAVYMETAL(9) | Heavy metal |
THUNDER_VOICE_CHANGER_MODE_COLD(10) | Cold |
THUNDER_VOICE_CHANGER_MODE_HEAVYMECHINERY(11) | Heavy mechinery |
THUNDER_VOICE_CHANGER_MODE_TRAPPEDBEAST(12) | Trapped breast |
THUNDER_VOICE_CHANGER_MODE_POWERCURRENT(13) | Power current |
public static final class AudioSaverMode
Audio saving mode
Constant (Default Value) | Description |
---|---|
THUNDER_AUDIO_SAVER_ONLY_CAPTURE(0) | Only save upstream audio data in channel. The voices of microphone capture and accompaniment can be saved after being set as upstream |
THUNDER_AUDIO_SAVER_ONLY_RENDER(1) | Save downstream audio data in room |
THUNDER_AUDIO_SAVER_BOTH(2) | Save upstream and downstream audio data in room |
public static final class AudioSaverWfMode
Writing file mode for saving audio
Constant (Default Value) | Description |
---|---|
THUNDER_AUDIO_SAVER_FILE_APPEND(0) | Open a file and put additional data at the end of file |
THUNDER_AUDIO_SAVER_FILE_OVERRIDE(1) | Open a file, and the written data will overlap its original content |
public static final class ThunderAudioRawFrameOperationMode
The use mode of onRecordAudioFrame
Constant (Default Value) | Description |
---|---|
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_READ_ONLY(0) | Read-only mode. The user can only get original audio data from AudioFrame |
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_WRITE_ONLY(1) | Write-only mode. The user replaces the data in AudioFrame to Thunder SDK for encoding and transmission |
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_READ_WRITE(2) | Read/write mode. The user obtains and modifies data from AudioFrame, and return it to Thunder SDK for encoding and transmission. |
public static final class ExternalVideoPixelFormat
External video pixel format
Constant (Default Value) | Description |
---|---|
THUNDER_PIXEL_FORMAT_RGBA(0) | RGBA format |
THUNDER_PIXEL_FORMAT_I420(1) | I420 format |
THUNDER_PIXEL_FORMAT_NV21(2) | NV21 format |
public static final class ThunderNetworkType
Network connection type
Constant (Default Value) | Description |
---|---|
THUNDER_NETWORK_TYPE_UNKNOWN(0) | Unknown network connection type |
THUNDER_NETWORK_TYPE_DISCONNECTED(1) | The network has been disconnected |
THUNDER_NETWORK_TYPE_CABLE(2) | Cable network |
THUNDER_NETWORK_TYPE_WIFI(3) | Wi-Fi (hotspot included) |
THUNDER_NETWORK_TYPE_MOBILE(4) | Mobile network. 2G, 3G and 4G network cannot be differentiated |
THUNDER_NETWORK_TYPE_MOBILE_2G(5) | 2G mobile network |
THUNDER_NETWORK_TYPE_MOBILE_3G(6) | 3G mobile network |
THUNDER_NETWORK_TYPE_MOBILE_4G(7) | 4G mobile network |
public static final class ThunderConnectionStatus
The network connection status with server
Constant (Default Value) | Description |
---|---|
THUNDER_CONNECTION_STATUS_CONNECTING(0) | Connecting |
THUNDER_CONNECTION_STATUS_CONNECTED(1) | Connected |
THUNDER_CONNECTION_STATUS_DISCONNECTED(2) | Disconnected |
public static final class ThunderVideoCaptureOrientation
Video capture orientation
Constant (Default Value) | Description |
---|---|
THUNDER_VIDEO_CAPTURE_ORIENTATION_PORTRAIT(0) | Portrait |
THUNDER_VIDEO_CAPTURE_ORIENTATION_LANDSCAPE(1) | Landscape |
public static final class ThunderVideoMirrorMode
Mirror mode
Constant (Default Value) | Description |
---|---|
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_MIRROR_PUBLISH_NO_MIRROR(0) | The preview other than stream publishing is mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_PUBLISH_BOTH_MIRROR(1) | Both preview and stream publishing are not mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_PUBLISH_BOTH_NO_MIRROR(2) | Neither preview and stream publishing is not mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_NO_MIRROR_PUBLISH_MIRROR(3) | Preview is not mirrored, but publish is mirrored |
public static final class ThunderPublishCDNErrorCode
Stream publishing results
Constant (Default Value) | Description |
---|---|
THUNDER_PUBLISH_CDN_ERR_SUCCESS(0) | Stream publishing succeeded |
THUNDER_PUBLISH_CDN_ERR_TOCDN_FAILED(1) | Publishing stream to external server (CDN) is failed. 1. Check whether url is correct. 2. Check whether the token in the URL is valid (generally, token is required during cdn stream publishing and can be ignored if it doe not exist). |
THUNDER_PUBLISH_CDN_ERR_THUNDERSERVER_FAILED(2) | Publish the stream to thunder internal server is failed. 1. Check anchor’s upstream network 2. Contact us to troubleshoot internal transmission problems |
THUNDER_PUBLISH_CDN_ERR_THUNDERSERVER_STOP(3) | Stop stream publishing |
public static final class ThunderSendMediaExtraInfoFailedStatus
Failure status of sending extra information
Constant (Default Value) | Description |
---|---|
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_DATA_EMPTY(1) | Extra information is null. |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_DATA_TOO_LARGE(2) | The data to be sent each time is too large. No more than 200 bytes when only publishing audio, and no more than 2048 bytes when publishing video |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_FREQUENCY_TOO_HIGHT(3) | The sending frequency is too high, which cannot exceeds 100ms each time |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NOT_IN_ANCHOR_SYSTEM(4) | Not an anchor system |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NO_JOIN_MEDIA(5) | Channel not to be joined |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NO_PUBLISH_SUCCESS(6) | Publishing failed |
public static final class ThunderAudioDeviceStatus
Audio device status
Constant (Default Value) | Description |
---|---|
THUNDER_AUDIO_DEVICE_STATUS_INIT_CAPTURE_SUCCESS(0) | Callback on successful initialization of audio capture device |
THUNDER_AUDIO_DEVICE_STATUS_INIT_CAPTURE_ERROR_OR_NO_PERMISSION(1) | Callback on initialization failure of audio capture. It may be caused by no permission |
THUNDER_AUDIO_DEVICE_STATUS_RELEASE_CAPTURE_SUCCESS(2) | Callback on successful release of audio capture device |
public static final class ThunderVideoCaptureStatus
Video capture status
Constant (Default Value) | Description |
---|---|
THUNDER_VIDEO_CAPTURE_STATUS_SUCCESS(0) | Succeeded |
THUNDER_VIDEO_CAPTURE_STATUS_AUTHORIZED(1) | Authorize |
THUNDER_VIDEO_CAPTURE_STATUS_NOT_DETERMINED(2) | No permission given |
THUNDER_VIDEO_CAPTURE_STATUS_RESTRICTED(3) | Occupied |
THUNDER_VIDEO_CAPTURE_STATUS_DENIED(4) | No permission |
THUNDER_VIDEO_CAPTURE_STATUS_CLOSE(5) | Close |
public static final class RemoteAudioState
Remote audio stream status
Constant (Default Value) | Description |
---|---|
THUNDER_REMOTE_AUDIO_STATE_STOPPED(0) | Default initialization sataus, which may be reported under the conditions of THUNDER_REMOTE_AUDIO_REASON_LOCAL_STOPPED(4) or THUNDER_REMOTE_AUDIO_REASON_REMOTE_STOPPED(6) |
THUNDER_REMOTE_AUDIO_STATE_STARTING(1) | The local user has accepted the first package of remote audio stream |
THUNDER_REMOTE_AUDIO_STATE_DECODING(2) | Decoding, playback normal |
THUNDER_REMOTE_AUDIO_STATE_FROZEN(3) | The reomte audio is freezing, which will be reported under the condition of THUNDER_REMOTE_AUDIO_REASON_NETWORK_CONGESTION(2) |
public static final class RemoteAudioReason
Cause of remote audio stream status change
Constant (Default Value) | Description |
---|---|
THUNDER_REMOTE_AUDIO_REASON_OK(0) | Normal |
THUNDER_REMOTE_AUDIO_REASON_INTERNAL(1) | Internal reason |
THUNDER_REMOTE_AUDIO_REASON_NETWORK_CONGESTION(2) | Network blocked |
THUNDER_REMOTE_AUDIO_REASON_NETWORK_RECOVERY(3) | Network back to normal |
THUNDER_REMOTE_AUDIO_REASON_LOCAL_STOPPED(4) | The local user stops receiving reomte audios or disables the audio module |
THUNDER_REMOTE_AUDIO_REASON_LOCAL_STARTED(5) | The local user resumes receiving the remote audio stream or enables the audio module |
THUNDER_REMOTE_AUDIO_REASON_REMOTE_STOPPED(6) | The remote user stops sending the audio stream or disables the audio module |
THUNDER_REMOTE_AUDIO_REASON_REMOTE_STARTED(7) | The remote user resumes sending the remote audio stream or enables the audio module |
public static final class RemoteVideoState
Remote video stream status
Constant (Default Value) | Description |
---|---|
THUNDER_REMOTE_VIDEO_STATE_STOPPED(0) | Default initialization status, which will be reported under the conditions of THUNDER_REMOTE_VIDEO_REASON_LOCAL_STOPPED(4) or THUNDER_REMOTE_VIDEO_REASON_REMOTE_STOPPED(6) |
THUNDER_REMOTE_VIDEO_STATE_STARTING(1) | The local user has accepted the first package of the reomte video |
THUNDER_REMOTE_VIDEO_STATE_DECODING(2) | The remote video is being decoded |
THUNDER_REMOTE_VIDEO_STATE_RENDERING(3) | The remote video is being renderred |
THUNDER_REMOTE_VIDEO_STATE_FROZEN(4) | Remote video is freezing, which will be reported under the conditions of THUNDER_REMOTE_VIDEO_REASON_NETWORK_CONGESTION(2) |
public static final class RemoteVideoReason
Cause of remote video stream status change
Constant (Default Value) | Description |
---|---|
THUNDER_REMOTE_VIDEO_REASON_OK(0) | Normal |
THUNDER_REMOTE_VIDEO_REASON_INTERNAL(1) | Internal reason |
THUNDER_REMOTE_VIDEO_REASON_NETWORK_CONGESTION(2) | Network blocked |
THUNDER_REMOTE_VIDEO_REASON_NETWORK_RECOVERY(3) | Network back to normal |
THUNDER_REMOTE_VIDEO_REASON_LOCAL_STOPPED(4) | The local user stops receiving reomte videos or disables the video module |
THUNDER_REMOTE_VIDEO_REASON_LOCAL_STARTED | The local user resumes receiving the remote video stream or enables the video module |
THUNDER_REMOTE_VIDEO_REASON_REMOTE_STOPPED | The remote user stops sending the video stream or disables the video module |
THUNDER_REMOTE_VIDEO_REASON_REMOTE_STARTED | The remote user resumes sending the remote video stream or enables the video module |
public static final class LocalAudioStreamStatus
Local audios status
Constant (Default Value) | Description |
---|---|
THUNDER_LOCAL_AUDIO_STREAM_STATUS_STOPPED(0) | Default initialization status |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_CAPTURING(1) | Enabling the recording device succeeded |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_ENCODING(2) | Coding the first frame of local audios succeeded |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_SENDING(3) | Sending the first frame of local audios succeeded |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_FAILED(4) | Enabling local audios failed |
public static final class LocalAudioStreamErrorReason
Cuase of local audios error
Constant (Default Value) | Description |
---|---|
THUNDER_LOCAL_AUDIO_STREAM_ERROR_OK(0) | Normal |
THUNDER_LOCAL_AUDIO_STREAM_ERROR_UNKNOWN(1) | Unknown reason |
THUNDER_LOCAL_AUDIO_STREAM_ERROR_CAPTURE_FAILURE(2) | Capturing local audios failed |
THUNDER_LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE(3) | Coding local audios failed |
public static final class LocalVideoStreamStatus
Local video stream status
Constant (Default Value) | Description |
---|---|
THUNDER_LOCAL_VIDEO_STREAM_STATUS_STOPPED(0) | Default initialization status |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_CAPTURING(1) | Enabling the recording device succeeded |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_PREVIEWING(2) | Previewing local video succeeded |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_ENCODING(3) | Coding the first frame of local videos succeeded |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_SENDING(4) | Sending the first frame of local videos succeeded |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_FAILED(5) | Enabling local videos failed |
public static final class LocalVideoStreamErrorReason
Cause of local video acquisition failure
Constant (Default Value) | Description |
---|---|
THUNDER_LOCAL_VIDEO_STREAM_ERROR_OK(0) | Normal |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_FAILURE(1) | Unknown error |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_DEVICE_DENIED(2) | No permission to enable the capture device |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_DEVICE_RESTRICTED(3) | The capture device is in use |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE(4) | Capturing local videos failed. Please whether the capture device is working properly |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE(5) | Coding failure of local video |
public static final class ThunderAudioFilePlayerEvent
Playback status of local files
Constant (Default Value) | Description |
---|---|
AUDIO_PLAY_EVENT_OPEN(1) | Open file |
AUDIO_PLAY_EVENT_PLAY(2) | Start playback |
AUDIO_PLAY_EVENT_STOP(3) | Stop playback |
AUDIO_PLAY_EVENT_PAUSE(4) | Pause playback |
AUDIO_PLAY_EVENT_RESUME(5) | Resume playback |
AUDIO_PLAY_EVENT_END(6) | Playback finished |
AUDIO_PLAY_EVENT_SEEK_COMPLETE(7) | Speed playback |
public static final class ThunderAudioFilePLayerErrorCode
Error code about playback events of local files
Constant (Default Value) | Description |
---|---|
AUDIO_PLAYER_OPEN_FILE_PATH_ERROR(-4) | Incorrect file path |
AUDIO_PLAYER_OPEN_FILE_FORMAT_NOT_SUPPORT(-3) | Incorrect file format |
AUDIO_PLAYER_OPEN_FILE_DECODER_FAILED(-2) | Decoding file format failed |
AUDIO_PLAYER_CREATE_FILE_DECODER_FAILED(-1) | Parsing file format failed |
AUDIO_PLAYER_STATUS_SUCCESS(0) | Succeeded |
public static final class LiveTranscodingMode
Configuration bracket for video mixing and transcoding output
Each bracket includes configuration of audio and video.
The default configuration of audio's each bracket is:
Encoding protocol | Bit rate | Sampling rate | Number of channels |
---|---|---|---|
encode | bitrate | sample | channel |
1 | 128 | 44100 | 2 |
The default configuration of video's each bracket is:
Constant (Default Value) | Bracket value | Resolution | Bit rate | Frame rate |
---|---|---|---|---|
TRANSCODING_MODE_320X180(1) | 1 | 320*180 | 150kbps | 15fps |
TRANSCODING_MODE_320X240(2) | 2 | 320*240 | 200kbps | 15fps |
TRANSCODING_MODE_640X360(3) | 3 | 640*360 | 500kbps | 15fps |
TRANSCODING_MODE_640X480(4) | 4 | 640*480 | 500kbps | 15fps |
TRANSCODING_MODE_960X544(5) | 5 | 960*544 | 1000kbps | 24fps |
TRANSCODING_MODE_1280X720(6) | 6 | 1280*720 | 1600kbps | 24fps |
TRANSCODING_MODE_1920X1080(7) | 7 | 1920*1080 | 4500kbps | 24fps |
101 | 180*320 | 150kbps | 15fps | |
102 | 240*320 | 200kbps | 15fps | |
103 | 360*640 | 500kbps | 15fps | |
104 | 480*640 | 500kbps | 15fps | |
105 | 544*960 | 1000kbps | 24fps | |
106 | 720*1280 | 1600kbps | 24fps | |
107 | 1080*1920 | 4500kbps | 24fps |
public static final class ThunderUserRole
User role
Constant (Default Value) | Description |
---|---|
THUNDERUSER_ROLE_AUDIENCE(0) | Only audience |
THUNDERUSER_ROLE_ANCHOR(1) | Anchor. If the audience interacts with the anchor, it will become an anchor |
public static final class ThunderLogLevel
Log level
Constant (Default Value) | Description |
---|---|
THUNDERLOG_LEVEL_TRACE(0) | TRACE |
THUNDERLOG_LEVEL_DEBUG(1) | DEBUG |
THUNDERLOG_LEVEL_INFO(2) | INFO |
THUNDERLOG_LEVEL_WARN(3) | WARN |
THUNDERLOG_LEVEL_ERROR(4) | ERROR |
THUNDERLOG_LEVEL_RELEASE(10) | RELEASE |
public static final class ThunderCameraPosition
Camera position
Constant (Default Value) | Description |
---|---|
THUNDERCAMERA_POSITION_FRONT(0) | Front camera |
THUNDERCAMERA_POSITION_BACK(1) | Rear camera. |
public static final class ThunderPublishOrientation
Orientation for publishing video
Constant (Default Value) | Description |
---|---|
THUNDERPUBLISH_VIDEO_ORIENTATION_PORTRAIT(0) | Portrait |
THUNDERPUBLISH_VIDEO_ORIENTATION_LANDSCAPE(1) | Landscape |
public static final class ThunderVideoEncodeType
Protocol type for encoding video
Constant (Default Value) | Description |
---|---|
THUNDERVIDEO_ENCODE_TYPE_H264(0) | H264 |
THUNDERVIDEO_ENCODE_TYPE_H265(1) | H265 |
public static final class ThunderVideoViewScaleMode
The video displays scale mode
Constant (Default Value) | Description |
---|---|
THUNDERVIDEOVIEW_SCALE_MODE_FILL(0) | Fill the window. If the proportion is not fit, it will be stretched to fill the window. |
THUNDERVIDEOVIEW_SCALE_MODE_ASPECT_FIT(1) | Adapt to the window. If the proportion is not fit, black edge will be left |
THUNDERVIDEOVIEW_SCALE_MODE_CLIP_TO_BOUNDS(2) | Fill the window. If the proportion is not fit, it will be cut out |
public static final class ThunderPublishPlayType
Publish play type
Constant (Default Value) | Description |
---|---|
THUNDERPUBLISH_PLAY_SINGLE(0) | Single publishing |
THUNDERPUBLISH_PLAY_INTERACT(1) | Video connection publishing |
THUNDERPUBLISH_PLAY_SCREENCAP(2) | Screen recording publishing |
THUNDERPUBLISH_PLAY_MULTI_INTERACT(3) | Multi-person video connection publishing |
public static final class ThunderRtcRemotePlayType
Remote end display type
Constant (Default Value) | Description |
---|---|
THUNDER_REMOTE_PLAY_NORMAL(0) | common audience view |
THUNDER_REMOTE_PLAY_MULTI(1) | Multiple interaction view |
public static final class ThunderPublishVideoMode
Video gear configuration
Constant (Default Value) | Description | Resolution | CodeRate | FrameRate |
---|---|---|---|---|
THUNDERPUBLISH_VIDEO_MODE_NORMAL(1) | SD | 320*240(landscape) | 200Kbps | 15fps |
THUNDERPUBLISH_VIDEO_MODE_HIGHQULITY(2) | HD | 368*640(portrait) | 500Kbps | 15fps |
THUNDERPUBLISH_VIDEO_MODE_SUPERQULITY(3) | UD | 544*960(portrait) | 1000Kbps | 24fps |
THUNDERPUBLISH_VIDEO_MODE_BLUERAY_2M(4) | Blu-ray | 720*1280(portrait) | 1500Kbps | 24fps |
THUNDERPUBLISH_VIDEO_MODE_BLUERAY_4M(5) | Blu-ray | 1080*1920(portrait) | 3000Kbps | 24fps |
public static final class ThunderVideoViewType
View type
Constant (Default Value) | Description |
---|---|
THUNDERVIDEO_VIEW_PREVIEW(1) | Preview |
THUNDERVIDEO_VIEW_PLAYVIEW(2) | Play view |
public static final class ThunderRtcProfile
Media mode
Constant (Default Value) | Description |
---|---|
THUNDER_PROFILE_DEFAULT(0) | Default mode, equals to THUNDER_PROFILE_NORMAL(1) audio/video mode |
THUNDER_PROFILE_NORMAL(1) | Audio/video mode (audio and video are both used) |
THUNDER_PROFILE_ONLY_AUDIO(2) | Pure audio mode (for scenario without video, so as to get more quality audio) |
public static final class ThunderVideoRenderMode
Video rendering mode (the same as the scale mode)
Constant (Default Value) | Description |
---|---|
THUNDERVIDEOVIEW_SCALE_MODE_FILL(0) | Fill the window. If the proportion is not fit, it will be stretched to fill the window. |
THUNDERVIDEOVIEW_SCALE_MODE_ASPECT_FIT(1) | Adapt to the window. If the proportion is not fit, black edge will be left |
THUNDERVIDEOVIEW_SCALE_MODE_CLIP_TO_BOUNDS(2) | Fill the window. If the proportion is not fit, it will be cut out |
public static final class LiveEngineCaptureType
Live engine capture Class
Constant (Default Value) | Description |
---|---|
THUNDER_CAPTURE_TYPE_DEFAULT_CAMERA(0) | Camera |
THUNDER_CAPTURE_TYPE_SCREEN_RECORD(1) | Screen recording |
THUNDER_CAPTURE_TYPE_EXTERNAL_SOURCE(2) | External stream publishing yuv |
public static final class ThunderVideoCodecType
Protocol Class for encoding and decoding video
Constant (Default Value) | Description |
---|---|
VIDEO_CODEC_UNKNOW(0) | Unknown type |
VIDEO_CODEC_VP8(1) | VP8 |
VIDEO_CODEC_H264(2) | H264 |
VIDEO_CODEC_H265(3) | H265 |
public static final class ThunderVideoQualityAdapt
Quality adaptability of local videos since last statistics (based on target frame rate and target code rate)
Constant (Default Value) | Description |
---|---|
ADAPT_NONE(0) | The quality of local video is constant |
ADAPT_UP_BANDWIDTH(1) | The quality of local video has been improved because of higher network bandwidth |
ADAPT_DOWN_BANDWIDTH(2) | The quality of local video becomes worse because of lower network bandwidth |
public static final class ThunderAudioOutputRouting
The type of the current audio routing.
Constant (Default Value) | Description |
---|---|
HUNDER_AUDIO_OUTPUT_ROUTING_DEFAULT(-1) | Default |
THUNDER_AUDIO_OUTPUT_ROUTING_HEADSET(0) | Headset |
THUNDER_AUDIO_OUTPUT_ROUTING_EARPIECE(1) | Earpiece |
THUNDER_AUDIO_OUTPUT_ROUTING_HEADSETNOMIC(2) | Headset without microphone |
THUNDER_AUDIO_OUTPUT_ROUTING_SPEAKERPHONE(3) | Speakerphone |
THUNDER_AUDIO_OUTPUT_ROUTING_LOUDSPEAKER(4) | Loudspeaker |
THUNDER_AUDIO_OUTPUT_ROUTING_HEADSETBLUETOOTH(5) | Bluetooth headset |
Reverberation parameter Class
public static final class ReverbExParameter {
/**
* Room size; range [0~100]
*/
public float mRoomSize = 0;
/**
* Pre-delay; range [0~200]
*/
public float mPreDelay = 0;
/**
* Reverberation; range: [0~100]
*/
public float mReverberance = 0;
/**
* High frequency factor; range [0~100]
*/
public float mHfDamping = 0;
/**
* Low frequency; range: [0~100]
*/
public float mToneLow = 0;
/**
* High frequency; range: [0~100]
*/
public float mToneHigh = 0;
/**
* Wet gain; range: [-20~10]
*/
public float mWetGain = 0;
/**
* Dry gain; range: [-20~10]
*/
public float mDryGain = 0;
/**
* Stereo width range: [0~100]
*/
public float mStereoWidth = 0;
}
Compressor parameter Class
public static final class CompressorParam {
/**
* Threshol; range: [-40~0]
*/
public int mThreshold = 0;
/**
* Gain
*/
public int mMakeupGain = 0;
/**
* Ratio
*/
public int mRatio = 0;
/**
* Slope
*/
public int mKnee = 0;
/**
* Release time; range: greater than0
*/
public int mReleaseTime = 0;
/**
* Start time; range: greater than 0
*/
public int mAttackTime = 0;
}
Limiter parameter Class
public static final class LimterParam {
/*
* -30 ~ 0
*/
public float fCeiling = 0;
/*
* -10 ~ 0
*/
public float fThreshold = 0;
/*
* 0 ~ 30
*/
public float fPreGain = 0;
/*
* 0 ~ 1000
*/
public float fRelease = 0;
/*
* 0 ~ 1000
*/
public float fAttack = 0;
/*
* 0 ~ 8
*/
public float fLookahead = 0;
/*
* 0.5 ~ 2
*/
public float fLookaheadRatio = 0;
/*
* 0 ~ 100
*/
public float fRMS = 0;
/*
* 0 ~ 1
*/
public float fStLink = 0;
}
Parameter Class of video encoding configuration
public class ThunderVideoEncoderConfiguration {
public int playType;//Playing method
public int publishMode;//Publish bracket
}
Profile (value) | Description |
---|---|
playType | Play type. For the optional value, refer to ThunderRtcConstant.ThunderVideoCaptureOrientation for details |
publishMode | Publish bracket. For the optional value, refer to ThunderRtcConstant.ThunderVideoCaptureOrientation for details |
Video coding inforamtion
public class ThunderVideoEncodeParam {
public int width; // Width
public int height; // Height
public int frameRate; // Frame rate
public int codeRate; // Code rate
}
Parameter Class for video watermark configuration
public class ThunderBoltImage {
/*
* During the local video living streaming and mixed video publishing, URL is defined differently.
* During the local live streaming, URL indicates the local absolute path of image on the local live streaming video;
* During the mixed video publishing, URL indicates the address of watermark image outputted by mixed audio. (The watermark is not supported in the mixed video output stream for the time being).
*/
public String url;
public int x; //The horizontal coordinate at upper left corner of the picture on the video frame.
public int y; //The vertical coordinate at upper left corner of the picture on the video frame.
public int width; //The width of the picture on the video frame.
public int height; //The height of the picture on the video frame.
}
The display layout parameter of multi-channel videos when there is multiple interaction
public class ThunderMultiVideoViewParam {
public ArrayList<VideoPosition> mVideoPositions; // Layout parameters of video/view
public VideoPosition mBgPosition; // Layout parameters of video/view background picture
public Bitmap mBgBitmap; // Video/view background picture
}
Parameter | Description |
---|---|
mVideoPositions | The position information of all grids. Multiple video is combined based on array |
mBgPosition | The position information of background pictures |
bgImageName | Background picture |
/*
* The following is VideoPosition diagram. The outline border indicates the overall video layout, and Video is a single vide area.
*
* |---------------------------------------------|
* | (0,0) |
* | |
* | (mX,mY) |
* | |---width---| |
* | | | |
* | height | | |
* | | Video | |
* | | | |
* | |-----------| |
* |---------------------------------------------|
*/
public class VideoPosition {
public int mIndex = 0; // Seat information for a single video/view layout
public int mX = 0; // X coordinate of a single video/view layout
public int mY = 0; // Y coordinate of a single video/view layout
public int mWidth = 0; // Width of a single video/view
public int mHeight = 0; // Height of a single video/view
}
Video display canvas
public class ThunderVideoCanvas {
public Object mView = null;//The view used to render video, often filled with FrameLayout
public int mRenderMode;//Render vidio scale mode, refer to ThunderRtcConstant.ThunderVideoRenderMode for optional values
public String mUid;//User’s uid
public int mSeatIndex;// Display location of the user specified by mUid
}
Configuration Class of video mixing and transcoding task
public class LiveTranscoding {
//Video mixing transcoding bracket, developing output video coding parameters (such as resolution, bit rate, frame rate, etc.) by setting bracket, which is configured in the background of Jocloud, and may be changed according to the needs of developers. See ThunderRtcConstant.LiveTranscodingMode for the default configuration information of the bracket
private int mTransCodingMode;
// Other parameters of video mixing, such as audio and video accompany address, lyrics address, etc.
private String mAudioUrl = ""; // URL of the standard audio file; support audio in Mp3 format
private String mLyricUrl = ""; // URL of lyric in LRC format, and the lyric file should be encoded in UTF-8 format. If this field is not configured, the audio will be played without lyrics; Otherwise, the lyrics will be added to the mixed video in the default style.
private String mMediaUrl = ""; // Video file url as standard
private MediaStreamLayout mMediaStreamLayout; //Layout of video standard stream in video mixing, see LiveTranscoding.MediaStreamLayout below for details
//All users in video mixing, see LiveTranscoding.TranscodingUser below for details
private ArrayList<TranscodingUser> mUserList = new ArrayList<>();
//Related operable functions
/**
* Add a user to the mixed video layout
*
* @param user
* @return 0
*/
public int addUser(TranscodingUser user);
/**
* Set user mixed video layout in batches
* In this method, the user sets all users participating in the combined picture. This method replaces the original data with new User data.
*
* @param users All mixed video users in channel
*/
public void setUsers(ArrayList<TranscodingUser> users);
/**
* Get current user location information
*
* @return Get information of all users in mixed video canvas in channel
*/
public final ArrayList<TranscodingUser> getUsers()
/**
* Remove users joining video mixing
*
* @param uid ID User ID to be removed
* @return 0
*/
public int removeUser(String uid);
/**
* Remove the mixed video of this channel. That is, the user will not use the mixed video
*
* @return 0
*/
public int removeAllUser();
/**
* Get the number of users joining video mixing
*
* @return Number of users joining video mixing
*/
public int getUserCount();
/**
* Set the bracket of mixed video outputted
*
* @param transCodingMode
*/
public void setTransCodingMode(int transCodingMode);
/**
* Get the bracket of mixed video outputted
*
* @return Bracket of mixed video outputted
*/
public int getTransCodingMode();
/**
* Set the external pure audio url as the standard stream for this mixed video. As the progress of the standard stream playback is required internally for synchronization of mixed video,
* the client should use ThunderAudioFilePlayer to play this audio and call setMixStandard in ThunderAudioFilePlayer to set the standard stream.
* If the user wants to use a customized style lyrics in the mixed video, the anchor can use the sendMediaExtraInfo API to send the lyrics progress, and call setAudioOnlyStandardSreamUrl to set the lyricUrl parameter to null,
* the audience will receive the onRecvMediaExtraInfo callback of IThunderMediaExtraInfoCallback when playing this mixed video stream, then read out the corresponding lyrics progress, and draw the lyrics according to the progress.
* @param audioUrl Standard video file url
* @param lyricUrl url of the lyrics file corresponding to the audio. The bank indicates no lyrics, otherwise the lyrics will be added to the mixed video in the default style.
* @return 0 Succeeded, <0 Failed
*/
public final int setAudioOnlyStandardSreamUrl(String audioUrl, String lyricUrl);
/**
* he external video media stream is set as the standard stream for mixed video, which cannot be used through API setAudioOnlyStandardSreamUrl simultaneously.
* @param mediaUrl Standard video file url
* @param layout Layout information of video media stream in the mixed video.
* @return 0 Succeeded, <0 Failed
*/
public final int setMediaStandardSream(String mediaUrl, MediaStreamLayout layout);
}
Used layout information configuration types include:
For the default configuration of video mixing and transcoding output bracket, refer to ThunderRtcConstant.LiveTranscodingMode for details
Layout configuration information participated in user’s mixed video stream
public static class TranscodingUser {
public String uid;
public String roomId;
public boolean bStandard;//Standard stream user or not
public int layoutX; //User's location x in video mixing canvas
public int layoutY; //User's location y in video mixing canvas
public int layoutW; //User's location w in video mixing canvas
public int layoutH; //User's location h in video mixing canvas
public int zOrder; //Layer number of the user's video frame on the live video. The value range is the integer in [0, 100], and the minimum value is 0 (default value), indicating that the image in this region is at the lowest level
public boolean bCrop; //How to crop the source stream when the video mixing service places it in the canvas (0: mend black edge, 1: crop)
public int cropX; //X coordinate of crop region
public int cropY; //Y coordinate of crop region
public int cropW; //Width of crop region
public int cropH; //Height of crop region
public float alpha; //Transparency of user video on the live video. The value range is [0.0, 1.0]. 0.0 indicates that the image in this region is completely transparent, while 1.0 indicates completely opaque. The default is 1.0
public int audioRoom;//Not yet realized
}
Layout configuration information of video standard stream in video mixing.
public static class MediaStreamLayout {
public int layoutX = 0; //Media's location x in video mixing canvas
public int layoutY = 0; //Media's location y in video mixing canvas
public int layoutW = 0; //Media's location w in video mixing canvas
public int layoutH = 0; //Media's location h in video mixing canvas
public int zOrder = 0; //Layer number of the media's video frame on the live video. The value range is the integer in [0, 100], and the minimum value is 0 (default value), indicating that the image in this region is at the lowest level
public boolean bCrop = true; //How to crop the source stream when the video mixing service places it in the canvas (0: mend black edge, 1: crop)
public int cropX = 0; //X coordinate of crop region
public int cropY = 0; //Y coordinate of crop region
public int cropW = 0; //Width of crop region
public int cropH = 0; //Height of crop region
public float alpha = 0; //Transparency of media video on the live video. The value range is [0.0, 1.0]. 0.0 indicates that the image in this region is completely transparent, while 1.0 indicates completely opaque. The default is 1.0
}