Window Media Player issues two requests for audio on a web page

I am using Windows Media Player on a webpage. I have version 11 installed, so I am currently testing version. The player is embedded in the page using this HTML:

<OBJECT id='MS_mediaPlayer' width="400" height="45" classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6' 
  standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
  <param name='autoStart' value="false">
  <param name='uiMode' value="invisible">
  <param name='loop' value="false">


I am calling in JavaScript:

  MS_mediaPlayer.URL = "SomeAudioFile.mp3";


When I look at Fiddler I see that the player is actually loading "SomeAudioFile.mp3" twice. Are there any settings I have? I tried to set "autoPlay" to true and not call "play ()". Got the same result - two downloads.

UPDATE: The first user agent of the request is "Windows-Media-Player / 11.0.5721.5268". The second has "Mozilla / 4.0 (compatible MSIE 7.0, Windows NT 5.1, GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5. 21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) ". It looks like the browser is making the same request a second time. No idea why

Any ideas?

UPDATE (4/1/10):
Still no solution.

  • I have fully debugged JS and there is only one call MediaPlayer.URL='.....'

    to install the audio file. Nothing else launches the media player to download the file, and there is no other place referencing the audio file on the page.
  • Another interesting fact is that it doesn't (double-load audio) when I launch the browser locally on my development web server. But other remote requests to the same web server generate a double audio load.
  • I believe I have eliminated any correlation with specific IE version or media player version. This happens with IE6-8 and WM9-12

source to share

2 answers

You should carefully study the requests. Sometimes you will see the media player making two requests because they are using HTTP Range requests (and not requesting the whole file). Find the "Range" request header. Also make sure that none of the requests are using the HEAD method, as it simply fetches the server response headers.

Also, if any of the sessions shows as interrupted in the Fiddler session list ("don't enter an icon, a red circle with a line through it"), that means the client has closed the request in the middle. This can happen if a component starts a download, interrupts it, and restarts. Why this is possible, I'm not sure.

You can try looking at other sites using WMP and see if you see two requests for them.



See the bottom of this article, which explains that the first request is Windows Media Player sniffing to determine the file type, and the second request is a real request. mediafoundationdevelopment

Still working on how to use this bit of information with a generic handler that doesn't give out the filename ....



All Articles