diff options
| author | Brian Jordan | 2012-03-28 12:57:44 -0400 |
|---|---|---|
| committer | Brian Jordan | 2012-03-28 12:57:44 -0400 |
| commit | b78b2a4a595f604aaaaed72102d662d6f334378f (patch) | |
| tree | d70a17d9b242e034ca4a0a3a0f053e232829977e /Video Tuneup/ViewController.m | |
| parent | a395e55659b7fe0801913a8bd65e1babbcde0fcc (diff) | |
| download | Video-Tuneup-b78b2a4a595f604aaaaed72102d662d6f334378f.tar.bz2 | |
add PlayerView. Resolves #1
Diffstat (limited to 'Video Tuneup/ViewController.m')
| -rw-r--r-- | Video Tuneup/ViewController.m | 13 |
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/ |
