i have a wkwebview
that goes into youtube and I would like to click on a video without it automatically throwing me into the video player.
I tried stopping this in 3 different ways
- using the
config.requiresUserActionForMediaPlayback = true
- in the
decidePolicyForNavigationAction
delegate function i check for the presence of a youtube video and setdecisionHandler(WKNavigationActionPolicy.Cancel)
- i also added a
webView.stopLoading()
to the stuff i did in #2
despite doing that, clicking on the link still triggers the video to automatically start playing.
i'm out of ideas; any thoughts?
i know i could try injecting some javascript but that seems like a last resort to me.