public async Task <IActionResult> View([FromQuery(Name = "v")] int videoId) { var video = videoManager.Get(videoId); if (video == null) { return(NotFound()); } if (video.DownloadedPath == null) { return(NotFound()); } var mimeType = await videoStorage.GetMimeType(video); if (mimeType == null) { return(NotFound()); } var videoFile = await videoStorage.FindVideoFile(video); return(PhysicalFile(videoFile, mimeType, true)); }