I cannot seem to play a Youtube livestream (e.g. https://youtu.be/tPE4wv7ob8Q) on Chromecast using the media_extractor.play_media component.
When I replace the url with a regular Youtube video HA does play without any issues.
Is my media_content_type incorrect maybe? Any help appriciated.
My configuration.yaml:
media_extractor:
My automation.yaml:
alias: Test
trigger:
- entity_id: binary_sensor.switch_158d00020f1bba
platform: state
to: 'on'
action:
- data:
media_content_id: https://youtu.be/tPE4wv7ob8Q
media_content_type: video/youtube
entity_id:
- media_player.tv_bedroom
- media_player.tv_bathroom
service: media_extractor.play_media
That doensāt matter I think. If thatās the issue then a regular Youtube stream wouldnāt load. I guess the problem has to be live streaming video. Any other thoughts?
this indeed looks like a problem with the live videos, i assume due to some issue with the yt-dl that is being used by the media_extractor for āvideo/youtubeā media_type.
probably media_extractor implementation in home-assistant should support also the āis_liveā option - see this info:
"is_live (boolean): Whether this video is a live stream or a fixed-length video"
Hi @goprojojo - If i understand the normal youtube link is working but livestream isnāt. I used your config above and tried to play a video but it doesnāt seem to work. I have added a media_player configuration too. Is the above config correct? Should we add a media_extractor section in config?
The above config should still work and you need to include media_extractor too. Try to replace it with a non-livestream url, for example: https://youtu.be/cHHLHGNpCSA
Has there been any update on this? I was also wondering if you could get around this by just having home assistant display an internal HTML page to the chromecast with just a simple iframe to the live video embedded?
I set up CATT in my HA container (non-persistent, but easy enough to restore when necessery)
Came across this thread today trying to live-stream lo-fi hip-hip girl and the local news. Turns out CATT does this out of the box catt -d "My Room display" cast "https://www.youtube.com/watch?v=5qap5aO4i9A"
The only hassle is that Iām integrating this with HA via shell_command, and havenāt worked out how to pass service data to the command successfully. At this stage. Iām stuck using an individual command for each video, but thatās a pretty simple workaround.
I just tried the YAML I posted in the Developer Tools and it worked like a charm I would expect the same YAML to work in an automation by just calling that service as an action?
Sorry for not being very clear; the āappā-part was just what I understood from the Home Assistant documentation where I found how to do this It should not be important.
My problem was very similar, I wanted to make an alarm clock with a YouTube live show. My problem was that the id changed every day when I started the stream. For this Google has its YouTube api. I created a new sensor to get the live id and call it from the automation. I leave the code below: