Согласно документации Apple, свойство 'asset' объекта AVPlayerItem должно быть доступно и возвращать действительный объект в iOS 4.0 и выше. Я обнаружил, что в iOS 4.2 свойство 'asset' объекта AVPlayerItem всегда равно nil. Пример кода:
CMTime theDuration = kCMTimeInvalid;
AVPlayerItem* theItem = anAVPlayer.currentItem;
AVAsset* theAsset = nil;
if ([AVPlayerItem instancesRespondToSelector:@selector(duration)]) {
// On iOS 4.3 we get here...
theDuration = [theItem duration];
} else if ([AVPlayerItem instancesRespondToSelector:@selector(asset)]) {
// On iOS 4.2 we get here...
theAsset = [theItem asset];
if (theAsset) {
// Unfortunately, we do not get here as theAsset is nil...
theDuration = [theAsset duration];
}
}
Кто-нибудь еще видел это?