Jamstash/app/queue/queue.js
Hyzual 19661f463b Fixes the communication between the player directive and the player service
- Adds a "playEnded()" function specifically for jplayer to call when the currently playing song ends. It uses $rootScope.$apply() to notify the directive that the song has changed.
- Shows the player controls' css.
- Marks the tests relating the "playing" status of the song as pending.
- Further uses the Player service in the subsonic view
2015-01-17 19:13:41 +01:00

20 lines
584 B
JavaScript

angular.module('jamstash.queue.controller', ['jamstash.player.service'])
.controller('QueueController', ['$scope', 'globals', 'player',
function ($scope, globals, player) {
'use strict';
$scope.settings = globals.settings;
$scope.player = player;
//$scope.song = player.queue;
//angular.copy($rootScope.queue, $scope.song);
$scope.itemType = 'pl';
$scope.playSong = function (song) {
console.log('Queue Controller - playSong()', song);
player.play(song);
};
$scope.queueEmpty = function () {
player.queue = [];
};
}]);