Fix LiveKit egress preset call and attach completion webhook per job.
Deploy Ladill Meet / deploy (push) Successful in 45s

Pass null encoding preset to match the PHP SDK, and register the meet webhook on each egress start so LiveKit Cloud does not need a global webhook URL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-04 03:42:28 +00:00
co-authored by Cursor
parent 152c0e6625
commit ebc11691e2
3 changed files with 21 additions and 4 deletions
+1
View File
@@ -49,6 +49,7 @@ MEET_RECORDINGS_DISK=local
MEET_RECORDING_MAX_MB=512
# Server-side recording via LiveKit Egress (recommended for production)
MEET_EGRESS_ENABLED=false
MEET_EGRESS_WEBHOOK_URL=
MEET_EGRESS_S3_BUCKET=
MEET_EGRESS_S3_REGION=
MEET_EGRESS_S3_ACCESS_KEY=
@@ -8,9 +8,9 @@ use App\Models\Session;
use Illuminate\Support\Facades\Log;
use Livekit\EncodedFileOutput;
use Livekit\EncodedFileType;
use Livekit\EncodingOptionsPreset;
use Livekit\EgressInfo;
use Livekit\S3Upload;
use Livekit\WebhookConfig;
use RuntimeException;
class LiveKitEgressService
@@ -41,14 +41,16 @@ class LiveKitEgressService
$client = $this->client();
$layout = $this->egressLayout($recording->layout);
$output = $this->buildFileOutput($session, $recording);
$preset = EncodingOptionsPreset::H264_720P_30;
return $client->startRoomCompositeEgress(
$session->media_room_name,
$layout,
$output,
$preset,
null,
$audioOnly,
false,
'',
\Livekit\AudioMixing::DEFAULT_MIXING,
$this->egressWebhooks(),
);
}
@@ -122,6 +124,19 @@ class LiveKitEgressService
};
}
/**
* @return list<WebhookConfig>
*/
protected function egressWebhooks(): array
{
$url = (string) config('meet.recordings.egress.webhook_url', '');
if ($url === '') {
$url = rtrim((string) config('app.url'), '/').'/api/livekit/webhook';
}
return [new WebhookConfig(['url' => $url])];
}
public function tryStart(Session $session, Recording $recording): ?array
{
if (! $this->isAvailable()) {
+1
View File
@@ -116,6 +116,7 @@ return [
'processing_timeout_minutes' => (int) env('MEET_RECORDING_PROCESSING_TIMEOUT_MINUTES', 15),
'egress' => [
'enabled' => (bool) env('MEET_EGRESS_ENABLED', false),
'webhook_url' => env('MEET_EGRESS_WEBHOOK_URL', ''),
's3' => [
'access_key' => env('MEET_EGRESS_S3_ACCESS_KEY', env('AWS_ACCESS_KEY_ID')),
'secret' => env('MEET_EGRESS_S3_SECRET', env('AWS_SECRET_ACCESS_KEY')),