UNPKG

@videosdk.live/js-sdk

Version:

<h1 align="center"> <img src="https://cdn.videosdk.live/docs/images/javascript/api_ref/js_api_ref.png"/><br/> </h1>

580 lines (470 loc) 12.1 kB
export enum Errors { // Server errors /** * The provided API key is missing or invalid. */ INVALID_API_KEY = 4001, /** * The provided token is empty, invalid, or has expired. */ INVALID_TOKEN = 4002, /** * The provided meeting ID is missing or invalid. */ INVALID_MEETING_ID = 4003, /** * The provided participant ID is missing or invalid. */ INVALID_PARTICIPANT_ID = 4004, /** * This participant has already joined from another device. */ DUPLICATE_PARTICIPANT = 4005, /** * Your account has been deactivated. Please contact VideoSDK support. */ ACCOUNT_DEACTIVATED = 4006, /** * Your account has been discontinued. Please contact support for more details. */ ACCOUNT_DISCONTINUED = 4007, /** * The permissions included in the token are invalid. */ INVALID_PERMISSIONS = 4008, /** * The maximum participant limit for this meeting has been reached. */ MAX_PARTCIPANT_REACHED = 4009, /** * The maximum number of speakers for this meeting has been reached. */ MAX_SPEAKER_REACHED = 4010, /** * Failed to start recording. Please try again. */ START_RECORDING_FAILED = 4011, /** * Failed to stop recording. Please try again. */ STOP_RECORDING_FAILED = 4012, /** * Failed to start the livestream. Please try again. */ START_LIVESTREAM_FAILED = 4013, /** * Failed to stop the livestream. Please try again. */ STOP_LIVESTREAM_FAILED = 4014, /** * The provided livestream output configuration is invalid. */ INVALID_LIVESTREAM_CONFIG = 4015, /** * Failed to start the HLS stream. */ START_HLS_FAILED = 4016, /** * Failed to stop the HLS stream. */ STOP_HLS_FAILED = 4017, /** * Failed to start transcription. Please try again. */ START_TRANSCRIPTION_FAILED = 4031, /** * Failed to stop transcription. */ STOP_TRANSCRIPTION_FAILED = 4032, // Server critical errors /** * Recording stopped due to an internal error. */ RECORDING_FAILED = 5001, /** * Livestream stopped due to an internal error. */ LIVESTREAM_FAILED = 5002, /** * HLS streaming stopped due to an internal error. */ HLS_FAILED = 5003, /** * Transcription stopped due to an internal error. */ TRANSCRIPTION_FAILED = 5007, // SDK errors /** * Video capture is not supported on this browser or device. */ ERROR_GET_VIDEO_MEDIA = 3011, /** * Audio capture is not supported on this browser or device. */ ERROR_GET_AUDIO_MEDIA = 3012, /** * Screen sharing is not supported on this browser or device. */ ERROR_GET_DISPLAY_MEDIA = 3013, /** * Permission to access the camera was denied. */ ERROR_GET_VIDEO_MEDIA_PERMISSION_DENIED = 3014, /** * Permission to access the microphone was denied. */ ERROR_GET_AUDIO_MEDIA_PERMISSION_DENIED = 3015, /** * Permission to share the screen was denied. */ ERROR_GET_DISPLAY_MEDIA_PERMISSION_DENIED = 3016, /** * Camera access was denied or dismissed. Please allow access in your browser settings. */ ERROR_CAMERA_ACCESS_DENIED_OR_DISMISSED = 3017, /** * Microphone access was denied or dismissed. Please allow access in your browser settings. */ ERROR_MICROPHONE_ACCESS_DENIED_OR_DISMISSED = 3018, /** * Camera permission was denied by the operating system. */ ERROR_CAMERA_PERMISSION_DENIED_BY_OS = 3019, /** * Microphone permission was denied by the operating system. */ ERROR_MICROPHONE_PERMISSION_DENIED_BY_OS = 3020, /** * Camera not found. Please ensure it is properly connected. */ ERROR_CAMERA_NOT_FOUND = 3021, /** * Microphone not found. Please ensure it is properly connected. */ ERROR_MICROPHONE_NOT_FOUND = 3022, /** * Camera is currently in use by another application. */ ERROR_CAMERA_IN_USE = 3023, /** * Microphone is currently in use by another application. */ ERROR_MICROPHONE_IN_USE = 3024, /** * There may be an issue with camera permissions or autoplay. * Refer to: http://tinyurl.com/autoplay-issue */ ERROR_CAMERA_PERMISSION_OR_AUTOPLAY_ISSUE = 3025, /** * Failed to initialize the video source. Please check browser permissions. */ ERROR_VIDEO_SOURCE_INITIATION_FAILED = 3026, /** * The webcam track ended or the device was disconnected. */ ERROR_WEBCAM_TRACK_ENDED = 3027, /** * The microphone track ended or the device was disconnected. */ ERROR_MICROPHONE_TRACK_ENDED = 3028, /** * The provided custom video track is invalid. Reverting to the default video track. */ ERROR_INVALID_CUSTOM_VIDEO_TRACK = 3029, /** * The provided custom audio track is invalid. Reverting to the default audio track. */ ERROR_INVALID_CUSTOM_AUDIO_TRACK = 3030, /** * The provided custom video track has ended. */ ERROR_CUSTOM_VIDEO_TRACK_ENDED = 3031, /** * The provided custom audio track has ended. */ ERROR_CUSTOM_AUDIO_TRACK_ENDED = 3032, /** * Camera access is currently unavailable. */ ERROR_CAMERA_ACCESS_UNAVAILABLE = 3033, /** * Microphone access is currently unavailable. */ ERROR_MICROPHONE_ACCESS_UNAVAILABLE = 3034, /** * An action was attempted before successfully joining the meeting. */ ERROR_ACTION_PERFORMED_BEFORE_MEETING_JOINED = 3035, /** * Camera access was denied or dismissed via app permissions. */ ERROR_RN_CAMERA_ACCESS_DENIED_OR_DISMISSED = 3036, /** * Camera not found. Please ensure it is connected and enabled. */ ERROR_RN_CAMERA_NOT_FOUND = 3037, /** * Microphone access was denied or dismissed via app permissions. */ ERROR_RN_MIC_ACCESS_DENIED_OR_DISMISSED = 3038, /** * Microphone not found. Please ensure it is connected and enabled. */ ERROR_RN_MIC_NOT_FOUND = 3039, /** * Camera access is unavailable on this device. */ ERROR_RN_CAMERA_ACCESS_UNAVAILABLE = 3040, /** * Microphone access is unavailable on this device. */ ERROR_RN_MIC_ACCESS_UNAVAILABLE = 3041, /** * Camera track ended. Please restart or reconnect the camera. */ ERROR_RN_CAMERA_TRACK_ENDED = 3042, /** * Microphone track ended. Please reconnect or restart the microphone. */ ERROR_RN_MIC_TRACK_ENDED = 3043, /** * Unable to establish a meeting or media connection. Please check your network connection, firewall or security settings, and try again or connect using a different network. */ ERROR_MEETING_MEDIA_CONNECTION_FAILED = 3044, } export enum recordingEvents { /** * Recording is in the starting phase. */ RECORDING_STARTING = "RECORDING_STARTING", /** * Recording has started successfully. */ RECORDING_STARTED = "RECORDING_STARTED", /** * Recording is in the stopping phase. */ RECORDING_STOPPING = "RECORDING_STOPPING", /** * Recording has stopped successfully. */ RECORDING_STOPPED = "RECORDING_STOPPED", } export enum livestreamEvents { /** * Livestream is in the starting phase. */ LIVESTREAM_STARTING = "LIVESTREAM_STARTING", /** * Livestream has started successfully. */ LIVESTREAM_STARTED = "LIVESTREAM_STARTED", /** * Livestream is in the stopping phase. */ LIVESTREAM_STOPPING = "LIVESTREAM_STOPPING", /** * Livestream has stopped successfully. */ LIVESTREAM_STOPPED = "LIVESTREAM_STOPPED", } export enum hlsEvents { /** * HLS streaming is in the starting phase. */ HLS_STARTING = "HLS_STARTING", /** * HLS streaming has started successfully. */ HLS_STARTED = "HLS_STARTED", /** * HLS stream is playable. */ HLS_PLAYABLE = "HLS_PLAYABLE", /** * HLS streaming is in the stopping phase. */ HLS_STOPPING = "HLS_STOPPING", /** * HLS streaming has stopped successfully. */ HLS_STOPPED = "HLS_STOPPED", } export enum transcriptionEvents { /** * Transcription is in the starting phase. */ TRANSCRIPTION_STARTING = "TRANSCRIPTION_STARTING", /** * Transcription has started successfully. */ TRANSCRIPTION_STARTED = "TRANSCRIPTION_STARTED", /** * Transcription is in the stopping phase. */ TRANSCRIPTION_STOPPING = "TRANSCRIPTION_STOPPING", /** * Transcription has stopped successfully. */ TRANSCRIPTION_STOPPED = "TRANSCRIPTION_STOPPED", } export enum modes { /** * @deprecated CONFERENCE mode is deprecated and will be removed in future versions. * Use SEND_AND_RECV instead. */ CONFERENCE = "CONFERENCE", /** * @deprecated VIEWER mode is deprecated and will be removed in future versions. * Use SIGNALLING_ONLY instead. */ VIEWER = "VIEWER", /** * Both audio and video streams will be produced and consumed. */ SEND_AND_RECV = "SEND_AND_RECV", /** * Both audio and video streams will not be produced or consumed. It is used solely for signaling. */ SIGNALLING_ONLY = "SIGNALLING_ONLY", /** * Only audio and video streams will be consumed without producing any. */ RECV_ONLY = "RECV_ONLY", } export enum Permission { /** * Audio permission. */ AUDIO = "audio", /** * Video permission. */ VIDEO = "video", /** * Audio and video permissions. */ AUDIO_AND_VIDEO = "audio_video", } export enum leaveReason { /** * WebSocket connection was disconnected. */ WEBSOCKET_DISCONNECTED = 1001, /** * Participant was removed from the meeting. */ REMOVE_PEER = 1002, /** * Participant was removed due to a viewer mode change. */ REMOVE_PEER_VIEWER_MODE_CHANGED = 1003, /** * Participant was removed because media relay stopped. */ REMOVE_PEER_MEDIA_RELAY_STOP = 1004, /** * Participant switched to another room. */ SWITCH_ROOM = 1005, /** * The meeting has been closed. */ ROOM_CLOSE = 1006, /** * Participant disconnected due to an unknown reason. */ UNKNOWN = 1007, /** * All participants were removed from the meeting. */ REMOVE_ALL = 1008, /** * Meeting ended via API. */ MEETING_END_API = 1009, /** * Participant was removed via API. */ REMOVE_PEER_API = 1010, /** * Participant joined from another device. */ DUPLICATE_PARTICIPANT = 1011, /** * Participant manually left the meeting. */ MANUAL_LEAVE_CALLED = 1101, /** * WebSocket connection attempts were exhausted. */ WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED = 1102, /** * Failed to join the meeting. */ JOIN_ROOM_FAILED = 1103, /** * Failed to switch rooms. */ SWITCH_ROOM_FAILED = 1104, } export enum BitrateMode { /** * Prioritizes video quality over bandwidth usage. */ HIGH_QUALITY = "high_quality", /** * Balances video quality and bandwidth usage. */ BALANCED = "balanced", /** * Optimizes for low bandwidth usage. */ BANDWIDTH_OPTIMIZED = "bandwidth_optimized", } export enum reliabilityMode { /** * Ensures reliable message delivery. */ RELIABLE = "RELIABLE", /** * Allows faster delivery without guaranteed reliability. */ UNRELIABLE = "UNRELIABLE", } export enum LogLevel { /** * Disables all logging output. No logs will be printed. */ NONE = "NONE", /** * Displays only critical failures and unrecoverable issues. */ ERROR = "ERROR", /** * Displays warnings and errors. Warnings indicate recoverable anomalies. */ WARN = "WARN", /** * Displays standard SDK activity logs including lifecycle events and state transitions. */ INFO = "INFO", /** * Displays detailed diagnostic logs for debugging SDK behavior and internal operations. */ DEBUG = "DEBUG", /** * Enables extremely verbose logging including high-frequency real-time events. */ ALL = "ALL", } export enum AgentState { /** Agent is inactive and not processing any input */ IDLE = "idle", /** Agent is actively listening to user input */ LISTENING = "listening", /** Agent is processing or generating a response */ THINKING = "thinking", /** Agent is speaking */ SPEAKING = "speaking", }