Fix LiveKit egress preset call and attach completion webhook per job.
Deploy Ladill Meet / deploy (push) Successful in 45s
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:
@@ -49,6 +49,7 @@ MEET_RECORDINGS_DISK=local
|
|||||||
MEET_RECORDING_MAX_MB=512
|
MEET_RECORDING_MAX_MB=512
|
||||||
# Server-side recording via LiveKit Egress (recommended for production)
|
# Server-side recording via LiveKit Egress (recommended for production)
|
||||||
MEET_EGRESS_ENABLED=false
|
MEET_EGRESS_ENABLED=false
|
||||||
|
MEET_EGRESS_WEBHOOK_URL=
|
||||||
MEET_EGRESS_S3_BUCKET=
|
MEET_EGRESS_S3_BUCKET=
|
||||||
MEET_EGRESS_S3_REGION=
|
MEET_EGRESS_S3_REGION=
|
||||||
MEET_EGRESS_S3_ACCESS_KEY=
|
MEET_EGRESS_S3_ACCESS_KEY=
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ use App\Models\Session;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Livekit\EncodedFileOutput;
|
use Livekit\EncodedFileOutput;
|
||||||
use Livekit\EncodedFileType;
|
use Livekit\EncodedFileType;
|
||||||
use Livekit\EncodingOptionsPreset;
|
|
||||||
use Livekit\EgressInfo;
|
use Livekit\EgressInfo;
|
||||||
use Livekit\S3Upload;
|
use Livekit\S3Upload;
|
||||||
|
use Livekit\WebhookConfig;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
class LiveKitEgressService
|
class LiveKitEgressService
|
||||||
@@ -41,14 +41,16 @@ class LiveKitEgressService
|
|||||||
$client = $this->client();
|
$client = $this->client();
|
||||||
$layout = $this->egressLayout($recording->layout);
|
$layout = $this->egressLayout($recording->layout);
|
||||||
$output = $this->buildFileOutput($session, $recording);
|
$output = $this->buildFileOutput($session, $recording);
|
||||||
$preset = EncodingOptionsPreset::H264_720P_30;
|
|
||||||
|
|
||||||
return $client->startRoomCompositeEgress(
|
return $client->startRoomCompositeEgress(
|
||||||
$session->media_room_name,
|
$session->media_room_name,
|
||||||
$layout,
|
$layout,
|
||||||
$output,
|
$output,
|
||||||
$preset,
|
null,
|
||||||
$audioOnly,
|
$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
|
public function tryStart(Session $session, Recording $recording): ?array
|
||||||
{
|
{
|
||||||
if (! $this->isAvailable()) {
|
if (! $this->isAvailable()) {
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ return [
|
|||||||
'processing_timeout_minutes' => (int) env('MEET_RECORDING_PROCESSING_TIMEOUT_MINUTES', 15),
|
'processing_timeout_minutes' => (int) env('MEET_RECORDING_PROCESSING_TIMEOUT_MINUTES', 15),
|
||||||
'egress' => [
|
'egress' => [
|
||||||
'enabled' => (bool) env('MEET_EGRESS_ENABLED', false),
|
'enabled' => (bool) env('MEET_EGRESS_ENABLED', false),
|
||||||
|
'webhook_url' => env('MEET_EGRESS_WEBHOOK_URL', ''),
|
||||||
's3' => [
|
's3' => [
|
||||||
'access_key' => env('MEET_EGRESS_S3_ACCESS_KEY', env('AWS_ACCESS_KEY_ID')),
|
'access_key' => env('MEET_EGRESS_S3_ACCESS_KEY', env('AWS_ACCESS_KEY_ID')),
|
||||||
'secret' => env('MEET_EGRESS_S3_SECRET', env('AWS_SECRET_ACCESS_KEY')),
|
'secret' => env('MEET_EGRESS_S3_SECRET', env('AWS_SECRET_ACCESS_KEY')),
|
||||||
|
|||||||
Reference in New Issue
Block a user