private function removeTrackFile(Track $track) { $path = $this->fileDir . DIRECTORY_SEPARATOR . $track->getTrackFile()->getHashName(); if (file_exists($path)) { unlink($path); } $this->om->remove($track->getTrackFile()); }
/** * @Get("/video/track/{track}/stream", name="get_video_track_stream", options={ "method_prefix" = false }) * @View(serializerGroups={"api_video"}) */ public function streamTrackAction(Track $track) { $this->throwExceptionIfNotGranted($track->getVideo(), 'OPEN'); $file = $track->getTrackFile(); return $this->returnFile($file); }