Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I also had this issue.</p> <p>The cache used by the iPad for preloading the video stream, was not emptied completely. So each time, this page with the video player was cleaned up and released, the allocated memory after cleanup still contained the cached memory. For big video's, this could be up to 50 MB.</p> <p>This is actually not a memory leak:</p> <p>If the page was opened again, the cache was re-allocated. But still frustating as you want a clean exit situation, meaning when this page is left and cleaned up, all memory used by this page should be released, including the memory used for caching the video stream....!</p> <p>After some serious tweeking, this sequence of commands seems to do the job:</p> <p>======================</p> <pre><code> [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:myMoviePlayer]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerDidExitFullscreenNotification object:myMoviePlayer]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerLoadStateDidChangeNotification object:myMoviePlayer]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMovieDurationAvailableNotification object:myMoviePlayer]; [myMoviePlayer pause]; myMoviePlayer.initialPlaybackTime = -1; [myMoviePlayer stop]; myMoviePlayer.initialPlaybackTime = -1; [myMoviePlayer.view removeFromSuperview]; [myMoviePlayer release]; </code></pre> <p>=================================</p> <p>In steps:</p> <p>1 - REMOVE all notifiers you are using for your movie player.</p> <p>2 - Pause the movie</p> <p>3 - set the Playback time to start</p> <p>4 - stop the movie</p> <p>5 - set the Playback time again to start</p> <p>6 - now remove the movie View</p> <p>7 - and finally release the movie player</p> <p>Resulting in my case in also the video cache memory being released on my iPad (OS 4.2.) and leaving a clean allocated memory situation, equal to the size before the page with the video player was openen. So same enter and exit memory.</p> <p>Hope this helps......</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload