Reputation: 132
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
Reputation: 3095
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.
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