YouTube Live Streaming embed code keeps changing

21,654

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.

Share:
21,654
Plumptre Ademola
Author by

Plumptre Ademola

Lamp Developer

Updated on July 15, 2022

Comments

  • Plumptre Ademola
    Plumptre Ademola almost 2 years

    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.

  • Plumptre Ademola
    Plumptre Ademola over 7 years
    Marc thanks alot, I used the gaming link , I just added my channel Id to the gaming url so it will look something like this <iframe width="640" height="360" src="gaming.youtube.com/embed/live_stream?channel=mychanneli‌​d" frameborder="0" allowfullscreen></iframe> remember change mychannelid to your real channel id
  • FlipMcF
    FlipMcF over 7 years
    Can we get a link to official documentation for this feature?
  • FlipMcF
    FlipMcF over 7 years
    Best source for this answer I see comes from reddit.com/r/youtubegaming/comments/50bw6h/… By reddit.com/user/crschmidt
  • Marc Chambers
    Marc Chambers over 7 years
    I work at YouTube. We generated this answer internally and are socializing it (the Redditor in the linked comment works here as well.) This SO answer is our canonical source for now :) twitter.com/YouTubeDev/status/770709748731609088
  • freedrull
    freedrull over 7 years
    Does this work with the iframe player API? developers.google.com/youtube/…
  • Jonathan
    Jonathan over 6 years
    Has this been fixed?
  • Bombelman
    Bombelman over 5 years
    This solution does not work anymore, I did use it a while without problems, but YT must have changed something. Does anyone know of another solution because I cannot find it. @MarcChambers
  • Rajendra
    Rajendra almost 4 years
    It works. Make sure to make your stream public. It wont work on private or Unlisted stream.