0

I'm trying to create a phonegap app that converts videos into maybe 30 or so jpeg frames.. This page converts a bigbuckbunny video into 30 frames > https://www.pewify.com/test/ (taken from https://bgrins.github.io/videoconverter.js/demo/)

It runs fine on an iPhone x running iOS 12 in mobile safari, it takes about 12-15 seconds to complete, but the same code packaged into a iOS cordova app running on the same phone will take almost 160 seconds to complete (both end results the same, but almost 10x as long), it works fine for android browsers or an android cordova app though

I'm using cordova android 7.0 and cordova ios 4.5.4 (phonegap cli-8.0.0) for the app

I've tried removing all unneeded plugins with just the bare minimum code but to no effect, it still runs just as slow

From what i understand phonegap is just using a webview similar to safari to render the app but in this case it works but much slower, on top of that the phone starts to get heated up (presumably doing some intensive CPU?)

Did read something about using WKWebview being faster in cordova instead but that messes up the app with lots of CORS and 'operation insecure" errors so have decided not to implement that for now (unless that is the solution?)

Hopefully someone can point me in the right direction as i'm not exactly sure what is the issue here as it works somewhat flawlessly in android (both chrome and phonegap) but only in iOS safari and not the phonegap app

PEWify
  • 1
  • 1

1 Answers1

0

Ok solved it, it was indeed WKWebview and it executed normally. I read somewhere that the webview in cordova and the webview in mobile safari is different hence the difference in speed (nitro js engine?)

For anyone interested, I used "cordova-plugin-wkwebview-file-xhr" to enable WKWebview and certain fixes to bypass CORS issues,ran the same code on it (had to use an inline blob when creating the worker though to bypass , taken from here Web workers without a separate Javascript file?)

Video conversion now runs as expected (12-ish seconds), hopefully this helps someone who might be facing slow execution of code on iOS phonegap..

PEWify
  • 1
  • 1