2018-04-26 15:33:47 +02:00
/ *
2022-01-13 11:18:47 +01:00
* ( C ) Copyright 2017 - 2022 OpenVidu ( https : //openvidu.io)
2018-04-26 15:33:47 +02:00
*
* 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 .
*
* /
import { Event } from './Event' ;
2018-05-08 13:01:34 +02:00
import { Session } from '../../OpenVidu/Session' ;
2022-11-15 15:28:55 +01:00
import { RecordingEventReason } from './Types/Types' ;
2018-04-26 15:33:47 +02:00
/ * *
2022-01-13 13:54:34 +01:00
* Triggered by :
2022-11-22 16:15:07 +01:00
* - { @link SessionEventMap . recordingStarted }
* - { @link SessionEventMap . recordingStopped }
2018-04-26 15:33:47 +02:00
* /
export class RecordingEvent extends Event {
/ * *
* The recording ID generated in openvidu - server
* /
id : string ;
/ * *
* The recording name you supplied to openvidu - server . For example , to name your recording file MY_RECORDING :
* - With * * API REST * * : POST to ` /api/recordings/start ` passing JSON body ` {"session":"sessionId","name":"MY_RECORDING"} `
2018-07-09 15:45:20 +02:00
* - With * * openvidu - java - client * * : ` OpenVidu.startRecording(sessionId, "MY_RECORDING") ` or ` OpenVidu.startRecording(sessionId, new RecordingProperties.Builder().name("MY_RECORDING").build()) `
* - With * * openvidu - node - client * * : ` OpenVidu.startRecording(sessionId, "MY_RECORDING") ` or ` OpenVidu.startRecording(sessionId, {name: "MY_RECORDING"}) `
2018-04-26 15:33:47 +02:00
*
2022-11-22 16:15:07 +01:00
* If no name is supplied , this property will be undefined and the recorded file will be named after property { @link id }
2018-04-26 15:33:47 +02:00
* /
name? : string ;
2019-02-21 14:48:26 +01:00
/ * *
* For 'recordingStopped' event :
* - "recordingStoppedByServer" : the recording has been gracefully stopped by the application
* - "sessionClosedByServer" : the Session has been closed by the application
2020-04-05 21:34:10 +02:00
* - "automaticStop" : see [ Automatic stop of recordings ] ( / e n / s t a b l e / a d v a n c e d - f e a t u r e s / r e c o r d i n g / # a u t o m a t i c - s t o p - o f - r e c o r d i n g s )
2021-06-01 15:01:40 +02:00
* - "nodeCrashed" : a node has crashed in the server side
2019-02-21 14:48:26 +01:00
*
* For 'recordingStarted' empty string
* /
2022-11-15 15:28:55 +01:00
reason? : RecordingEventReason ;
2019-02-21 14:48:26 +01:00
2018-04-26 15:33:47 +02:00
/ * *
* @hidden
* /
2022-11-15 15:28:55 +01:00
constructor ( target : Session , type : string , id : string , name : string , reason? : RecordingEventReason ) {
2018-04-26 15:33:47 +02:00
super ( false , target , type ) ;
this . id = id ;
if ( name !== id ) {
this . name = name ;
}
2019-02-21 14:48:26 +01:00
this . reason = reason ;
2018-04-26 15:33:47 +02:00
}
/ * *
* @hidden
* /
// tslint:disable-next-line:no-empty
2022-11-15 15:28:55 +01:00
callDefaultBehavior() { }
2022-08-17 18:04:05 +02:00
}