Search code examples
htmliosipadvideouiwebview

Video is not playing in one iPad specifically


I am developing an app for iOS which includes a UIWebView which, among other this, contains a video (stored locally, in the same folder as some images which are being displayed correctly).

This works fine in my own iPad, but I have been given another one at work to install the app to and there it shows nothing more than the video controls. When I click on the play button nothing happens. The iPad is owned by the company so any security feature might be enabled.

I have researched quite a lot and I cannot find any reasons why the app may be working on one iPad and not on another one. I know it might be impossible to fix without having a passcode or something like that but I need to know at least which configuration might be the one that is making the app not to work.


Solution

  • Using WKWebView fixed it. UIWebView should not be used any longer unless it is specifically needed.

    From Apple documentation:

    In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView. Additionally, consider setting the WKPreferences property javaScriptEnabled to false if you render files that are not supposed to run JavaScript.