2018-04-23 11:06:16 +02:00
|
|
|
import { Session } from './Session';
|
|
|
|
import { SessionProperties } from './SessionProperties';
|
|
|
|
import { Recording } from './Recording';
|
|
|
|
import { RecordingProperties } from './RecordingProperties';
|
2017-06-10 01:44:31 +02:00
|
|
|
export declare class OpenVidu {
|
|
|
|
private urlOpenViduServer;
|
2018-03-14 18:48:29 +01:00
|
|
|
private static readonly API_RECORDINGS;
|
|
|
|
private static readonly API_RECORDINGS_START;
|
|
|
|
private static readonly API_RECORDINGS_STOP;
|
|
|
|
private hostname;
|
|
|
|
private port;
|
|
|
|
private basicAuth;
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* @param urlOpenViduServer Public accessible IP where your instance of OpenVidu Server is up an running
|
|
|
|
* @param secret Secret used on OpenVidu Server initialization
|
|
|
|
*/
|
2017-06-10 01:44:31 +02:00
|
|
|
constructor(urlOpenViduServer: string, secret: string);
|
2018-01-27 19:39:49 +01:00
|
|
|
createSession(properties?: SessionProperties): Session;
|
2018-04-18 10:39:39 +02:00
|
|
|
startRecording(sessionId: string): Promise<Recording>;
|
2018-04-18 14:23:16 +02:00
|
|
|
startRecording(sessionId: string, name: string): Promise<Recording>;
|
|
|
|
startRecording(sessionId: string, properties: RecordingProperties): Promise<Recording>;
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* Stops the recording of a [[Session]]
|
|
|
|
*
|
|
|
|
* @param recordingId The `id` property of the [[Recording]] you want to stop
|
|
|
|
*
|
|
|
|
* @returns 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
|
|
|
|
*/
|
2018-04-18 10:39:39 +02:00
|
|
|
stopRecording(recordingId: string): Promise<Recording>;
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* Gets an existing [[Recording]]
|
|
|
|
*
|
|
|
|
* @param recordingId The `id` property of the [[Recording]] you want to retrieve
|
|
|
|
*
|
|
|
|
* @returns 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`
|
|
|
|
*/
|
2018-04-18 10:39:39 +02:00
|
|
|
getRecording(recordingId: string): Promise<Recording>;
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* Lists all existing recordings
|
|
|
|
*
|
|
|
|
* @returns A Promise that is resolved to an array with all existing recordings
|
|
|
|
*/
|
2018-04-18 10:39:39 +02:00
|
|
|
listRecordings(): Promise<Recording[]>;
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* Deletes a [[Recording]]. The recording must have status `stopped` or `available`
|
|
|
|
*
|
|
|
|
* @param recordingId
|
|
|
|
*
|
|
|
|
* @returns 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
|
|
|
|
*/
|
2018-03-14 18:48:29 +01:00
|
|
|
deleteRecording(recordingId: string): Promise<Error>;
|
|
|
|
private getBasicAuth(secret);
|
|
|
|
private setHostnameAndPort();
|
2017-06-10 01:44:31 +02:00
|
|
|
}
|