Skip to content

Add media player external url#23337

Merged
balloob merged 6 commits intodevfrom
add-media-player-external-url
Apr 25, 2019
Merged

Add media player external url#23337
balloob merged 6 commits intodevfrom
add-media-player-external-url

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Apr 24, 2019

Description:

Allow integrations to indicate that their cover urls can be accessed externally, indicating to the frontend that we don't have to proxy the image.

When property set to True, the entity_picture will default to just that url.

To do:

Related issue (if applicable): fixes home-assistant/architecture#211

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

if player.media_image_remotely_accessible:
url = player.media_image_url
if url is not None:
return web.Response(status=301, headers={
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do the parameters used in /api/media_player_proxy (token or cache) change whenever the media changes? If not, we should be using a 302 instead so browsers don't cache the redirect and pin to the image.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You're so right.

@balloob balloob merged commit de6fdb0 into dev Apr 25, 2019
@delete-merged-branch delete-merged-branch Bot deleted the add-media-player-external-url branch April 25, 2019 05:37
@balloob balloob mentioned this pull request May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New media player property: media_image_remotely_accessible

3 participants