我想在用户暂停视频时为我的视频添加叠加视图。有什么方法可以从 MPMoviePlayerController 获取暂停通知吗?
根据Apple Doc,应该有办法做到这一点,但我找不到应该使用哪个通知来实现此目的。
引用:
除了在以下情况下收到通知之外
播放完毕,感兴趣的客户
可以通过以下方式通知
情况:
-当电影播放器开始播放、暂停或开始向前播放时
...
有关详细信息,请参阅本参考中的通知部分。
I want to add an overlay view for my video when the video is paused by the user. Is there any way to get the pause notification from MPMoviePlayerController?
According to Apple Doc, there should be ways to do this but I can't find which notification should I use for this purpose.
Quote:
In addition to being notified when
playback finishes, interested clients
can be notified in the following
situations:
-When the movie player begins playing, is paused, or begins seeking forward
...
For more information, see the Notifications section in this reference.
发布评论
评论(1)
我假设您了解委托和协议作为接收回调的方式?
还有另一种称为通知的全局机制。
您可以通过以下方式执行此操作
然后,在playbackStateChanged内,您可以获取playbackState
直接从播放器读取playbackstate的步骤在文档中指定
I assume you know about delegates and protocols as a means of receiving callbacks?
There's another global mechanism called notifications too.
You can do this via
Then, within playbackStateChanged, you can fetch the playbackState
The step of reading playbackstate directly from the player is specified in the docs