Created
June 30, 2012 13:41
-
-
Save stevenhuey/3023783 to your computer and use it in GitHub Desktop.
AVPlayer KVO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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