
- 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
20 lines
584 B
JavaScript
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 = [];
|
|
};
|
|
}]);
|