Пример #1
0
        //Method to convert a YouTube video's frame to a .png image
        public ActionResult screenshot(video x)
        {
            //Ensure URL is valid
            x.fileType = "jpg";
            if (x.validate() == false)
            {
                return(View("clipper", x));
            }

            //Ensure video time is not null
            if (x.startTime == null || x.startTime == "")
            {
                x.message = "Requested capture time cannot be empty";
                return(View("clipper", x));
            }

            x.interval = x.textToTimeSpan(x.startTime);

            //Clip screenshot image from requested frame
            x.toPng(x.url);
            return(View("clipper", x));
        }