1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/. |
5
|
|
|
* |
6
|
|
|
* Copyright (c) 2016-2024 BigBlueButton Inc. and by respective authors (see below). |
7
|
|
|
* |
8
|
|
|
* This program is free software; you can redistribute it and/or modify it under the |
9
|
|
|
* terms of the GNU Lesser General Public License as published by the Free Software |
10
|
|
|
* Foundation; either version 3.0 of the License, or (at your option) any later |
11
|
|
|
* version. |
12
|
|
|
* |
13
|
|
|
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY |
14
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
15
|
|
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU Lesser General Public License along |
18
|
|
|
* with BigBlueButton; if not, see <https://www.gnu.org/licenses/>. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace BigBlueButton\Core; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Class Record. |
25
|
|
|
*/ |
26
|
|
|
class Record |
27
|
|
|
{ |
28
|
|
|
protected \SimpleXMLElement $rawXml; |
29
|
|
|
|
30
|
|
|
private string $recordId; |
31
|
|
|
private string $meetingId; |
32
|
|
|
private string $name; |
33
|
|
|
private bool $isPublished; |
34
|
|
|
private string $state; |
35
|
|
|
private float $startTime; |
36
|
|
|
private float $endTime; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @deprecated deprecated since 2.1.2 |
40
|
|
|
*/ |
41
|
|
|
private string $playbackType; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @deprecated deprecated since 2.1.2 |
45
|
|
|
*/ |
46
|
|
|
private string $playbackUrl; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @deprecated deprecated since 2.1.2 |
50
|
|
|
*/ |
51
|
|
|
private int $playbackLength; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var array<string, string> |
55
|
|
|
*/ |
56
|
|
|
private array $metas; |
57
|
|
|
|
58
|
|
|
public function __construct(\SimpleXMLElement $xml) |
59
|
|
|
{ |
60
|
|
|
$this->rawXml = $xml; |
61
|
|
|
$this->recordId = $xml->recordID->__toString(); |
62
|
|
|
$this->meetingId = $xml->meetingID->__toString(); |
63
|
|
|
$this->name = $xml->name->__toString(); |
64
|
|
|
$this->isPublished = 'true' === $xml->published->__toString(); |
65
|
|
|
$this->state = $xml->state->__toString(); |
66
|
|
|
$this->startTime = (float) $xml->startTime->__toString(); |
67
|
|
|
$this->endTime = (float) $xml->endTime->__toString(); |
68
|
|
|
$this->playbackType = $xml->playback->format->type->__toString(); |
|
|
|
|
69
|
|
|
$this->playbackUrl = $xml->playback->format->url->__toString(); |
|
|
|
|
70
|
|
|
$this->playbackLength = (int) $xml->playback->format->length->__toString(); |
|
|
|
|
71
|
|
|
|
72
|
|
|
foreach ($xml->metadata->children() as $meta) { |
73
|
|
|
$this->metas[$meta->getName()] = $meta->__toString(); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function getRecordId(): string |
78
|
|
|
{ |
79
|
|
|
return $this->recordId; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function getMeetingId(): string |
83
|
|
|
{ |
84
|
|
|
return $this->meetingId; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
public function getName(): string |
88
|
|
|
{ |
89
|
|
|
return $this->name; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function isPublished(): ?bool |
93
|
|
|
{ |
94
|
|
|
return $this->isPublished; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
public function getState(): string |
98
|
|
|
{ |
99
|
|
|
return $this->state; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
public function getStartTime(): float |
103
|
|
|
{ |
104
|
|
|
return $this->startTime; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
public function getEndTime(): float |
108
|
|
|
{ |
109
|
|
|
return $this->endTime; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @deprecated |
114
|
|
|
*/ |
115
|
|
|
public function getPlaybackType(): string |
116
|
|
|
{ |
117
|
|
|
return $this->playbackType; |
|
|
|
|
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @deprecated |
122
|
|
|
*/ |
123
|
|
|
public function getPlaybackUrl(): string |
124
|
|
|
{ |
125
|
|
|
return $this->playbackUrl; |
|
|
|
|
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @deprecated |
130
|
|
|
*/ |
131
|
|
|
public function getPlaybackLength(): int |
132
|
|
|
{ |
133
|
|
|
return $this->playbackLength; |
|
|
|
|
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @return array<string, string> |
138
|
|
|
*/ |
139
|
|
|
public function getMetas(): array |
140
|
|
|
{ |
141
|
|
|
return $this->metas; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @return Format[] |
146
|
|
|
*/ |
147
|
|
|
public function getFormats(): array |
148
|
|
|
{ |
149
|
|
|
$formats = []; |
150
|
|
|
|
151
|
|
|
foreach ($this->rawXml->playback->format as $formatXml) { |
152
|
|
|
if ($formatXml) { |
153
|
|
|
$formats[] = new Format($formatXml); |
154
|
|
|
} |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
return $formats; |
158
|
|
|
} |
159
|
|
|
} |
160
|
|
|
|
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.