Following the example in this SO thread, I was trying to implement this functionality:
var fn = "cordova.plugins.photoLibrary.saveImage";
if (isVideo) fn = "cordova.plugins.photoLibrary.saveVideo";
window[fn](entry.toURL(), album, success, error);
This however throws the following error:
TypeError: undefined is not a function (near '...window[fn]...')
Are cordova functions not part of the global window namespace?