Andrew Poulos wrote:
I'm using Windows Media Audio, via a WAX file, and I have some custom
controls to start and stop the audio. While it works in IE, FF gives an
error. The HTML looks like this:
<object id='obj' type='audio/x-ms-wax'
style='position:absolute; left:0px; top:0px;'
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
codeBase='http://activex... blah
width='100' height='100'>
<param name='FileName' value='wma_sample.wax'>
<param name='AutoStart' value='0'>
<embed id='objff' type='audio/x-ms-wax'
src='wma_sample.wax' autostart='0' width='100' height='100'></embed>
</object>
The above code usually works, but you will find many validation errors
if you check it at the W3C validator. Briefly, this code uses an
ActiveX object for browsers that support it(mainly IE). The ActiveX
path is valid code for browsers that support it. For the many browsers
that do not support ActiveX for the WMP, the embed path is
automatically taken. This usually works, but embed is a hangover from
the browser war era and has never been part of official W3C html. Hence
the validation errors you will get. However this can all be avoided.
See
http://www.cwdjr.info/souearly/mixedtestRoot.php and view the
source code. This code will work for the WMP using a .wax
redirector/playlist file, and the wax file can include several songs in
wma, mpg, wav, midi etc formats that will play in sequence. The WMP is
a huge program, about 3 to 4 times the size of many lean browsers such
as Firefox. It has many controls built in, so why reinvent the wheel?
You can have anything from a simple on/off button with auto start or
not, up to much more elaborate controls such as on my demo page.
Controlling the WMP with custom written script can be very tricky and
has varied some with WMP updates. There used to be quite a bit about
this subject on the vast Microsoft developers sites. However you will
find that many of the controls they use are aimed at IE only. Some use
vbscript that most browsers do not support. Some use Microsoft's
Jscript. I used to write scripts to control the WMP, but I now would do
it only as a last resort. For example, one of the Microsoft scripts
used to detect the WMP version failed after an upgrade, and I had to go
in and revise the Jscript and a vbscript - and all of this just to play
correctly on IE.
In addition to the code I show on my page, it is also possible to use
Microsoft conditional html comments to use an ActiveX path for IE and
an object path for everything else. This might be of limited use if one
wanted to use a parameter on IE that is only supported by an ActiveX
control and do something else for other browsers. I also have code for
this, but it is unlikely to be needed for your application.