IE, embedded WMP 9.0: double GET request

Discussion in 'ASP General' started by RomanVN, Jul 3, 2006.

  1. RomanVN

    RomanVN Guest

    Hello,

    I have the following problem.
    The Windows MediaPlayer object is embedded in an ASP page:

    --- test.asp ---------------------------
    <%@ LANGUAGE=VBScript enablesessionstate=true LCID=1033 %>
    <% option explicit %>
    <html>
    <body>

    <h2>TEST</h2>
    <embed type="application/x-mplayer2"
    pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
    src="test2.asp?fn=test.wav"
    width=320
    height=69
    name="MediaPlayer"
    autostart="False"
    ShowStatusBar=1
    ShowDisplay=0
    ShowControls=1>
    </embed>
    </body>
    </html>
    -------------------------------

    The src parameter of the MediaPlayer object references to another ASP
    script
    which returns WAV file as a binary stream:

    --- test2.asp ----------------------------
    <%@ LANGUAGE=VBScript enablesessionstate=true LCID=1033 %>
    <% option explicit %>
    <%
    Dim fn
    fn = Request.QueryString("fn")
    if not isNull(fn) and fn <> "" then
    Dim vpath, path, strExt, strContentType
    vpath = "logs"
    path = Server.MapPath(vpath)

    strExt = LCase(GetFileExtension(fn))
    if strExt = "mp3" then
    strContentType = "audio/mp3"
    else
    strContentType = "audio/wav"
    end if

    Dim strFilePath
    strFilePath = path & "\" & fn 'This is the path to the file on disk.

    Dim objStream
    Set objStream = Server.CreateObject("ADODB.Stream")
    objStream.Open
    objStream.Type = 1
    objStream.LoadFromFile strFilePath

    Response.AddHeader "Content-Type", strContentType
    Response.AddHeader "Content-Disposition", "inline; filename=" & fn
    Response.AddHeader "Accept-Ranges", "bytes"
    Response.AddHeader "Content-Length", CStr(objStream.Size)
    Response.BinaryWrite objStream.Read

    objStream.Close
    Set objStream = Nothing
    end if

    Function GetFileExtension(fn)
    Dim strExt, intExtPos
    strExt = ""
    intExtPos = InstrRev(fn, ".")
    if (not IsNull(intExtPos)) and intExtPos > 0 then
    strExt = Mid(fn, intExtPos + 1)
    end if
    GetFileExtension = strExt
    End Function
    %>
    -------------------------------


    For some strange reason the web site receives 2 get requests:
    one from the MediaPlayer object and the other from the browser itself:


    2006-07-03 08:44:32 192.168.X.X - 192.168.X.X 80 GET /test.asp - 200 0
    1018
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322)
    2006-07-03 08:44:32 192.168.X.X - 192.168.X.X 80 GET /test2.asp
    fn=test.wav 200 0 119682 Windows-Media-Player/9.00.00.3250
    2006-07-03 08:44:32 192.168.X.X - 192.168.X.X 80 GET /test2.asp
    fn=test.wav 200 0 119682
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322)


    However, if the src parameter references a direct link to
    a static WAV file on the server (src="test.wav"), then the browser
    sends one GET request (form the MediaPlayer):

    2006-07-03 08:45:05 192.168.X.X - 192.168.X.X 80 GET /test.asp - 200 0
    1005
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322)
    2006-07-03 08:45:05 192.168.X.X - 192.168.X.X 80 GET /test.wav - 200 0
    119635 Windows-Media-Player/9.00.00.3250


    How can I eliminate the extra request?
     
    RomanVN, Jul 3, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sydex
    Replies:
    12
    Views:
    6,649
    Victor Bazarov
    Feb 17, 2005
  2. gsauns

    Embedded WMP stops playing

    gsauns, Apr 27, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    423
    gsauns
    Apr 29, 2007
  3. Aris

    Embedded WMP 9

    Aris, Jun 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    128
  4. Greg S

    Embedded WMP

    Greg S, Apr 23, 2007, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    144
    Greg S
    May 7, 2007
  5. craig
    Replies:
    3
    Views:
    184
    craig
    Dec 16, 2003
Loading...

Share This Page