Apple のドキュメントによると、iOS 4.0 以降では、AVPlayerItem の「asset」プロパティが利用可能であり、有効なオブジェクトを返す必要があります。iOS 4.2 では、AVPlayerItem オブジェクトの「asset」プロパティが常に 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];
}
}
他の誰かがこれを見たことがありますか?