songz / cordova-plugin-opentok

Cordova Plugin for OpenTok - add webrtc video to your iOS or Android App
Other
162 stars 270 forks source link

Cordova is not defined #212

Open PrimeObjects opened 8 years ago

PrimeObjects commented 8 years ago

Hello, I'm using this plugin in a ionic + angularjs + ngCordova enviroment, I got the following error when tracking. My code is in a controller and called by angularjs router

JS: Objects being updated in TBUpdateObjects opentok.js:232 JS: Object updated opentok.js:234 JS sessionId: TBPublisher ionic.bundle.js:20434 ReferenceError: Cordova is not defined at TBUpdateObjects (file:///android_asset/www/js/opentok.js:237:9) at new TBPublisher (file:///android_asset/www/js/opentok.js:316:9) at Object.window.OT.initPublisher (file:///android_asset/www/js/opentok.js:6:16) at Scope.$scope.loadWebRTC (file:///android_asset/www/app/default/default.js:42:28) at Scope.$scope.initialForm (file:///android_asset/www/app/default/default.js:31:20) at new (file:///android_asset/www/app/default/default.js:105:12) at invoke (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:13012:17) at Object.instantiate (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:13020:27) at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17289:28 at self.appendViewElement (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:48435:24) (anonymous function) @ ionic.bundle.js:20434 plugins/cordova-plugin-whitelist/whitelist.js:23 No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.(anonymous function) @ plugins/cordova-plugin-whitelist/whitelist.js:23 plugins/cordova-plugin-opentokjs/src/android/opentok.js:8326 Uncaught TypeError: OTPlugin.isInstalled is not a function

Any idea?

Thanks Gary

ammar08429 commented 8 years ago

the cordova.js file is not available while testing in browser, So if yo need to test it , use an emulator or a mobile device than you wont get this error

vikas0vanvi commented 7 years ago

anyone got it working ? i am facing same issue in mobile , even tho i have placed cordova.js in index page

msach22 commented 7 years ago

Hey @vikas0vanvi here's a basic 1:1 application using OpenTok and Ionic: https://github.com/opentok/opentok-ionic-samples

You have to run ionic serve so opentok.js can be copied into your www folder. After that, you can prepare for the platform.

You can also find the updated plugin using OpenTok iOS and Android 2.12.0 SDKs here: https://github.com/opentok/cordova-plugin-opentok