Starts rewriting the player service.

The API is simplified: we can play a song, restart the currently playing song, load a song (that'll be used only by local storage), play the next track or the previous track.

As a result, I changed all the calls to playSong(false, song) which are now just play(song)
This commit is contained in:
Hyzual 2014-12-10 23:46:57 +01:00
parent 226a768987
commit e51961c167
13 changed files with 145 additions and 446 deletions

View file

@ -279,7 +279,7 @@
$rootScope.selectAll(songs);
$rootScope.addSongsToQueue();
var next = $rootScope.queue[0];
player.playSong(false, next);
player.play(next);
};
$rootScope.playFrom = function (index, songs) {
var from = songs.slice(index,songs.length);
@ -292,7 +292,7 @@
$rootScope.queue = [];
$rootScope.addSongsToQueue();
var next = $rootScope.queue[0];
player.playSong(false, next);
player.play(next);
}
};
$rootScope.addSongsToQueue = function () {
@ -446,7 +446,7 @@
// Load Saved Song
var song = angular.fromJson(localStorage.getItem('CurrentSong'));
if (song) {
player.playSong(true, song);
player.load(song);
// Load Saved Queue
var items = angular.fromJson(localStorage.getItem('CurrentQueue'));
if (items) {