Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OpenVidu

Hierarchy

  • OpenVidu

Index

Constructors

constructor

  • new OpenVidu(urlOpenViduServer: string, secret: string): OpenVidu
  • Parameters

    • urlOpenViduServer: string

      Public accessible IP where your instance of OpenVidu Server is up an running

    • secret: string

      Secret used on OpenVidu Server initialization

    Returns OpenVidu

Properties

activeSessions

activeSessions: Session[] = []

Array of active sessions. This value will remain unchanged since the last time method OpenVidu.fetch was called. Exceptions to this rule are:

To get the array of active sessions with their current actual value, you must call OpenVidu.fetch before consulting property activeSessions

Methods

createSession

deleteRecording

  • deleteRecording(recordingId: string): Promise<Error>
  • Deletes a Recording. The recording must have status stopped or available

    Parameters

    • recordingId: string

    Returns Promise<Error>

    A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. This Error object has as message property with the following values:

    • 404: no recording exists for the passed recordingId
    • 409: the recording has started status. Stop it before deletion

fetch

  • fetch(): Promise<boolean>
  • Updates every property of every active Session with the current status they have in OpenVidu Server. After calling this method you can access the updated array of active sessions in activeSessions

    Returns Promise<boolean>

    A promise resolved to true if any Session status has changed with respect to the server, or to false if not. This applies to any property or sub-property of any of the sessions locally stored in OpenVidu Node Client

getRecording

  • getRecording(recordingId: string): Promise<Recording>
  • Gets an existing Recording

    Parameters

    • recordingId: string

      The id property of the Recording you want to retrieve

    Returns Promise<Recording>

    A Promise that is resolved to the Recording if it successfully stopped and rejected with an Error object if not. This Error object has as message property with the following values:

    • 404: no recording exists for the passed recordingId

listRecordings

  • Lists all existing recordings

    Returns Promise<Recording[]>

    A Promise that is resolved to an array with all existing recordings

startRecording

  • Starts the recording of a Session

    Parameters

    • sessionId: string

      The sessionId of the Session you want to start recording

    Returns Promise<Recording>

    A Promise that is resolved to the Recording if it successfully started (the recording can be stopped with guarantees) and rejected with an Error object if not. This Error object has as message property with the following values:

    • 404: no session exists for the passed sessionId
    • 406: the session has no connected participants
    • 422: when passing RecordingProperties, resolution parameter exceeds acceptable values (for both width and height, min 100px and max 1999px) or trying to start a recording with both hasAudio and hasVideo to false
    • 409: the session is not configured for using MediaMode.ROUTED or it is already being recorded
    • 501: OpenVidu Server recording module is disabled (openvidu.recording property set to false)
  • Starts the recording of a Session

    Parameters

    • sessionId: string

      The sessionId of the Session you want to start recording

    • name: string

      The name you want to give to the video file. You can access this same value in your clients on recording events (recordingStarted, recordingStopped)

    Returns Promise<Recording>

    A Promise that is resolved to the Recording if it successfully started (the recording can be stopped with guarantees) and rejected with an Error object if not. This Error object has as message property with the following values:

    • 404: no session exists for the passed sessionId
    • 406: the session has no connected participants
    • 422: when passing RecordingProperties, resolution parameter exceeds acceptable values (for both width and height, min 100px and max 1999px) or trying to start a recording with both hasAudio and hasVideo to false
    • 409: the session is not configured for using MediaMode.ROUTED or it is already being recorded
    • 501: OpenVidu Server recording module is disabled (openvidu.recording property set to false)
  • Starts the recording of a Session

    Parameters

    Returns Promise<Recording>

    A Promise that is resolved to the Recording if it successfully started (the recording can be stopped with guarantees) and rejected with an Error object if not. This Error object has as message property with the following values:

    • 404: no session exists for the passed sessionId
    • 406: the session has no connected participants
    • 422: when passing RecordingProperties, resolution parameter exceeds acceptable values (for both width and height, min 100px and max 1999px) or trying to start a recording with both hasAudio and hasVideo to false
    • 409: the session is not configured for using MediaMode.ROUTED or it is already being recorded
    • 501: OpenVidu Server recording module is disabled (openvidu.recording property set to false)

stopRecording

  • stopRecording(recordingId: string): Promise<Recording>
  • Stops the recording of a Session

    Parameters

    • recordingId: string

      The id property of the Recording you want to stop

    Returns Promise<Recording>

    A Promise that is resolved to the Recording if it successfully stopped and rejected with an Error object if not. This Error object has as message property with the following values:

    • 404: no recording exists for the passed recordingId
    • 406: recording has starting status. Wait until started status before stopping the recording

Generated using TypeDoc