类型定义
本页列出 Android API 所有的类型定义。
EduContextRoomType
房间类型。
枚举值
- OneToOne
- 一对一互动教学
- SmallClass
- 在线互动小班课
- LargeClass
- 互动直播大班课
EduContextVideoRenderMode
视频渲染模式。
枚举值
- Hidden
- Hidden 模式。优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,多出的视频将被截掉。
- Fit
- Fit 模式。优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频长宽与显示窗口不同,视窗上未被填满的区域将被涂黑。
AgoraEduContextVideoSourceType
视频源类型。
枚举值
- None
- 无视频
- Camera
- 摄像头采集的视频
- Screen
- 屏幕共享的视频
AgoraEduContextAudioSourceType
音频源类型。
枚举值
- None
- 无音频
- Camera
- 麦克风采集的音频
AgoraEduContextMediaStreamType
媒体流类型。
枚举值
- None
- 既无音频也无视频
- Audio
- 纯音频流
- Video
- 纯视频流
- Both
- 音视频流
AgoraEduContextVideoStreamSubscribeLevel
视频流的分辨率高低。
枚举值
- LOW
- 分辨率低的视频流
- HIGH
- 分辨率高的视频流
AgoraEduContextDeviceType
设备类型。
枚举值
- Camera
- 摄像头
- Mic
- 麦克风
- Speaker
- 扬声器
AgoraEduContextMediaSourceState
媒体源状态。
枚举值
- Error
- 媒体源错误
- Close
- 媒体源关闭
- Open
- 媒体源开启
AgoraEduContextDeviceState2
设备状态
枚举值
- Error
- 设备错误
- Close
- 设备关闭
- Open
- 设备开启
EduContextUserLeftReason
用户离开房间原因。
枚举值
- Normal
- 用户正常离开房间。
- KickedOut
- 用户被踢出房间。
AgoraEduContextClassState
课堂状态。
枚举值
- Before
- 课堂还未开始。
- During
- 课堂进行中。
- After
- 课堂已结束。
AgoraEduContextUserRole
用户角色。
枚举值
- Teacher
- 老师
- Student
- 学生
- Assistant
- 助教
EduContextNetworkQuality
网络质量。
枚举值
- Unknown
- 未知
- Good
- 良好
- Medium
- 中等
- Bad
- 差
EduContextMirrorMode
视频镜像模式。
枚举值
- AUTO
- SDK 默认关闭镜像模式。
- ENABLED
- 开启镜像模式。
- DISABLED
- 关闭镜像模式。
EduContextConnectionState
本地客户端与声网服务器的连接状态。
枚举值
- Disconnected
- 连接已断开。
- Connecting
- 连接中。
- Connected
- 已连接。
- Reconnecting
- 重连中。
- Aborted
- 被踢出。
FcrAudioRawDataPosition
音频管线节点。
枚举值
- record
2
:录制后- beforeMixed
8
:多条远端音频流被混合成一路音频流前- mixed
4
:所有远端与本地音频流都已混合成一路音频流
FcrRecordingState
录制状态。
枚举值
- STOPPED
- 不在录制中
- STARTING
- 录制启动中
- STARTED
- 正在录制中
EduContextRenderConfig
视频渲染配置。
data class EduContextRenderConfig( val renderMode: EduContextRenderMode = EduContextRenderMode.HIDDEN, val mirrorMode: EduContextMirrorMode = EduContextMirrorMode.AUTO)
属性
- renderMode
- 视频渲染模式,详见 EduContextVideoRenderMode。
- mirrorMode
- 镜像模式,详见 EduContextMirrorMode。
AgoraEduContextStreamInfo
流信息。
data class AgoraEduContextStreamInfo( val streamUuid: String, val streamName: String?, val streamType: AgoraEduContextMediaStreamType, val videoSourceType: AgoraEduContextVideoSourceType, val audioSourceType: AgoraEduContextAudioSourceType, var videoSourceState: AgoraEduContextMediaSourceState, var audioSourceState: AgoraEduContextMediaSourceState, var videoState: AgoraEduContextMediaState, var audioState: AgoraEduContextMediaState, var owner: AgoraEduContextUserInfo)
属性
- streamUuid
- 流 ID,String 型。
- streamName
- 流名称,String 型。
- streamType
- 流类型,详见 AgoraEduContextMediaStreamType。
- videoSourceType
- 视频源类型,详见 AgoraEduContextVideoSourceType。
- audioSourceType
- 音频源类型,详见 AgoraEduContextAudioSourceType。
- videoSourceState
- 视频源状态,详见 AgoraEduContextMediaSourceState。
- audioSourceState
- 音频源状态,详见 AgoraEduContextMediaSourceState。
- owner
- 流所属的用户,详见 AgoraEduContextUserInfo。
AgoraEduContextUserInfo
用户基础信息。
data class AgoraEduContextUserInfo( val userUuid: String, val userName: String, val role: AgoraEduContextUserRole = AgoraEduContextUserRole.Student)
属性
- userUuid
- 用户 ID,String 型。
- userName
- 用户名称,String 型。
- role
- 用户角色,详见 AgoraEduContextUserRole。
AgoraEduContextDeviceInfo
设备信息。
data class AgoraEduContextDeviceInfo( val deviceId: String, val deviceName: String, val deviceType: AgoraEduContextDeviceType )
属性
- deviceType
- 设备类型,详见 AgoraEduContextDeviceType。
- deviceId
- 设备 ID,String 型。
- deviceName
- 设备名称,String 型。
EduContextRoomInfo
房间信息。
data class EduContextRoomInfo( val roomUuid: String, val roomName: String, val roomType: EduContextRoomType )
属性
- roomUuid
- 房间 ID,String 型。
- roomName
- 房间名称,String 型。
- roomType
- 房间类型,详见 EduContextRoomType。
AgoraEduContextClassInfo
课堂信息。
data class AgoraEduContextClassInfo( var state: AgoraEduContextClassState = AgoraEduContextClassState.Before, val startTime: Long = 0L, val duration: Long = 0L, val closeDelay: Long = 0L )
属性
- state
- 课堂状态,详见 AgoraEduContextClassState。
- startTime
- 课堂开始时间,Long 型。
- duration
- 课堂时长,Long 型。
- closeDelay
- 拖堂时长,Long 型。
AgoraEduContextLocalStreamConfig
视频流配置。
data class AgoraEduContextLocalStreamConfig( val width: Int, val height: Int, val frameRate: Int, val bitRate: Int, val mirror: Boolean )
属性
- width
- 视频宽,Int 型,单位为 pixel,默认值为 320。
- height
- 视频高,Int 型,单位为 pixel,默认值为 240。
- frameRate
- 视频帧率,Int 型,单位为 fps,默认值为 15。
- bitRate
- 视频码率,Int 型,单位为 Kbps,默认值为 200。
- mirror
- 视频是否镜像,Bool 型,默认值为 false。
FcrAudioRawDataConfig
需要回调出的音频数据配置。
public class FcrAudioRawDataConfig { public int sampleRate = 48000; public int samplesPerChannel = 1024; public int channels = 1; public int mode = 0; public int position = 2; }
属性
- sampleRate
- 采样率,可设为 8000,16000,32000,44100 或 48000。默认值 48000。
- samplesPerChannel
- 每次回调时每个声道的样本点个数。默认值 1024。
- channels
- 单声道或双声道。默认值 1。
- mode
- 对音频数据的操作权限,目前只读
Constants.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY
。 - position
- 音频数据在管道中的位置,比如录制后、播放前等,可设为
IAudioFrameObserver.POSITION_RECORD
。
FcrAudioRawData
音频数据。
public class FcrAudioRawData { public int samplesPerChannel; public int bytesPerSample; public int channels; public int sampleRate; public ByteBuffer buffer; }
属性
- samplesPerChannel
- 每个声道的采样点数。
- bytesPerSample
- 每个样本的字节数,2 字节。
- channels
- 声道数。
- sampleRate
- 采样率。
- buffer
- 指向音频数据内存的指针。buffer 的长度(字节) = (samplesPerChannel * channels * bytesPerSample)
FcrSnapshotInfo
截图信息。
class FcrSnapshotInfo { var roomUuid: String? = null var streamUuid: String? = null var filePath: String? = null var width: Int? = null var height: Int? = null }
参数
- roomUuid
- 房间 ID。
- streamUuid
- 流 ID
- filePath
- 截图保存地址。
- width
- 图片宽度。
- height
- 图片高度。