import { JSBridgeProtocol } from '@realsee/jsbridge-x'; import { RTCProtocol } from '../rtc/protocol'; import { BuiltInRTCType, RTCType } from '../rtc/type'; import { GetVoiceSign } from './GetVoiceSign'; import { MicroStatus } from './LiveMsg'; /** * 依赖配置。 */ export interface LiveOptions { /** * 创建`WebSocket`所依赖的URL。 */ url?: string; /** * RTC实例。 * 优先使用该实例。 */ rtc?: RTCProtocol; /** * RTC类型 * rtc 为空时使用内置的rtc实例类型 */ rtcType?: RTCType; /** * 麦克风初始状态 */ initialMicroStatus?: MicroStatus; /** * 获取建立 WebSocket 连接的依赖Tick */ getTicket?: () => Promise; /** * jsBridge实例 * 使用内置rtc时提供给rtc实例使用 */ jsBridge?: JSBridgeProtocol; /** * 获取语音签名的接口 * 使用内置rtc时提供给rtc实例使用 */ getVoiceSign?: GetVoiceSign; /** * 使用webRTC时会有自动播放的安全策略限制,用户有交互 * @param options * @returns */ autoPlayConfirm?: (options: { onConfirm: () => void; }) => void; /** * 使用内置的rtc实例 */ useBuiltInRTC?: boolean; /** * 内置的rtc通道类型 * trtc or chime , default trtc */ builtInRTCType?: BuiltInRTCType; /** * 使用内置的jsBridge实例 */ useBuiltInJsBridge?: boolean; /** * 能否禁用某个/些用户的麦克风 */ canForbidUserMicro?: (users: string | string[]) => boolean; /** * 能否限制某个/些用户的帧数据同步 */ canForbidUserSync?: (users: string | string[]) => boolean; /** * 能否强制"踢掉"某个/些用户。 */ canForbidUserKick?: (users: string | string[]) => boolean; /** * 是否开启调试模式:此模式下会在终端打印日志方便调试。 */ __debug__?: boolean; }