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

View Single Post
Old 08-20-2009, 04:05 PM   #2 (permalink)
MichaelE
http://app-apps.com
 
Join Date: Jun 2009
Location: Los Angeles, CA
Posts: 450
MichaelE is on a distinguished road
Lightbulb

The documentation is not at all clear on how to do this, but it's fairly straightforward.
  1. Add the MobileCoreServices framework to your project
  2. Add #import <MobileCoreServices/UTCoreTypes.h> to the header file where you will reference the picker. Alternately, you can add the import to your precompiled header file (.pch) so the UTCoreTypes constants are available throughout the project.
Now, before calling the UIImagePickerController, just set the mediaTypes property to the movie type, kUTTypeMovie. Or, if you wanted to only display photos you would use kUTTypeImage:
Code:
myImagePickerController.mediaTypes =  
   [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
Keep in mind that you should check if the device supports video recording before setting the sourceType, as setting it to a movie type on a device that does not support video recording will cause all sorts of havoc. You do that by looking at the available source types:
Code:
NSArray *sourceTypes = 
   [UIImagePickerController availableMediaTypesForSourceType:myImagePickerController.sourceType];
if (![sourceTypes containsObject:(NSString *)kUTTypeMovie ]){
   // no movie type supported...add code to handle that here.
}
Quote:
Originally Posted by NewiPhoneDeveloper View Post
Hello,
Now my question is (and sorry if it's a stupid one): How and what mediaType do I assign, so UIImagePickerController directly launches with the video camera?
__________________
Michael Emmons
Founder, App Apps, LLC
http://app-apps.com



VideoBot | Audiotorium Notes | Thought Bubbles
MichaelE is offline   Reply With Quote
 

» Advertisements
» Online Users: 773
26 members and 747 guests
ADY, apatsufas, arlethatm26, baja_yu, dcool, dljeffery, doffing81, esoteric, isodev, jakespencer, jbro, JmayLive, mer10, Morrisone, MrDrewC, Newbie123, NSString, oceanlablight, raymng, Rifts, sacha1996, seecoolguy, Speed, tne7laa, Yoonoo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,171
Threads: 93,916
Posts: 402,127
Top Poster: BrianSlick (7,966)
Welcome to our newest member, arlethatm26
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:08 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.