Esempio n. 1
0
        public async Task <FileContentResult> GetEntityAsVideo(object entity)
        {
            Image image = ImageService.GetObjectAsImage(entity);

            string imagePath = ImageService.SaveImageToFile(image);

            string videoPath = await VideoService.CreateVideoFromImage(imagePath);

            byte[] bytes = await System.IO.File.ReadAllBytesAsync(videoPath);

            if (ImageService.ImageSettings.AutoDelete)
            {
                System.IO.File.Delete(imagePath);
            }

            if (ImageService.ImageSettings.AutoDelete)
            {
                System.IO.File.Delete(videoPath);
            }

            return(File(bytes, "video/mp4"));
        }