### Hierarchy

- OpenVidu

## Index

### Constructors

- constructor

### Methods

- createSession
- deleteRecording
- getRecording
- listRecordings
- startRecording
- stopRecording

## Constructors

### constructor

- new OpenVidu(urlOpenViduServer: string, secret: string): OpenVidu

- - Defined in OpenVidu.ts:37

  #### 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

## Methods

### createSession

- createSession(properties?: SessionProperties): Promise<Session>

- - Defined in OpenVidu.ts:55

  Creates an OpenVidu session. You can call Session.getSessionId in the resolved promise to retrieve the `sessionId`

  #### Parameters

  - ##### Optional properties: SessionProperties

  #### Returns Promise<Session>

  A Promise that is resolved to the Session if success and rejected with an Error object if not. This Error object has as `message` property with the following values:

  - `409`: you are trying to assign an already-in-use custom sessionId to the session. See SessionProperties.customSessionId

### deleteRecording

- deleteRecording(recordingId: string): Promise<Error>

- - Defined in OpenVidu.ts:309

  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

### getRecording

- getRecording(recordingId: string): Promise<Recording>

- - Defined in OpenVidu.ts:210

  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

- listRecordings(): Promise<Recording[]>

- - Defined in OpenVidu.ts:255

  Lists all existing recordings

  #### Returns Promise<Recording[]>

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

### startRecording

- startRecording(sessionId: string): Promise<Recording>
- startRecording(sessionId: string, name: string): Promise<Recording>
- startRecording(sessionId: string, properties: RecordingProperties): Promise<Recording>

- - Defined in OpenVidu.ts:68

  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`
  - `400`: the session has no connected participants
  - `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`)
- - Defined in OpenVidu.ts:69

  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`
  - `400`: the session has no connected participants
  - `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`)
- - Defined in OpenVidu.ts:70

  Starts the recording of a Session

  #### Parameters

  - ##### sessionId: string

    The `sessionId` of the Session you want to start recording

  - ##### properties: RecordingProperties

  #### 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`
  - `400`: the session has no connected participants
  - `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>

- - Defined in OpenVidu.ts:162

  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