I have wkwebviewone that goes into youtube, and I would like to click on the video without launching it automatically in the player.
I tried to stop this in three different ways.
- via
config.requiresUserActionForMediaPlayback = true - in the delegate function,
decidePolicyForNavigationActionI check for the presence of YouTube videos and setdecisionHandler(WKNavigationActionPolicy.Cancel) - I also added
webView.stopLoading()to what I did in # 2
despite this, clicking on the link still causes the video to start automatically.
I have no ideas; any thoughts?
I know, I could try to introduce some javascript, but this seems to me last.
source
share