mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 08:46:35 +00:00
reverted media player card
This commit is contained in:
parent
40b19006f1
commit
4398fcdec3
@ -55,13 +55,6 @@
|
|||||||
top: 91px;
|
top: 91px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.source-container {
|
|
||||||
position: absolute;
|
|
||||||
left: 8px;
|
|
||||||
right: 8px;
|
|
||||||
top: 170px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls {
|
.controls {
|
||||||
@apply(--paper-font-body1);
|
@apply(--paper-font-body1);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
@ -145,28 +138,6 @@
|
|||||||
class='self-center'
|
class='self-center'
|
||||||
></paper-icon-button>
|
></paper-icon-button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class='controls layout horizontal justified'
|
|
||||||
invisible$='[[!playerObj.supportsSelectInputSource]]'
|
|
||||||
>
|
|
||||||
<paper-icon-button
|
|
||||||
icon="mdi:login-variant">
|
|
||||||
</paper-icon-button>
|
|
||||||
<paper-dropdown-menu no-label-float selected-item-label='{{selectedSource}}' on-tap='stopPropagation'>
|
|
||||||
<paper-menu class="dropdown-content" selected="[[computeSelectedSource(stateObj)]]">
|
|
||||||
<template is='dom-repeat' items='[[stateObj.attributes.source_list]]'>
|
|
||||||
<paper-item>[[item]]</paper-item>
|
|
||||||
</template>
|
|
||||||
</paper-menu>
|
|
||||||
</paper-dropdown-menu>
|
|
||||||
</div>
|
|
||||||
</paper-material>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='source-container'
|
|
||||||
>
|
|
||||||
<paper-material elevation="1">
|
|
||||||
|
|
||||||
</paper-material>
|
</paper-material>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -27,11 +27,6 @@ export default new Polymer({
|
|||||||
computed: 'computePlaybackControlIcon(playerObj)',
|
computed: 'computePlaybackControlIcon(playerObj)',
|
||||||
},
|
},
|
||||||
|
|
||||||
selectedSource: {
|
|
||||||
type: String,
|
|
||||||
observer: 'selectedSourceChanged',
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The z-depth of the card, from 0-5.
|
* The z-depth of the card, from 0-5.
|
||||||
*/
|
*/
|
||||||
@ -43,11 +38,7 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
playerObjChanged(playerObj) {
|
playerObjChanged(playerObj) {
|
||||||
this.style.height = '78px';
|
this.style.height = this.computeShowControls(playerObj) ? '175px' : '78px';
|
||||||
if (this.computeShowControls(playerObj)) {
|
|
||||||
this.style.height = playerObj.supportsSelectInputSource ? '232px' : '175px';
|
|
||||||
}
|
|
||||||
|
|
||||||
this.style.backgroundImage = playerObj.stateObj.attributes.entity_picture ?
|
this.style.backgroundImage = playerObj.stateObj.attributes.entity_picture ?
|
||||||
`url(${playerObj.stateObj.attributes.entity_picture})` : '';
|
`url(${playerObj.stateObj.attributes.entity_picture})` : '';
|
||||||
},
|
},
|
||||||
@ -85,18 +76,6 @@ export default new Polymer({
|
|||||||
return playerObj.isMuted ? 'mdi:volume-off' : 'mdi:volume-high';
|
return playerObj.isMuted ? 'mdi:volume-off' : 'mdi:volume-high';
|
||||||
},
|
},
|
||||||
|
|
||||||
computeSelectedSource(stateObj) {
|
|
||||||
return stateObj.attributes.source_list.indexOf(stateObj.attributes.source);
|
|
||||||
},
|
|
||||||
|
|
||||||
selectedSourceChanged(option) {
|
|
||||||
// Selected Option will transition to '' before transitioning to new value
|
|
||||||
if (option === '' || option === this.stateObj.attributes.source) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.playerObj.input(option);
|
|
||||||
},
|
|
||||||
|
|
||||||
handleNext(ev) {
|
handleNext(ev) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
this.playerObj.nextTrack();
|
this.playerObj.nextTrack();
|
||||||
@ -132,8 +111,4 @@ export default new Polymer({
|
|||||||
this.playerObj.volumeMute(!this.playerObj.isMuted);
|
this.playerObj.volumeMute(!this.playerObj.isMuted);
|
||||||
},
|
},
|
||||||
|
|
||||||
stopPropagation(ev) {
|
|
||||||
ev.stopPropagation();
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user