diff options
| -rw-r--r-- | Video Tuneup.xcodeproj/project.pbxproj | 2 | ||||
| -rw-r--r-- | Video Tuneup/ViewController.h | 5 | ||||
| -rw-r--r-- | Video Tuneup/ViewController.m | 16 | ||||
| -rw-r--r-- | Video Tuneup/en.lproj/ViewController_iPad.xib | 90 |
4 files changed, 92 insertions, 21 deletions
diff --git a/Video Tuneup.xcodeproj/project.pbxproj b/Video Tuneup.xcodeproj/project.pbxproj index 6b9e579..e302a2a 100644 --- a/Video Tuneup.xcodeproj/project.pbxproj +++ b/Video Tuneup.xcodeproj/project.pbxproj @@ -461,6 +461,7 @@ GCC_PREFIX_HEADER = "Video Tuneup/Video Tuneup-Prefix.pch"; INFOPLIST_FILE = "Video Tuneup/Video Tuneup-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; }; name = Debug; @@ -472,6 +473,7 @@ GCC_PREFIX_HEADER = "Video Tuneup/Video Tuneup-Prefix.pch"; INFOPLIST_FILE = "Video Tuneup/Video Tuneup-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/Video Tuneup/ViewController.h b/Video Tuneup/ViewController.h index 8c84b4f..fb2f19a 100644 --- a/Video Tuneup/ViewController.h +++ b/Video Tuneup/ViewController.h @@ -34,6 +34,9 @@ @property (nonatomic, retain) IBOutlet UILabel *exportStatus; @property (nonatomic, retain) IBOutlet UISlider* mScrubber; +@property (nonatomic, retain) IBOutlet UIButton *mediaLibraryButton; +@property (nonatomic, retain) UIPopoverController *mediaLibraryPopover; + - (void)hideCameraRollText; - (IBAction)loadAssetFromFile:sender; @@ -52,4 +55,6 @@ - (CMTime)playerItemDuration; - (void)exportDidFinish:(AVAssetExportSession*)session; + +- (IBAction)showMediaLibrary:(id)sender; @end
\ No newline at end of file diff --git a/Video Tuneup/ViewController.m b/Video Tuneup/ViewController.m index 83a82a9..e26af47 100644 --- a/Video Tuneup/ViewController.m +++ b/Video Tuneup/ViewController.m @@ -16,7 +16,7 @@ static const NSString *ItemStatusContext; @implementation ViewController @synthesize player, playerItem, playerView, playButton, pauseButton, rewindButton, editor, videoNavBar, exportStatus, -mScrubber; +mScrubber, mediaLibraryButton, mediaLibraryPopover; #pragma mark - Video playback @@ -398,6 +398,20 @@ mScrubber; [player play]; // loop player. If not doing this, set button to pause } +#pragma mark - Media Library + +- (IBAction)showMediaLibrary:(id)sender { + // http://stackoverflow.com/questions/2469523/mpmediapickercontroller-for-selecting-video-files#answer-3212470 + + UIButton *theButton = (UIButton *)sender; + UIImagePickerController* picker = [[UIImagePickerController alloc] init]; + //picker.delegate = self; + picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; + picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; + mediaLibraryPopover = [[UIPopoverController alloc] initWithContentViewController:picker]; + [self.mediaLibraryPopover presentPopoverFromRect:[theButton bounds] inView:theButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; + +} #pragma mark - View controller boilerplate diff --git a/Video Tuneup/en.lproj/ViewController_iPad.xib b/Video Tuneup/en.lproj/ViewController_iPad.xib index d4cece4..17a4421 100644 --- a/Video Tuneup/en.lproj/ViewController_iPad.xib +++ b/Video Tuneup/en.lproj/ViewController_iPad.xib @@ -2,10 +2,10 @@ <archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00"> <data> <int key="IBDocument.SystemTarget">1280</int> - <string key="IBDocument.SystemVersion">11D50d</string> + <string key="IBDocument.SystemVersion">10K549</string> <string key="IBDocument.InterfaceBuilderVersion">1938</string> - <string key="IBDocument.AppKitVersion">1138.32</string> - <string key="IBDocument.HIToolboxVersion">568.00</string> + <string key="IBDocument.AppKitVersion">1038.36</string> + <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="NS.object.0">933</string> @@ -46,7 +46,6 @@ <reference key="NSSuperview" ref="766721923"/> <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="761978491"/> - <string key="NSReuseIdentifierKey">_NS:241</string> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBIPadFramework</string> <int key="IBUIContentHorizontalAlignment">0</int> @@ -82,7 +81,6 @@ <reference key="NSSuperview" ref="766721923"/> <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="1061865793"/> - <string key="NSReuseIdentifierKey">_NS:241</string> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBIPadFramework</string> <int key="IBUIContentHorizontalAlignment">0</int> @@ -112,7 +110,7 @@ <string key="NSFrame">{{93, 11}, {564, 23}}</string> <reference key="NSSuperview" ref="812339394"/> <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="425377558"/> + <reference key="NSNextKeyView" ref="938661883"/> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBIPadFramework</string> <int key="IBUIContentHorizontalAlignment">0</int> @@ -168,7 +166,6 @@ <reference key="NSSuperview" ref="766721923"/> <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="812339394"/> - <string key="NSReuseIdentifierKey">_NS:212</string> <object class="NSColor" key="IBUIBackgroundColor" id="347621421"> <int key="NSColorSpace">1</int> <bytes key="NSRGB">MCAwIDAAA</bytes> @@ -185,7 +182,6 @@ <reference key="NSSuperview" ref="766721923"/> <reference key="NSWindow"/> <reference key="NSNextKeyView"/> - <string key="NSReuseIdentifierKey">_NS:241</string> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBIPadFramework</string> <int key="IBUIContentHorizontalAlignment">0</int> @@ -215,7 +211,6 @@ <reference key="NSSuperview" ref="766721923"/> <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="806269495"/> - <string key="NSReuseIdentifierKey">_NS:345</string> <bool key="IBUIOpaque">NO</bool> <bool key="IBUIClipsSubviews">YES</bool> <int key="IBUIContentMode">7</int> @@ -237,6 +232,35 @@ <int key="NSfFlags">16</int> </object> </object> + <object class="IBUIButton" id="938661883"> + <reference key="NSNextResponder" ref="766721923"/> + <int key="NSvFlags">292</int> + <string key="NSFrame">{{54, 906}, {75, 37}}</string> + <reference key="NSSuperview" ref="766721923"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="425377558"/> + <bool key="IBUIOpaque">NO</bool> + <string key="targetRuntimeIdentifier">IBIPadFramework</string> + <int key="IBUIContentHorizontalAlignment">0</int> + <int key="IBUIContentVerticalAlignment">0</int> + <int key="IBUIButtonType">1</int> + <string key="IBUINormalTitle">Library</string> + <reference key="IBUIHighlightedTitleColor" ref="804940373"/> + <object class="NSColor" key="IBUINormalTitleColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> + </object> + <reference key="IBUINormalTitleShadowColor" ref="752673392"/> + <object class="IBUIFontDescription" key="IBUIFontDescription" id="1067550929"> + <int key="type">2</int> + <double key="pointSize">15</double> + </object> + <object class="NSFont" key="IBUIFont" id="361109798"> + <string key="NSName">Helvetica-Bold</string> + <double key="NSSize">15</double> + <int key="NSfFlags">16</int> + </object> + </object> </array> <string key="NSFrame">{{0, 20}, {768, 1004}}</string> <reference key="NSSuperview"/> @@ -258,7 +282,6 @@ <nil key="NSNextResponder"/> <int key="NSvFlags">292</int> <string key="NSFrameSize">{72, 37}</string> - <string key="NSReuseIdentifierKey">_NS:241</string> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBIPadFramework</string> <int key="IBUIContentHorizontalAlignment">0</int> @@ -271,15 +294,8 @@ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> </object> <reference key="IBUINormalTitleShadowColor" ref="752673392"/> - <object class="IBUIFontDescription" key="IBUIFontDescription"> - <int key="type">2</int> - <double key="pointSize">15</double> - </object> - <object class="NSFont" key="IBUIFont"> - <string key="NSName">Helvetica-Bold</string> - <double key="NSSize">15</double> - <int key="NSfFlags">16</int> - </object> + <reference key="IBUIFontDescription" ref="1067550929"/> + <reference key="IBUIFont" ref="361109798"/> </object> </array> <object class="IBObjectContainer" key="IBDocument.Objects"> @@ -325,6 +341,14 @@ <int key="connectionID">51</int> </object> <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">mediaLibraryButton</string> + <reference key="source" ref="841351856"/> + <reference key="destination" ref="938661883"/> + </object> + <int key="connectionID">60</int> + </object> + <object class="IBConnectionRecord"> <object class="IBCocoaTouchEventConnection" key="connection"> <string key="label">loadAssetFromFile:</string> <reference key="source" ref="1049445720"/> @@ -403,6 +427,15 @@ </object> <int key="connectionID">46</int> </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchEventConnection" key="connection"> + <string key="label">showMediaLibrary:</string> + <reference key="source" ref="938661883"/> + <reference key="destination" ref="841351856"/> + <int key="IBEventType">7</int> + </object> + <int key="connectionID">61</int> + </object> </array> <object class="IBMutableOrderedSet" key="objectRecords"> <array key="orderedObjects"> @@ -432,6 +465,7 @@ <reference ref="425377558"/> <reference ref="1049445720"/> <reference ref="761978491"/> + <reference ref="938661883"/> </array> <reference key="parent" ref="0"/> </object> @@ -519,6 +553,11 @@ <reference key="object" ref="1042807396"/> <reference key="parent" ref="812339394"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">59</int> + <reference key="object" ref="938661883"/> + <reference key="parent" ref="766721923"/> + </object> </array> </object> <dictionary class="NSMutableDictionary" key="flattenedProperties"> @@ -540,6 +579,7 @@ <string key="43.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="45.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="47.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="59.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="7.CustomClassName">PlayerView</string> <string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> </dictionary> @@ -547,7 +587,7 @@ <nil key="activeLocalization"/> <dictionary class="NSMutableDictionary" key="localizations"/> <nil key="sourceID"/> - <int key="maxID">58</int> + <int key="maxID">61</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <array class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -569,6 +609,7 @@ <string key="pause:">id</string> <string key="play:">id</string> <string key="rewind:">id</string> + <string key="showMediaLibrary:">id</string> </dictionary> <dictionary class="NSMutableDictionary" key="actionInfosByName"> <object class="IBActionInfo" key="exportToCameraRoll:"> @@ -595,10 +636,15 @@ <string key="name">rewind:</string> <string key="candidateClassName">id</string> </object> + <object class="IBActionInfo" key="showMediaLibrary:"> + <string key="name">showMediaLibrary:</string> + <string key="candidateClassName">id</string> + </object> </dictionary> <dictionary class="NSMutableDictionary" key="outlets"> <string key="exportStatus">UILabel</string> <string key="mScrubber">UISlider</string> + <string key="mediaLibraryButton">UIButton</string> <string key="pauseButton">UIButton</string> <string key="playButton">UIButton</string> <string key="playerView">PlayerView</string> @@ -614,6 +660,10 @@ <string key="name">mScrubber</string> <string key="candidateClassName">UISlider</string> </object> + <object class="IBToOneOutletInfo" key="mediaLibraryButton"> + <string key="name">mediaLibraryButton</string> + <string key="candidateClassName">UIButton</string> + </object> <object class="IBToOneOutletInfo" key="pauseButton"> <string key="name">pauseButton</string> <string key="candidateClassName">UIButton</string> |
