aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Jordan2012-03-29 14:48:29 -0400
committerBrian Jordan2012-03-29 14:48:29 -0400
commitc9fbc31509b4db1d2a86f8e6e2c9a7a087fded87 (patch)
tree909d003514c022f793aac3ef50ba501c8865eb5f
parent86b37f6418e01d116cf5e8537190df258be3a4a4 (diff)
downloadVideo-Tuneup-c9fbc31509b4db1d2a86f8e6e2c9a7a087fded87.tar.bz2
resolve #4
-rw-r--r--Video Tuneup/ViewController.m8
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