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
4 Answers
Try including these two lines
webView.allowsInlineMediaPlayback = YES;
webView.mediaPlaybackRequiresUserAction = NO;
These lines solved my issue which is occurring in iOS 12.2

- 772
- 8
- 15
-
When i try to do this in swift i get "Cannot assign to immutable expression of type 'Bool?" – Sealer_05 Jun 20 '19 at 03:26
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
Could be similar to this issue
Video from local storage not playing in WebView (Xamarin.Forms) after latest iOS update (12.2)

- 131,367
- 29
- 160
- 239
mediaPlaybackRequiresUserAction = NO; look:https://www.jianshu.com/p/d3f326dae445

- 71
- 3
-
-
When i try to do this in swift i get "Cannot assign to immutable expression of type 'Bool?" – Sealer_05 Jun 20 '19 at 03:25
You will need to enable insecure content loading in your app. Otherwise if you would not like to do that you can create a mirror of the video on a secure server.
https://stackoverflow.com/a/30732693 see here for more info.

- 1,304
- 8
- 27
-
Thank you ! http://community.cqliving.com/h5/info/detail/512.html?cid=512&isOpenApp=&f=10 The video in h5 webpage cannot be played. in IOS 12.2 Other version Can Played – gkh Apr 24 '19 at 02:36