Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

HTTP server response, file request from IE

$
0
0

Hello.

I really hope I can get support here. Have read all the specifications but they are a bit unclear on the subject. 

I have an http web server that I coded myself. I don't really know how to handle file requests in the best way. But I tried different options.

I have tried partial request as well and have some questions there too, but I'll keep these questions off this thread as it gets too messy.

Request from IE:

GET /filename.mp4 HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko
Accept:*/*
Referer: http://localhost:27015/index.php
GetContentFeatures.DLNA.ORG1
Pragma:getIfoFileURI.dlna.org
Accept-Language: sv-SE
Accept-Encoding: gzip, deflate
Host: localhost:27015
Connection: Keep-Alive
Cache-Control: no-cache

Response from server:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: video/mp4
Content-Length: 38722854

Option 1.
Send the entire video / full size, with one function call, send();

Unexpected errors:
IE dev tools shows that the first request for the video is canceled. Then a similar / identical request is sent which is used instead. Why is the first request always interrupted just to use the second one instead?

Option 2.
Multiple calls to send(), where only 1mb is sent each time.

This method seems to be best, considering that all data is not sent to the user immediately. If the video is 40 mb in size, it does not feel reasonable to send the full size before the user has pressed play, or has reached a certain point in the web player.

Unexpected error:
Other browsers handle this quite well. They only receive, recv() more data if the user has reached a point where more data is needed, instead of regularly receiving more until the entire file has been downloaded.

I use send() within a loop and send 1mb each repetition. IE seems to receive every two seconds. It's way too fast. The user is forced to download the entire video (14 minutes), just after watching 1 minute. Also if user press "stop" in the webplayer, IE continues to receive 10-15 seconds before it aborts.

As the first option, the first request is canceled and the second identical request is used instead.

I would really appreciate some feedback and tips on what I can do differently to make it work better

Best regards




Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>