1

I'm using WKWebView instead of UIWebView. But I did not get a way to fetch the url of embedded video.

I have tried with these methods:

[wkWebView evaluateJavaScript:@"document.querySelector('video').currentSrc;" completionHandler:^(id result, NSError *error) {
        // result will contain the video url
 }];

Please suggest a method to get the embedded video url in web page using WKWebView.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Antony Raphel
  • 2,036
  • 2
  • 25
  • 45
  • in Response callback, just check the response content-type, if content-type is video/mp4 it means this is video URL, maybe content-type is diff like audio/mp4 or application/mp4 depends upon the content. – Muhammad Shauket Nov 19 '18 at 02:52
  • @ShauketSheikh there is response callback functions – Antony Raphel Nov 19 '18 at 19:09
  • can you find any solution for detect video url from WKWebView – Virani Vivek Mar 29 '19 at 05:42
  • @AntonyRaphel can you find any solution for that please help me https://stackoverflow.com/questions/55377677/how-to-detect-avplayer-and-get-url-of-current-video-from-wkwebview – Virani Vivek Apr 04 '19 at 12:17

0 Answers0