I have a problem playing local video on iOS in an application in Cordoba. First, I want to emphasize that this problem only occurs when I use WKWebView , and if I use UiWebView, the video plays normally. This is the script that I have:
-User displays the URL of the video to the screen
-Via FileTransfer I download it to my phone and save it in the right place
-Using JS video is loaded into the <video> and played.
I basically do everything as described in response to this SO question . The problem with UiWebView was that if the relative path was set to src, the video for some reason could not be downloaded (no matter what combination I used), so this solution worked great for me, because it is based on this line of code:
entry.toURL()
This returns the full path to the downloaded video, which is great, at least for UiWebView.
The problem for WkWebView is that entry.toURL () returns smth. eg:
file:///var/mobile/Containers/Data/Application/3A43AFB5-BEF6-4A0C-BBDB-FC7D2D98BEE9/Documents/videos/Dips.mp4
And WKWebView does not work with the file: // protocol. In addition, neither WKWebView works with relative paths :(
Can someone help me fix this?
source share