问题描述
我有一个的UIWebView
加载的网站链接:在我iOS应用。我不知道如何检测的UIWebView音频的播放状态。
I have an UIWebView
to load a html web link:http://m.y.qq.com in my iOS app. I don't know how to detect the playing state of the audio in UIWebView.
我只需要知道在的UIWebView
音频是否是打还是不中我的iOS应用程序,这样我可以做一些事情。
I just need to know whether the audio in UIWebView
is playing or not in my iOS app, so that I can do something.
我寻觅了很多#1和谷歌,但我无法找到一个满意的答复。任何人都可以给我一些帮助吗?
I have searched a lot from Stackoverflow and Google, but I can't find a satisfied answer. Can anyone give me some help?
推荐答案
AVAudioSession
有一个 sharedInstance
属性您可以在这种情况下利用。该属性是一个布尔,可以在多个线程进行更新。
AVAudioSession
has a sharedInstance
property which you can utilize in this instance. The property is a BOOL and can be updated upon multiple threads.
@ tnylee的code是完美的。
@tnylee's code is perfect.
这篇关于如何检测音频的播放状态UIWebView的iOS中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!