如果应用程序在后台,如何阻止MPMoviePlayerViewController下载视频

问题描述:

我使用MPMoviePlayerViewController播放一些来自互联网的视频.

I use MPMoviePlayerViewController to play some videos form the internet.

当用户按下主屏幕按钮且应用程序进入后台时,iphone仍会下载大量信息.

When the user presses home button and the app goes in background, the iphone still downloads a lot of information.

任何人都可以向我推荐如何在不禁用多任务处理或不调用exit(0)的情况下停止流量吗?

Can anyone recomend me how the trafic can be stopped, without disabling multitasking or calling exit(0)?

我试图停止MPMoviePlayerViewController,但是在某些情况下,当未完全加载MPMoviePlayerViewController时,它不会响应(不是视频,即MPMoviePlayerViewController).

I have tried to stop the MPMoviePlayerViewController, but in some cases, when the MPMoviePlayerViewController is not fully loaded, the it doesn't respond(not the video, the MPMoviePlayerViewController).

预先感谢!

[movieplayer stop];  
movieplayer.initialPlaybackTime = -1.0;  
[movieplayer release];   

您可以在 applicationDidEnterBackground

- (void)applicationDidEnterBackground:(UIApplication *)application {  
}