Auto play (Responsive voice text to speech) not working in WKWebview
<p>I am trying to load a webpage into WKWebView which contains Responsive JS text to speech. Web page auto plays the text to speech when it finishes loading. </p>

<p>But inside the app the text to speech auto play not working when the page is loaded. It only works if I fire a javascript method through button click inside the app. </p>

<p>Is it possible to auto play when load the page? If is it possible how can I get it done.</p>

<pre><code>- (void)viewDidLoad {

[super viewDidLoad];

WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
config.requiresUserActionForMediaPlayback = NO;

wkWebview = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:config];
wkWebview.navigationDelegate = self;
[self.view insertSubview:wkWebview atIndex:0];

NSURL *url;
url = [NSURL URLWithString:[[self.content objectAtIndex:0] objectForKey:@"URL"]];

NSURLRequest *request = [NSURLRequest requestWithURL:url];
[wkWebview loadRequest:request];


button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self
           action:@selector(aMethod:)
 forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);
[self.view addSubview:button];
}
</code></pre>

<p>Here is button action</p>

<pre><code>- (IBAction)aMethod:(id)sender
{
     [wkWebview evaluateJavaScript:@"document.getElementsByName('Play')[0].click()" completionHandler:^(id _Nullable sds, NSError * _Nullable error) {
    }];
}
</code></pre>