![]() I came up with several ideas though none of which I am completely sold on:ġ) Youtube is sending down self contained video and audio chunks with each /videoplayback call. I tried to attempt to only load a range of bytes (via setting the Range http header) which unfortunately failed (I'm assuming because there was no meta-data for the video coming with the video).Īt this point I'm stuck on figuring out how Youtube accomplishes this. It also seems worth noting that most normal requests due to HTML5 video requests seem to receive a 206 response code back while it streams, yet youtube's playvideo calls get a 200 back. Looking at the network traffic it appears to sends requests to which returns binary video data back in chunks of 1.1mb. However, what I am now stuck on is how Youtube deals with the pieces. Using those two resources I am able to load a mp4 video into a blob and display it in a HTML5 video tag. In my attempts to investigate how this worked, I noticed the video src tag has a value of blob:http%3A//which pointed me to blobs, which then led me to typed arrays. It also seems to only buffer the relevant pieces, so if you skip around it will make sure not to buffer pieces that are unlikely to be watched. Instead it manages to control buffering so it only buffers a certain amount while paused. Youtube does not work this way (at least in chrome). If you seek to the middle, it will start downloading from the seek position all the way to the end. This means that if your video is 300 megs, all 300 megs will be downloaded. Previously I have tested HTML5 videos and I found that the server starts streaming the whole video from the start and buffers in the background the complete rest of the video. ![]() I noticed that unlike most HTML5 video I have seen, Youtube's video player does not do a normal video source and instead utilizes a blob url as the source. I was watching a youtube video and I decided to investigate some parts of its video player. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |