Fix auto-record egress failing before LiveKit room exists.
Deploy Ladill Meet / deploy (push) Successful in 51s
Deploy Ladill Meet / deploy (push) Successful in 51s
Create rooms via the LiveKit API, retry egress when the room is missing, and resume server egress after the host connects when auto-record fell back to browser capture. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class RecordingService
|
||||
{
|
||||
$active = $session->recordings()->where('status', 'recording')->first();
|
||||
if ($active) {
|
||||
return $active;
|
||||
return $this->ensureServerEgress($session, $active);
|
||||
}
|
||||
|
||||
$recording = Recording::create([
|
||||
@@ -66,6 +66,24 @@ class RecordingService
|
||||
return $this->captureMode($recording) === 'egress';
|
||||
}
|
||||
|
||||
public function ensureServerEgress(Session $session, Recording $recording): Recording
|
||||
{
|
||||
if ($this->usesServerEgress($recording) || ! $this->egress->isAvailable()) {
|
||||
return $recording;
|
||||
}
|
||||
|
||||
$egressMeta = $this->egress->tryStart($session, $recording);
|
||||
if ($egressMeta === null) {
|
||||
return $recording;
|
||||
}
|
||||
|
||||
$recording->update([
|
||||
'metadata' => array_merge($recording->metadata ?? [], $egressMeta),
|
||||
]);
|
||||
|
||||
return $recording->fresh();
|
||||
}
|
||||
|
||||
public function stop(Recording $recording, string $actorRef): Recording
|
||||
{
|
||||
if ($recording->status !== 'recording') {
|
||||
|
||||
Reference in New Issue
Block a user