HTML
<input type="button" id="PlayOrPause" style="width:60px" value="Play" onClick='doPlayOrPause();'>
Ctrl
$scope.doPlayOrPause = function(){
cameraModuleService.doPlayOrPause();
}
Service
cameraModuleService.service('cameraModuleService', function ($http, $timeout, ENV, $log, $rootScope, $cookieStore, $compile) {
this.getVLC = function(){
if( window.document[name] ){
return window.document[name];
}
if( navigator.appName.indexOf("Microsoft Internet") == -1 ){
if( document.embeds && document.embeds[name] )
return document.embeds[name];
}else{
return document.getElementById(name);
}
}
this.doPlayOrPause = function(){
var vlc = getVLC("vlc");
if( vlc )
{
if( vlc.playlist.isPlaying )
vlc.playlist.togglePause();
else
vlc.playlist.play();
}
}
);
Here I am calling service getVLC
, but it says getVLC is not defined. How do I call one service from the same service ?
P.S. Both functions are in the same service