mirror of https://github.com/OpenVidu/openvidu.git
"Archive" to "Recording" in openvidu-server, openvidu-java-client and openvidu-node-client
parent
2926c64a4e
commit
14c246f00f
|
@ -1,7 +0,0 @@
|
|||
package io.openvidu.java.client;
|
||||
|
||||
public enum ArchiveMode {
|
||||
ALWAYS, // The session is archived automatically (as soon as there are clients publishing streams to the session)
|
||||
MANUAL; // The session is not archived automatically. To archive the session, you can call the OpenVidu.StartArchive() method
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ public class OpenVidu {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Archive startRecording(String sessionId) throws OpenViduException {
|
||||
public Recording startRecording(String sessionId) throws OpenViduException {
|
||||
try {
|
||||
HttpPost request = new HttpPost(this.urlOpenViduServer + API_RECORDINGS + API_RECORDINGS_START);
|
||||
|
||||
|
@ -104,7 +104,7 @@ public class OpenVidu {
|
|||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if ((statusCode == org.apache.http.HttpStatus.SC_OK)) {
|
||||
return new Archive(OpenVidu.httpResponseToJson(response));
|
||||
return new Recording(OpenVidu.httpResponseToJson(response));
|
||||
} else {
|
||||
throw new OpenViduException(Code.RECORDING_START_ERROR_CODE, Integer.toString(statusCode));
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class OpenVidu {
|
|||
}
|
||||
}
|
||||
|
||||
public Archive stopRecording(String recordingId) throws OpenViduException {
|
||||
public Recording stopRecording(String recordingId) throws OpenViduException {
|
||||
try {
|
||||
HttpPost request = new HttpPost(
|
||||
this.urlOpenViduServer + API_RECORDINGS + API_RECORDINGS_STOP + "/" + recordingId);
|
||||
|
@ -122,7 +122,7 @@ public class OpenVidu {
|
|||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if ((statusCode == org.apache.http.HttpStatus.SC_OK)) {
|
||||
return new Archive(OpenVidu.httpResponseToJson(response));
|
||||
return new Recording(OpenVidu.httpResponseToJson(response));
|
||||
} else {
|
||||
throw new OpenViduException(Code.RECORDING_STOP_ERROR_CODE, Integer.toString(statusCode));
|
||||
}
|
||||
|
@ -132,14 +132,14 @@ public class OpenVidu {
|
|||
}
|
||||
}
|
||||
|
||||
public Archive getRecording(String recordingId) throws OpenViduException {
|
||||
public Recording getRecording(String recordingId) throws OpenViduException {
|
||||
try {
|
||||
HttpGet request = new HttpGet(this.urlOpenViduServer + API_RECORDINGS + "/" + recordingId);
|
||||
HttpResponse response = myHttpClient.execute(request);
|
||||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if ((statusCode == org.apache.http.HttpStatus.SC_OK)) {
|
||||
return new Archive(OpenVidu.httpResponseToJson(response));
|
||||
return new Recording(OpenVidu.httpResponseToJson(response));
|
||||
} else {
|
||||
throw new OpenViduException(Code.RECORDING_LIST_ERROR_CODE, Integer.toString(statusCode));
|
||||
}
|
||||
|
@ -149,20 +149,20 @@ public class OpenVidu {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Archive> listRecordings() throws OpenViduException {
|
||||
public List<Recording> listRecordings() throws OpenViduException {
|
||||
try {
|
||||
HttpGet request = new HttpGet(this.urlOpenViduServer + API_RECORDINGS);
|
||||
HttpResponse response = myHttpClient.execute(request);
|
||||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if ((statusCode == org.apache.http.HttpStatus.SC_OK)) {
|
||||
List<Archive> archives = new ArrayList<>();
|
||||
List<Recording> recordings = new ArrayList<>();
|
||||
JSONObject json = OpenVidu.httpResponseToJson(response);
|
||||
JSONArray array = (JSONArray) json.get("items");
|
||||
array.forEach(item -> {
|
||||
archives.add(new Archive((JSONObject) item));
|
||||
recordings.add(new Recording((JSONObject) item));
|
||||
});
|
||||
return archives;
|
||||
return recordings;
|
||||
} else {
|
||||
throw new OpenViduException(Code.RECORDING_LIST_ERROR_CODE, Integer.toString(statusCode));
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package io.openvidu.java.client;
|
|||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class Archive {
|
||||
public class Recording {
|
||||
|
||||
public enum Status {
|
||||
starting, // The recording is starting (cannot be stopped)
|
||||
|
@ -13,7 +13,7 @@ public class Archive {
|
|||
failed; // The recording has failed
|
||||
}
|
||||
|
||||
private Archive.Status status;
|
||||
private Recording.Status status;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
|
@ -25,7 +25,7 @@ public class Archive {
|
|||
private boolean hasAudio = true;
|
||||
private boolean hasVideo = true;
|
||||
|
||||
public Archive(JSONObject json) {
|
||||
public Recording(JSONObject json) {
|
||||
this.id = (String) json.get("id");
|
||||
this.name = (String) json.get("name");
|
||||
this.sessionId = (String) json.get("sessionId");
|
||||
|
@ -35,10 +35,10 @@ public class Archive {
|
|||
this.url = (String) json.get("url");
|
||||
this.hasAudio = (boolean) json.get("hasAudio");
|
||||
this.hasVideo = (boolean) json.get("hasVideo");
|
||||
this.status = Archive.Status.valueOf((String) json.get("status"));
|
||||
this.status = Recording.Status.valueOf((String) json.get("status"));
|
||||
}
|
||||
|
||||
public Archive.Status getStatus() {
|
||||
public Recording.Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package io.openvidu.java.client;
|
||||
|
||||
public enum ArchiveLayout {
|
||||
public enum RecordingLayout {
|
||||
BEST_FIT, // All the videos are evenly distributed, taking up as much space as possible
|
||||
PICTURE_IN_PICTURE,
|
||||
VERTICAL_PRESENTATION,
|
|
@ -0,0 +1,6 @@
|
|||
package io.openvidu.java.client;
|
||||
|
||||
public enum RecordingMode {
|
||||
ALWAYS, // The session is recorded automatically (as soon as there are clients publishing streams to the session)
|
||||
MANUAL; // The session is not recorded automatically. To record the session, you can call the OpenVidu.startRecording() method
|
||||
}
|
|
@ -44,8 +44,8 @@ public class Session {
|
|||
HttpPost request = new HttpPost(this.urlOpenViduServer + API_SESSIONS);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("archiveLayout", properties.archiveLayout().name());
|
||||
json.put("archiveMode", properties.archiveMode().name());
|
||||
json.put("recordingLayout", properties.recordingLayout().name());
|
||||
json.put("recordingMode", properties.recordingMode().name());
|
||||
json.put("mediaMode", properties.mediaMode().name());
|
||||
StringEntity params = new StringEntity(json.toString());
|
||||
|
||||
|
|
|
@ -3,17 +3,17 @@ package io.openvidu.java.client;
|
|||
public class SessionProperties {
|
||||
|
||||
private MediaMode mediaMode;
|
||||
private ArchiveMode archiveMode;
|
||||
private ArchiveLayout archiveLayout;
|
||||
private RecordingMode recordingMode;
|
||||
private RecordingLayout recordingLayout;
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private MediaMode mediaMode = MediaMode.ROUTED;
|
||||
private ArchiveMode archiveMode = ArchiveMode.MANUAL;
|
||||
private ArchiveLayout archiveLayout = ArchiveLayout.BEST_FIT;
|
||||
private RecordingMode recordingMode = RecordingMode.MANUAL;
|
||||
private RecordingLayout recordingLayout = RecordingLayout.BEST_FIT;
|
||||
|
||||
public SessionProperties build() {
|
||||
return new SessionProperties(this.mediaMode, this.archiveMode, this.archiveLayout);
|
||||
return new SessionProperties(this.mediaMode, this.recordingMode, this.recordingLayout);
|
||||
}
|
||||
|
||||
public SessionProperties.Builder mediaMode(MediaMode mediaMode) {
|
||||
|
@ -21,13 +21,13 @@ public class SessionProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SessionProperties.Builder archiveMode(ArchiveMode archiveMode) {
|
||||
this.archiveMode = archiveMode;
|
||||
public SessionProperties.Builder recordingMode(RecordingMode recordingMode) {
|
||||
this.recordingMode = recordingMode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SessionProperties.Builder archiveLayout(ArchiveLayout archiveLayout) {
|
||||
this.archiveLayout = archiveLayout;
|
||||
public SessionProperties.Builder recordingLayout(RecordingLayout recordingLayout) {
|
||||
this.recordingLayout = recordingLayout;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -35,26 +35,26 @@ public class SessionProperties {
|
|||
|
||||
protected SessionProperties() {
|
||||
this.mediaMode = MediaMode.ROUTED;
|
||||
this.archiveMode = ArchiveMode.MANUAL;
|
||||
this.archiveLayout = ArchiveLayout.BEST_FIT;
|
||||
this.recordingMode = RecordingMode.MANUAL;
|
||||
this.recordingLayout = RecordingLayout.BEST_FIT;
|
||||
}
|
||||
|
||||
private SessionProperties(MediaMode mediaMode, ArchiveMode archiveMode, ArchiveLayout archiveLayout) {
|
||||
private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, RecordingLayout recordingLayout) {
|
||||
this.mediaMode = mediaMode;
|
||||
this.archiveMode = archiveMode;
|
||||
this.archiveLayout = archiveLayout;
|
||||
this.recordingMode = recordingMode;
|
||||
this.recordingLayout = recordingLayout;
|
||||
}
|
||||
|
||||
public ArchiveMode archiveMode() {
|
||||
return this.archiveMode;
|
||||
public RecordingMode recordingMode() {
|
||||
return this.recordingMode;
|
||||
}
|
||||
|
||||
public MediaMode mediaMode() {
|
||||
return this.mediaMode;
|
||||
}
|
||||
|
||||
public ArchiveLayout archiveLayout() {
|
||||
return this.archiveLayout;
|
||||
public RecordingLayout recordingLayout() {
|
||||
return this.recordingLayout;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { Session } from "./Session";
|
||||
import { SessionProperties } from "./SessionProperties";
|
||||
import { Archive } from "./Archive";
|
||||
import { Recording } from "./Recording";
|
||||
export declare class OpenVidu {
|
||||
private urlOpenViduServer;
|
||||
private static readonly API_RECORDINGS;
|
||||
|
@ -11,10 +11,10 @@ export declare class OpenVidu {
|
|||
private basicAuth;
|
||||
constructor(urlOpenViduServer: string, secret: string);
|
||||
createSession(properties?: SessionProperties): Session;
|
||||
startRecording(sessionId: string): Promise<Archive>;
|
||||
stopRecording(recordingId: string): Promise<Archive>;
|
||||
getRecording(recordingId: string): Promise<Archive>;
|
||||
listRecordings(): Promise<Archive[]>;
|
||||
startRecording(sessionId: string): Promise<Recording>;
|
||||
stopRecording(recordingId: string): Promise<Recording>;
|
||||
getRecording(recordingId: string): Promise<Recording>;
|
||||
listRecordings(): Promise<Recording[]>;
|
||||
deleteRecording(recordingId: string): Promise<Error>;
|
||||
private getBasicAuth(secret);
|
||||
private setHostnameAndPort();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Session_1 = require("./Session");
|
||||
var Archive_1 = require("./Archive");
|
||||
var Recording_1 = require("./Recording");
|
||||
var https = require('https');
|
||||
var OpenVidu = /** @class */ (function () {
|
||||
function OpenVidu(urlOpenViduServer, secret) {
|
||||
|
@ -37,8 +37,8 @@ var OpenVidu = /** @class */ (function () {
|
|||
});
|
||||
res.on('end', function () {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (Archive in JSON format). Resolve new Archive
|
||||
resolve(new Archive_1.Archive(JSON.parse(body)));
|
||||
// SUCCESS response from openvidu-server (Recording in JSON format). Resolve new Recording
|
||||
resolve(new Recording_1.Recording(JSON.parse(body)));
|
||||
}
|
||||
else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
|
@ -74,8 +74,8 @@ var OpenVidu = /** @class */ (function () {
|
|||
});
|
||||
res.on('end', function () {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (Archive in JSON format). Resolve new Archive
|
||||
resolve(new Archive_1.Archive(JSON.parse(body)));
|
||||
// SUCCESS response from openvidu-server (Recording in JSON format). Resolve new Recording
|
||||
resolve(new Recording_1.Recording(JSON.parse(body)));
|
||||
}
|
||||
else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
|
@ -111,8 +111,8 @@ var OpenVidu = /** @class */ (function () {
|
|||
});
|
||||
res.on('end', function () {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (Archive in JSON format). Resolve new Archive
|
||||
resolve(new Archive_1.Archive(JSON.parse(body)));
|
||||
// SUCCESS response from openvidu-server (Recording in JSON format). Resolve new Recording
|
||||
resolve(new Recording_1.Recording(JSON.parse(body)));
|
||||
}
|
||||
else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
|
@ -148,13 +148,13 @@ var OpenVidu = /** @class */ (function () {
|
|||
});
|
||||
res.on('end', function () {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (JSON arrays of Archives in JSON format). Resolve list of new Archives
|
||||
var archiveArray = [];
|
||||
// SUCCESS response from openvidu-server (JSON arrays of recordings in JSON format). Resolve list of new recordings
|
||||
var recordingArray = [];
|
||||
var responseItems = JSON.parse(body)['items'];
|
||||
for (var i = 0; i < responseItems.length; i++) {
|
||||
archiveArray.push(new Archive_1.Archive(responseItems[i]));
|
||||
recordingArray.push(new Recording_1.Recording(responseItems[i]));
|
||||
}
|
||||
resolve(archiveArray);
|
||||
resolve(recordingArray);
|
||||
}
|
||||
else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -23,8 +23,8 @@ var Session = /** @class */ (function () {
|
|||
return;
|
||||
}
|
||||
var requestBody = JSON.stringify({
|
||||
'archiveLayout': this.properties.archiveLayout(),
|
||||
'archiveMode': this.properties.archiveMode(),
|
||||
'recordingLayout': this.properties.recordingLayout(),
|
||||
'recordingMode': this.properties.recordingMode(),
|
||||
'mediaMode': this.properties.mediaMode()
|
||||
});
|
||||
var options = {
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":";;AACA,+CAA8C;AAC9C,yDAAwD;AAKxD,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE7B;IAQI,iBAAoB,QAAgB,EAAU,IAAY,EAAU,SAAiB,EAAE,UAA8B;QAAjG,aAAQ,GAAR,QAAQ,CAAQ;QAAU,SAAI,GAAJ,IAAI,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAH7E,cAAS,GA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C;oBAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACxB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,2DAA2D;oBAC3D,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAClC,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACvB,GAAG,CAAC,GAAG,EAAE,CAAC;IACd,CAAC;IAEM,+BAAa,GAApB;QACI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IA3HuB,oBAAY,GAAW,eAAe,CAAC;IACvC,kBAAU,GAAW,aAAa,CAAC;IA4H/D,cAAC;CAAA,AA/HD,IA+HC;AA/HY,0BAAO"}
|
|
@ -4,6 +4,6 @@ export * from './Session';
|
|||
export * from './SessionProperties';
|
||||
export * from './TokenOptions';
|
||||
export * from './MediaMode';
|
||||
export * from './ArchiveLayout';
|
||||
export * from './ArchiveMode';
|
||||
export * from './Archive';
|
||||
export * from './RecordingLayout';
|
||||
export * from './RecordingMode';
|
||||
export * from './Recording';
|
||||
|
|
|
@ -9,7 +9,7 @@ __export(require("./Session"));
|
|||
__export(require("./SessionProperties"));
|
||||
__export(require("./TokenOptions"));
|
||||
__export(require("./MediaMode"));
|
||||
__export(require("./ArchiveLayout"));
|
||||
__export(require("./ArchiveMode"));
|
||||
__export(require("./Archive"));
|
||||
__export(require("./RecordingLayout"));
|
||||
__export(require("./RecordingMode"));
|
||||
__export(require("./Recording"));
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,gCAA2B;AAC3B,oCAA+B;AAC/B,+BAA0B;AAC1B,yCAAoC;AACpC,oCAA+B;AAC/B,iCAA4B;AAC5B,qCAAgC;AAChC,mCAA8B;AAC9B,+BAA0B"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,gCAA2B;AAC3B,oCAA+B;AAC/B,+BAA0B;AAC1B,yCAAoC;AACpC,oCAA+B;AAC/B,iCAA4B;AAC5B,uCAAkC;AAClC,qCAAgC;AAChC,iCAA4B"}
|
|
@ -1,4 +0,0 @@
|
|||
export enum ArchiveMode {
|
||||
ALWAYS = 'ALWAYS', // The session is archived automatically (as soon as there are clients publishing streams to the session)
|
||||
MANUAL = 'MANUAL' // The session is not archived automatically. To archive the session, you can call the OpenVidu.StartArchive() method
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { Session } from "./Session";
|
||||
import { SessionProperties } from "./SessionProperties";
|
||||
import { Archive } from "./Archive";
|
||||
import { Recording } from "./Recording";
|
||||
|
||||
declare const Buffer;
|
||||
let https = require('https');
|
||||
|
@ -24,8 +24,8 @@ export class OpenVidu {
|
|||
return new Session(this.hostname, this.port, this.basicAuth, properties);
|
||||
}
|
||||
|
||||
public startRecording(sessionId: string): Promise<Archive> {
|
||||
return new Promise<Archive>((resolve, reject) => {
|
||||
public startRecording(sessionId: string): Promise<Recording> {
|
||||
return new Promise<Recording>((resolve, reject) => {
|
||||
|
||||
let requestBody = JSON.stringify({
|
||||
'session': sessionId
|
||||
|
@ -50,8 +50,8 @@ export class OpenVidu {
|
|||
});
|
||||
res.on('end', () => {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (Archive in JSON format). Resolve new Archive
|
||||
resolve(new Archive(JSON.parse(body)));
|
||||
// SUCCESS response from openvidu-server (Recording in JSON format). Resolve new Recording
|
||||
resolve(new Recording(JSON.parse(body)));
|
||||
} else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
reject(new Error(res.statusCode));
|
||||
|
@ -68,8 +68,8 @@ export class OpenVidu {
|
|||
});
|
||||
}
|
||||
|
||||
public stopRecording(recordingId: string): Promise<Archive> {
|
||||
return new Promise<Archive>((resolve, reject) => {
|
||||
public stopRecording(recordingId: string): Promise<Recording> {
|
||||
return new Promise<Recording>((resolve, reject) => {
|
||||
|
||||
let options = {
|
||||
hostname: this.hostname,
|
||||
|
@ -89,8 +89,8 @@ export class OpenVidu {
|
|||
});
|
||||
res.on('end', () => {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (Archive in JSON format). Resolve new Archive
|
||||
resolve(new Archive(JSON.parse(body)));
|
||||
// SUCCESS response from openvidu-server (Recording in JSON format). Resolve new Recording
|
||||
resolve(new Recording(JSON.parse(body)));
|
||||
} else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
reject(new Error(res.statusCode));
|
||||
|
@ -107,8 +107,8 @@ export class OpenVidu {
|
|||
});
|
||||
}
|
||||
|
||||
public getRecording(recordingId: string): Promise<Archive> {
|
||||
return new Promise<Archive>((resolve, reject) => {
|
||||
public getRecording(recordingId: string): Promise<Recording> {
|
||||
return new Promise<Recording>((resolve, reject) => {
|
||||
|
||||
let options = {
|
||||
hostname: this.hostname,
|
||||
|
@ -128,8 +128,8 @@ export class OpenVidu {
|
|||
});
|
||||
res.on('end', () => {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (Archive in JSON format). Resolve new Archive
|
||||
resolve(new Archive(JSON.parse(body)));
|
||||
// SUCCESS response from openvidu-server (Recording in JSON format). Resolve new Recording
|
||||
resolve(new Recording(JSON.parse(body)));
|
||||
} else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
reject(new Error(res.statusCode));
|
||||
|
@ -146,8 +146,8 @@ export class OpenVidu {
|
|||
});
|
||||
}
|
||||
|
||||
public listRecordings(): Promise<Archive[]> {
|
||||
return new Promise<Archive[]>((resolve, reject) => {
|
||||
public listRecordings(): Promise<Recording[]> {
|
||||
return new Promise<Recording[]>((resolve, reject) => {
|
||||
|
||||
let options = {
|
||||
hostname: this.hostname,
|
||||
|
@ -167,13 +167,13 @@ export class OpenVidu {
|
|||
});
|
||||
res.on('end', () => {
|
||||
if (res.statusCode === 200) {
|
||||
// SUCCESS response from openvidu-server (JSON arrays of Archives in JSON format). Resolve list of new Archives
|
||||
let archiveArray: Archive[] = [];
|
||||
// SUCCESS response from openvidu-server (JSON arrays of recordings in JSON format). Resolve list of new recordings
|
||||
let recordingArray: Recording[] = [];
|
||||
let responseItems = JSON.parse(body)['items'];
|
||||
for (let i = 0; i < responseItems.length; i++) {
|
||||
archiveArray.push(new Archive(responseItems[i]));
|
||||
recordingArray.push(new Recording(responseItems[i]));
|
||||
}
|
||||
resolve(archiveArray);
|
||||
resolve(recordingArray);
|
||||
} else {
|
||||
// ERROR response from openvidu-server. Resolve HTTP status
|
||||
reject(new Error(res.statusCode));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export class Archive {
|
||||
export class Recording {
|
||||
|
||||
private id: string;
|
||||
private name: string;
|
||||
|
@ -9,7 +9,7 @@ export class Archive {
|
|||
private url: string;
|
||||
private hasaudio: boolean = true;
|
||||
private hasvideo: boolean = true;
|
||||
private status: Archive.Status;
|
||||
private status: Recording.Status;
|
||||
|
||||
constructor(json: JSON) {
|
||||
this.id = json['id'];
|
||||
|
@ -24,7 +24,7 @@ export class Archive {
|
|||
this.status = json['status'];
|
||||
}
|
||||
|
||||
public getStatus(): Archive.Status {
|
||||
public getStatus(): Recording.Status {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ export class Archive {
|
|||
}
|
||||
}
|
||||
|
||||
export namespace Archive {
|
||||
export namespace Recording {
|
||||
export enum Status {
|
||||
starting, // The recording is starting (cannot be stopped)
|
||||
started, // The recording has started and is going on
|
|
@ -1,4 +1,4 @@
|
|||
export enum ArchiveLayout {
|
||||
export enum RecordingLayout {
|
||||
BEST_FIT = 'BEST_FIT', // All the videos are evenly distributed, taking up as much space as possible
|
||||
PICTURE_IN_PICTURE = 'PICTURE_IN_PICTURE',
|
||||
VERTICAL_PRESENTATION = 'VERTICAL_PRESENTATION',
|
|
@ -0,0 +1,4 @@
|
|||
export enum RecordingMode {
|
||||
ALWAYS = 'ALWAYS', // The session is recorded automatically (as soon as there are clients publishing streams to the session)
|
||||
MANUAL = 'MANUAL' // The session is not recorded automatically. To record the session, you can call the OpenVidu.startRecording() method
|
||||
}
|
|
@ -31,8 +31,8 @@ export class Session {
|
|||
}
|
||||
|
||||
let requestBody = JSON.stringify({
|
||||
'archiveLayout': this.properties.archiveLayout(),
|
||||
'archiveMode': this.properties.archiveMode(),
|
||||
'recordingLayout': this.properties.recordingLayout(),
|
||||
'recordingMode': this.properties.recordingMode(),
|
||||
'mediaMode': this.properties.mediaMode()
|
||||
});
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import { MediaMode } from "./MediaMode";
|
||||
import { ArchiveMode } from "./ArchiveMode";
|
||||
import { ArchiveLayout } from "./ArchiveLayout";
|
||||
import { RecordingMode } from "./RecordingMode";
|
||||
import { RecordingLayout } from "./RecordingLayout";
|
||||
|
||||
export class SessionProperties {
|
||||
|
||||
constructor(private mediaModeProp: MediaMode, private archiveModeProp: ArchiveMode, private archiveLayoutProp: ArchiveLayout) { }
|
||||
constructor(private mediaModeProp: MediaMode, private recordingModeProp: RecordingMode, private recordingLayoutProp: RecordingLayout) { }
|
||||
|
||||
mediaMode(): string {
|
||||
return this.mediaModeProp;
|
||||
}
|
||||
|
||||
archiveMode(): ArchiveMode {
|
||||
return this.archiveModeProp;
|
||||
recordingMode(): RecordingMode {
|
||||
return this.recordingModeProp;
|
||||
}
|
||||
|
||||
archiveLayout(): ArchiveLayout {
|
||||
return this.archiveLayoutProp;
|
||||
recordingLayout(): RecordingLayout {
|
||||
return this.recordingLayoutProp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,11 +23,11 @@ export namespace SessionProperties {
|
|||
export class Builder {
|
||||
|
||||
private mediaModeProp: MediaMode = MediaMode.ROUTED;
|
||||
private archiveModeProp: ArchiveMode = ArchiveMode.MANUAL;
|
||||
private archiveLayoutProp: ArchiveLayout = ArchiveLayout.BEST_FIT;
|
||||
private recordingModeProp: RecordingMode = RecordingMode.MANUAL;
|
||||
private recordingLayoutProp: RecordingLayout = RecordingLayout.BEST_FIT;
|
||||
|
||||
build(): SessionProperties {
|
||||
return new SessionProperties(this.mediaModeProp, this.archiveModeProp, this.archiveLayoutProp);
|
||||
return new SessionProperties(this.mediaModeProp, this.recordingModeProp, this.recordingLayoutProp);
|
||||
}
|
||||
|
||||
mediaMode(mediaMode: MediaMode): Builder {
|
||||
|
@ -35,13 +35,13 @@ export namespace SessionProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
archiveMode(archiveMode: ArchiveMode): Builder {
|
||||
this.archiveModeProp = archiveMode;
|
||||
recordingMode(recordingMode: RecordingMode): Builder {
|
||||
this.recordingModeProp = recordingMode;
|
||||
return this;
|
||||
}
|
||||
|
||||
archiveLayout(archiveLayout: ArchiveLayout): Builder {
|
||||
this.archiveLayoutProp = archiveLayout;
|
||||
recordingLayout(recordingLayout: RecordingLayout): Builder {
|
||||
this.recordingLayoutProp = recordingLayout;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -4,6 +4,6 @@ export * from './Session';
|
|||
export * from './SessionProperties';
|
||||
export * from './TokenOptions';
|
||||
export * from './MediaMode';
|
||||
export * from './ArchiveLayout';
|
||||
export * from './ArchiveMode';
|
||||
export * from './Archive';
|
||||
export * from './RecordingLayout';
|
||||
export * from './RecordingMode';
|
||||
export * from './Recording';
|
|
@ -356,7 +356,7 @@ public class SessionEventsHandler {
|
|||
try {
|
||||
existingParticipants = session.getParticipants();
|
||||
} catch (OpenViduException exception) {
|
||||
// Session is already closed. This happens when ArchiveMode.ALWAYS and last
|
||||
// Session is already closed. This happens when RecordingMode.ALWAYS and last
|
||||
// participant has left the session. No notification needs to be sent
|
||||
log.warn("Session already closed when trying to send 'recordingStopped' notification");
|
||||
return;
|
||||
|
|
|
@ -18,8 +18,8 @@ import com.google.gson.JsonSyntaxException;
|
|||
import io.openvidu.client.OpenViduException;
|
||||
import io.openvidu.client.OpenViduException.Code;
|
||||
import io.openvidu.client.internal.ProtocolElements;
|
||||
import io.openvidu.java.client.ArchiveLayout;
|
||||
import io.openvidu.java.client.ArchiveMode;
|
||||
import io.openvidu.java.client.RecordingLayout;
|
||||
import io.openvidu.java.client.RecordingMode;
|
||||
import io.openvidu.java.client.MediaMode;
|
||||
import io.openvidu.java.client.SessionProperties;
|
||||
import io.openvidu.server.core.SessionManager;
|
||||
|
@ -55,7 +55,7 @@ public class KurentoSessionManager extends SessionManager {
|
|||
SessionProperties properties = sessionProperties.get(sessionId);
|
||||
if (properties == null && this.isInsecureParticipant(participant.getParticipantPrivateId())) {
|
||||
properties = new SessionProperties.Builder().mediaMode(MediaMode.ROUTED)
|
||||
.archiveMode(ArchiveMode.ALWAYS).archiveLayout(ArchiveLayout.BEST_FIT).build();
|
||||
.recordingMode(RecordingMode.ALWAYS).recordingLayout(RecordingLayout.BEST_FIT).build();
|
||||
}
|
||||
createSession(kcSessionInfo, properties);
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class KurentoSessionManager extends SessionManager {
|
|||
|
||||
} else if (remainingParticipants.size() == 1 && openviduConfig.isRecordingModuleEnabled()
|
||||
&& MediaMode.ROUTED.equals(session.getSessionProperties().mediaMode())
|
||||
&& ArchiveMode.ALWAYS.equals(session.getSessionProperties().archiveMode())
|
||||
&& RecordingMode.ALWAYS.equals(session.getSessionProperties().recordingMode())
|
||||
&& ProtocolElements.RECORDER_PARTICIPANT_PUBLICID
|
||||
.equals(remainingParticipants.iterator().next().getParticipantPublicId())) {
|
||||
|
||||
|
@ -230,7 +230,7 @@ public class KurentoSessionManager extends SessionManager {
|
|||
|
||||
if (this.openviduConfig.isRecordingModuleEnabled()
|
||||
&& MediaMode.ROUTED.equals(session.getSessionProperties().mediaMode())
|
||||
&& ArchiveMode.ALWAYS.equals(session.getSessionProperties().archiveMode())
|
||||
&& RecordingMode.ALWAYS.equals(session.getSessionProperties().recordingMode())
|
||||
&& !recordingService.sessionIsBeingRecorded(session.getSessionId())
|
||||
&& session.getActivePublishers() == 0) {
|
||||
recordingService.startRecording(session);
|
||||
|
|
|
@ -105,7 +105,7 @@ public class ComposedRecordingService {
|
|||
}
|
||||
|
||||
String location = OpenViduServer.publicUrl.replaceFirst("wss://", "");
|
||||
String layoutUrl = session.getSessionProperties().archiveLayout().name().toLowerCase().replaceAll("_", "-");
|
||||
String layoutUrl = session.getSessionProperties().recordingLayout().name().toLowerCase().replaceAll("_", "-");
|
||||
|
||||
envs.add("URL=https://OPENVIDUAPP:" + secret + "@" + location + "/#/layout-" + layoutUrl + "/" + shortSessionId
|
||||
+ "/" + secret);
|
||||
|
|
|
@ -35,8 +35,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import io.openvidu.client.OpenViduException;
|
||||
import io.openvidu.client.internal.ProtocolElements;
|
||||
import io.openvidu.java.client.ArchiveLayout;
|
||||
import io.openvidu.java.client.ArchiveMode;
|
||||
import io.openvidu.java.client.RecordingLayout;
|
||||
import io.openvidu.java.client.RecordingMode;
|
||||
import io.openvidu.java.client.MediaMode;
|
||||
import io.openvidu.java.client.SessionProperties;
|
||||
import io.openvidu.server.core.ParticipantRole;
|
||||
|
@ -71,26 +71,26 @@ public class SessionRestController {
|
|||
|
||||
SessionProperties.Builder builder = new SessionProperties.Builder();
|
||||
if (params != null) {
|
||||
String archiveModeString = (String) params.get("archiveMode");
|
||||
String archiveLayoutString = (String) params.get("archiveLayout");
|
||||
String recordingModeString = (String) params.get("recordingMode");
|
||||
String recordingLayoutString = (String) params.get("recordingLayout");
|
||||
String mediaModeString = (String) params.get("mediaMode");
|
||||
|
||||
try {
|
||||
if (archiveModeString != null) {
|
||||
ArchiveMode archiveMode = ArchiveMode.valueOf(archiveModeString);
|
||||
builder = builder.archiveMode(archiveMode);
|
||||
if (recordingModeString != null) {
|
||||
RecordingMode recordingMode = RecordingMode.valueOf(recordingModeString);
|
||||
builder = builder.recordingMode(recordingMode);
|
||||
}
|
||||
if (archiveLayoutString != null) {
|
||||
ArchiveLayout archiveLayout = ArchiveLayout.valueOf(archiveLayoutString);
|
||||
builder = builder.archiveLayout(archiveLayout);
|
||||
if (recordingLayoutString != null) {
|
||||
RecordingLayout recordingLayout = RecordingLayout.valueOf(recordingLayoutString);
|
||||
builder = builder.recordingLayout(recordingLayout);
|
||||
}
|
||||
if (mediaModeString != null) {
|
||||
MediaMode mediaMode = MediaMode.valueOf(mediaModeString);
|
||||
builder = builder.mediaMode(mediaMode);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
return this.generateErrorResponse("ArchiveMode " + params.get("archiveMode") + " | " + "ArchiveLayout "
|
||||
+ params.get("archiveLayout") + " | " + "MediaMode " + params.get("mediaMode")
|
||||
return this.generateErrorResponse("RecordingMode " + params.get("recordingMode") + " | " + "RecordingLayout "
|
||||
+ params.get("recordingLayout") + " | " + "MediaMode " + params.get("mediaMode")
|
||||
+ " are not defined", "/api/tokens", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -689,12 +689,10 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
|||
|
||||
/*session.on('publisherStartSpeaking', (event) => {
|
||||
console.log('Publisher start speaking');
|
||||
console.log(event);
|
||||
});
|
||||
|
||||
session.on('publisherStopSpeaking', (event) => {
|
||||
console.log('Publisher stop speaking');
|
||||
console.log(event);
|
||||
});*/
|
||||
}
|
||||
|
||||
|
|
|
@ -15,22 +15,22 @@
|
|||
<h3>Session Properties</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Archive Mode</th>
|
||||
<th>Archive Layout</th>
|
||||
<th>Recording Mode</th>
|
||||
<th>Recording Layout</th>
|
||||
<th>Media Mode</th>
|
||||
</tr>
|
||||
<tr id="tr-session-properties">
|
||||
<td>
|
||||
<mat-select placeholder="ArchiveMode" [(ngModel)]="selectedArchiveMode">
|
||||
<mat-option *ngFor="let archiveMode of archiveModes" [value]="archiveMode">
|
||||
{{ archiveMode }}
|
||||
<mat-select placeholder="RecordingMode" [(ngModel)]="selectedRecordingMode">
|
||||
<mat-option *ngFor="let recordingMode of recordingModes" [value]="recordingMode">
|
||||
{{ recordingMode }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</td>
|
||||
<td>
|
||||
<mat-select placeholder="ArchiveLayout" [(ngModel)]="selectedArchiveLayout">
|
||||
<mat-option *ngFor="let archiveLayout of archiveLayouts" [value]="archiveLayout">
|
||||
{{ archiveLayout }}
|
||||
<mat-select placeholder="RecordingLayout" [(ngModel)]="selectedRecordingLayout">
|
||||
<mat-option *ngFor="let recordingLayout of recordingLayouts" [value]="recordingLayout">
|
||||
{{ recordingLayout }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</td>
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
|||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { OpenviduRestService } from '../../services/openvidu-rest.service';
|
||||
import { OpenviduParamsService } from '../../services/openvidu-params.service';
|
||||
import { SessionProperties, ArchiveMode, ArchiveLayout, MediaMode } from 'openvidu-node-client';
|
||||
import { SessionProperties, RecordingMode, RecordingLayout, MediaMode } from 'openvidu-node-client';
|
||||
|
||||
import * as colormap from 'colormap';
|
||||
const numColors = 64;
|
||||
|
@ -26,11 +26,11 @@ export class TestApirestComponent implements OnInit, OnDestroy {
|
|||
openViduRoles = ['SUBSCRIBER', 'PUBLISHER', 'MODERATOR'];
|
||||
selectedRole = 'PUBLISHER';
|
||||
|
||||
archiveModes = ['ALWAYS', 'MANUAL'];
|
||||
selectedArchiveMode = 'MANUAL';
|
||||
recordingModes = ['ALWAYS', 'MANUAL'];
|
||||
selectedRecordingMode = 'MANUAL';
|
||||
|
||||
archiveLayouts = ['BEST_FIT'];
|
||||
selectedArchiveLayout = 'BEST_FIT';
|
||||
recordingLayouts = ['BEST_FIT'];
|
||||
selectedRecordingLayout = 'BEST_FIT';
|
||||
|
||||
mediaModes = ['ROUTED'];
|
||||
selectedMediaMode = 'ROUTED';
|
||||
|
@ -71,8 +71,8 @@ export class TestApirestComponent implements OnInit, OnDestroy {
|
|||
private getSessionId() {
|
||||
this.openviduRestService.getSessionId(this.openviduUrl, this.openviduSecret,
|
||||
new SessionProperties.Builder()
|
||||
.archiveMode(ArchiveMode[this.selectedArchiveMode])
|
||||
.archiveLayout(ArchiveLayout[this.selectedArchiveLayout])
|
||||
.recordingMode(RecordingMode[this.selectedRecordingMode])
|
||||
.recordingLayout(RecordingLayout[this.selectedRecordingLayout])
|
||||
.mediaMode(MediaMode[this.selectedMediaMode])
|
||||
.build())
|
||||
.then((sessionId) => {
|
||||
|
|
Loading…
Reference in New Issue