? (, AudioToolbox, CoreVideo ..). , , , , , .
mp4, , (10 , , ... 20 , 5 ). .
However, on my iPhone (with 20 MB video), it allocated only 900 KB of shared memory for the application, with no noticeable changes when starting / stopping / releasing the video. It always remained approximately 900 kb for 10 times when I tested it (start / stop / release).
It looks like the next time you won’t be able to trust the simulator.
Code I tested:
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"SomeMovieFile" ofType:@"mp4"]];
MPMoviePlayerController *newPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
self.player = newPlayer;
[newPlayer release];
[self.view addSubview:player.view];
[player play];
Then in another button I stopped it and released the player:
[player.view removeFromSuperview]
player.initialPlaybackTime = -1;
[player stop]
self.player = nil; // this is just a habit of mine.. calling stop should unload the buffers though
[player release]
source
share