appControllers.controller('home', function($scope, $ionicPlatform, $cordovaMedia, $state, backgroundsounds_mediahandler ) { $scope.showmentor=false; $ionicPlatform.ready(function() { var mediastartespiel1 = new Media('/android_asset/www/sounds/spiel1.mp3', spiel1_intro_finish,null); $scope.mediastartespiel1=mediastartespiel1; backgroundsounds_mediahandler.playbackgroundmusic(); }); $scope.spiel1_intro = function(){ $scope.showmentor=true; $scope.mediastartespiel1.play(); $scope.mediastartespiel1.setVolume('1.0'); } function spiel1_intro_finish() { $scope.mediastartespiel1.release(); $scope.showmentor=false; $state.go('spiel1'); } });