Cordova plugins?


#1

hi

looooove ionic but just understand that cordova plugins do not work out of the box with ionic (bad for me…)

how can i use this plugin please?

cordova plugin add https://github.com/raulduran/VideoPlayer.git

thanks


#2

Should be able to use like so…

.controller('MainCtrl', function($scope, $ionicPlatform){
  $ionicPlatform.ready(function() {
    $scope.playVideo = function(){
      if(window.cordova && window.cordova.plugins.videoPlayer){
        cordova.plugins.videoPlayer.play("http://path.to.my/video.mp4");
      }
    }
  });
})

Just remember that you should wrap it in $ionicPlatform.ready to make sure cordvoa is ready.


#3

hi

thanks it works !

++


#4

Hi, please how can i use it for multiple URLs ? defined in another Controller with under a scope service ?