Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > IE, embedded WMP 9.0: double GET request

Reply
Thread Tools

IE, embedded WMP 9.0: double GET request

 
 
RomanVN
Guest
Posts: n/a
 
      07-03-2006
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;+.N ET+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;+.N ET+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;+.N ET+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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WMP wont stream embedded files. Kevin Scott Computer Support 3 10-24-2007 06:48 PM
SOLVED - can't open file in windows media player / WMP. But can in VLC - video LAN .. Now can in WMP jameshanley39@yahoo.co.uk Computer Information 2 09-19-2007 02:53 AM
Embedded WMP stops playing gsauns ASP .Net 2 04-29-2007 06:41 PM
Want to replace WMP 10 visualizations with ones from Wmp 8/9 blnstr Computer Support 1 12-08-2006 04:43 AM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM



Advertisments