Stream to your own website

Wish you could to live stream to your own website? You can with StreamYard!

There are number of ways to accomplish this – in this tutorial we’re going to use YouTube.

Note: If your YouTube account was created after August 2016, you need monetization enabled and an approved AdSense account linked to your YouTube account. Check the YouTube Features page to confirm live streaming and embedding is enabled as well.

Embed a YouTube Live stream

Follow these steps to embed a YouTube Live stream on your website:

  1. Add your YouTube channel on StreamYard. You can do this from your dashboard.
  2. Create a broadcast. Then on the broadcast, click on “More”, then “View on YouTube”. view on youtube
  3. On YouTube, right click on the video section and click “Copy embed code”. youtube embed code
  4. Paste the embed code onto your website. Your viewers will see the stream on your website when you go live on StreamYard! Note that the embed code will be different for each broadcast.

Embedding the YouTube Live chat

Follow these steps if you’d also like to embed the YouTube Live chat on your website:

  1. Find the video ID from the embed code in the Embed a YouTube Live stream section. For example, the video ID is oHg5SJYRHA0z for this embed code:
    1
    2
    3
    4
    5
    6
    
     <iframe
         width="560"
         height="315"
         src="https://www.youtube.com/embed/oHg5SJYRHA0z"
         frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
     </iframe>
    
  2. Create the live chat URL using your domain name and this video ID.
    1
    
     https://www.youtube.com/live_chat?v=<your video ID>&embed_domain=<your website domain>
    

    So, if your website was example.com and your video ID was oHg5SJYRHA0z, the link would be

    1
    
     https://www.youtube.com/live_chat?v=oHg5SJYRHA0z&embed_domain=example.com
    
  3. On your website, create an embeddable link with the following format:
    1
    2
    3
    4
    5
    
     <iframe
         width="640"
         height="360"
         src="https://www.youtube.com/live_chat?v=<your video ID>&embed_domain=<your website domain>">
     </iframe>
    

After following these steps, you should have a functional YouTube chat embedded on your website.