- upload recording of call in chunks - recordings are merged on server side in jobs - improve UI of the recording tab
37 lines
882 B
PHP
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);
|
|
}
|
|
}
|