Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions source/_integrations/media_source.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ ha_quality_scale: internal

The Media Source integration platform allows integrations to expose media for
use inside Home Assistant through the Media Browser panel or through supported
media players like Google Cast. This integration is configured automatically
media players like Google Cast.

## Configuration

This integration is configured automatically
through `default_config` or if another integration implements a media source.

If your configuration does not contain any of the above, you can add the below
Expand All @@ -27,7 +31,7 @@ media_source:
## Local Media

By default, the integration looks for media in a specified folder.
If other `media_dirs` are not declared you need to use `/media/local` path for
If other `media_dirs` are not declared you need to use `/media/local` path for
example in companion app notification.

For Home Assistant OS, Supervised and Container users, this folder is by default
Expand Down Expand Up @@ -58,23 +62,37 @@ homeassistant:
recording: /mnt/recordings
```

Please note, that the folder must be accessible locally. Home Assistant
cannot connect to external or remote network shares using this configuration
option.

## Playing media from a Media Source

To play media from a media source via a service call, use the uri scheme `media-source://media_source/<media_dir>/<path>`.
Default `media_dir`is `local`.
To play media from a media source via a service call, use the uri
scheme `media-source://media_source/<media_dir>/<path>`.
Default `media_dir` is `local`.

<div class="note">
Web browsers and Google Cast media players have very limited video container and codec support. The Media Source integration does not do any transcoding of media, meaning media files must be natively supported by your media player or web browser (for playing in the frontend). If a video file is not supported by your media player or web browser it will fail to play. Please check the documentation of your media player or web browser for lists of supported video formats.
Web browsers and Google Cast media players have very limited video container
and codec support. The Media Source integration does not do any transcoding of
media, meaning media files must be natively supported by your media player or
web browser (for playing in the frontend).

If a video file is not supported by
your media player or web browser it will fail to play. Please check the
documentation of your media player or web browser for lists
of supported video formats.
</div>

Example:

```yaml
service: media_player.play_media
target:
entity_id: media_player.living_room_tv
data:
media_content_type: video/mp4
media_content_id: media-source://media_source/local/videos/favourites/Epic Sax Guy 10 Hours.mp4
media_content_type: "video/mp4"
media_content_id: "media-source://media_source/local/videos/favourites/Epic Sax Guy 10 Hours.mp4"
```

[basic-configuration]: /docs/configuration/basic/#media_dirs