I have a video in one tab and some data analysis based on the video in another tab.
My second tab depends a lot on the naturalSize of the video.
I listen to the notification for the video’s naturalSize in my first tab and as soon as I get it I store the naturalSize in a shared object for both the tabs and in viewWillAppear of the second tab I use the that value.
My problem is the notification for naturalSize is not generated unless I play the video.
How should I go about it ?
I tried playing and pausing the vidoe in first tab’s viewDidLoad but it doesn’t work.
UPDATE: Although There is no direct solution for generating the notification but please checkout my answer for a workaround where you don’t need to be dependent on the notification at all when you are not streaming a remote video and it’s locally available.
This is by design and there is no workaround. The natural size of a video when being played back using
MPMoviePlayerControlleris not known until that movie is playable – that is, the player needs to pre buffer the video until enough information is available.