Note that there are some explanatory texts on larger screens.

plurals
  1. POThumbnail for youtube video
    primarykey
    data
    text
    <p>I am trying to create a thumbnail for youtube video,but me getting below error:-</p> <pre><code>Error Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo=0xa07ac00 NSLocalizedDescription=Operation Stopped, NSUnderlyingError=0xa07e580 "The operation couldn’t be completed. (OSStatus error -12939.)", NSLocalizedFailureReason=The server is not correctly configured. </code></pre> <p>Please help me out to create a thumbnail of youtube video from youtube link.</p> <p>The Code am using to create thumbnail is as follows:-</p> <pre><code>NSURL *url = [NSURL URLWithString:strVideoURL]; AVURLAsset *asset=[[AVURLAsset alloc] initWithURL:url options:nil]; AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:asset]; generator.appliesPreferredTrackTransform=TRUE; CMTime thumbTime = CMTimeMakeWithSeconds(0,30); AVAssetImageGeneratorCompletionHandler handler = ^(CMTime requestedTime, CGImageRef im, CMTime actualTime, AVAssetImageGeneratorResult result, NSError *error) { if (result != AVAssetImageGeneratorSucceeded) { NSLog(@"couldn't generate thumbnail, error:%@", error); } // TODO Do something with the image NSLog(@"CGImage---- %@", im); UIImage *thumbnail=[UIImage imageWithCGImage:im]; UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(30, 50, 120, 120)]; imageView.backgroundColor=[UIColor redColor]; imageView.image=thumbnail; [image addSubview:imageView]; UIView *view=(UIView*)[self.view viewWithTag:10]; [view removeFromSuperview]; }; CGSize maxSize = CGSizeMake(128, 128); generator.maximumSize = maxSize; [generator generateCGImagesAsynchronouslyForTimes:[NSArray arrayWithObject:[NSValue valueWithCMTime:thumbTime]] completionHandler:handler]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload