Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changeVolume API - 03-factory-angularPlayer.js #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add changeVolume API - 03-factory-angularPlayer.js #36

wants to merge 1 commit into from

Conversation

qaraluch
Copy link

Decrease code redundancy by shifting changeVolume function to API. This makes change of global volume variable possible:

angular.module('myApp')
.controller('myCtrl',
  ['$scope', 'angularPlayer', function($scope, angularPlayer){
    angularPlayer.changeVolume(25);
}]);

Decrease code redundancy by shifting changeVolume function to API. This make change global volume variable possible:
```js
angular.module('myApp')
.controller('myCtrl',
  ['$scope', 'angularPlayer', function($scope, angularPlayer){
    angularPlayer.changeVolume(25);
}]);
```
// chaning global variable too
volume = newVolume;
for(var i = 0; i < soundManager.soundIDs.length; i++) {
var mySound = soundManager.getSoundById(soundManager.soundIDs[i]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants