Can someone comment this design? (Sorry, bad English)
Customer wants play video during HTTP download. I tried implementing
HTTP server and executable that host Microsoft ActiveX Media Control. When
downloading start (control client code) I start server and spawn executable with command line point
to this server (http://localhost:port/filename). It works as expected for WMV and ASF files. For MPG it show
video after downloading (and I get GET request several times (some of them
without range and conditions)). AVI it works only when I clear browsing
history. I tried, as I can (except GetContentFeatures.DLNA.ORG: 1 – don’t know
how), process any conditional and RANGE specifics in HTTP header but no luck.
When I compare request to my local server with IIS (using wireshark) I see
difference even in first GET.
My question is – if this schema can work for all formats or
it just bad idea?
Thank for your time.
Assuming your HTTPd is not broken, this always works, however different file formats behave differently.
- ASF/WMV/WMA (which is all the same ASF format) can be played without the file index and is played by the WM source filters, which do require the index and have their own HTTP client optimized for streaming.
- AVI could be played without the file index but it is played by the URLReader and AVISplitter. The AVISplitter requires the index and the index is at the end. The URLReader uses the HTTP moniker which uses the WinINet/WinHTTP HTTP client. The HTTP client supports range requests, but the HTTP moniker does not, so the URLReader must download the whole file before the AVISplitter plays it.
- MPG/MPA/MP2/MP3 does not have an index at all and it is played by the URLReader and MPEG1Splitter. Since there is no index, the file file is played while it is still being downloaded.
- MP4/MOV/F4V/3GP (same ISOM format) require the index, but the index can be placed at the beginning or at the end: if it's at the beginning, the file can be played right away; if at the end, only after a complete dowmload.
Other formats have other behaviors and so do other media players (the above description is for DirectShow).