android - $cordovaMedia stop working -
i trying create musical instrument consisting of 8 notes, these notes represented image divided 8 areas. whenever press area plays note, if press repeatedly several areas after while app stops producing sounds. how can avoid happening?
now post code... working ionic framework.
in app.js
angular.module('starter', ['ionic', 'ngcordova', 'starter.controllers'])
and on... interested part of app.js callback of 'ngcordova' angular.module
now on controllers.js
`
angular.module('starter.controllers', []) .controller('soundctrl', function($scope, $cordovamedia) { //play media $scope.play = function(src) { var media = new media(src, null, null); $cordovamedia.play(media); }; })
`
finally on file html this
` <img src="img/image.png" style="margin-top:10%;width:100%;height:auto;" usemap="#hangdrum"> <map name="hangdrum"> <area shape="circle" coords="298,63,37,34" ng-click="play('/android_asset/www/mp3/a.mp3')">
`
now... sound ok , start correctly if play sound (or press different times after 10 time (more or less) stop play sound.
why? how can fix it? ;)