I am trying to play a MediaItem using AVPlayer and later trying to get the duration of the current item like this (duration is an object of type CMTime):
duration = [[player currentItem] duration];
I get no issues in iPad but in iPod Touch, I get the following error. I haven't tried this in iPhone yet.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AVPlayerItem duration]: unrecognized selector sent to instance 0x186100'
Any pointers to the fix will be greatly appreciated.