diff --git a/src/more-infos/more-info-media_player.html b/src/more-infos/more-info-media_player.html
index 2ba1b51b91..fd10034176 100644
--- a/src/more-infos/more-info-media_player.html
+++ b/src/more-infos/more-info-media_player.html
@@ -33,7 +33,7 @@
hidden$='[[computeHidePowerButton(isOff, supportsTurnOn, supportsTurnOff)]]'>
+
this.fire('iron-resize'), 500);
@@ -102,6 +116,14 @@ export default new Polymer({
return isMuted ? 'mdi:volume-off' : 'mdi:volume-high';
},
+ computeHideVolumeButtons(isOff, supportsVolumeButtons) {
+ return !supportsVolumeButtons || isOff;
+ },
+
+ computeShowPlaybackControls(isOff, hasMedia) {
+ return !isOff && hasMedia;
+ },
+
computePlaybackControlIcon() {
if (this.isPlaying) {
return this.supportsPause ? 'mdi:pause' : 'mdi:stop';
@@ -136,6 +158,23 @@ export default new Polymer({
this.callService('volume_mute', { is_volume_muted: !this.isMuted });
},
+ handleVolumeUp() {
+ const obj = this.$.volumeUp;
+ this.handleVolumeWorker('volume_up', obj, true);
+ },
+
+ handleVolumeDown() {
+ const obj = this.$.volumeDown;
+ this.handleVolumeWorker('volume_down', obj, true);
+ },
+
+ handleVolumeWorker(service, obj, force) {
+ if (force || (obj !== undefined && obj.pointerDown)) {
+ this.callService(service);
+ this.async(() => this.handleVolumeWorker(service, obj, false), 500);
+ }
+ },
+
volumeSliderChanged(ev) {
const volPercentage = parseFloat(ev.target.value);
const vol = volPercentage > 0 ? volPercentage / 100 : 0;