Bandwidth Data implications of embedding Youtube videos in my website

11,336

Solution 1

Both the youtube player and the video content is streamed from Youtube's server. The only price you pay is the few bytes it takes to add the video player embed code in your HTML pages.

Solution 2

When you embed a YouTube video, it streams directly from YouTube's servers.
Your server is not involved.

Solution 3

When you insert youtube or any embed code in your html page, your server serves the html content to the user's web browser / client (technically means user's web browser). And this html content is processed and translated by the client/ user's web browser. This means that it is served by your server as a link, but when the client translates it, it becomes an action; an action to pull content from the somewhere. So the client (user's web browser pulls the video from the specified url embedded in the iframe. In turn, the bandwith been used are calculated from

Solution 4

In addition to what Etienne Perot said, There are 3 nodes in play here, namely:

  1. Your server
  2. Youtube Servers
  3. The Client (i.e the user accessing you website)

In simple words: embed is an html tag that allows you include a link to a resource. And since youtube's embed goes in the form of youtu.be/foo or youtube.com/foo. Your browser simply parses (processes the link) and gets the content from that link, thereby visiting youtube website (underground) to fetch the referenced link without going through your server nor anything like that.

Meanwhile when you insert youtube or any embed code in your html page, your server serves the html content to the visitor's web browser / client (technically means visitor's web browser). And this html content is processed and translated by the client / user's web browser.

This means that it is served by your server as a link, but when the client translates it, it becomes an action; an action to pull content from the somewhere. So the client (user's web browser pulls the video from the specified url embedded in the iframe. In turn, the bandwith been used are calculated from

  1. The client (i.e the bandwidth used to access in the internet and the video's url) - calculated or billed by your ISP from your data active subscription.
  2. Youtube's Server (i.e the bandwidth from the server that serves the content being streamed) - calculated or billed by google cloud service from their inhouse cloud resource allocation.

If you use the google chrome browser, you can check this our by right clicking on the video and clicking inspect element, then switching to the network tab; you might have to hit refresh so that the page tries to get all the content loaded all over again: the purpose of this is to see where the content is loaded from.

See Network Analysis Reference on how to use the network tab in google chrome developer tools. Mozilla firefox and some named browsers also have the inspect element and network monitor feature.

I hope this helps somebody.

Share:
11,336
Null Head
Author by

Null Head

Software developer with skills in Java, C#, PHP and Objective C languages. Might end up with objective C but not sure. Life unearths surprises everyday. Currently working as web developer.

Updated on June 05, 2022

Comments

  • Null Head
    Null Head almost 2 years

    If I embed a Youtube video on my web page, what are the data usage implications on my server?
    I have a shared web hosting plan for my website with a data transfer limit of 5 GB/month. When a user plays video on my site, is my server taxed for data transfer i.e. if the video is of size 1GB, is my data transfer limit decreased by 1GB?
    And is my server processor taxed for video streaming?
    What other things should I be concerned about?

    Is there any link you can point me towards? That will be helpful.

    Thanks