cordova-plugin-opentokjs icon indicating copy to clipboard operation
cordova-plugin-opentokjs copied to clipboard

Wrap initialization logic for iOS into a conditionally loaded module

Open aoberoi opened this issue 9 years ago • 1 comments

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 only for the iOS platform. That would take away the dependency on cordova-plugin-device.

Additionally, other iOS specific manipulations of the opentok.js library could be handled in this script.

aoberoi avatar Jun 23 '15 20:06 aoberoi

  • 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.

aoberoi avatar Jun 23 '15 21:06 aoberoi