You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
942 B

<?php
namespace App\Http\Controllers;
use App\Services\FileService;
use Illuminate\Http\Request;
use Log;
class LiveVideoController extends Controller
{
const EVENT_TYPE_FILE_CLOSED = "FileClosed";
private $fileService;
public function __construct()
{
$this->fileService = new FileService();
}
//
public function add(Request $request)
{
$data = $request->json()->all();
$eventType = $data["EventType"];
$eventData = $data["EventData"];
Log::info("bilibili live record webhook data : ", json_encode($data));
if ($eventType == self::EVENT_TYPE_FILE_CLOSED) {
Log::info($eventData["RelativePath"]);
$this->fileService->renameFileAndAddToQueue("/mnt/e/rec/" . $eventData["RelativePath"], "flv", "mp4");
}
// Log::info($data["EventData"]);
// Log::info($data["EventType"]);
return response("", 200);
}
}