In default configuration the WKWebView loads the page, and the internal video playback can only be played after the user's active operation, and it must be played in full screen. This configuration may not meet the business needs, and the web video should be played inline and automatically in the page. So you should set WKWebViewConfiguration, the specific code is as follows:
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
configuration.allowsInlineMediaPlayback = YES;
if (@available(iOS 10.0, *)) {
configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
} else {
configuration.requiresUserActionForMediaPlayback = NO;
}
And your web page needs to set video too, for example
<video width="320" height="240" controls="" webkit-playsinline="true" playsinline="true">
<source src="https://xx.com.xxx.mp4" type="video/mp4">
</video>