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-01-27 19:39:49 +01:00
|
|
|
import { MediaMode } from "./MediaMode";
|
2018-04-18 10:39:39 +02:00
|
|
|
import { RecordingMode } from "./RecordingMode";
|
|
|
|
import { RecordingLayout } from "./RecordingLayout";
|
2018-01-27 19:39:49 +01:00
|
|
|
|
|
|
|
export class SessionProperties {
|
|
|
|
|
2018-04-20 15:50:56 +02:00
|
|
|
constructor(private mediaModeProp: MediaMode, private recordingModeProp: RecordingMode, private defaultRecordingLayoutProp: RecordingLayout, private defaultCustomLayoutProp: string) { }
|
2018-01-27 19:39:49 +01:00
|
|
|
|
|
|
|
mediaMode(): string {
|
|
|
|
return this.mediaModeProp;
|
|
|
|
}
|
|
|
|
|
2018-04-18 10:39:39 +02:00
|
|
|
recordingMode(): RecordingMode {
|
|
|
|
return this.recordingModeProp;
|
2018-01-27 19:39:49 +01:00
|
|
|
}
|
|
|
|
|
2018-04-20 12:04:56 +02:00
|
|
|
defaultRecordingLayout(): RecordingLayout {
|
|
|
|
return this.defaultRecordingLayoutProp;
|
2018-01-27 19:39:49 +01:00
|
|
|
}
|
2018-04-20 15:50:56 +02:00
|
|
|
|
|
|
|
defaultCustomLayout(): string {
|
|
|
|
return this.defaultCustomLayoutProp;
|
|
|
|
}
|
2018-01-27 19:39:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export namespace SessionProperties {
|
|
|
|
export class Builder {
|
|
|
|
|
|
|
|
private mediaModeProp: MediaMode = MediaMode.ROUTED;
|
2018-04-18 10:39:39 +02:00
|
|
|
private recordingModeProp: RecordingMode = RecordingMode.MANUAL;
|
2018-04-20 12:04:56 +02:00
|
|
|
private defaultRecordingLayoutProp: RecordingLayout = RecordingLayout.BEST_FIT;
|
2018-04-20 15:50:56 +02:00
|
|
|
private defaultCustomLayoutProp: string = '';
|
2018-01-27 19:39:49 +01:00
|
|
|
|
|
|
|
build(): SessionProperties {
|
2018-04-20 15:50:56 +02:00
|
|
|
return new SessionProperties(this.mediaModeProp, this.recordingModeProp, this.defaultRecordingLayoutProp, this.defaultCustomLayoutProp);
|
2018-01-27 19:39:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
mediaMode(mediaMode: MediaMode): Builder {
|
|
|
|
this.mediaModeProp = mediaMode;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2018-04-18 10:39:39 +02:00
|
|
|
recordingMode(recordingMode: RecordingMode): Builder {
|
|
|
|
this.recordingModeProp = recordingMode;
|
2018-01-27 19:39:49 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2018-04-20 12:04:56 +02:00
|
|
|
defaultRecordingLayout(layout: RecordingLayout): Builder {
|
|
|
|
this.defaultRecordingLayoutProp = layout;
|
2018-01-27 19:39:49 +01:00
|
|
|
return this;
|
|
|
|
}
|
2018-04-20 15:50:56 +02:00
|
|
|
|
|
|
|
defaultCustomLayout(path: string): Builder {
|
|
|
|
this.defaultCustomLayoutProp = path;
|
|
|
|
return this;
|
|
|
|
}
|
2018-01-27 19:39:49 +01:00
|
|
|
};
|
|
|
|
}
|