I have created a http webserver which needs to support streaming video to other applications. I am facing issue with windows media player while seeking. Windows media player crashes when I seek in a particular fashion. Other than this it is working fine.
Steps in which media player is crashing.
Suppose there are 3 points on seek bar(say A, B, C).
1) A is the start position of video.
2) Jump to position C.
3) Jump back to position B.
4) Again jump back to position C(or any position ahead of position B).(This is where media player crashes with following error.)
"Windows Media Player encountered a problem while playing the file".
When the media player crashes, I don't get any request on my web server. otherwise on my server side I am getting normal seek(content-range) http requests.
Last Http request and response exchanged with media player on jumping to point B.
Request:
GET XXXXXXXXXXXXXXXXXXXXXXXXX HTTP/1.1
Connection: keep-alive
Cache-Control: no-cache
Pragma: getIfoFileURI.dlna.org
Accept: */*
Range: bytes=10125312-16437247
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514
GetContentFeatures.DLNA.ORG: 1
TransferMode.DLNA.ORG: Streaming
Host: localhost:16716
Response:
HTTP/1.1 206 Partial Content
Date: Fri, 08 Mar 2013 11:41:54 GMT
Content-Type: video/mp4
Access-Control-Allow-Origin: *
Connection: keep-alive
TransferMode.DLNA.ORG: Streaming
File-Size: 33994175
Accept-Ranges: bytes
Content-Range: bytes 10125312-16437247/16437248
Content-Length: 6311936
Thanks
This problem likely results from the invalid Content-Range
header in your response.
The response specifies a File-Size: 33994175
header but your Content-Range
header says something different:
Content-Range: bytes 10125312-16437247/16437248
The range component following the slash (/16437248
) should reflect the full size of the underlying resource in bytes. I suspect that windows media player takes that to mean there is no content after the 16437248
position and borks.
Changing the header in question to the following should solve the problem:
Content-Range: bytes 10125312-16437247/33994175