Пожалуйста помогите при сохранении видео , показывает что успешно загружено но сам файл по сути не загружается
function end_pager($app) {
$message = null;
$id = input('id');
if ($id) {
CSRFProtection::validate();
$livestream = get_livestream($id);
if (!$livestream or !is_livestream_owner($livestream)) redirect('livestreams');
//check for livestream files
$_FILES['video-blob']['name'] = 'video.webm';
$video = input_file('video-blob');
$filename = input('filename');
if($filename == 'nofile' || !$video){
if (!$livestream or !is_livestream_owner($livestream)) redirect('livestreams');
db()->query("UPDATE livestreams SET status='0' WHERE id='{$id}'");
}
$videoUploader = new Uploader($video, 'video');
$videoUploader->setPath(get_userid().'/'.date('Y').'/livestreams/video')->disableCDN();
$videoUploader->uploadFile();
$video_path = $videoUploader->result();
$livestreamId = $livestream['id'];
if($videoUploader->passed()){
db()->query("UPDATE livestreams SET status='2', end_time = ".time().", file_path = '".$video_path."' WHERE id='{$id}'");
fire_hook('livestream.end', null, array($livestream, $livestreamId));
return json_encode(array("status" => 1, "message" => "Livestream Successfully Uploaded"));
} else {
fire_hook('livestream.end', null, array($livestream, $livestreamId));
db()->query("UPDATE livestreams SET status='0', end_time = ".time()." WHERE id='{$id}'");
return json_encode(array("status" => 0, "message" => "Unknown Error: File is not uploaded successfully, please try again"));
}
}
}