EDIT: Tested in 8.3 simulator too, same issue.
I have an app which works perfectly fine in iOS 9.0 onwards (all versions). However specific to iOS 8.4, the AVPlayer doesn't play anything. No audio & video.
Happens on both iPad and iPhone.
I have added observer for status and rate key path and as per the logger, those method do get called as if the avplayer is playing. However in the actual device and simulator both - there is no video and audio.
I have checked the avplayer's error property too and it's null throughout.
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context {
if (object == ((AppDelegate*)[[UIApplication sharedApplication] delegate]).avplayer) {
if ( [keyPath isEqualToString:@"status"]) {
NSLog(@"Status changed: %@, %@",change,((AppDelegate*)[[UIApplication sharedApplication] delegate]).avplayer.error.localizedDescription);
}
else if ([keyPath isEqualToString:@"rate"] && ((AppDelegate*)[[UIApplication sharedApplication] delegate]).avplayer.status == AVPlayerStatusReadyToPlay ) {
NSLog(@"Rate changed: %@",change);
}
}
}
Output:
2016-03-13 15:01:47.152 XXXXX[47910:2113657] Status changed: {
kind = 1;
new = 1;
}, (null)
2016-03-13 15:01:47.153 XXXXX[47910:2113567] Rate changed: {
kind = 1;
new = 1;
}
2016-03-13 15:01:47.160 XXXXX[47910:2113567] Rate changed: {
kind = 1;
new = 1;
}