import { NativeModules } from 'react-native'; import { ZoomVideoSdkUser } from './ZoomVideoSdkUser'; import { ZoomVideoSdkSessionStatisticsInfo, ZoomVideoSdkSessionAudioStatisticsInfoType, ZoomVideoSdkSessionVideoStatisticsInfoType, ZoomVideoSdkSessionShareStatisticsInfoType, } from './ZoomVideoSdkSessionStatisticsInfo'; import type { SessionType } from './ZoomVideoSdk'; const { RNZoomVideoSdkSession } = NativeModules; /** * Zoom Video SDK session. */ export type ZoomVideoSdkSessionType = { /** * Get the session's name. */ getSessionName: () => Promise; /** * Get the session ID. */ getSessionID: () => Promise; /** * Get the session's password. */ getSessionPassword: () => Promise; /** * Get the host's name. */ getSessionHostName: () => Promise; /** * Get the session's host user object. */ getSessionHost: () => Promise; /** * Get a list of the session's remote users. */ getRemoteUsers: () => Promise; /** * Get the session's user object for myself. */ getMySelf: () => Promise; /** * Get the session number. */ getSessionNumber: () => Promise; /** * Get the session phone passcode. */ getSessionPhonePasscode: () => Promise; /** * Get the session audio statistics information. */ getAudioStatisticsInfo: () => Promise; /** * Get the received audio frequency. */ getAudioRecvFrequency: () => Promise; /** * Get the received audio jitter. */ getAudioRecvJitter: () => Promise; /** * Get the received audio latency. */ getAudioRecvLatency: () => Promise; /** * Get the average packet loss for received audio. */ getAudioRecvPacketLossAvg: () => Promise; /** * Get the maximum packet loss for received audio. */ getAudioRecvPacketLossMax: () => Promise; /** * Get the sent audio frequency. */ getAudioSendFrequency: () => Promise; /** * Get the sent audio jitter. */ getAudioSendJitter: () => Promise; /** * Get the sent audio latency. */ getAudioSendLatency: () => Promise; /** * Get the average packet loss for sent audio. */ getAudioSendPacketLossAvg: () => Promise; /** * Get the maximum packet loss for sent audio. */ getAudioSendPacketLossMax: () => Promise; /** * Get video statistics information. */ getVideoStatisticsInfo: () => Promise; /** * Get the received video frames per second. */ getVideoRecvFps: () => Promise; /** * Get the received video frame height. */ getVideoRecvFrameHeight: () => Promise; /** * Get the received video frame width. */ getVideoRecvFrameWidth: () => Promise; /** * Get the received video jitter. */ getVideoRecvJitter: () => Promise; /** * Get the received video latency. */ getVideoRecvLatency: () => Promise; /** * Get the average packet loss for received video. */ getVideoRecvPacketLossAvg: () => Promise; /** * Get the maximum packet loss for received video. */ getVideoRecvPacketLossMax: () => Promise; /** * Get the sent video frames per second. */ getVideoSendFps: () => Promise; /** * Get the sent video frame height. */ getVideoSendFrameHeight: () => Promise; /** * Get the sent video frame width. */ getVideoSendFrameWidth: () => Promise; /** * Get the sent video jitter. */ getVideoSendJitter: () => Promise; /** * Get the sent video latency. */ getVideoSendLatency: () => Promise; /** * Get the average packet loss for sent video. */ getVideoSendPacketLossAvg: () => Promise; /** * Get the maximum packet loss for sent video. */ getVideoSendPacketLossMax: () => Promise; /** * Get sharing statistics information. */ getShareStatisticsInfo: () => Promise; /** * Get the received share frames per second. */ getShareRecvFps: () => Promise; /** * Get the received share frame height. */ getShareRecvFrameHeight: () => Promise; /** * Get the received share frame width. */ getShareRecvFrameWidth: () => Promise; /** * Get the received share jitter. */ getShareRecvJitter: () => Promise; /** * Get the received share latency. */ getShareRecvLatency: () => Promise; /** * Get the average packet loss for received share. */ getShareRecvPacketLossAvg: () => Promise; /** * Get the maximum packet loss for received share. */ getShareRecvPacketLossMax: () => Promise; /** * Get the sent share frames per second. */ getShareSendFps: () => Promise; /** * Get the sent share frame height. */ getShareSendFrameHeight: () => Promise; /** * Get the sent share frame width. */ getShareSendFrameWidth: () => Promise; /** * Get the sent share jitter. */ getShareSendJitter: () => Promise; /** * Get the sent share latency. */ getShareSendLatency: () => Promise; /** * Get the sent share latency. */ getShareSendPacketLossAvg: () => Promise; /** * Get the maximum packet loss for sent share. */ getShareSendPacketLossMax: () => Promise; /** * Get the session type. */ getSessionType: () => Promise; }; export class ZoomVideoSdkSession implements ZoomVideoSdkSessionType { async getSessionName() { const sessionName = await RNZoomVideoSdkSession.getSessionName(); return sessionName; } async getSessionPassword() { const sessionPassword = await RNZoomVideoSdkSession.getSessionPassword(); return sessionPassword; } async getSessionHostName() { const sessionHostName = await RNZoomVideoSdkSession.getSessionHostName(); return sessionHostName; } async getSessionID() { const sessionID = await RNZoomVideoSdkSession.getSessionID(); return sessionID; } async getSessionHost() { const user = await RNZoomVideoSdkSession.getSessionHost(); return new ZoomVideoSdkUser(user); } async getRemoteUsers() { const users = await RNZoomVideoSdkSession.getRemoteUsers(); return users.map((user: ZoomVideoSdkUser) => new ZoomVideoSdkUser(user)); } async getMySelf() { const user = await RNZoomVideoSdkSession.getMySelf(); return new ZoomVideoSdkUser(user); } async getSessionNumber() { const sessionNumber = await RNZoomVideoSdkSession.getSessionNumber(); return sessionNumber; } async getSessionPhonePasscode() { const sessionPhonePasscode = await RNZoomVideoSdkSession.getSessionPhonePasscode(); return sessionPhonePasscode; } async getAudioStatisticsInfo() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioStatisticsInfo(); } async getAudioRecvFrequency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioRecvFrequency(); } async getAudioRecvJitter() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioRecvJitter(); } async getAudioRecvLatency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioRecvLatency(); } async getAudioRecvPacketLossAvg() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioRecvPacketLossAvg(); } async getAudioRecvPacketLossMax() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioRecvPacketLossMax(); } async getAudioSendFrequency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioSendFrequency(); } async getAudioSendJitter() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioSendJitter(); } async getAudioSendLatency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioSendLatency(); } async getAudioSendPacketLossAvg() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioSendPacketLossAvg(); } async getAudioSendPacketLossMax() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.audioSendPacketLossMax(); } async getVideoStatisticsInfo() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoStatisticsInfo(); } async getVideoRecvFps() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvFps(); } async getVideoRecvFrameHeight() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvFrameHeight(); } async getVideoRecvFrameWidth() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvFrameWidth(); } async getVideoRecvJitter() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvJitter(); } async getVideoRecvLatency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvLatency(); } async getVideoRecvPacketLossAvg() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvPacketLossAvg(); } async getVideoRecvPacketLossMax() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoRecvPacketLossMax(); } async getVideoSendFps() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendFps(); } async getVideoSendFrameHeight() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendFrameHeight(); } async getVideoSendFrameWidth() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendFrameWidth(); } async getVideoSendJitter() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendJitter(); } async getVideoSendLatency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendLatency(); } async getVideoSendPacketLossAvg() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendPacketLossAvg(); } async getVideoSendPacketLossMax() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.videoSendPacketLossMax(); } async getShareStatisticsInfo() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareStatisticsInfo(); } async getShareRecvFps() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvFps(); } async getShareRecvFrameHeight() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvFrameHeight(); } async getShareRecvFrameWidth() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvFrameWidth(); } async getShareRecvJitter() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvJitter(); } async getShareRecvLatency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvLatency(); } async getShareRecvPacketLossAvg() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvPacketLossAvg(); } async getShareRecvPacketLossMax() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareRecvPacketLossMax(); } async getShareSendFps() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendFps(); } async getShareSendFrameHeight() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendFrameHeight(); } async getShareSendFrameWidth() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendFrameWidth(); } async getShareSendJitter() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendJitter(); } async getShareSendLatency() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendLatency(); } async getShareSendPacketLossAvg() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendPacketLossAvg(); } async getShareSendPacketLossMax() { const info = new ZoomVideoSdkSessionStatisticsInfo(); return info.shareSendPacketLossMax(); } async getSessionType() { return await RNZoomVideoSdkSession.getSessionType(); } }