declare module 'ezuikit-js' { namespace EZUIKit { class EZUIKitPlayer { readonly themeId: string constructor(options: EZUIKitPlayerOptions) /** * 开始播放 */ play(): Promise /** * 停止播放 */ stop(): Promise /** * 开启声音 */ openSound(): Promise /** * 开始录制 * @param fileName */ startSave(fileName: string): Promise /** * 停止录制并下载文件 */ stopSave(): Promise /** * 抓图 * @param fileName * @param capCallback * 方式1 - 下载到本地 * player.capturePict(fileName) * 方式2 - 返回base64格式 * player.capturePict(fileName, capCallback) */ capturePicture(fileName: string, capCallback?: { (data: string): void }): void /** * 开始对讲 */ startTalk(): void /** * 全屏 */ stopTalk(): void /** * 全屏 */ fullScreen(): void /** * 取消全屏 */ cancelFullScreen(): void /** * 获取OSD时间 */ getOSDTime(): Promise /** * 切换地址播放 * @param options */ changePlayUrl(options: { type?: 'live' | 'rec' | 'cloud.rec' deviceSerial?: string, channelNo?: number, accessToken?: string, hd?: boolean, validCode?: string, begin?: string, end?: string }): Promise Theme: { /** * 切换模板主题 */ changeTheme(template: EZUIKitPlayerOptions['template']) } /** * 开启电子放大 */ enableZoom(): Promise /** * 关闭电子放大 */ enableZoom(): Promise /** * 重置画面宽高 * @param width * @param height */ reSize(width: number, height: number) } } export default EZUIKit } type EZUIKitPlayerOptionsThemeDataBtnList = { iconId: 'deviceID' | 'deviceName' | 'cloudRec' | 'rec' | 'play' | 'capturePicture' | 'sound' | 'pantile' | 'recordvideo' | 'talk' | 'zoom' | 'hd' | 'webExpend' | 'expend', part: 'left' | 'right', defaultActive: number, memo: string, isrender: number } type EZUIKitPlayerOptionsThemeData = { autoFocus: number, // 连接视频时的占位图片 poster?: string, header: { color?: string, activeColor?: string, backgroundColor?: string, btnList: EZUIKitPlayerOptionsThemeDataBtnList[] }, footer: { color?: string, activeColor?: string, backgroundColor?: string, btnList: EZUIKitPlayerOptionsThemeDataBtnList[] }, } export type EZUIKitPlayerOptions = { id: string, url: string, accessToken: string, width: number, height: number, template?: 'mobileLive' | 'mobileRec' | 'simple' | 'pcLive' | 'security' | 'voice' | 'pcRec' | string, themeData?: EZUIKitPlayerOptionsThemeData, // 例:talk plugin?: string[], handleSuccess?(), seekFrequency?: number }