了解MPMoviePlayerController当前是否正在播放 [英] Find out if MPMoviePlayerController is currently playing

查看:90
本文介绍了了解MPMoviePlayerController当前是否正在播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于MPMoviePlayerController的小问题,当我点击该电影按钮时,我有一个播放电影的链接,但是当我点击另一个按钮时应用程序崩溃,我需要找到如何识别该电影正在播放或得到任何回应

I have one small problem regarding MPMoviePlayerController, i have a link that play movie when i click on that movie button, however when i click on another button the application gets crashed, i need to find how to identify that movie is playing or getting any kind of response

推荐答案

要扩展@ Saurabh的答案,您可以检查视频是否正在播放

To expand on @Saurabh's answer you can check if the video is playing by

if(player.playbackState == MPMoviePlaybackStatePlaying)
{
// is Playing
}

其中 MPMoviePlaybackState 定义为

enum {
   MPMoviePlaybackStateStopped,
   MPMoviePlaybackStatePlaying,
   MPMoviePlaybackStatePaused,
   MPMoviePlaybackStateInterrupted,
   MPMoviePlaybackStateSeekingForward,
   MPMoviePlaybackStateSeekingBackward
};
typedef NSInteger MPMoviePlaybackState;

这篇关于了解MPMoviePlayerController当前是否正在播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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