This had been working in an old version of ionic
but now I've finished updating the rest of this app and gone back to finalise this the sound won't play.
I have an on-off switch for playing a demo sound in the app. Here is the code, with comments and with the commented out part I thought might be causing my problem. It isn't.
.controller( 'SoundCtrl', function( $scope, $timeout ) {
$scope.sound_on = false;
var media = new Media( '100bpm.wav' );
$scope.soundPlayer = function() {
console.log( "in soundPlayer" );
if( $scope.sound_on == false ) {
$scope.sound_on = true;
media.setVolume( '1.0' );
media.play();
console.log( "sound on" );
console.log( media );
/*$timeout(function(){
$scope.sound_on=false;
console.log("should change");
}, 12600);*/
} else {
media.stop();
$scope.sound_on = false;
console.log( "sound off" );
}
}
});
I get all the right console logs, and I put the wav file in the same folder as my js scripts.
Still nothing.
Any help?