mirror of https://github.com/OpenVidu/openvidu.git
openvidu-node-client Recording.name
parent
84045f82d4
commit
a93f88c66b
|
@ -1,6 +1,7 @@
|
||||||
import { Session } from "./Session";
|
import { Session } from "./Session";
|
||||||
import { SessionProperties } from "./SessionProperties";
|
import { SessionProperties } from "./SessionProperties";
|
||||||
import { Recording } from "./Recording";
|
import { Recording } from "./Recording";
|
||||||
|
import { RecordingProperties } from "RecordingProperties";
|
||||||
export declare class OpenVidu {
|
export declare class OpenVidu {
|
||||||
private urlOpenViduServer;
|
private urlOpenViduServer;
|
||||||
private static readonly API_RECORDINGS;
|
private static readonly API_RECORDINGS;
|
||||||
|
@ -12,6 +13,8 @@ export declare class OpenVidu {
|
||||||
constructor(urlOpenViduServer: string, secret: string);
|
constructor(urlOpenViduServer: string, secret: string);
|
||||||
createSession(properties?: SessionProperties): Session;
|
createSession(properties?: SessionProperties): Session;
|
||||||
startRecording(sessionId: string): Promise<Recording>;
|
startRecording(sessionId: string): Promise<Recording>;
|
||||||
|
startRecording(sessionId: string, name: string): Promise<Recording>;
|
||||||
|
startRecording(sessionId: string, properties: RecordingProperties): Promise<Recording>;
|
||||||
stopRecording(recordingId: string): Promise<Recording>;
|
stopRecording(recordingId: string): Promise<Recording>;
|
||||||
getRecording(recordingId: string): Promise<Recording>;
|
getRecording(recordingId: string): Promise<Recording>;
|
||||||
listRecordings(): Promise<Recording[]>;
|
listRecordings(): Promise<Recording[]>;
|
||||||
|
|
|
@ -12,12 +12,30 @@ var OpenVidu = /** @class */ (function () {
|
||||||
OpenVidu.prototype.createSession = function (properties) {
|
OpenVidu.prototype.createSession = function (properties) {
|
||||||
return new Session_1.Session(this.hostname, this.port, this.basicAuth, properties);
|
return new Session_1.Session(this.hostname, this.port, this.basicAuth, properties);
|
||||||
};
|
};
|
||||||
OpenVidu.prototype.startRecording = function (sessionId) {
|
OpenVidu.prototype.startRecording = function (sessionId, param2) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var requestBody = JSON.stringify({
|
var requestBody;
|
||||||
'session': sessionId
|
if (!!param2) {
|
||||||
});
|
if (!(typeof param2 === 'string')) {
|
||||||
|
requestBody = JSON.stringify({
|
||||||
|
session: sessionId,
|
||||||
|
name: param2.name()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
requestBody = JSON.stringify({
|
||||||
|
session: sessionId,
|
||||||
|
name: param2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
requestBody = JSON.stringify({
|
||||||
|
session: sessionId,
|
||||||
|
name: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
var options = {
|
var options = {
|
||||||
hostname: _this.hostname,
|
hostname: _this.hostname,
|
||||||
port: _this.port,
|
port: _this.port,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
||||||
import { Session } from "./Session";
|
import { Session } from "./Session";
|
||||||
import { SessionProperties } from "./SessionProperties";
|
import { SessionProperties } from "./SessionProperties";
|
||||||
import { Recording } from "./Recording";
|
import { Recording } from "./Recording";
|
||||||
|
import { RecordingProperties } from "RecordingProperties";
|
||||||
|
|
||||||
declare const Buffer;
|
declare const Buffer;
|
||||||
let https = require('https');
|
let https = require('https');
|
||||||
|
@ -24,12 +25,33 @@ export class OpenVidu {
|
||||||
return new Session(this.hostname, this.port, this.basicAuth, properties);
|
return new Session(this.hostname, this.port, this.basicAuth, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
public startRecording(sessionId: string): Promise<Recording> {
|
public startRecording(sessionId: string): Promise<Recording>;
|
||||||
|
public startRecording(sessionId: string, name: string): Promise<Recording>;
|
||||||
|
public startRecording(sessionId: string, properties: RecordingProperties): Promise<Recording>;
|
||||||
|
|
||||||
|
public startRecording(sessionId: string, param2?: string | RecordingProperties): Promise<Recording> {
|
||||||
return new Promise<Recording>((resolve, reject) => {
|
return new Promise<Recording>((resolve, reject) => {
|
||||||
|
|
||||||
let requestBody = JSON.stringify({
|
let requestBody;
|
||||||
'session': sessionId
|
|
||||||
});
|
if (!!param2) {
|
||||||
|
if (!(typeof param2 === 'string')) {
|
||||||
|
requestBody = JSON.stringify({
|
||||||
|
session: sessionId,
|
||||||
|
name: (<RecordingProperties>param2).name()
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
requestBody = JSON.stringify({
|
||||||
|
session: sessionId,
|
||||||
|
name: param2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
requestBody = JSON.stringify({
|
||||||
|
session: sessionId,
|
||||||
|
name: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
hostname: this.hostname,
|
hostname: this.hostname,
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
export class RecordingProperties {
|
||||||
|
|
||||||
|
constructor(private rName: string) { }
|
||||||
|
|
||||||
|
name(): string {
|
||||||
|
return this.rName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace RecordingProperties {
|
||||||
|
export class Builder {
|
||||||
|
|
||||||
|
private rName: string = '';
|
||||||
|
|
||||||
|
build(): RecordingProperties {
|
||||||
|
return new RecordingProperties(this.rName);
|
||||||
|
}
|
||||||
|
|
||||||
|
name(name: string): Builder {
|
||||||
|
this.rName = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue