diff --git a/app/components/controls/music-control.js b/app/components/controls/music-control.js index 2a0f263..1b9cd37 100644 --- a/app/components/controls/music-control.js +++ b/app/components/controls/music-control.js @@ -1,12 +1,58 @@ import Em from 'ember'; export default Em.Component.extend({ - didInsertElement: function () { + dancer: null, + + classNames: ['container-fluid'], + + actions: { + play: function(){ + if(this.get('status') === 'playing'){ + this.get('dancer').pause(); + this.set('status', 'paused'); + } else if(this.get('status') === 'paused'){ + this.get('dancer').play(); + this.set('status', 'playing'); + } + }, + next : function(){ + + }, + previous: function(){ + + }, + + fullscreen: function(){ + + } + }, + + nextPrevEnabled: function(){ + return this.get('playQueue').length > 1; + }.property('playQueue.[]'), + + status: null, + + playQueue: [], + timeElapsed: '0:00', + timeRemaining: '0:00', + + playButton: function(){ + if(this.get('status') === 'playing'){ + return 'pause'; + } else { + return 'play-arrow'; + } + }.property('status'), + + init: function(){ + this._super(); + var dancer = new Dancer(), self = this, briOff = function(i){ Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', { - data: JSON.stringify({'on': 1, 'transitiontime': 0}), + data: JSON.stringify({'bri': 1, 'transitiontime': 0}), contentType: 'application/json', type: 'PUT' }); @@ -35,18 +81,24 @@ export default Em.Component.extend({ } } - }), - a = new Audio(); + }); kick.on(); + this.setProperties({ + dancer: dancer, + kick: kick + }); + }, + + didInsertElement: function () { + var dancer = this.get('dancer'), self = this; audio_file.onchange = function(){ - var files = this.files; + var files = this.files, a = new Audio(); var file = URL.createObjectURL(files[0]); a.src = file; dancer.load(a); - - dancer.play(); + self.set('status', 'paused'); }; }, diff --git a/app/components/controls/music-control/music-player.js b/app/components/controls/music-control/music-player.js deleted file mode 100644 index 218406e..0000000 --- a/app/components/controls/music-control/music-player.js +++ /dev/null @@ -1,27 +0,0 @@ -import Em from 'ember'; - -export default Em.Component.extend({ - classNames: ['container-fluid'], - - actions: { - play: function(){ - - }, - next : function(){ - - }, - previous: function(){ - - } - }, - - status: null, - - playButton: function(){ - if(this.get('status') === 'paused'){ - return 'pause'; - } else { - return 'play-arrow'; - } - }.property('status') -}); diff --git a/app/styles/app.scss b/app/styles/app.scss index 3500671..5c0d403 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -25,7 +25,6 @@ md-content { } .navigationItem { - text-transform: uppercase; cursor: pointer; font-family: 'Slabo 27px', serif; font-size: 18px; @@ -170,6 +169,28 @@ md-toolbar { color: red; } +#playerControls { + opacity: 0; + transition: all 0.2s ease-in-out; + position: absolute; + bottom: 0; + left: 0; + padding: 10px; + width: 100%; + color: white !important; +} + +#playerTimeControls { + position: relative; + font-size: 12px; + top: 2px; + margin-left: 10px; +} + +#playerControlsRight { + float: right; +} + .playerControllIcon { color: white !important; cursor: pointer; @@ -180,13 +201,17 @@ md-toolbar { } #playerArea { - height: 200px; + height: 300px; background-color: black; display: inline-block; } +#playerArea:hover #playerControls { + opacity: 1; +} + #playlist { - height: 200px; + height: 300px; background-color: grey; display: inline-block; } diff --git a/app/templates/components/bridge-controls.hbs b/app/templates/components/bridge-controls.hbs index 3546fac..7cf7d42 100644 --- a/app/templates/components/bridge-controls.hbs +++ b/app/templates/components/bridge-controls.hbs @@ -14,7 +14,7 @@ {{#paper-content flex-layout="column" flex=true}}
diff --git a/app/templates/components/controls/music-control.hbs b/app/templates/components/controls/music-control.hbs index cbb4c74..2ae3f94 100644 --- a/app/templates/components/controls/music-control.hbs +++ b/app/templates/components/controls/music-control.hbs @@ -1 +1,29 @@ -{{controls/music-control/music-player}} \ No newline at end of file +