6

iOS15 Webview's HTML using Video tag, the following crash occurs, does anyone know what is the reason for this?

[<WebAVPlayerController 0x282f41420> valueForUndefinedKey:]: this class is not key value coding-compliant for the key playingOnMatchPointDevice.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Leo
  • 61
  • 1

2 Answers2

0

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>
Ahmad R. Nazemi
  • 775
  • 10
  • 26
Mr.王
  • 1
0

I have solved the same problem, there is a [IM open source SDK-MobileimSDK4i] in the project, and it will be good after deleting it, the specific problem of the subsequent block is unknown!

AllenZhang
  • 11
  • 1