MediaContext
类提供可供 App 调用的用于课前预览的相关方法。
abstract fun openCamera()
开启摄像头。
abstract fun closeCamera()
关闭摄像头。
abstract fun startPreview(container: ViewGroup)
开启本地视频预览。
abstract fun stopPreview()
停止本地视频预览。
abstract fun openMicrophone()
开启麦克风。
abstract fun closeMicrophone()
关闭麦克风。
abstract fun publishStream(type: EduContextMediaStreamType)
将流发布到远端,包括当前摄像头采集的视频流和麦克风采集的音频流。
参数 | 描述 |
---|---|
type |
媒体流类型,详见 EduContextMediaStreamType。 |
abstract fun unPublishStream(type: EduContextMediaStreamType)
取消发布流。
参数 | 描述 |
---|---|
type |
媒体流类型,详见 EduContextMediaStreamType。 |
abstract fun renderRemoteView(container: ViewGroup?, streamUuid: String)
开始或停止渲染远端视频流。
参数 | 描述 |
---|---|
container |
视频 Container。viewGroup 为 null 代表关闭流渲染。 |
streamUuid |
流 ID。 |
abstract fun setVideoEncoderConfig(videoEncoderConfig: EduContextVideoEncoderConfig)
设置视频编码配置。
参数 | 描述 |
---|---|
videoEncoderConfig |
视频编码配置,详见 EduContextVideoEncoderConfig。 |