How to detect action of Play button clicked in youtube in wkwebview
, I have gone through this question, it is some how similar to my question but not duplicate and unanswered.
Any help will be appreciated.
Thanks.
How to detect action of Play button clicked in youtube in wkwebview
, I have gone through this question, it is some how similar to my question but not duplicate and unanswered.
Any help will be appreciated.
Thanks.
If you need only one callback when play button is clicked the very first time (doesn't notify about pause/play).
Use this code and replace http://apple.com
with some youtube url.
Set a breakpoint in
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage)
Run in simulator and tap on youtube play button. You will get a callback in
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage)
method.