如何在我的网站中嵌入深色主题的 youtube 实时聊天页面
how to embed youtube live chat page with dark theme in my website
我想将 YouTube 实时聊天页面嵌入到我的网站中。我用下面的代码成功实现了它。
<iframe src="https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost" frameborder="0"></iframe>
默认主题是浅色,但我的网站使用深色主题。
我知道 Youtube 有 light 和 dark 两个主题,所以我想更改嵌入式实时聊天页面的主题。
我尝试在 url 上添加 'theme=dark' 但它不起作用。
那么有什么办法可以做到这一点吗?
谢谢。
也许有点乱七八糟。当您转到 gaming.youtube.com 时,youtube 会自动切换到 "dark mode"。这也适用于嵌入式聊天。所以这应该可以解决问题:
<iframe src="https://gaming.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost" frameborder="0"></iframe>
编辑: 嵌入聊天不适用于现代浏览器。可以在此处找到更多信息:How to embed youtube livestream chat
现在,您可以将参数添加到 URL 地址 dark_theme=1
https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost&dark_theme=1
我想将 YouTube 实时聊天页面嵌入到我的网站中。我用下面的代码成功实现了它。
<iframe src="https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost" frameborder="0"></iframe>
默认主题是浅色,但我的网站使用深色主题。
我知道 Youtube 有 light 和 dark 两个主题,所以我想更改嵌入式实时聊天页面的主题。
我尝试在 url 上添加 'theme=dark' 但它不起作用。
那么有什么办法可以做到这一点吗?
谢谢。
也许有点乱七八糟。当您转到 gaming.youtube.com 时,youtube 会自动切换到 "dark mode"。这也适用于嵌入式聊天。所以这应该可以解决问题:
<iframe src="https://gaming.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost" frameborder="0"></iframe>
编辑: 嵌入聊天不适用于现代浏览器。可以在此处找到更多信息:How to embed youtube livestream chat
现在,您可以将参数添加到 URL 地址 dark_theme=1
https://www.youtube.com/live_chat?v=xxxxxx&embed_domain=localhost&dark_theme=1