Google Groups

Re: Why does the iPhone player issue strange Byte Range Requests


Jeffrey Posnick Jun 15, 2012 1:24 PM
Posted in group: YouTube APIs Developer Forum
Hello Michael,

 The various streaming mechanisms used by official YouTube video players are meant to be opaque to third party developers and users, and I don't have any reason to believe that the behavior you're reporting isn't intended.

 If you're experience legitimate playback issues the Players team will obviously investigate, but we can't go into the details of how things are being streamed in this forum.

Cheers,
-Jeff Posnick, YouTube API Team


On Thursday, June 14, 2012 12:40:19 PM UTC-4, Michael Kilian wrote:
We have observed the following odd behavior when accessing YouTube videos with an iPhone (and I believe iPad as well).

1. The player issues a request for 2 bytes:

              Range: bytes=0-1 

And the server returns these two bytes:

              Content-Range: bytes 0-1/16905148

2. The player then requests the whole file as a byte range request:

              Range: bytes=0-16905147 

And the server signals it is returning these bytes:

             Content-Range: bytes 0-16905147/16905148

3. Later the player presumably hangs up on this stream and issues a new Byte Range Request asking for the remainder of the file:

             Range: bytes=222296-16905147 

with response:

            Content-Range: bytes 222296-16905147/16905148 

And this continues...the player hangs up on the range and issues a new request further into the video, but always to the end of the video.
            Range: bytes=8192708-16905147
            Range: bytes=8453724-16905147
            Range: bytes=8556532-16905147

and so forth.

This seems very wasteful on a couple of counts:

   1. It requires a new connection for each request
   2. It likely abandons data that was in flight

What is the reason for this? 

At a higher level, why do iPhone/iPad devices use Byte Range requests rather than the /range qualifier on the URL sent to YouTube?