Limit resuming of buffering videos to those that are visible

This commit is contained in:
Eric Jensen
2016-04-19 13:21:06 -07:00
parent 4973cd5cd0
commit 4a010337f6

View File

@@ -242,7 +242,7 @@ static NSString * const kStatus = @"status";
}
}
} else if ([keyPath isEqualToString:kPlaybackLikelyToKeepUpKey]) {
if (_shouldBePlaying && [change[NSKeyValueChangeNewKey] boolValue] == true) {
if (_shouldBePlaying && [change[NSKeyValueChangeNewKey] boolValue] == true && ASInterfaceStateIncludesVisible(self.interfaceState)) {
[self play]; // autoresume after buffer catches up
}
}