gpt4 book ai didi

api - YouTube 实时聊天嵌入无法在移动设备上运行

转载 作者:行者123 更新时间:2023-12-02 03:19:52 25 4
gpt4 key购买 nike

<iframe allowfullscreen="" frameborder="0" height="500" src="https://www.youtube.com/live_chat?v=XX71LoT8AME&embed_domain=localhost" width="480"></iframe>

这是 YouTube 实时聊天嵌入的 Iframe 代码。它在桌面 View 中工作正常,但在移动 View 中返回 javascript 错误并且不显示任何内容

最佳答案

官方 YouTube documentation

Embed Live chat

Note: embedding live chat isn't available on mobile web.

During a live stream, you can embed live chat on your own site by using an iframe.

  1. Get the video ID for the live stream. You can get the video ID from the watch page URL (youtube.com/watch?v=12345). In this case, the video ID is ‘12345’. If you chose "Stream now," right-click on the player and select Copy video URL to get the video URL.
  2. Get the domain URL for the site you want to embed chat on. If you're embedding chat on www.example.com/youtube_chat, your embedding domain is "www.example.com."
  3. Combine the embedded URL in the following way: https://www.youtube.com/live_chat?v=12345&embed_domain=www.example.com.
  4. This is the URL for your iframe. Note the embed_domain must match the the URL of the page you’re embedding the chat on. If they are different, the embedded chat will not load.

关于api - YouTube 实时聊天嵌入无法在移动设备上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55120923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com