I was curious if there was a way of telling if audio is coming from a specific WKWebView similar to the way you can find the tab playing audio in Chrome and Safari?
Asked
Active
Viewed 2,024 times
6
-
You can check the `UIWebView` solution, maybe it works for `WKWebView` too, e.g. http://stackoverflow.com/questions/33240647/how-to-detect-the-playing-state-of-the-audio-in-uiwebview-in-ios – Sulthan Mar 25 '16 at 17:25
1 Answers
1
In the WKWebView's delegate, after webview loading finished, execute javascript that addEventListener
to audio
and video
tag with event play
, pause
, ended
. Then check the playback state for purpose.

Elf Sundae
- 1,575
- 16
- 23
-
-
Can you explain how can do this with javascript please see and give me any suggestion https://stackoverflow.com/questions/55377677/how-to-detect-avplayer-and-get-url-of-current-video-from-wkwebview – Virani Vivek Apr 04 '19 at 07:02