ios - wkwebview requiresUserActionForMediaPlayback not working -


i have wkwebview goes youtube , click on video without automatically throwing me video player.

i tried stopping in 3 different ways

  1. using config.requiresuseractionformediaplayback = true
  2. in decidepolicyfornavigationaction delegate function check presence of youtube video , set decisionhandler(wknavigationactionpolicy.cancel)
  3. i added webview.stoploading() stuff did in #2

despite doing that, clicking on link still triggers video automatically start playing.

i'm out of ideas; thoughts?

i know try injecting javascript seems last resort me.


Comments