sls/app/Http/Responses/Interview/RecordingChunkReceivedResponse.php
kushal.saha 121b4beaf8 feat(call recording): chuked recoding upload
- upload recording of call in chunks 
- recordings are merged on server side in jobs
- improve UI of the recording tab
2026-08-19 05:43:32 +00:00

37 lines
882 B
PHP

<?php
namespace App\Http\Responses\Interview;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Http\JsonResponse;
class RecordingChunkReceivedResponse implements Responsable
{
/**
* Create a new response instance.
*
* @param string $sessionId
* @param int $chunkIndex
*/
public function __construct(
protected string $sessionId,
protected int $chunkIndex
) {}
/**
* Create an HTTP response that represents the object.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\JsonResponse
*/
public function toResponse($request): JsonResponse
{
return response()->json([
'success' => true,
'chunk_index' => $this->chunkIndex,
'is_final' => false,
'session_id' => $this->sessionId,
], 200);
}
}