ios - I want to display a videothumbnail image of a video from url in my uiimageview for iphone -
is possible first image frame of video , display in uiimageview . video saved in server. need call url play video
an example:
nsurl *videourl = [nsurl fileurlwithpath:videopath]; avurlasset *asset = [[avurlasset alloc] initwithurl:videourl options:nil]; avassetimagegenerator *generate = [[avassetimagegenerator alloc] initwithasset:asset]; generate.appliespreferredtracktransform = yes; nserror *err = null; cmtime time = cmtimemake(1, 60); cgimageref imgref = [generate copycgimageattime:time actualtime:null error:&err]; uiimage *img = [[uiimage alloc] initwithcgimage:imgref]; [yourimageview setimage:img];
hope helps..
Comments
Post a Comment