Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-20-2011, 10:41 AM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 1
Gargamel is on a distinguished road
Smile UIImagePickerController thumbnail of video which is pick up from library

Hi,

I am trying to get the thumbnail of the video which is pick up from library using the UIImagePickerController.

Here is my code. I can get the the thumbnail of video if I using the camera to record a video. But I can not get the thumbnail if I pick up a video from the library. Anybody know why?

-(void)imagePickerControllerUIImagePickerControll er *)picker didFinishPickingMediaWithInfoNSDictionary *)info
{
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];

if([mediaType isEqualToStringNSString *)kUTTypeMovie]){
NSURL *mediaUrl = [info objectForKey:UIImagePickerControllerMediaURL];

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:mediaUrl];
moviePlayer.shouldAutoplay = NO;
UIImage *thumbnail = [[moviePlayer thumbnailImageAtTime:0.0 timeOption:MPMovieTimeOptionNearestKeyFrame] retain];
[imageView setImage:thumbnail]; //imageView is a UIImageView

[moviePlayer release];
[thumbnail release];
[self dismissModalViewControllerAnimated:YES];
return;

}
Gargamel is offline   Reply With Quote
Reply

Bookmarks

Tags
library, thumbnail, uiimagepickercontrolle, video

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 345
13 members and 332 guests
dansparrow, dre, iOS.Lover, LezB44, lorrettaui53, Nobbsy, Objective Zero, oztemel, pbart, samdanielblr, sledzeppelin, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:49 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0