0

I am trying to avoid auto video playing in MPMoviePlayerController is there any possible way to stop webview not to load video in full screen and MPMoviePlayerController ? I used this codes in viewDidLoad but still no success !

    webView.mediaPlaybackRequiresUserAction = true
    webView.allowsInlineMediaPlayback = false
rmaddy
  • 314,917
  • 42
  • 532
  • 579
iOS.Lover
  • 5,923
  • 21
  • 90
  • 162
  • UIWebView will NOT auto-play any video by default. Please check your javascript/html code – Sivajee Battina Jul 13 '17 at 16:21
  • @SivajeeBattina Yes , my mistake ! but is there any possible way to avoid movie playing at all ? even in MPMoviePlayerController – iOS.Lover Jul 13 '17 at 16:23
  • Yes. Can you please paste your javascript or html code here – Sivajee Battina Jul 13 '17 at 16:24
  • @SivajeeBattina it is from different websites youtube , vimeo , and etc... any website which has video content – iOS.Lover Jul 13 '17 at 16:24
  • Understood your problem @Mc.Love. can you please try [webview stringByEvaluatingJavaScriptFromString: @"document.querySelector('video').pause();"] – Sivajee Battina Jul 13 '17 at 16:28
  • @SivajeeBattina Still open videos in `MPMoviePlayerController` What I am trying here is I need to get video URL with `AVPlayerItemBecameCurrentNotification` In this case I have to play video first to get its `URL` but I need to get URL without going in MPMovie.... – iOS.Lover Jul 13 '17 at 16:33
  • AVPlayerItemBecameCurrentNotification is use in WKWebView ? if yes how can i do that please see my question https://stackoverflow.com/questions/55377677/how-to-detect-avplayer-and-get-url-of-current-video-from-wkwebview – Virani Vivek Apr 03 '19 at 06:12

0 Answers0