From 2ec766ffb478918d0d4722cd687ff1f0d42ddd9a Mon Sep 17 00:00:00 2001 From: Pawel Date: Mon, 25 Jan 2021 14:17:27 +0100 Subject: [PATCH] Add extra dict possible for send to Chromecast (#16268) Co-authored-by: Franck Nijhof --- source/_integrations/media_player.markdown | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/source/_integrations/media_player.markdown b/source/_integrations/media_player.markdown index 20a05a9d6af..025a5109360 100644 --- a/source/_integrations/media_player.markdown +++ b/source/_integrations/media_player.markdown @@ -48,6 +48,81 @@ Available services: `turn_on`, `turn_off`, `toggle`, `volume_up`, `volume_down`, | `entity_id` | yes | Target a specific media player. To target all media players, use `all`. | | `media_content_id` | no | A media identifier. The format of this is integration dependent. For example, you can provide URLs to Sonos and Cast but only a playlist ID to iTunes. | | `media_content_type` | no | A media type. Must be one of `music`, `tvshow`, `video`, `episode`, `channel` or `playlist`. For example, to play music you would set `media_content_type` to `music`. | +| `extra` | yes | Extra dictionary data to send, e.g., title, thumbnail. Possible values can be found below. + +##### Extra dictionary data + +{% configuration %} +title: + type: string + description: Title of the media. + required: false +thumb: + type: string + description: Thumbnail image URL. + required: false +current_time: + type: float + description: Seconds since the beginning of the content. If the content is live content, and the position is not specified, the stream will start at the live position. + required: false +autoplay: + type: boolean + description: Whether the media will automatically play. + default: true + required: false +stream_type: + type: string + description: "Describes the type of media artifact as one of the following: `NONE`, `BUFFERED`, `LIVE`." + required: false +subtitles: + type: string + description: URL of subtitle file to be shown on chromecast. + required: false +subtitles_lang: + type: string + description: Language for subtitles. + required: false +subtitles_mime: + type: string + description: Mimetype of subtitles. + required: false +subtitle_id: + type: integer + description: ID of subtitle to be loaded. + required: false +enqueue: + type: boolean + description: If True, enqueue the media instead of play it. + default: false + required: false +media_info: + type: map + description: Additional MediaInformation attributes not explicitly listed. + required: false +metadata: + type: map + description: "Media metadata object, one of the following: `GenericMediaMetadata`, `MovieMediaMetadata`, `TvShowMediaMetadata`, `MusicTrackMediaMetadata`, `PhotoMediaMetadata`." + required: false +{% endconfiguration %} + +Documentation: + +- [Google Dev Documentaion MediaData](https://developers.google.com/cast/docs/reference/messages#MediaData) +- [Google Dev Documentaion MediaInformation](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.MediaInformation) + + +Example of calling media_player service with title and image set: + +```yaml +entity_id: media_player.chromecast +service: media_player.play_media +data: + media_content_type: music + media_content_id: 'https://fake-home-assistant.io.stream/aac' + extra: + thumb: 'https://brands.home-assistant.io/_/homeassistant/logo.png' + title: HomeAssitantRadio +``` #### Service `media_player.select_source`