mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +00:00
Add supportsPlay (#169)
This commit is contained in:
parent
aeb82117eb
commit
894c2cd29e
@ -180,7 +180,7 @@
|
||||
<paper-icon-button
|
||||
class='primary'
|
||||
icon='[[computePlaybackControlIcon(playerObj)]]'
|
||||
invisible='[[!computePlaybackControlIcon(playerObj)]]'
|
||||
invisible$='[[!computePlaybackControlIcon(playerObj)]]'
|
||||
disabled='[[playerObj.isOff]]'
|
||||
on-tap='handlePlaybackControl'
|
||||
></paper-icon-button>
|
||||
@ -298,7 +298,7 @@ Polymer({
|
||||
if (playerObj.isPlaying) {
|
||||
return playerObj.supportsPause ? 'mdi:pause' : 'mdi:stop';
|
||||
} else if (playerObj.isPaused || playerObj.isOff || playerObj.isIdle) {
|
||||
return 'mdi:play';
|
||||
return playerObj.supportsPlay ? 'mdi:play' : null;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
@ -60,7 +60,8 @@
|
||||
<paper-icon-button icon='mdi:skip-previous' on-tap='handlePrevious'
|
||||
hidden$='[[!supportsPreviousTrack]]'></paper-icon-button>
|
||||
<paper-icon-button icon='[[computePlaybackControlIcon(stateObj)]]'
|
||||
on-tap='handlePlaybackControl' highlight></paper-icon-button>
|
||||
on-tap='handlePlaybackControl'
|
||||
hidden$='[[!computePlaybackControlIcon(stateObj)]]' highlight></paper-icon-button>
|
||||
<paper-icon-button icon='mdi:skip-next' on-tap='handleNext'
|
||||
hidden$='[[!supportsNextTrack]]'></paper-icon-button>
|
||||
</template>
|
||||
@ -217,6 +218,11 @@ Polymer({
|
||||
value: false,
|
||||
},
|
||||
|
||||
supportsPlay: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
|
||||
hasMediaControl: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
@ -244,6 +250,7 @@ Polymer({
|
||||
this.supportsPlayMedia = (newVal.attributes.supported_media_commands & 512) !== 0;
|
||||
this.supportsVolumeButtons = (newVal.attributes.supported_media_commands & 1024) !== 0;
|
||||
this.supportsSelectSource = (newVal.attributes.supported_media_commands & 2048) !== 0;
|
||||
this.supportsPlay = (newVal.attributes.supported_media_commands & 16384) !== 0;
|
||||
|
||||
if (newVal.attributes.source_list !== undefined) {
|
||||
this.sourceIndex = newVal.attributes.source_list.indexOf(this.source);
|
||||
@ -279,7 +286,7 @@ Polymer({
|
||||
if (this.isPlaying) {
|
||||
return this.supportsPause ? 'mdi:pause' : 'mdi:stop';
|
||||
}
|
||||
return 'mdi:play';
|
||||
return this.supportsPlay ? 'mdi:play' : null;
|
||||
},
|
||||
|
||||
computeHidePowerButton: function (isOff, supportsTurnOn, supportsTurnOff) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user