2018-04-18 14:29:07 +02:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2017-2018 OpenVidu (http://openvidu.io/)
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-04-23 11:06:16 +02:00
|
|
|
import { RecordingLayout } from './RecordingLayout';
|
|
|
|
import { RecordingProperties } from './RecordingProperties';
|
2018-04-20 12:04:56 +02:00
|
|
|
|
2018-04-18 10:39:39 +02:00
|
|
|
export class Recording {
|
2018-03-14 18:48:29 +01:00
|
|
|
|
|
|
|
private id: string;
|
|
|
|
private sessionId: string;
|
|
|
|
private createdAt: number;
|
2018-04-23 11:06:16 +02:00
|
|
|
private size = 0;
|
|
|
|
private duration = 0;
|
2018-03-14 18:48:29 +01:00
|
|
|
private url: string;
|
2018-04-23 11:06:16 +02:00
|
|
|
private hasaudio = true;
|
|
|
|
private hasvideo = true;
|
2018-04-18 10:39:39 +02:00
|
|
|
private status: Recording.Status;
|
2018-04-20 12:04:56 +02:00
|
|
|
private recordingProperties: RecordingProperties;
|
2018-03-14 18:48:29 +01:00
|
|
|
|
2018-04-23 11:06:16 +02:00
|
|
|
/* tslint:disable:no-string-literal */
|
2018-03-14 18:48:29 +01:00
|
|
|
constructor(json: JSON) {
|
|
|
|
this.id = json['id'];
|
|
|
|
this.sessionId = json['sessionId'];
|
|
|
|
this.createdAt = json['createdAt'];
|
|
|
|
this.size = json['size'];
|
|
|
|
this.duration = json['duration'];
|
|
|
|
this.url = json['url'];
|
|
|
|
this.hasaudio = json['hasAudio'];
|
|
|
|
this.hasvideo = json['hasVideo'];
|
|
|
|
this.status = json['status'];
|
2018-04-23 11:06:16 +02:00
|
|
|
this.recordingProperties = { name: json['name'], recordingLayout: json['layout'] };
|
2018-03-14 18:48:29 +01:00
|
|
|
}
|
2018-04-23 11:06:16 +02:00
|
|
|
/* tslint:enable:no-string-literal */
|
2018-03-14 18:48:29 +01:00
|
|
|
|
2018-04-18 10:39:39 +02:00
|
|
|
public getStatus(): Recording.Status {
|
2018-03-14 18:48:29 +01:00
|
|
|
return this.status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getId(): string {
|
|
|
|
return this.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getName(): string {
|
2018-04-23 11:06:16 +02:00
|
|
|
return this.recordingProperties.name;
|
2018-04-20 12:04:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public getLayout(): RecordingLayout {
|
2018-04-23 11:06:16 +02:00
|
|
|
return this.recordingProperties.recordingLayout;
|
2018-03-14 18:48:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public getSessionId(): string {
|
|
|
|
return this.sessionId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getCreatedAt(): number {
|
|
|
|
return this.createdAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getSize(): number {
|
|
|
|
return this.size;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getDuration(): number {
|
|
|
|
return this.duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getUrl(): string {
|
|
|
|
return this.url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public hasAudio(): boolean {
|
|
|
|
return this.hasaudio;
|
|
|
|
}
|
|
|
|
|
|
|
|
public hasVideo(): boolean {
|
|
|
|
return this.hasvideo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-18 10:39:39 +02:00
|
|
|
export namespace Recording {
|
2018-03-14 18:48:29 +01:00
|
|
|
export enum Status {
|
|
|
|
starting, // The recording is starting (cannot be stopped)
|
|
|
|
started, // The recording has started and is going on
|
|
|
|
stopped, // The recording has finished OK
|
|
|
|
available, // The recording is available for downloading. This status is reached for all
|
|
|
|
// stopped recordings if property 'openvidu.recording.free-access' is true
|
|
|
|
failed // The recording has failed
|
|
|
|
}
|
|
|
|
}
|