getStation(); // Verify that the station supports on-demand streaming. if (!$station->getEnableOnDemand()) { return $response->withStatus(403) ->withJson(new Entity\Api\Error(403, __('This station does not support on-demand streaming.'))); } $media = $this->mediaRepo->requireByUniqueId($media_id, $station); $fsMedia = (new StationFilesystems($station))->getMediaFilesystem(); set_time_limit(600); return $response->streamFilesystemFile($fsMedia, $media->getPath()); } }