Youtube live chat embed not working in mobile

梦想的初衷 提交于 2019-12-24 14:57:00

问题


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

This is the Iframe code for the youtube live chat embed. It works fine in desktop view but return a javascript error in mobile view and no content is shown


回答1:


We just wanted to embed the youtube chat and found this on Google Support.

Unfortunately, Youtube chat embed isn’t available on mobile web according to google: https://support.google.com/youtube/answer/2524549?hl=en

Take care, I.




回答2:


Official 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.


来源:https://stackoverflow.com/questions/55120923/youtube-live-chat-embed-not-working-in-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!