I am a beginner in iOS development. I am developing an application where I require the size of a video which is getting played in the MPMoviePlayerController.
I am using the property naturalSize of MPMoviePlayerController to get the dimensions of the video that is played.
@property(nonatomic, readonly) CGSize naturalSize;
It takes time for the MPMoviePlayerController to load the video metadata, so you should add a listener and wait for the naturalSize to be loaded. Something like this:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieNaturalSizeAvailable:) name:MPMovieNaturalSizeAvailableNotification object:myMoviePlayer];
myVideoPlayer.naturalSize gives you the desired value and after that, you can play the video.