I am a newbie with ionic and trying to install phonertc on ionic platform but when i run the app it shows for VideoViewDirective that RefrenceError: cordova is undefined.
VideoViewDirective.js
angular.module('phonertcdemo')
.directive('videoView', function ($rootScope, $timeout) {
return {
restrict: 'E',
template: '<div class="video-container"></div>',
replace: true,
link: function (scope, element, attrs) {
function updatePosition() {
cordova.plugins.phonertc.setVideoView({
container: element[0],
local: {
position: [240, 240],
size: [50, 50]
}
});
}
$timeout(updatePosition, 500);
$rootScope.$on('videoView.updatePosition', updatePosition);
}
}
});