YouTube Live Streaming embed code keeps changing

假装没事ソ 提交于 2020-01-11 02:15:11

问题


I do live streaming with YouTube and I can watch it on my site by coping the embed code into my site

Its looks like this below

<iframe width="640" height="360" src="https://www.youtube.com/embed/gz54fede3Y" frameborder="0" allowfullscreen></iframe>

But recently I discovered that every time I do a live stream, I have to start updating the embeded code on my site each time with the one that will be generated from my live channel.

This is because it keeps regenerating a different code. Its so frustrating to do this, is there a way to get a particular embed code that will not change so I don't have to worry about this, or is there a setting that I am not aware of.


回答1:


There is a static URL to embed the video player for the "Stream now" stream. It is currently not exposed anywhere in the UI, but we will fix that soon (hopefully.)

It looks like this: https://www.youtube.com/embed/live_stream?channel=[channel ID]

You can also use a YouTube Gaming link, like so: https://gaming.youtube.com/embed/live_stream?channel=[channel ID]

You can determine your channel ID by going to https://www.youtube.com/account_advanced and copying the string after "YouTube Channel ID".

Once you've got this link, you can use it in the "src" attribute of your embed code.



来源:https://stackoverflow.com/questions/39204757/youtube-live-streaming-embed-code-keeps-changing

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