开发者

Stop iPad MoviePlayer video when a view is changed

I'm writing my first iPad app that plays a video on a portion of the screen. My problem is that if the user changes to another view while the video is playing, the audio keeps playing in the background. I assume I have to add something to the "viewDidUnload" method but I'm not开发者_JS百科 sure what to do. Any ideas? Thanks for any info.


You can try adding

[myMoviePlayer pause]; // assume myMoviePlayer is an instance variable
[myMoviePlayer stop];
myMoviePlayer = nil;

to your viewWillDisappear method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜