Skip to content

Extract media controls into method#5141

Merged
bramkragten merged 10 commits into
devfrom
media-controls
Mar 12, 2020
Merged

Extract media controls into method#5141
bramkragten merged 10 commits into
devfrom
media-controls

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Mar 12, 2020

Breaking change

Proposed change

Extract button generation into a new method to make it easier to follow what's going on.

Update gallery to show more relevant states.

If player is idle and it supports play, show play button.

Check for existence of "media_position" instead of truthy check, as we were not showing progress bars if media position was 0.

Updated gallery:
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Comment thread src/panels/lovelace/cards/hui-media-control-card.ts
Comment thread src/panels/lovelace/cards/hui-media-control-card.ts
Comment thread src/panels/lovelace/cards/hui-media-control-card.ts Outdated
@zsarnett
Copy link
Copy Markdown
Contributor

Idle is still Grayscale

`}
</div>
`}
<div class="playback-controls">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the CSS class to be .playback-controls or change this back to .controls

Comment thread src/panels/lovelace/cards/hui-media-control-card.ts Outdated
@balloob
Copy link
Copy Markdown
Member Author

balloob commented Mar 12, 2020

Updated
image

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Mar 12, 2020

image

@bramkragten bramkragten merged commit 9b220cc into dev Mar 12, 2020
@delete-merged-branch delete-merged-branch Bot deleted the media-controls branch March 12, 2020 09:40
@bramkragten bramkragten added this to the 0.107 milestone Mar 12, 2020
@bramkragten bramkragten mentioned this pull request Mar 12, 2020
@lock lock Bot locked and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants