diff options
| author | Brian Jordan | 2012-03-28 13:11:10 -0400 |
|---|---|---|
| committer | Brian Jordan | 2012-03-28 13:11:10 -0400 |
| commit | 6276c3004552d250d0fc22df975b9c29ea1f6884 (patch) | |
| tree | ce4ae9fb7c5d1bd3b99c70e4f88d732d4445316a | |
| parent | b78b2a4a595f604aaaaed72102d662d6f334378f (diff) | |
| download | Video-Tuneup-6276c3004552d250d0fc22df975b9c29ea1f6884.tar.bz2 | |
add play, pause, rewind. Resolves #2
| -rw-r--r-- | Video Tuneup/ViewController.h | 4 | ||||
| -rw-r--r-- | Video Tuneup/ViewController.m | 10 | ||||
| -rw-r--r-- | Video Tuneup/en.lproj/ViewController_iPad.xib | 171 |
3 files changed, 178 insertions, 7 deletions
diff --git a/Video Tuneup/ViewController.h b/Video Tuneup/ViewController.h index 9a39837..247e770 100644 --- a/Video Tuneup/ViewController.h +++ b/Video Tuneup/ViewController.h @@ -18,7 +18,11 @@ @property (retain) AVPlayerItem *playerItem; @property (nonatomic, retain) IBOutlet PlayerView *playerView; @property (nonatomic, retain) IBOutlet UIButton *playButton; +@property (nonatomic, retain) IBOutlet UIButton *pauseButton; + - (IBAction)loadAssetFromFile:sender; - (IBAction)play:sender; +- (IBAction)pause:sender; +- (IBAction)rewind:sender; - (void)syncUI; @end
\ No newline at end of file diff --git a/Video Tuneup/ViewController.m b/Video Tuneup/ViewController.m index ca3d92d..b88a8f8 100644 --- a/Video Tuneup/ViewController.m +++ b/Video Tuneup/ViewController.m @@ -14,7 +14,7 @@ static const NSString *ItemStatusContext; @implementation ViewController -@synthesize player, playerItem, playerView, playButton; +@synthesize player, playerItem, playerView, playButton, pauseButton; #pragma mark - Video playback @@ -97,6 +97,14 @@ static const NSString *ItemStatusContext; - (IBAction)play:sender { [player play]; } + +- (IBAction)pause:sender { + [player pause]; +} + +- (IBAction)rewind:sender { + [player seekToTime:kCMTimeZero]; +} - (void)playerItemDidReachEnd:(NSNotification *)notification { [player seekToTime:kCMTimeZero]; diff --git a/Video Tuneup/en.lproj/ViewController_iPad.xib b/Video Tuneup/en.lproj/ViewController_iPad.xib index b6fe7bc..897fb98 100644 --- a/Video Tuneup/en.lproj/ViewController_iPad.xib +++ b/Video Tuneup/en.lproj/ViewController_iPad.xib @@ -41,7 +41,7 @@ <string key="NSFrame">{{172, 191}, {403, 84}}</string> <reference key="NSSuperview" ref="766721923"/> <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="1061865793"/> + <reference key="NSNextKeyView" ref="958752162"/> <string key="NSReuseIdentifierKey">_NS:241</string> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBIPadFramework</string> @@ -49,7 +49,7 @@ <int key="IBUIContentVerticalAlignment">0</int> <int key="IBUIButtonType">1</int> <string key="IBUINormalTitle">Open Movie</string> - <object class="NSColor" key="IBUIHighlightedTitleColor"> + <object class="NSColor" key="IBUIHighlightedTitleColor" id="950055607"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MQA</bytes> </object> @@ -57,15 +57,15 @@ <int key="NSColorSpace">1</int> <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> </object> - <object class="NSColor" key="IBUINormalTitleShadowColor"> + <object class="NSColor" key="IBUINormalTitleShadowColor" id="484429581"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MC41AA</bytes> </object> - <object class="IBUIFontDescription" key="IBUIFontDescription"> + <object class="IBUIFontDescription" key="IBUIFontDescription" id="245349657"> <int key="type">2</int> <double key="pointSize">15</double> </object> - <object class="NSFont" key="IBUIFont"> + <object class="NSFont" key="IBUIFont" id="1064047706"> <string key="NSName">Helvetica-Bold</string> <double key="NSSize">15</double> <int key="NSfFlags">16</int> @@ -88,6 +88,75 @@ </object> <string key="targetRuntimeIdentifier">IBIPadFramework</string> </object> + <object class="IBUIButton" id="958752162"> + <reference key="NSNextResponder" ref="766721923"/> + <int key="NSvFlags">292</int> + <string key="NSFrame">{{172, 302}, {72, 37}}</string> + <reference key="NSSuperview" ref="766721923"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="540429936"/> + <string key="NSReuseIdentifierKey">_NS:241</string> + <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">Play</string> + <reference key="IBUIHighlightedTitleColor" ref="950055607"/> + <object class="NSColor" key="IBUINormalTitleColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> + </object> + <reference key="IBUINormalTitleShadowColor" ref="484429581"/> + <reference key="IBUIFontDescription" ref="245349657"/> + <reference key="IBUIFont" ref="1064047706"/> + </object> + <object class="IBUIButton" id="540429936"> + <reference key="NSNextResponder" ref="766721923"/> + <int key="NSvFlags">292</int> + <string key="NSFrame">{{337, 302}, {72, 37}}</string> + <reference key="NSSuperview" ref="766721923"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="454189542"/> + <string key="NSReuseIdentifierKey">_NS:241</string> + <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">Pause</string> + <reference key="IBUIHighlightedTitleColor" ref="950055607"/> + <object class="NSColor" key="IBUINormalTitleColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> + </object> + <reference key="IBUINormalTitleShadowColor" ref="484429581"/> + <reference key="IBUIFontDescription" ref="245349657"/> + <reference key="IBUIFont" ref="1064047706"/> + </object> + <object class="IBUIButton" id="454189542"> + <reference key="NSNextResponder" ref="766721923"/> + <int key="NSvFlags">292</int> + <string key="NSFrame">{{500, 302}, {78, 37}}</string> + <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> + <int key="IBUIContentVerticalAlignment">0</int> + <int key="IBUIButtonType">1</int> + <string key="IBUINormalTitle">Rewind</string> + <reference key="IBUIHighlightedTitleColor" ref="950055607"/> + <object class="NSColor" key="IBUINormalTitleColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> + </object> + <reference key="IBUINormalTitleShadowColor" ref="484429581"/> + <reference key="IBUIFontDescription" ref="245349657"/> + <reference key="IBUIFont" ref="1064047706"/> + </object> </array> <string key="NSFrame">{{0, 20}, {768, 1004}}</string> <reference key="NSSuperview"/> @@ -105,6 +174,27 @@ </object> <string key="targetRuntimeIdentifier">IBIPadFramework</string> </object> + <object class="IBUIButton" id="588124301"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">292</int> + <string key="NSFrameSize">{72, 37}</string> + <reference key="NSSuperview"/> + <string key="NSReuseIdentifierKey">_NS:241</string> + <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">Play</string> + <reference key="IBUIHighlightedTitleColor" ref="950055607"/> + <object class="NSColor" key="IBUINormalTitleColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> + </object> + <reference key="IBUINormalTitleShadowColor" ref="484429581"/> + <reference key="IBUIFontDescription" ref="245349657"/> + <reference key="IBUIFont" ref="1064047706"/> + </object> </array> <object class="IBObjectContainer" key="IBDocument.Objects"> <array class="NSMutableArray" key="connectionRecords"> @@ -133,6 +223,33 @@ </object> <int key="connectionID">9</int> </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchEventConnection" key="connection"> + <string key="label">play:</string> + <reference key="source" ref="958752162"/> + <reference key="destination" ref="841351856"/> + <int key="IBEventType">7</int> + </object> + <int key="connectionID">15</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchEventConnection" key="connection"> + <string key="label">pause:</string> + <reference key="source" ref="540429936"/> + <reference key="destination" ref="841351856"/> + <int key="IBEventType">7</int> + </object> + <int key="connectionID">17</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchEventConnection" key="connection"> + <string key="label">rewind:</string> + <reference key="source" ref="454189542"/> + <reference key="destination" ref="841351856"/> + <int key="IBEventType">7</int> + </object> + <int key="connectionID">18</int> + </object> </array> <object class="IBMutableOrderedSet" key="objectRecords"> <array key="orderedObjects"> @@ -159,6 +276,9 @@ <array class="NSMutableArray" key="children"> <reference ref="1049445720"/> <reference ref="1061865793"/> + <reference ref="958752162"/> + <reference ref="540429936"/> + <reference ref="454189542"/> </array> <reference key="parent" ref="0"/> </object> @@ -172,6 +292,26 @@ <reference key="object" ref="1061865793"/> <reference key="parent" ref="766721923"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">11</int> + <reference key="object" ref="958752162"/> + <reference key="parent" ref="766721923"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">12</int> + <reference key="object" ref="540429936"/> + <reference key="parent" ref="766721923"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">13</int> + <reference key="object" ref="588124301"/> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">14</int> + <reference key="object" ref="454189542"/> + <reference key="parent" ref="766721923"/> + </object> </array> </object> <dictionary class="NSMutableDictionary" key="flattenedProperties"> @@ -179,6 +319,10 @@ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="-2.CustomClassName">UIResponder</string> <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="7.CustomClassName">PlayerView</string> @@ -188,7 +332,7 @@ <nil key="activeLocalization"/> <dictionary class="NSMutableDictionary" key="localizations"/> <nil key="sourceID"/> - <int key="maxID">10</int> + <int key="maxID">18</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <array class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -205,23 +349,38 @@ <string key="superclassName">UIViewController</string> <dictionary class="NSMutableDictionary" key="actions"> <string key="loadAssetFromFile:">id</string> + <string key="pause:">id</string> <string key="play:">id</string> + <string key="rewind:">id</string> </dictionary> <dictionary class="NSMutableDictionary" key="actionInfosByName"> <object class="IBActionInfo" key="loadAssetFromFile:"> <string key="name">loadAssetFromFile:</string> <string key="candidateClassName">id</string> </object> + <object class="IBActionInfo" key="pause:"> + <string key="name">pause:</string> + <string key="candidateClassName">id</string> + </object> <object class="IBActionInfo" key="play:"> <string key="name">play:</string> <string key="candidateClassName">id</string> </object> + <object class="IBActionInfo" key="rewind:"> + <string key="name">rewind:</string> + <string key="candidateClassName">id</string> + </object> </dictionary> <dictionary class="NSMutableDictionary" key="outlets"> + <string key="pauseButton">UIButton</string> <string key="playButton">UIButton</string> <string key="playerView">PlayerView</string> </dictionary> <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="pauseButton"> + <string key="name">pauseButton</string> + <string key="candidateClassName">UIButton</string> + </object> <object class="IBToOneOutletInfo" key="playButton"> <string key="name">playButton</string> <string key="candidateClassName">UIButton</string> |
