export class Meeting { /** * @description * This represents the meetingId */ id: string; /** * @description * This represents the `participantId` of the active speaker in the meeting */ activeSpeakerId?: string; /** * @description * This represents the `participantId` of the active presenter in the meeting */ activePresenterId?: string; /** * @description * This represents the `participantId` of the main participant in the meeting */ mainParticipantId: string; /** * @deprecated */ connections: Map; /** * @description * These represents the `Participant` object for the local participant */ localParticipant: Participant; /** * @description * These represents the Map of all the Participant objects except local participant */ participants: Map; /** * @description These represents the current state of the meeting Livestream */ livestreamState: | 'LIVESTREAM_STOPPED' | 'LIVESTREAM_STARTING' | 'LIVESTREAM_STARTED' | 'LIVESTREAM_STOPPING'; /** * @description These represents the current state of the meeting recording */ recordingState: | 'RECORDING_STOPPED' | 'RECORDING_STARTING' | 'RECORDING_STARTED' | 'RECORDING_STOPPING'; /** * @description These represents the current state of the meeting HLS * */ hlsState: 'HLS_STOPPED' | 'HLS_STARTING' | 'HLS_STARTED' | 'HLS_STOPPING'; /** * @description These object will provide the URLs to play the HLS streams */ hlsUrls: { downstreamUrl?: string; playbackHlsUrl?: string; livestreamUrl?: string; }; /** * @description These represents the current state of the meeting transcription */ transcriptionState: | 'TRANSCRIPTION_STOPPED' | 'TRANSCRIPTION_STARTING' | 'TRANSCRIPTION_STARTED' | 'TRANSCRIPTION_STOPPING'; /** * @description These represents the current state of the meeting translation */ translationState: | 'TRANSLATION_STOPPED' | 'TRANSLATION_STARTING' | 'TRANSLATION_STARTED' | 'TRANSLATION_STOPPING'; /** * @description These object will contain all the messages send using the `send` method */ messages: Array<{ from: string; timestamp: string; payload: string | Uint8Array; reliability: string; }>; /** * @description These method is used to join the meeting */ join(): Promise; /** * @description This method is used to change the participant mode between SEND_AND_RECV, RECV_ONLY and SIGNALLING_ONLY */ changeMode( mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY' ): Promise; /** * @description These method is used to leave the meeting for local participant */ leave(): Promise; /** * @description These method is used to end the meeting for all participants */ end(): Promise; /** * @param participantId `participantId` for which entry is to be responed * @param decision `true` if the participant is allowed to join the meeting else `false` */ respondEntry(participantId: string, decision: boolean): Promise; /** * @description returns all the pinned participants in the meeting */ get pinnedParticipants(): Map; /** * @description Mute the mic of local participant and stop broadcasting audio */ muteMic(): Promise; /** * @param customAudioTrack You can pass your own custom audio track here. * To learn more checkour this [reference](https://docs.videosdk.live/javascript/guide/video-and-audio-calling-api-sdk/features/custom-track/custom-audio-track) * @description unmute the mic of local participant and start broadcasting audio */ unmuteMic(customAudioTrack?: MediaStream): Promise; /** * * @description This method is used to stop boradcasting the video to other participants */ disableWebcam(): Promise; /** * @param customVideoTrack You can pass your own custom video track here. * To learn more checkour this [reference](https://docs.videosdk.live/javascript/guide/video-and-audio-calling-api-sdk/features/custom-track/custom-video-track) * @description This method will turn on the webcam of local participant and start broadcasting video */ enableWebcam(customVideoTrack?: MediaStream): Promise; /** * @description This method is used to stop boradcasting the screenshare to other participants */ disableScreenShare(): Promise; /** * @param customScreenSharingTrack You can pass your own custom screen share track here. * To learn more checkour this [reference](https://docs.videosdk.live/javascript/guide/video-and-audio-calling-api-sdk/features/custom-track/custom-screen-share-track) * @description This method will start broadcasting participants screen share * */ enableScreenShare(customScreenSharingTrack?: MediaStream): Promise; /** * Send a message over the DataChannel with chunking. * * @param {string | Blob | ArrayBuffer | ArrayBufferView} payload - The message to send. * @param {object} [options={}] - Additional send options. * @param {"RELIABLE" | "UNRELIABLE"} [options.reliability="RELIABLE"] - Reliability mode. * @returns {Promise} Resolves `true` if the message was sent, rejects if an error occurred. */ send( payload: string | Blob | ArrayBuffer | ArrayBufferView, options?: { reliability?: 'RELIABLE' | 'UNRELIABLE'; } ): Promise; /** * @param kind * Kind of stream that will be paused */ pauseAllStreams( kind?: 'audio' | 'video' | 'share' | 'shareAudio' | 'all' ): Promise; /** * @param kind * Kind of stream that will be resumed */ resumeAllStreams( kind?: 'audio' | 'video' | 'share' | 'shareAudio' | 'all' ): Promise; /** * @param webhookUrl * Webhook URL which will be called by VideoSDK when the recording state gets changed * @param awsDirPath? * awsDirPath represents the Directory you want to store your recording if you have configured your own S3 storage * * @param config Config can be used to configure the Recording * @param config.layout.type This represents the layout which is to used in the Recording * @param config.layout.priority This defines the priority of participants to be considered while composing Recording * @param config.layout.gridSize This defines the maximum number of participants in the grid * @param config.theme This defines the color theme of the Recording * @param config.mode This defines the mode of the Recording as only audio or vidoe and audio both * @param config.quality This defines the quality of the Recording * * @param transcription Configuration of post-meeting transcription and summary generation. * @param transcription.enabled Enables or disables post transcription. * @param transcription.summary.enabled Enables or disables summary generation from post transcriptions. * @param transcription.summary.prompt Guides summary generation (optional). */ startRecording( webhookUrl: string, awsDirPath: string, config: { layout: { type: 'GRID' | 'SPOTLIGHT' | 'SIDEBAR'; priority: 'SPEAKER' | 'PIN'; gridSize: number; }; theme: 'DARK' | 'LIGHT' | 'DEFAULT'; mode: 'video-and-audio' | 'audio'; quality: 'low' | 'med' | 'high'; }, transcription?: { enabled: boolean; summary?: { enabled: boolean; prompt?: string; }; } ): Promise; /** * @description This method is used to stop the meeting recording */ stopRecording(): Promise; /** * This method is used to start the meeting RTMP livestream to provided output * @param outputs This defines the array of outputs to which the RTMP livestream has to be broadcasted * @param config Config can be used to configure the RTMP livestream * @param config.layout.type This represents the layout which is to used in the RTMP livestream * @param config.layout.priority This defines the priority of participants to be considered while composing RTMP livestream * @param config.layout.gridSize This defines the maximum number of participants in the grid * @param config.theme This defines the color theme of the RTMP livestream */ startLivestream( outputs: Array<{ url: string; streamKey: string; }>, config?: { layout: { type: 'GRID' | 'SPOTLIGHT' | 'SIDEBAR'; priority: 'SPEAKER' | 'PIN'; gridSize: number; }; theme: 'DARK' | 'LIGHT' | 'DEFAULT'; } ): Promise; /** * @description This method is used to stop the meeting RTMP livestream */ stopLivestream(): Promise; /** * This method is used to start the meeting HLS * @param config Config can be used to configure the HLS stream * @param config.layout.type This represents the layout which is to used in the HLS * @param config.layout.priority This defines the priority of participants to be considered while composing HLS * @param config.layout.gridSize This defines the maximum number of participants in the grid * @param config.theme This defines the color theme of the HLS livestream * @param config.mode This defines the mode of the HLS livestream as only audio or vidoe and audio both * @param config.quality This defines the quality of the HLS livestream * * @param transcription Configuration of post-meeting transcription and summary generation. * @param transcription.enabled Enables or disables post transcription. * @param transcription.summary.enabled Enables or disables summary generation from post transcriptions. * @param transcription.summary.prompt Guides summary generation (optional). */ startHls(config?: { layout: { type: 'GRID' | 'SPOTLIGHT' | 'SIDEBAR'; priority: 'SPEAKER' | 'PIN'; gridSize: number; }; theme: 'DARK' | 'LIGHT' | 'DEFAULT'; mode: 'video-and-audio' | 'audio'; quality: 'low' | 'med' | 'high'; transcription?: { enabled: boolean; summary?: { enabled: boolean; prompt?: string; }; }; }): Promise; /** * @description This method is used to stop the meeting HLS */ stopHls(): Promise; /** * @description This method returns all the available mics */ getMics(): Promise< Array<{ deviceId: string; label: string; }> >; /** * @description This method returns all the available webcams */ getWebcams(): Promise< Array<{ deviceId: string; label: string; facingMode: 'front' | 'environment'; }> >; /** * * @param object These can be the `deviceId` to which the mic input has to be changed or * you can pass the audio stream to this method which will be used for the audio broadcast */ changeMic(object: string | MediaStream): Promise; /** * @description This method is used to switch to a different meeting * @param meetingId The ID of the meeting to switch to (mandatory) * @param token The token for the new meeting (optional) */ switchTo({ meetingId, token }: { meetingId: string; token?: string; }): Promise; /** * * @param object These can be the `deviceId` to which the webcam input has to be changed or * you can pass the video stream to this method which will be used for the video broadcast */ changeWebcam(object: string | MediaStream): Promise; /** * @param stream This method will be used to replace the provided stream with current webcam stream */ replaceWebcamStream(stream: MediaStream): Promise; /** * Used for internal purpose */ startWhiteboard(): Promise; /** * Used for internal purpose */ stopWhiteboard(): Promise; /** * @description Enables Adaptive Subscription, which dynamically adjusts the subscribed video streams * based on participant visibility and network conditions to optimize performance in large meetings. */ enableAdaptiveSubscription(): Promise; /** * @description Disables Adaptive Subscription, forcing all subscribed video streams to remain active * regardless of participant visibility or network conditions. */ disableAdaptiveSubscription(): Promise; pubSub: { /** * Publish a message to a topic. * * @param topic Topic to which the message will be published * @param message The message content to be published * @param options Publish options * @param options.persist When `true`, the message is stored for the entire session and delivered to newly joined participants * @param options.sendOnly An array of `participantId` that should receive the message. If omitted, the message is broadcast to all participants * @param payload Additional data to send along with the message */ publish: ( topic: string, message: string, options: { persist?: boolean; sendOnly?: Array; }, payload?: object ) => Promise; /** * Subscribe to messages on a topic. * * @param topic Topic to which you want to subscribe * @param listeners Event callbacks for realtime, batched, old, and dropped messages * @param listeners.onMessageReceived Triggered when a new message is published to the topic * @param listeners.onBatchReceived Triggered with an array of realtime messages grouped for bulk handling * @param listeners.onOldMessagesReceived Triggered with old messages when persistence is enabled. Receives `(messages, { isLast })` * @param listeners.onMessageDrop Triggered when messages are dropped due to slow network or device CPU. Receives `{ droppedCount }` * @param options Subscription behavior config * @param options.oldMessageLimit How many old messages to receive. Pass `0` to receive none. Omit for all * @param options.realtimeOverflow Behavior when the client can't keep up — `'queue'` (default) or `'drop'` * @param options.maxQueue Maximum number of message batches to queue when overflowing. Max `200`. Default `70` * @param options.newMessageLimit Maximum number of realtime messages to receive per 500 ms */ subscribe: ( topic: string, listeners: { onMessageReceived?: (message: { id: string; message: string; senderId: string; senderName: string; timestamp: string; topic: string; payload: object; }) => void; onBatchReceived?: ( messages: Array<{ id: string; message: string; senderId: string; senderName: string; timestamp: string; topic: string; payload: object; }> ) => void; onOldMessagesReceived?: ( messages: Array<{ id: string; message: string; senderId: string; senderName: string; timestamp: string; topic: string; payload: object; }>, info: { isLast: boolean } ) => void; onMessageDrop?: (info: { droppedCount: number }) => void; }, options?: { oldMessageLimit?: number; realtimeOverflow?: 'queue' | 'drop'; maxQueue?: number; newMessageLimit?: number; } ) => Promise; /** * Unsubscribe from messages on a topic. * * @param topic Topic to stop receiving messages for * @param listener The same listeners object that was passed to `subscribe` */ unsubscribe: ( topic: string, listener: { onMessageReceived?: (message: { id: string; message: string; senderId: string; senderName: string; timestamp: string; topic: string; payload: object; }) => void; onBatchReceived?: ( messages: Array<{ id: string; message: string; senderId: string; senderName: string; timestamp: string; topic: string; payload: object; }> ) => void; onOldMessagesReceived?: ( messages: Array<{ id: string; message: string; senderId: string; senderName: string; timestamp: string; topic: string; payload: object; }>, info: { isLast: boolean } ) => void; onMessageDrop?: (info: { droppedCount: number }) => void; } ) => Promise; }; /** * @description This method is used to request media relay to another meeting * @param options.destinationMeetingId The ID of the meeting to relay media to * @param options.token Optional token for the destination meeting * @param options.kinds Optional array of media types to relay ('audio', 'video', 'share', 'share_audio') */ requestMediaRelay(options: { destinationMeetingId: string; token?: string; kinds?: Array<'audio' | 'video' | 'share' | 'share_audio'>; }): Promise; /** * @description Stop relaying media to a destination meeting * @param destinationMeetingId The meeting ID to stop media relay to */ stopMediaRelay(destinationMeetingId: string): Promise; /** * Add event listener * @param eventType Event name to which you want to subscribe. * @param listener Callback function which will be triggered when the event happens */ on( eventType: | 'participant-joined' | 'participant-left' | 'participant-mode-change' | 'speaker-changed' | 'presenter-changed' | 'main-participant-changed' | 'entry-requested' | 'entry-responded' | 'recording-started' | 'recording-stopped' | 'recording-state-changed' | 'livestream-started' | 'livestream-stopped' | 'livestream-state-changed' | 'hls-started' | 'hls-stopped' | 'hls-state-changed' | 'stream-enabled' | 'stream-disabled' | 'whiteboard-started' | 'whiteboard-stopped' | 'meeting-joined' | 'meeting-left' | 'mic-requested' | 'webcam-requested' | 'pin-state-changed' | 'connection-open' | 'connection-close' | 'meeting-state-changed' | 'switch-meeting' | 'error' | 'data' | 'transcription-text' | 'transcription-state-changed' | 'translation-text' | 'translation-state-changed' | 'translation-language-changed' | 'character-joined' | 'character-left' | 'paused-all-streams' | 'resumed-all-streams' | 'media-relay-started' | 'media-relay-stopped' | 'media-relay-error' | 'media-relay-request-response' | 'media-relay-request-received' | 'quality-limitation' | 'audio-input-silence' | 'codec-changed', listener: (data: any) => void ): void; /** * Remove event listener * @param eventType Event name to which you want to unsubscribe. * @param listener Callback function which was passed while subscribing to the event */ off( eventType: | 'participant-joined' | 'participant-left' | 'participant-mode-change' | 'speaker-changed' | 'presenter-changed' | 'main-participant-changed' | 'entry-requested' | 'entry-responded' | 'recording-started' | 'recording-stopped' | 'recording-state-changed' | 'livestream-started' | 'livestream-stopped' | 'livestream-state-changed' | 'hls-started' | 'hls-stopped' | 'hls-state-changed' | 'stream-enabled' | 'stream-disabled' | 'whiteboard-started' | 'whiteboard-stopped' | 'meeting-joined' | 'meeting-left' | 'mic-requested' | 'webcam-requested' | 'pin-state-changed' | 'connection-open' | 'connection-close' | 'meeting-state-changed' | 'switch-meeting' | 'error' | 'data' | 'transcription-text' | 'transcription-state-changed' | 'translation-text' | 'translation-state-changed' | 'translation-language-changed' | 'character-joined' | 'character-left' | 'paused-all-streams' | 'resumed-all-streams' | 'media-relay-started' | 'media-relay-stopped' | 'media-relay-error' | 'media-relay-request-response' | 'media-relay-request-received' | 'quality-limitation' | 'audio-input-silence' | 'codec-changed', listener: (data: any) => void ): void; } import { Participant } from './participant'; import { Connection } from './connection';