John Albert Flores
John Albert Flores

Reputation: 132

Source of YouTube video can't be find on HTML

I just wondering how youtube displays the Video on their web app without the tag? I also want to implement that kind of technique from my other future web apps.

Upvotes: 0

Views: 37

Answers (1)

Ahmed Hammad
Ahmed Hammad

Reputation: 3095

TL;DR

It's because the video is streamed asynchronously, and not loaded at once. In HTML you will only find a player-container, which is a placeholder for the frames to be fed into it.

A bit more

When you click on a video, the metadata of the video loads first (title, description, etc.), then the stream flows through a socket, depending on the settings you have.

If there were a a fixed source in the HTML for which the video is loaded, changing the settings (playback speed, resolution, etc.) would have resulted in a page refresh!

In addition, YouTube prevents un-permissioned video downloads for a while now, another reason why not to provide a direct source to the video blob.

Upvotes: 2

Related Questions