Skip to content

Commit

Permalink
Fixed for supporting mediaPlaybackRequiresUserAction under iOS 10. (#…
Browse files Browse the repository at this point in the history
…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: #22208

Differential Revision: D13334868

Pulled By: cpojer

fbshipit-source-id: f2a811a477054155ed5fe62ab31e4d63f70e7848
  • Loading branch information
ifsnow authored and kelset committed Dec 12, 2018
1 parent 692fc2e commit 79011d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion React/Views/RCTWKWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ - (void)didMoveToWindow
wkWebViewConfig.mediaTypesRequiringUserActionForPlayback = _mediaPlaybackRequiresUserAction
? WKAudiovisualMediaTypeAll
: WKAudiovisualMediaTypeNone;
wkWebViewConfig.dataDetectorTypes = _dataDetectorTypes;
wkWebViewConfig.dataDetectorTypes = _dataDetectorTypes;
#else
wkWebViewConfig.mediaPlaybackRequiresUserAction = _mediaPlaybackRequiresUserAction;
#endif

_webView = [[WKWebView alloc] initWithFrame:self.bounds configuration: wkWebViewConfig];
Expand Down

0 comments on commit 79011d7

Please sign in to comment.