473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

IE, embedded WMP 9.0: double GET request

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?

Jul 3 '06 #1
0 1254

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: fotis | last post by:
hello there! I am playing with embedded python these days. I wrote sth like this: ------------------------------ Code ------------------------------- #include <Python.h> #include <iostream>...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
1
by: Chester | last post by:
Hello all, I am looking for an implementation of snprintf() that is targeted for the embedded world, i.e. is optimized for memory size. I also don't need to print anything larger than a float...
0
by: Nick White [MSFT] | last post by:
Hello fellow Microsoft Windows Mobile and Embedded enthusiasts: I invite you to peruse the list below of upcoming technical chats and Webcasts offered by the Windows Mobile and Embedded Devices...
16
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is...
0
by: David Hodges | last post by:
After installing the service packs from Framework 1.0 and 1.1 on my W2k web server I get the above error on all applications. I am at my wits end and finding nothing on Google that helps. Here...
16
by: Charles Law | last post by:
I have a string similar to the following: " MyString 40 "Hello world" all " It contains white space that may be spaces or tabs, or a combination, and I want to produce an array...
49
by: Alex Vinokur | last post by:
Are there any restrictions/problems for use of C++ STL in development in embedded systems? In particular: * Does STL require too much space/memory? * Is 'implementation of STL...
30
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
Let's say we had a simple function for returning the amount of days in a month: unsigned DaysInMonth(unsigned const month) { switch (month) { case 8: case 3: case 5:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.