summaryrefslogtreecommitdiffstats
path: root/macosx/HBAVPlayer.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-05-19 14:23:43 +0200
committerDamiano Galassi <[email protected]>2016-05-19 14:23:43 +0200
commit06d98da70c325b3d5d7315a594db573996a3e337 (patch)
tree4e76cc8a4871b2bb281c4443c6c9e07b19003bad /macosx/HBAVPlayer.m
parent26b48313574002f7722d03e13d713d4ca7b55aca (diff)
MacGui: fix HBAVPlayer loaded state.
Diffstat (limited to 'macosx/HBAVPlayer.m')
-rw-r--r--macosx/HBAVPlayer.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/macosx/HBAVPlayer.m b/macosx/HBAVPlayer.m
index 892cf17f9..d1028a2bb 100644
--- a/macosx/HBAVPlayer.m
+++ b/macosx/HBAVPlayer.m
@@ -70,7 +70,6 @@ typedef void (^HBPlayableObverser)(void);
// Because we want to access our AVPlayer in our ensuing set-up, we must dispatch our handler to the main queue.
dispatch_async(dispatch_get_main_queue(), ^(void) {
[self _setUpPlaybackOfAsset:_movie withKeys:assetKeysToLoadAndTest];
- self.loaded = YES;
});
}];
@@ -99,12 +98,14 @@ typedef void (^HBPlayableObverser)(void);
if ([asset statusOfValueForKey:key error:&error] == AVKeyValueStatusFailed)
{
self.playable = NO;
+ self.loaded = YES;
return;
}
if (!asset.isPlayable)
{
self.playable = NO;
+ self.loaded = YES;
return;
}
@@ -141,9 +142,11 @@ typedef void (^HBPlayableObverser)(void);
break;
case AVPlayerItemStatusReadyToPlay:
self.playable = YES;
+ self.loaded = YES;
break;
case AVPlayerItemStatusFailed:
- self.playable = YES;
+ self.playable = NO;
+ self.loaded = YES;
break;
}