cordova-plugin-opentokjs
cordova-plugin-opentokjs copied to clipboard
Wrap initialization logic for iOS into a conditionally loaded module
Currently the project requires an application developer to use a bit of code (only for iOS) so that the JS is executed in the right order.
if (window.device.platform === 'iOS') {
cordova.plugins.iosrtc.registerGlobals();
window.OT = cordova.require('cordova-plugin-opentokjs.OpenTokClient');
}
This is brittle and we might be able to hide this implementation detail inside a conditionally loaded cordova-plugin-device
.
Additionally, other iOS specific manipulations of the opentok.js library could be handled in this script.
- the
refreshVideos()
method might be able to be mounted into the OT namespace, and called automatically in certain instances. - the
OT.setLogLevel()
method could be enhanced by adding logging for iosrtc as well.