aboutsummaryrefslogtreecommitdiffstats
path: root/Video Tuneup/ViewController.m
diff options
context:
space:
mode:
authorBrian Jordan2012-03-28 12:57:44 -0400
committerBrian Jordan2012-03-28 12:57:44 -0400
commitb78b2a4a595f604aaaaed72102d662d6f334378f (patch)
treed70a17d9b242e034ca4a0a3a0f053e232829977e /Video Tuneup/ViewController.m
parenta395e55659b7fe0801913a8bd65e1babbcde0fcc (diff)
downloadVideo-Tuneup-b78b2a4a595f604aaaaed72102d662d6f334378f.tar.bz2
add PlayerView. Resolves #1
Diffstat (limited to 'Video Tuneup/ViewController.m')
-rw-r--r--Video Tuneup/ViewController.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/Video Tuneup/ViewController.m b/Video Tuneup/ViewController.m
index 200553f..ca3d92d 100644
--- a/Video Tuneup/ViewController.m
+++ b/Video Tuneup/ViewController.m
@@ -19,17 +19,22 @@ static const NSString *ItemStatusContext;
#pragma mark - Video playback
- (void)syncUI {
+ NSLog(@"syncUI");
+
if ((player.currentItem != nil) &&
([player.currentItem status] == AVPlayerItemStatusReadyToPlay)) {
playButton.enabled = YES;
+ NSLog(@"Enabling play button");
+
}
else {
playButton.enabled = NO;
+ NSLog(@"Play button disabled");
}
+
}
- (IBAction)loadAssetFromFile:sender {
-
NSLog(@"Loading asset.");
NSURL *fileURL = [[NSBundle mainBundle]
@@ -111,8 +116,13 @@ static const NSString *ItemStatusContext;
- (void)viewDidLoad
{
[super viewDidLoad];
+
+ NSLog(@"viewDidLoad");
+
[self syncUI];
+ NSLog(@"syncUI");
+
// Register with the notification center after creating the player item.
[[NSNotificationCenter defaultCenter]
addObserver:self
@@ -120,6 +130,7 @@ static const NSString *ItemStatusContext;
name:AVPlayerItemDidPlayToEndTimeNotification
object:[player currentItem]];
+ NSLog(@"registered");
// Do any additional setup after loading the view, typically from a nib.
// http://mobileorchard.com/easy-audio-playback-with-avaudioplayer/