import { XYLayoutState } from '../render/videoManager.type'; import { Gap } from '../../type/layout'; import { AutoState } from '../../type/polling'; /** * 设备类型 * * @param webrtc - WebRTC终端 * @param soft - 软件APP终端 * @param hard - 硬件终端 * @param nemono - 小鱼终端 * @param virtualnemo - 虚拟小鱼终端 * @param nemo - 小鱼终端 * @param tvbox - 大型硬件终端 * @param h323 - H323终端 * @param record - 虚拟录制终端 * @param bruce - 大鱼硬件终端 * @param tel - 手机终端 * @param pstngw - PSTN终端 * @param desk - 桌面应用终端 */ export type XYDeviceType = 'webrtc' | 'soft' | 'hard' | 'nemono' | 'virtualnemo' | 'nemo' | 'tvbox' | 'h323' | 'record' | 'bruce' | 'tel' | 'pstngw' | 'desk'; /** * Layout头像类型 * * @param NONE -1 - 无头像 * @param TEXT 0 - 名称头像 * @param IMAGE 1 - 人物头像 */ export declare enum LayoutAvatarType { NONE = -1, TEXT = 0, IMAGE = 1 } /** * 视频关闭原因 * * @param MuteByUser - 用户自己关闭 * @param MuteByBWLimit - 带宽限制 * @param MuteByNoInput - 没有视频输入 * @param MuteByConfMgmt - 会控关闭 * @param MuteByDeviceDetection - 设备探测 * @param MuteByPhoneCall - 电话占用 */ export declare enum MuteReason { MuteByUser = 0, MuteByBWLimit = 1, MuteByNoInput = 2, MuteByConfMgmt = 3, MuteByDeviceDetection = 4, MuteByPhoneCall = 5 } /** * Layout Result布局结果中返回的基础数据 * * @property { number } participantId 参会者id * @property { 0 | 1 } mediagroupid 参会者画面类型,0:people画面,1:共享内容画面 * @property { string } remoteType 设备类型 * @property { string } remoteName 参会者名称 * @property { string } videoTrackId 当前参会者画面Track轨道id,用于在 VideoTrackList 中匹配stream数据 * @property { boolean } isAudioMute 参会者麦克风状态,true:开启,false:关闭 * @property { boolean } isVideoMute 参会者摄像头状态,true:开启,false:关闭 * @property { boolean } isActiveSpeaker 参会者是否是语音激励,即当前会中说话声音最大的一个人 * @property { number } LayoutVideoState 参会者画面的状态:请求中,正常,电话入会,视频暂停等 * @property { number } MuteReason 视频关闭原因 * @property { number } extUserId 参会者ID * @property { string } calluri 参会者Url * @property { number } ExpectHeight 期望分辨率 * @property { number } ExpectWidth 期望分辨率 * @property { number } feccOri ignore */ export interface ILayoutRoster { participantId: number; mediagroupid: number; remoteType: string; remoteName: string; videoTrackId: string; isAudioMute: boolean; isVideoMute: boolean; isActiveSpeaker: boolean; LayoutVideoState: number; MuteReason: MuteReason; extUserId: string; calluri: string; ExpectHeight: number; ExpectWidth: number; feccOri: number; } /** * Roster:参会者的基本信息,包含基本信息,设备信息,画面信息等 * * @property { string } key - 内部Key,包含参会者endpointId、多分组通道信息,由一定规则生成; * @property { IDeviceType } deviceType - 设备类型 * @property { string } endpointId - 设备ID * @property { string } displayName - 参会者名称 * @property { number } mediagroupid - 参会者画面类型,0:people画面,1:共享内容画面 * @property { number } participantId - 参会者人员临时ID,迁会之后此ID会发生变化 * @property { boolean } audioTxMute - 参会者麦克风状态,true:关闭麦克风,false:开启麦克风 * @property { boolean } videoTxMute - 参会者摄像头状态,true:关闭摄像头,false:开启摄像头 * @property { boolean } isForceFullScreen - 参会者是否是主画面 * @property { boolean } isFocusScreen - 参会者是否是焦点画面 * @property { number } videoMuteReason - 视频关闭原因 * @property { boolean } isContent - 参会者画面类型,同mediagroupid,true:是共享内容画面,false:people画面 * @property { boolean } isActiveSpeaker - 参会者是否是语音激励,即当前会中说话声音最大的一个人 * @property { boolean } isLocal - 是否是Local设备 * @property { string } hiddenReason - 可选,是否是会控隐藏画面模式,默认是无此属性,当有内容时,代表隐藏这个画面 * @property { boolean } audioRxMute - ignore * @property { boolean } videoRxMute - ignore * @property { boolean } onHold - ignore * @property { boolean } isLastAdd - ignore * @property { boolean } isPolling - ignore */ export interface IRoster extends Partial { key: string; deviceType: XYDeviceType; endpointId: string; displayName: string; mediagroupid: number; participantId: number; audioTxMute: boolean; videoTxMute: boolean; audioRxMute: boolean; videoRxMute: boolean; videoMuteReason: number; isForceFullScreen: boolean; isFocusScreen: boolean; isLastAdd: boolean; onHold: boolean; isPolling: boolean; isContent: boolean; isActiveSpeaker: boolean; isLocal?: boolean; hiddenReason?: string; } /** * 参会者布局详细数据 * * @property { string } id - Layout ID,布局唯一ID * @property { IRoster } roster - 参会者基本信息、状态信息,例如:用户名、麦克风/摄像头状态、是否是主会场等信息 * @property { XYLayoutState } state - 当前参会者的画面状态信息 * @property { IRotateStyle | null } rotate - 当前参会者的旋转信息,用于设置video标签样式 * @property { IRotationInfoTotalItem | null } rotationInfo - 当前参会者的旋转信息 * @property { LayoutAvatar | null } avatar - 头像, 如未在setFeatureConfig配置相关参数,则返回null * @property { XYPositionStyle } positionStyle - Layout成员布局位置样式 * @property { boolean } isMirror - 是否是镜像画面 * @property { ExternalTemplateConfig } templateConfig - 模版额外配置 * @property { number[] } position - 位置坐标,分别是左,上,宽,高 * @property { XYPositionInfo } positionInfo - Layout成员布局位置 分别是:宽、高 * @property { number } index - 索引值 * @property { AutoState } pollingState - 轮询多画面状态 * @property { string } pollingName - 多画面名称 * @property { number } resolution - 忽略, 2.0.2以前的版本 自定义布局roster请流使用 * @property { number } quality - 忽略, 2.0.2以前的版本 自定义布局roster请流使用 * @property { boolean } deal - 是否处理此数据 */ export interface ILayout { id: string; roster: IRoster | null; state: XYLayoutState; rotate: IRotateStyle | null; rotationInfo: IRotationInfoTotalItem | null; avatar: LayoutAvatar | null; positionStyle?: XYPositionStyle; isMirror?: boolean; templateConfig?: ExternalTemplateConfig; position?: number[]; positionInfo?: XYPositionInfo; index?: number; pollingState?: AutoState; pollingName?: string; resolution?: number; quality?: number; deal?: boolean; gap?: Gap[]; } /** * Layout成员布局位置 * 分别是:宽、高 * * @property { number } width - 当前画面的宽度 * @property { number } height - 当前画面的高度 */ export interface XYPositionInfo { width: number; height: number; } /** * Layout成员布局位置样式 * 分别是:左、上、宽、高 * * @property { string } left - 当前画面距离左的像素位置 * @property { string } top - 当前画面距离上的像素位置 * @property { string } width - 当前画面宽度,单位px * @property { string } height - 当前画面高度,单位px * */ export interface XYPositionStyle { left: string; top: string; width: string; height: string; } /** * Video元素旋转样式 * * @property { string } transform - Video元素选转角度:rotateZ(${n}deg) * @property { string } width - Video元素的宽:${n}px * @property { string } height - Video元素的高:${n}px */ export interface IRotateStyle { transform?: string; width?: string; height?: string; } /** * 画面屏幕旋转信息 * * @property { number } height - 高度 * @property { number } width - 宽度 * @property { number } participantId - 用户id * @property { number } rotation - 旋转角度 * @param 0 | 1 不需要旋转 * @param 2 顺时针旋转180度 * @param 3 顺时针旋转270度 */ export interface IRotationInfoItem { height: number; width: number; participantId: number; rotation: number; } /** * 缓存content+people的屏幕旋转信息数据 * * @property { number } mediagroupid 画面类型:people/content * @property { string } id 用户id */ export interface IRotationInfoTotalItem extends IRotationInfoItem { mediagroupid: number; id: string; } /** * 缓存媒体下发的屏幕旋转信息 * * @property { IRotationInfoItem[] } content content共享内容的旋转信息 * @property { IRotationInfoItem[] } people people的旋转信息 * @property { IRotationInfoTotalItem[] } total content+people的旋转信息 */ export interface IRotationInfo { content: IRotationInfoItem[]; people: IRotationInfoItem[]; total: IRotationInfoTotalItem[]; } /** * 头像 * * @property { LayoutAvatarType } type - 头像类型,名称头像、人物头像 * @property { string } value - 内容 */ export interface LayoutAvatar { type: LayoutAvatarType; value: string; } /** * 模版额外配置 * * @property { string } id - templateId (模版名称_画面数量_第几个画面) * @property { boolean } isPIP - 是否在画中画 * @property { boolean } isRotate - 是否要适配旋转 * @property { number } zIndex - 层级 * @property { Record } customStyle - 自定义样式 * @property { boolean } isMain - 是否是大画面 * @property { boolean } enableBorder - 是否开启边框 */ export interface ExternalTemplateConfig { id?: string; isPIP?: boolean; isRotate?: boolean; zIndex?: number; customStyle?: Record; isMain?: boolean; enableBorder?: boolean; }