1

I want to embed youtube live chat page into my website. And I successfully implemented it with the following code.

<iframe src="https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost" frameborder="0"></iframe>

The default theme is light, but my website use dark theme.

I know Youtube has two themes including light and dark, so I want to change the theme of the embedded live chat page.

I tried to add 'theme=dark' on url but it not works.

So is there any way to do this?

Thanks.

lanhe
  • 13
  • 1
  • 4
  • Does this answer your question? [How to embed youtube livestream chat](https://stackoverflow.com/questions/52468303/how-to-embed-youtube-livestream-chat) – Nazir Mar 26 '20 at 11:08
  • Maybe I didn't make it clear. I have implemented embedding live chat on my website,The question is, the theme of live chat page (https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost) is light, but my website is dark. I know youtube has two themes includes dark and light. so I want to know how can I change the theme of embedded live chat page? anyway, thanks for your help. – lanhe Mar 27 '20 at 01:19

2 Answers2

5

Now, you can add parameter to the URL address dark_theme=1

https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost&dark_theme=1
  • How about light theme? Without adding the parameter, the embedded live chat is already in dark theme. However, I would like it to be light theme. Do you have any idea how to achieve it? I had tried `dark_theme=0` and `light_theme=1` but it's not working. – Joshua Ooi Mar 09 '23 at 13:24
0

Perhaps a bit of a hack. When you go to gaming.youtube.com, youtube automatically switches to "dark mode". This also applies to the embedded chat. So this should do the trick:

<iframe src="https://gaming.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost" frameborder="0"></iframe>

Edit: Embedding the chat does not work for modern browsers. More info can be found here: How to embed youtube livestream chat

rofavadeka
  • 577
  • 6
  • 19