2

I have some videos and I need to be able to seek to various points in them without having downloaded the entire video prior to that point. So far I have it working great in Firefox and Chrome using the html5 video tag with NodeJS and the vid-streamer module. However, IE 11 insists on downloading the entire video, I can't get it to skip ahead until it has downloaded up to the point I want to play. Does IE support partial content, and is there some trick to triggering it? Or is it already asking for it with one of the other headers (GetContentFeatures.DLNA.ORG??) and my server doesn't understand?

Sample firefox request header--it sends a new request whenever you seek, key piece being the range header, which it sends even for the initial request (bytes=0-):

Accept  video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5
Accept-Language en-us,en;q=0.5
Connection  keep-alive
Cookie  connect.sid=...
Host    ...
Range   bytes=75661312-
Referer ...
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0

And server response:

Accept-Ranges   bytes
Cache-Control   public
Connection  keep-alive
Content-Disposition inline; filename=video.webm;
Content-Length  12509
Content-Range   bytes 75661312-75673820/75673821
Content-Transfer-Encoding   binary
Content-Type    video/webm
Date    Wed, 03 Sep 2014 21:42:08 GMT
Last-Modified   Thu, 28 Aug 2014 15:05:24 GMT
Pragma  public
Server  VidStreamer.js/0.1.4
Vary    Accept-Encoding
X-Powered-By    Express
status  206 Partial Content

IE11 does not send a range:

Request GET /videos/video.mp4 HTTP/1.1
Accept  */*
If-Modified-Since   Mon, 16 Nov 2009 14:05:45 GMT
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Referer ...
GetContentFeatures.DLNA.ORG 1
Pragma  getIfoFileURI.dlna.org
Accept-Language en-US
Accept-Encoding gzip, deflate
Host    ...
Connection  Keep-Alive
Cookie  ...

And the server (reasonably, I think) responds with the whole video and a 200 OK instead of 206 partial content:

Response    HTTP/1.1 200 OK
X-Powered-By    Express
Vary    Accept-Encoding
Cache-Control   public
Connection  keep-alive
Content-Type    video/mp4
Content-Disposition inline; filename=video.mp4;
Pragma  public
Last-Modified   Mon, 16 Nov 2009 14:05:45 GMT
Content-Transfer-Encoding   binary
Content-Length  36373917
Server  VidStreamer.js/0.1.4
Date    Wed, 03 Sep 2014 21:38:42 GMT
Pam G
  • 161
  • 1
  • 6

2 Answers2

4

Figured it out. IE11 does support pseudo streaming but it wants the "Accept-Ranges: bytes" header before it will bother requesting a range, so the server needs to respond with that regardless of whether it is actually sending a byte range. I had to modify my vid-streamer module to do that.

Caveat: I have no idea which browsers support the video tag but not byte ranges, so I can't say for sure that this won't break something somewhere, but it seems like it should be ok...

Pam G
  • 161
  • 1
  • 6
  • Did you only have to add the "Accept-Ranges: bytes" response header when serving the MP4 or did you add it to all responses? –  Dec 24 '15 at 10:28
  • I added it to all responses, but IE was only requesting the mp4 versions so it could be restricted if needed. – Pam G Jan 23 '16 at 20:40
-1

I had the same problem until after some test I figured out that the initial request from IE/Edge does not include a range header. If you correspondingly respond with an initial Content-Range of the file size equal to your Content-Length header IE will assume you just want to send the whole file in one go. If you don't get an range header you are better off choosing some content length that is less than the size of the file. I chose 1Mb, but it doesn't really matter I think.