Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 21516 [details]
My WKWebView Factory
My problem is that I have a WKWebViews that contain video URL's and they auto play full screen no matter what the setting are in the WKWebViewConfiguration.
What I assume is the problem is that recently Apple deprecated several properties on WKWebViewConfiguration such as 'requiresUserActionForMediaPlayback' and 'mediaPlaybackRequiresUserAction'(as seen here: https://developer.apple.com/reference/webkit/wkwebviewconfiguration).
Setting these values used to work in iOS 10.2 and below, but it does not work on iOS 10.3. I have added the new property 'mediaTypesRequiringUserActionForPlayback' set to all (or none, neither value changes anything).
I also have never gotten 'allowsInlineMediaPlayback' to be applied and actually work.
My guess as to what is happening is that you guys added the new properties but still only honor the deprecated properties.
Attached I have a util class where I am creating my WKWebViews.
Please include your full build logs, crash reports (if any), test case (to reproduce) and all version informations.
The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
1. Create a WKWebViewConfiguration.
- Set all proporties you can to make it so that the use would have to click on the video to make it play (requiresUserActionForMediaPlayback, mediaPlaybackRequiresUserAction, and mediaTypesRequiringUserActionForPlayback)
2. Add the webview to a view controller
3. Load a video url (Example video url: https://s3-us-west-2.amazonaws.com/fanreact-rtmp-video-stream/9693_116_11_2_16_18_40.mp4)
- PostWebView.LoadRequest(new NSUrlRequest(new NSUrl(url), NSUrlRequestCachePolicy.ReturnCacheDataElseLoad, 40));
You will notice that one the video is loaded, it will automatically fullscreen and start playing the video even though we are saying in the WKWebViewConfiguration that it must have user interaction to start playing.
Xamarin Studio Community
Version 6.3 (build 863)
Installation UUID: f30ba685-40c4-4f4d-92fa-0c4bbc84716b
Mono 4.8.1 (mono-4.8.0-branch/22a39d7) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 408010000
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Apple Developer Tools
Xcode 8.3.1 (12170)
Version: 10.8.0.175 (Xamarin Studio Community)
Build date: 2017-03-28 14:05:38-0400
Version: 126.96.36.199 (Xamarin Studio Community)
Android SDK: /Users/dustinwilliams/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
SDK Tools Version: 25.2.3
I did a bit of research and I couldn't figure out how to prevent autoplay for videos either.
After the move from UIWebView to WKWebView it seems Apple deprecated the APIs that should be used to prevent autoplay: https://developer.apple.com/reference/webkit/wkwebviewconfiguration
I created a quick Swift project (see attachements) to ensure it's not a Xamarin specific bug to answer your:
"My guess as to what is happening is that you guys added the new properties but still only honor the deprecated properties."
Xamarin.iOS is a very thin layer on top of the native iOS frameworks and the 2 test cases (C#/Swift) show absolutely identical behaviors.
Also about: "Setting these values used to work in iOS 10.2 and below, but it does not work on iOS 10.3.".
Actually I would say setting those values didn't work as well but rather the autoplay setting (of the WKWebView, defined internally by Apple) was off.
You can check that by commenting the 3 properties defined for the WKWebViewConfiguration (in both test cases) and see that with nothing defined at all, the video won't auto play (when it does autoplay with nothing defined on iOS 10.3).
I cannot help any further since this is a native issue and I only have as much information as you (Apple API doc) with regard to how WKWebView works (:
I can only tell you this is not a Xamarin-specific bug so I will close this issue.
Filing a radar (bug) with Apple  or asking the broader developer community would be the best and quickest place for additional troubleshooting help on this issue.
Posting a question on Stack Overflow  or the Xamarin Forums  would be the best next step.
Created attachment 22334 [details]
C# Simplified Test Case
Created attachment 22335 [details]
Swift Simplified Test Case