Trying to play a YouTube video on loop

Hi all,

I’ve recently (with some help) got a YouTube video to play on my TV as part of an automation however when the video stops that’s it… Is there a way to put it on loop?

I’ve had a look and can’t see anything…

Any help?

You could create an automation which starts the stream again once the play_time has passed.

That was a thought, though I hoped there was an easier way…

Can you share the automation? I tought you can put a youtube video on loop with a option in the url, but i’m not sure.

Hi Pippyn,

this is the script i use for playing the video,

log_fire:
  alias: Warm Log Fire
  sequence:
    - service: media_extractor.play_media
      entity_id: media_player.tv
      data:
        media_content_id: "https://www.youtube.com/watch?v=bmGsQkLb4yg"
        media_content_type: video/youtube

then i call it into an automation using

- service: script.log_fire

and everything works… but i want to loop the video if possible as i have several of these and some videos are only 5 mins long.

1 Like

Does this work;

thanks for the suggestion, unfortunately it didn’t work for me.