Fixed for supporting mediaPlaybackRequiresUserAction under iOS 10. (#22208)

Summary:
There is a problem that the `mediaPlaybackRequiresUserAction` property does not work in WKWebView(`useWebKit`) under iOS 10.

I fully know you are currently working to migrate the core's WebView to the standalone `react-native-webview` project. This has already been submitted to PR in `react-native-webview` and will be merged soon. I hope this fix applies to `react-native` before your migration is done.
Pull Request resolved: https://github.com/facebook/react-native/pull/22208

Differential Revision: D13334868

Pulled By: cpojer

fbshipit-source-id: f2a811a477054155ed5fe62ab31e4d63f70e7848
This commit is contained in:
ifsnow
2018-12-12 16:58:35 +00:00
committed by Lorenzo Sciandra
parent 692fc2e4d9
commit 79011d77cc
+3 -1
View File
@@ -76,7 +76,9 @@ static NSString *const MessageHanderName = @"ReactNative";
wkWebViewConfig.mediaTypesRequiringUserActionForPlayback = _mediaPlaybackRequiresUserAction
? WKAudiovisualMediaTypeAll
: WKAudiovisualMediaTypeNone;
wkWebViewConfig.dataDetectorTypes = _dataDetectorTypes;
wkWebViewConfig.dataDetectorTypes = _dataDetectorTypes;
#else
wkWebViewConfig.mediaPlaybackRequiresUserAction = _mediaPlaybackRequiresUserAction;
#endif
_webView = [[WKWebView alloc] initWithFrame:self.bounds configuration: wkWebViewConfig];