import { ExternalTemplateConfig, ILayout, IRoster } from './index'; import { StreamResolutionLevel, VideoQuality } from './stream'; /** * Layout List数据,支持画面重复渲染 * * @param { string } Map.key - Roster Id,一对多关系,同一个Id可能会有多个画面重复渲染 * @param { ILayout[] } Map.value - Layout List数据,每个一Layout代表一路画面 */ export type TLayoutMap = Map; /** * 布局模式类型 */ export type IMode = `${TemplateMode | ContentTemplateMode}`; /** * 【AUTO】模版类型 * * @param SPEAKER - 演讲者模式,即 1大N小 画面模式 * @param GALLERY - 画廊模式,即 宫格布局 */ export declare enum TemplateMode { SPEAKER = "SPEAKER", GALLERY = "GALLERY" } /** * 【AUTO】Content布局模式 * * @param MULTI_PIC_CONTENT_HIGH_PRIORITY - 缩略视图, Content是大窗口 * @param MULTI_PIC_ACTIVE_HIGH_PRIORITY - 缩略共享, ActiveSpeaker是大窗口 * @param TWO_PIC_PIP - 共享视图, 画中画模式(picture in picture) * @param CONTENT_ONLY - 共享全视图, 只显示Content * @param TWO_PIC_SYMMETRIC - 共享+演讲, 对称显示content和speaker(side by side) */ export declare enum ContentTemplateMode { MULTI_PIC_CONTENT_HIGH_PRIORITY = "MULTI_PIC_CONTENT_HIGH_PRIORITY", MULTI_PIC_ACTIVE_HIGH_PRIORITY = "MULTI_PIC_ACTIVE_HIGH_PRIORITY", TWO_PIC_PIP = "TWO_PIC_PIP", CONTENT_ONLY = "CONTENT_ONLY", TWO_PIC_SYMMETRIC = "TWO_PIC_SYMMETRIC" } /** * 模板对应位置类型 * * @enum * @param LOCAL - 本地 * @param CONTENT - 共享画面 * @param PEOPLE - 非共享画面 * @param CHAIRMAN - 主会场 */ export declare enum TemplateType { LOCAL = "LOCAL", CONTENT = "CONTENT", PEOPLE = "PEOPLE", CHAIRMAN = "CHAIRMAN", NONE = "NONE" } /** * Layout 模版 分辨率 * * @property { StreamResolutionLevel } normal 默认请流分辨率 * @property { StreamResolutionLevel } low 低性能请流分辨率 * @property { StreamResolutionLevel } high 高分辨率 */ export interface ITemplateResolution { normal: StreamResolutionLevel; low: StreamResolutionLevel; high?: StreamResolutionLevel; } /** * Layout模版定义 * * @property { number[] } position - 位置/尺寸比例 * @property { ITemplateResolution } resolution - 分辨率 * @property { number } resolution.normal - 正常分辨率 * @property { number } resolution.low - 低性能模式分辨率 * @property { number } resolution.high - 高分辨率 * @property { VideoQuality } quality - 请流质量 * @property { TemplateType } type - 类型,LOCAL/CONTENT/PEOPLE/CHAIRMAN * @property { any } config - 额外配置项 eg: zIndex - 层级 * @property { string } calluri - 指定请流的callUri */ export type ITemplateObj = { position: number[]; resolution: ITemplateResolution; quality?: VideoQuality; type?: TemplateType; config?: ExternalTemplateConfig; calluri?: string; gap?: Gap[]; }; /** * 模版信息 */ export type ITemplate = Partial<{ [type in TemplateMode | ContentTemplateMode]: TemplateInfos; }>; export interface TemplateInfos { temp: { [id: string]: ITemplateObj[]; }; rate: { [index: number]: number; }; } /** * 最终匹配的模版数据 * * @param { ITemplateObj[] } template 模版信息 * @param { number } rate 容器比例 */ export interface TemplateInfo { template: ITemplateObj[]; rate: number; } /** * 获取模版配置参数 * * @param { TemplateMode | ContentTemplateMode } modeType - 模版类型 * @param { number } templateCount - 模版对应画面数量 * @param { number } participantCount - 会中总人数 * @param { boolean } isEnableHideLocalView - 是否隐藏本地画面模式 * @param { boolean } isChairmanMode - 是否是主会场模式 * @param { boolean } isInDialogMode - 是否是对话模式布局 * @param { TemplateType } templateType - 全屏画面类型 * @param { LayoutOrientationType } orientation - 是否是移动端,及方向 * @param { FocusViewConfig } focusViewConfig - 切换的主画面信息 */ export interface TemplateParams { modeType?: TemplateMode | ContentTemplateMode; templateCount?: number; participantCount?: number; isEnableHideLocalView?: boolean; isChairmanMode?: boolean; isInDialogMode?: boolean; templateType?: TemplateType; orientation?: LayoutOrientationType; focusViewConfig?: FocusViewConfig; } /** * 移动端布局方向 * * @param NONE -1 - 默认布局(PC) * @param MOBILE_HORIZONTAL 0 - 移动端横屏布局 * @param MOBILE_VERTICAL 1 - 移动端竖屏布局 */ export declare enum LayoutOrientationType { NONE = -1, MOBILE_HORIZONTAL = 0, MOBILE_VERTICAL = 1 } /** * 焦点画面来源 * * @param NONE 0 - 无 * @param USER 1 - 用户 * @param MEETING 2 - 会控 */ export declare enum FocusViewKind { NONE = 0, USER = 1, MEETING = 2 } /** * 焦点画面参数 * * @property { boolean } isFocusMode - 是否显示焦点画面布局,Content/全屏模式 优先级更高 * @property { TemplateType } type - 画面类型 * @property { IRoster|null } roster - 焦点画面roster信息 * @property { FocusViewKind } kind - 来源 */ export interface FocusViewConfig { isFocusMode: boolean; type: TemplateType; roster: IRoster | null; kind?: FocusViewKind; } /** * 布局相关配置 * * @property { boolean } isForceSharedLayout - 本地共享布局是否强制宫格布局 * @property { number } localSharedMaxViewCount - 本地共享时显示的最大画面数量 * @property { number } layoutGap - 布局间距,默认:1,代表1px */ export interface LayoutConfig { isForceSharedLayout?: boolean; localSharedMaxViewCount?: number; layoutGap?: number; } /** * 主画面来源 * * @param NONE '' - 默认:主会场模式 * @param MAIN_VENUE mainVenue - 主会场模式 * @param FOCUS_MODE focusMode - 焦点模式 */ export declare enum ChairManReason { NONE = "", MAIN_VENUE = "mainVenue", FOCUS_MODE = "focusMode" } /** * RosterId 分割信息 * * @property { string } endpointId - 参会者callUri字段 * @property { string } mediagroupId - 多分组ID */ export interface IRosterIdInfo { endpointId: string; mediagroupId: string; } export interface Template { [key: string]: { rate: number | undefined; temp: any; }; } export interface TemplateItem { position: number[]; resolution: { normal: StreamResolutionLevel; low?: StreamResolutionLevel; high?: StreamResolutionLevel; }; type: TemplateType; quality: VideoQuality; } /** * Layout状态,当前仅支持上报轮询多画面状态 * * @property { boolean } isPolling - 是否增在轮询中,true代表正在轮询中,false代表结束/暂停轮询状态 */ export interface LayoutState { isPolling: boolean; } /** * RosterId 分割信息 * * @property { string } endpointId - 参会者callUri字段 * @property { string } mediagroupId - 多分组ID */ export interface IRosterIdInfo { endpointId: string; mediagroupId: string; } /** * 需要管理员广播才能收看内容共享 * * @property { boolean } enableContentLiveOnHold - 是否开启了指定内容广播 * @property { string } audioTrackId - 广播的audioTrackId * @property { string } contentUrl - 广播的contentUrl */ export interface ContentOnholdInfo { enableContentLiveOnHold: boolean; audioTrackId: string; contentUrl: string; } /** * 模版间距 * * @param OFF 0 - 关闭 * @param ON 1 - 开启 */ export declare enum Gap { OFF = 0, ON = 1 }