public function transmitVideo($id) { $uploaded_file = $this->generate_uploaded_fileinfo($dest_folder = 'casts/video'); $upload_success = Input::file('file')->move($dest_folder, $uploaded_file['final_file']); if ($upload_success) { $xcast = Xcast::findOrFail($id); if (File::exists($xcast->video) && !preg_match('/_default\\.mp4$/', $xcast->video)) { File::delete($xcast->video); } $getid3 = new getID3(); $video_info = $getid3->analyze($uploaded_file['final_path_file']); $xcast->duration = $video_info['playtime_string']; $xcast->video = $uploaded_file['final_path_file']; $xcast->save(); return Response::json('success', 200); } else { return Response::json('error', 400); } }
public function show($id) { $xcast = Xcast::findOrFail($id); return View::make('site.cast', compact('xcast')); }