iOS 12.2 real machine can not play the video in html5 loaded by UIWebView, link url http://community.cqliving.com/h5/info/detail/512.html?cid=512&isOpenApp=&f=10, other versions can play video
Rendering
Try including these two lines
webView.allowsInlineMediaPlayback = YES;
webView.mediaPlaybackRequiresUserAction = NO;
These lines solved my issue which is occurring in iOS 12.2
Is it embedded using UIWebView or WKWebView or similar?
Try setting mediaPlaybackRequiresUserAction
to YES
for the webview. I'm seeing the same issue (UIWebView
and WKWebView
both) in iOS 12.2. Works fine in iOS 12.1 and earlier.
When debugging, you see this error in safari console:
Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission
https://developer.apple.com/documentation/uikit/uiwebview/1617954-mediaplaybackrequiresuseraction?language=objc
https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614727-mediaplaybackrequiresuseraction?language=objc
Could be similar to this issue
Video from local storage not playing in WebView (Xamarin.Forms) after latest iOS update (12.2)
mediaPlaybackRequiresUserAction = NO; look:https://www.jianshu.com/p/d3f326dae445
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With