1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SquareetLabs\LaravelOpenVidu\Events; |
4
|
|
|
|
5
|
|
|
use Illuminate\Queue\SerializesModels; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class RecordingStatusChanged |
9
|
|
|
* @package SquareetLabs\LaravelOpenVidu\Events |
10
|
|
|
*/ |
11
|
|
|
class RecordingStatusChanged |
12
|
|
|
{ |
13
|
|
|
use SerializesModels; |
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @var string $sessionId |
16
|
|
|
* Session for which the event was triggered |
17
|
|
|
* A string with the session unique identifier |
18
|
|
|
*/ |
19
|
|
|
public $sessionId; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var int $timestamp |
23
|
|
|
* Time when the event was triggered |
24
|
|
|
* UTC milliseconds |
25
|
|
|
*/ |
26
|
|
|
public $timestamp; |
27
|
|
|
|
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string $participantId |
31
|
|
|
* Identifier of the participant |
32
|
|
|
* A string with the participant unique identifier |
33
|
|
|
*/ |
34
|
|
|
public $participantId; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var int $startTime |
38
|
|
|
* Time when the recording started |
39
|
|
|
* UTC milliseconds |
40
|
|
|
*/ |
41
|
|
|
public $startTime; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string $id |
45
|
|
|
* Unique identifier of the recording |
46
|
|
|
* A string with the recording unique identifier |
47
|
|
|
*/ |
48
|
|
|
public $id; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var string $name |
52
|
|
|
* Name given to the recording file |
53
|
|
|
* A string with the recording name |
54
|
|
|
*/ |
55
|
|
|
public $name; |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var string $outputMode |
60
|
|
|
* Output mode of the recording (COMPOSED or INDIVIDUAL) |
61
|
|
|
* A string with the recording output mode |
62
|
|
|
*/ |
63
|
|
|
public $outputMode; |
64
|
|
|
|
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @var bool $hasAudio |
68
|
|
|
* Wheter the recording file has audio or not |
69
|
|
|
* [true,false] |
70
|
|
|
*/ |
71
|
|
|
public $hasAudio; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var bool $hasVideo |
75
|
|
|
* Wheter the recording file has video or not |
76
|
|
|
* [true,false] |
77
|
|
|
*/ |
78
|
|
|
public $hasVideo; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @var string $recordingLayout |
82
|
|
|
* The type of layout used in the recording. Only defined if outputMode is COMPOSED and hasVideo is true |
83
|
|
|
* A RecordingLayout value (BEST_FIT, PICTURE_IN_PICTURE, CUSTOM ...) |
84
|
|
|
*/ |
85
|
|
|
public $recordingLayout; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @var string $resolution |
89
|
|
|
* Resolution of the recorded file. Only defined if outputMode is COMPOSED and hasVideo is true |
90
|
|
|
* A string with the width and height of the video file in pixels. e.g. "1280x720" |
91
|
|
|
*/ |
92
|
|
|
public $resolution; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @var int $size |
96
|
|
|
* The size of the video file. 0 until status is stopped |
97
|
|
|
* Bytes |
98
|
|
|
*/ |
99
|
|
|
public $size; |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @var int $duration |
103
|
|
|
* Duration of the video file. 0 until status is stopped |
104
|
|
|
* Seconds |
105
|
|
|
*/ |
106
|
|
|
public $duration; |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @var string $status |
110
|
|
|
* Status of the recording |
111
|
|
|
* ["started","stopped","ready","failed"] |
112
|
|
|
*/ |
113
|
|
|
public $status; |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @var string $reason |
117
|
|
|
* Why the recording stopped. Only defined when status is stopped or ready |
118
|
|
|
* ["recordingStoppedByServer","lastParticipantLeft","sessionClosedByServer","automaticStop","openviduServerStopped","mediaServerDisconnect"] |
119
|
|
|
*/ |
120
|
|
|
public $reason; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @var string $event |
124
|
|
|
* Openvidu server webhook event |
125
|
|
|
*/ |
126
|
|
|
public $event; |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Create a new SessionCreated event instance. |
130
|
|
|
* @param array $data |
131
|
|
|
*/ |
132
|
|
|
public function __construct(array $data) |
133
|
|
|
{ |
134
|
|
|
$this->sessionId = $data['sessionId']; |
135
|
|
|
$this->timestamp = $data['timestamp']; |
136
|
|
|
$this->participantId = $data['participantId']; |
137
|
|
|
$this->startTime = $data['startTime']; |
138
|
|
|
$this->id = $data['id']; |
139
|
|
|
$this->name = $data['name']; |
140
|
|
|
$this->outputMode = $data['outputMode']; |
141
|
|
|
$this->hasAudio = $data['hasAudio']; |
142
|
|
|
$this->hasVideo = $data['hasVideo']; |
143
|
|
|
$this->recordingLayout = $data['recordingLayout']; |
144
|
|
|
$this->resolution = $data['resolution']; |
145
|
|
|
$this->size = $data['size']; |
146
|
|
|
$this->duration = $data['duration']; |
147
|
|
|
$this->status = $data['status']; |
148
|
|
|
$this->reason = $data['reason']; |
149
|
|
|
$this->event = $data['event']; |
150
|
|
|
} |
151
|
|
|
} |