Skip to content

Commit

Permalink
release 0.5.9, allowing the selective flag to be cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
David Connolly committed Nov 7, 2014
1 parent 625c724 commit 8b45cf4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions dist/angular-media-player.js
Expand Up @@ -71,8 +71,8 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])
/**
* @usage play([index], [selectivePlay])
* @param {integer} index: playlist index (0...n), to start playing from
* @param {boolean} selectivePlay: only correct value is `true`, in which case will only play the specified,
* or current, track. The default is to continue playing the next one.
* @param {boolean} selectivePlay: `true` will only play the specified or current track, 'false' will reset the flag to default
* The default is to continue playing the next one.
*/
play: function (index, selectivePlay) {
// method overloading
Expand All @@ -82,6 +82,8 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])
}
if (selectivePlay) {
this.$selective = true;
} else if (selectivePlay == false) {
this.$selective = false;
}

if (this.$playlist.length > index) {
Expand All @@ -106,6 +108,8 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])
}
if (selectivePlay) {
this.$selective = true;
} else if (selectivePlay == false) {
this.$selective = false;
}

if (typeof index === 'number' && index + 1 !== this.currentTrack) {
Expand Down Expand Up @@ -477,7 +481,7 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])

}]
);


angular.module('mediaPlayer.helpers', [])
.factory('mp.throttle', ['$timeout', function ($timeout) {
return function (delay, no_trailing, callback, debounce_mode) {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-media-player.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/directive.js
Expand Up @@ -71,8 +71,8 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])
/**
* @usage play([index], [selectivePlay])
* @param {integer} index: playlist index (0...n), to start playing from
* @param {boolean} selectivePlay: only correct value is `true`, in which case will only play the specified,
* or current, track. The default is to continue playing the next one.
* @param {boolean} selectivePlay: `true` will only play the specified or current track, 'false' will reset the flag to default
* The default is to continue playing the next one.
*/
play: function (index, selectivePlay) {
// method overloading
Expand All @@ -82,6 +82,8 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])
}
if (selectivePlay) {
this.$selective = true;
} else if (selectivePlay == false) {
this.$selective = false;
}

if (this.$playlist.length > index) {
Expand All @@ -106,6 +108,8 @@ angular.module('mediaPlayer', ['mediaPlayer.helpers'])
}
if (selectivePlay) {
this.$selective = true;
} else if (selectivePlay == false) {
this.$selective = false;
}

if (typeof index === 'number' && index + 1 !== this.currentTrack) {
Expand Down

0 comments on commit 8b45cf4

Please sign in to comment.