我有一些視頻,我需要能夠尋求他們的各種點,而不必在那之前下載整個視頻。到目前爲止,我已經使用帶有NodeJS和vid-streamer模塊的html5視頻標籤,在Firefox和Chrome中使用它。但是,IE 11堅持要下載整個視頻,直到它已經下載到我想播放的點爲止,我無法跳過它。 IE是否支持部分內容,並有觸發它的一些技巧?或者是它已經與其他標題之一(GetContentFeatures.DLNA.ORG ??)要求它和我的服務器不明白?在IE11中的http僞流
樣品火狐請求報頭 - 它發送每當你尋找一個新的請求,鍵片是所述範圍標頭,它甚至發送用於初始請求(字節= 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
和服務器迴應:
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不發送範圍:
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 ...
而且服務器(重我認爲)用整個視頻和200 OK而不是206部分內容作出響應:
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
您是否只需在服務MP4時添加「Accept-Ranges:bytes」響應標題,還是將其添加到所有響應中? – 2015-12-24 10:28:58
我將它添加到所有響應中,但IE只請求了mp4版本,因此如果需要它可能會受到限制。 – 2016-01-23 20:40:29