Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-soundmanager2",
"version": "0.5.6",
"version": "0.5.7",
"authors": [
"Parminder Klair"
],
Expand Down
17 changes: 9 additions & 8 deletions dist/angular-soundmanager2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4801,42 +4801,42 @@ ngSoundManager.factory('angularPlayer', ['$rootScope', '$log',
]);


ngSoundManager.directive('soundManager', ['$filter', 'angularPlayer',
function($filter, angularPlayer) {
ngSoundManager.directive('soundManager', ['$filter', '$timeout', 'angularPlayer',
function($filter, $timeout, angularPlayer) {
return {
restrict: "E",
link: function(scope, element, attrs) {
//init and load sound manager 2
angularPlayer.init();
scope.$on('track:progress', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.progress = data;
});
});
scope.$on('track:id', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.currentPlaying = angularPlayer.currentTrackData();
});
});
scope.$on('currentTrack:position', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.currentPostion = $filter('humanTime')(data);
});
});
scope.$on('currentTrack:duration', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.currentDuration = $filter('humanTime')(data);
});
});
scope.isPlaying = false;
scope.$on('music:isPlaying', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.isPlaying = data;
});
});
scope.playlist = angularPlayer.getPlaylist(); //on load
scope.$on('player:playlist', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.playlist = data;
});
});
Expand All @@ -4845,6 +4845,7 @@ ngSoundManager.directive('soundManager', ['$filter', 'angularPlayer',
}
]);


ngSoundManager.directive('musicPlayer', ['angularPlayer', '$log',
function(angularPlayer, $log) {
return {
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-soundmanager2.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-soundmanager2",
"version": "0.5.6",
"version": "0.5.7",
"description": "SoundManager2 Music Player for AngularJs",
"main": "src/angular-soundmanager2.js",
"directories": {
Expand Down Expand Up @@ -33,4 +33,4 @@
"grunt-contrib-uglify": "~0.7.0",
"grunt-contrib-watch": "~0.6.1"
}
}
}
18 changes: 9 additions & 9 deletions src/04-directive-soundManager.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
ngSoundManager.directive('soundManager', ['$filter', 'angularPlayer',
function($filter, angularPlayer) {
ngSoundManager.directive('soundManager', ['$filter', '$timeout', 'angularPlayer',

Copy link
Copy Markdown
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.
'ngSoundManager' is not defined.

function($filter, $timeout, angularPlayer) {
return {
restrict: "E",
link: function(scope, element, attrs) {
//init and load sound manager 2
angularPlayer.init();
scope.$on('track:progress', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.progress = data;
});
});
scope.$on('track:id', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.currentPlaying = angularPlayer.currentTrackData();
});
});
scope.$on('currentTrack:position', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.currentPostion = $filter('humanTime')(data);
});
});
scope.$on('currentTrack:duration', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.currentDuration = $filter('humanTime')(data);
});
});
scope.isPlaying = false;
scope.$on('music:isPlaying', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.isPlaying = data;
});
});
scope.playlist = angularPlayer.getPlaylist(); //on load
scope.$on('player:playlist', function(event, data) {
scope.$apply(function() {
$timeout(function() {
scope.playlist = data;
});
});
}
};
}
]);
]);