Skip to content

Instantly share code, notes, and snippets.

@stevenhuey
Created June 30, 2012 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenhuey/3023783 to your computer and use it in GitHub Desktop.
Save stevenhuey/3023783 to your computer and use it in GitHub Desktop.
AVPlayer KVO
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if ([keyPath isEqualToString:@"status"])
{
if (AVPlayerItemStatusReadyToPlay == _player.currentItem.status)
{
[_player play];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment