diff --git a/dist/angular-media-player.js b/dist/angular-media-player.js index ca63726..a9b85f6 100644 --- a/dist/angular-media-player.js +++ b/dist/angular-media-player.js @@ -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 @@ -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) { @@ -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) { @@ -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) { diff --git a/dist/angular-media-player.min.js b/dist/angular-media-player.min.js index c27a3bc..f6e9acf 100644 --- a/dist/angular-media-player.min.js +++ b/dist/angular-media-player.min.js @@ -1 +1 @@ -angular.module("mediaPlayer",["mediaPlayer.helpers"]).value("mp.throttleSettings",{enabled:!0,time:1e3}).constant("mp.playerDefaults",{currentTrack:0,ended:void 0,network:void 0,playing:!1,seeking:!1,tracks:0,volume:1,formatDuration:"00:00",formatTime:"00:00",loadPercent:0}).directive("mediaPlayer",["$rootScope","$interpolate","$timeout","mp.throttle","mp.playerDefaults","mp.throttleSettings",function(a,b,c,d,e,f){function g(a){return function(b,d){var e,f=null;if(a.$attachPlaylist(b),void 0===b&&void 0!==d)return a.pause();if(a.currentTrack){e=d?d[a.currentTrack-1]:-1;for(var g=0;ga?(this.currentTrack=a+1,this.load(this.$playlist[a],!0)):(!this.currentTrack&&this.$domEl.readyState&&this.currentTrack++,void(this.ended?this.load(!0):this.$domEl.play()))},playPause:function(a,b){"boolean"==typeof a&&(b=a,a=void 0),b&&(this.$selective=!0),"number"==typeof a&&a+1!==this.currentTrack?this.play(a):this.playing?this.pause():this.play()},pause:function(){this.$domEl.pause()},stop:function(){this.reset()},toggleMute:function(){this.muted=this.$domEl.muted=!this.$domEl.muted},next:function(a){var b=this;if(b.currentTrack&&b.currentTrackd?"0"+d:d)+":"+(10>e?"0"+e:e);return b=c>0?(10>c?"0"+c:c)+":"+f:f},$attachPlaylist:function(a){void 0===a||null===a?this.playlist=[]:this.$playlist=a}},i=function(a,b,c){var e={playing:function(){a.$apply(function(a){a.playing=!0,a.ended=!1})},pause:function(){a.$apply(function(a){a.playing=!1})},ended:function(){!a.$selective&&a.currentTrack/