Streaming video for Windows Media Player via http

Trying to stream video to Windows Media Player from a servlet (progressive download style). Stream processing works, but I have some strange behavior that I would like to exclude, not caused by a problem in my implementation.

When using WMP to open the servlet URL, WMP will execute a total of 4 http-get requests for the same resource, but with slightly different headers each time. The connection for the first 3 requests seems closed once the request (including headers) has been sent. The fourth request remains connected, and I can actually deliver the response headers and the contents of the file.

We tried using wirehark to view the first three queries. Identical response triggers are sent for all 4 requests, and the first 3 requests succeeded in sending response headers and part of the contents of the file before closing. (I don’t know if this is appropriate, but I need to enable “Support for packet capture using IP TSO-enabled equipment” for wiring in order to properly parse the stream, otherwise the first packet containing http-response is considered invalid.)

Below are 4 request headers:

GET /basic/test.mpg HTTP/1.1
Accept: */*
User-Agent: Windows-Media-Player/12.0.7600.16415
Accept-Encoding: gzip, deflate
Host: 192.168.1.34
Connection: Keep-Alive

GET /basic/test.mpg HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
User-Agent: NSPlayer/12.00.7600.16385 WMFSDK/12.00.7600.16385
GetContentFeatures.DLNA.ORG: 1
Host: 192.168.1.34

GET /basic/test.mpg HTTP/1.1
Accept: */*
User-Agent: NSPlayer/12.00.7600.16385 WMFSDK/12.00.7600.16385
Icy-Metadata: 1
Accept-Encoding: gzip, deflate
Host: 192.168.1.34
Connection: Keep-Alive

GET /basic/test.mpg HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
User-Agent: NSPlayer/12.00.7600.16385 WMFSDK/12.00.7600.16385
GetContentFeatures.DLNA.ORG: 1
Host: 192.168.1.34

Answer headers:

HTTP/1.1 200 OK
Content-Type: video/mpeg
Content-Length: 130549760
ETag: TEST1286565215430
ContentFeatures.DLNA.ORG: DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=00
Server: Jetty(6.1.x)
+3
source share
1 answer

The connection for the first 3 requests seems closed as soon as the request is sent (including headers).

", "? . , , , . Range: Cache-Control:.

0

Source: https://habr.com/ru/post/1768675/


All Articles