- [UIWebView setMediaPlaybackRequiresUserAction:] affects all instances

If I have a UIWebView with mediaPlaybackRequiresUserAction = YES , then later in my application, create a new UIWebView and set mediaPlaybackRequiresUserAction = NO on it, it will also change the value of this property in the first instance.

eg. I have a UIWebView and then the second (t20) text (for an ad), changing the mediaPlaybackRequiresUserAction in the modal webView affects the presentation of the UIWebView .

Any ideas why this is so? Are all UIWebViews supported by a single instance?

Link to the sample project here .

+8
ios objective-c uiwebview
source share
1 answer

Not sure what your purpose of the application is, just try as follows:

 - (IBAction)unwind:(UIStoryboardSegue *)unwindSegue { [self TS_updateLabel]; [[self webView] setMediaPlaybackRequiresUserAction:YES]; [self TS_reloadWebView]; } 

....

in the TS_reloadWebView method

  if (self.webView.isLoading) { [self.webView stopLoading]; } [self.webView loadHTMLString:htmlString baseURL:baseURL]; 

I think this is also a UIWebView error .... but now this method can solve your problem.

0
source share

All Articles