diff --git a/client/static/index.html b/client/static/index.html index 282d0d0..26ce081 100644 --- a/client/static/index.html +++ b/client/static/index.html @@ -104,11 +104,11 @@ margin-bottom: 1px; }
Skip
- + < - + >
@@ -126,10 +126,10 @@ margin-bottom: 1px; }
Volume
- + - - + +
@@ -161,21 +161,39 @@ var showStatus = function(text) { $timeout(function() {$scope.status = ''; }, 2000); }; +var seek = function(seconds) { + var direction = seconds < 0 ? "Back" : "Forward"; + $http({ + method: 'GET', + url: '/seek/' + seconds + }).then(function successCallback(response) { + showStatus(direction + ": Success"); + }, function errorCallback(response) { + showStatus(direction + ": Error"); + }); +}; + +var volume = function(delta) { + var direction = delta < 0 ? "down" : "up"; + $http({ + method: 'GET', + url: '/volume/' + delta + }).then(function successCallback(response) { + showStatus("Volume " + direction + ": Success"); + }, function errorCallback(response) { + showStatus("Volume " + direction + ": Error"); + }); +}; + $scope.status = ''; $scope.alert = ''; -$scope.back = function() {} -$scope.pause = function() {} -$scope.forward = function() { -$http({ - method: 'GET', - url: '/seek/10' -}).then(function successCallback(response) { - showStatus("Forward: Success"); -}, function errorCallback(response) { - showStatus("Forward: Error"); - }); - } +$scope.back = function() { seek(-10) }; +$scope.pause = function() {}; +$scope.forward = function() { seek(10) }; +$scope.volumeUp = function() { volume(5) }; +$scope.volumeDown = function() { volume(-5) }; + $scope.showListBottomSheet = function($event) { $scope.alert = ''; $mdBottomSheet.show({