如果应用程序在后台,如何阻止MPMoviePlayerViewController下载视频 [英] how to stop MPMoviePlayerViewController from downloading video if the app is in background

查看:71
本文介绍了如果应用程序在后台,如何阻止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 {  
}  

这篇关于如果应用程序在后台,如何阻止MPMoviePlayerViewController下载视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆