diff options
| author | Brian Jordan | 2012-03-29 14:48:29 -0400 |
|---|---|---|
| committer | Brian Jordan | 2012-03-29 14:48:29 -0400 |
| commit | c9fbc31509b4db1d2a86f8e6e2c9a7a087fded87 (patch) | |
| tree | 909d003514c022f793aac3ef50ba501c8865eb5f | |
| parent | 86b37f6418e01d116cf5e8537190df258be3a4a4 (diff) | |
| download | Video-Tuneup-c9fbc31509b4db1d2a86f8e6e2c9a7a087fded87.tar.bz2 | |
resolve #4
| -rw-r--r-- | Video Tuneup/ViewController.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Video Tuneup/ViewController.m b/Video Tuneup/ViewController.m index ba65432..a3d1d9f 100644 --- a/Video Tuneup/ViewController.m +++ b/Video Tuneup/ViewController.m @@ -23,10 +23,10 @@ static const NSString *ItemStatusContext; NSLog(@"syncUI"); if ((player.currentItem != nil) && - ([player.currentItem status] == AVPlayerItemStatusReadyToPlay)) { + ([player.currentItem status] == AVPlayerItemStatusReadyToPlay && + CMTimeCompare([player.currentItem duration], kCMTimeZero) != 0)) { playButton.enabled = YES; NSLog(@"Enabling play button"); - } else { playButton.enabled = NO; @@ -122,7 +122,9 @@ static const NSString *ItemStatusContext; - (IBAction)play:(id)sender { - if(player.rate == 0 && (player.currentItem != nil) && ([player.currentItem status] == AVPlayerItemStatusReadyToPlay)) { // Paused + if(player.rate == 0 && (player.currentItem != nil) && + ([player.currentItem status] == AVPlayerItemStatusReadyToPlay && + CMTimeCompare([player.currentItem duration], kCMTimeZero) != 0)) { // Paused NSLog(@"Playing item"); [player play]; [self.videoNavBar setItems:[NSArray |
