Bandwidth Data implications of embedding Youtube videos in my website
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
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.
In addition to what Etienne Perot said, There are 3 nodes in play here, namely:
- Your server
- Youtube Servers
- 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
- 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.
- 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.
When you embed a YouTube video, it streams directly from YouTube's servers.
Your server is not involved.