mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
parent
be100c5b9a
commit
b171efee8b
@ -13,7 +13,10 @@ ha_release: 0.49
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
The `media_extractor` component gets an stream URL and send it to a media player entity.
|
The `media_extractor` component gets an stream URL and send it to a media player entity. This component can extract entity specific streams if configured accordingly.
|
||||||
|
<p class='note'>
|
||||||
|
Media extractor doesn't transcode streams, it just tries to find stream that match requested query.
|
||||||
|
</p>
|
||||||
|
|
||||||
To use the media extrator service in your installation, add the following to your `configuration.yaml` file:
|
To use the media extrator service in your installation, add the following to your `configuration.yaml` file:
|
||||||
|
|
||||||
@ -22,9 +25,35 @@ To use the media extrator service in your installation, add the following to you
|
|||||||
media_extractor:
|
media_extractor:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Configuration variables:
|
||||||
|
|
||||||
|
- **default_query** (*Optional*): Set default stream query for all devices ('best' by default).
|
||||||
|
- **customize** (*Optional*): Set entity specific values. For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
media_extractor:
|
||||||
|
default_query: worst
|
||||||
|
customize:
|
||||||
|
media_player.my_sonos:
|
||||||
|
video: bestvideo
|
||||||
|
music: bestaudio[ext=mp3]
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration sets query for all service calls like: ```{"entity_id": "media_player.my_sonos", "media_content_id": "https://soundcloud.com/bruttoband/brutto-11", "media_content_type": "music"}``` to 'bestaudio' with mp3 extention.
|
||||||
|
|
||||||
|
Query examples with explanations:
|
||||||
|
* **bestvideo** - best video only stream
|
||||||
|
* **best** - best video + audio stream
|
||||||
|
* **bestaudio[ext=m4a]** - best audio stream with m4a extension
|
||||||
|
* **worst** - worst video + audio stream
|
||||||
|
* **bestaudio[ext=m4a]/bestaudio[ext=ogg]/bestaudio** - best m4a audio, otherwise best ogg audio and only then any best audio
|
||||||
|
|
||||||
|
More info about queries [here](https://github.com/rg3/youtube-dl#format-selection)
|
||||||
|
|
||||||
### {% linkable_title Use the service %}
|
### {% linkable_title Use the service %}
|
||||||
|
|
||||||
Go the the "Developer Tools", then to "Call Service", and choose `media_extractor/play_media` from the list of available services. Fill the "Service Data" field as shown in the example below and hit "CALL SERVICE".
|
Go to the "Developer Tools", then to "Call Service", and choose `media_extractor/play_media` from the list of available services. Fill the "Service Data" field as shown in the example below and hit "CALL SERVICE".
|
||||||
|
|
||||||
This will download the file from the given URL.
|
This will download the file from the given URL.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user