Hi,
I have an audio file (.mid or .wav or .mp3) in an object element:
<object id="snd" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.
cab#Version=5,1,52,701" type="application/x-oleobject" width="282"
height="53">
<param name="FileName" value="Tjaikovsky_-_The_sorcerers_apprentice.mid" />
<param name="loop" value="true" />
<... more presentational params ...>
<embed name="embsnd" src="Tjaikovsky_-_The_sorcerers_apprentice.mid"
width="280" height="53" controls="smallconsole" autostart="true"
loop="true"></embed>
</object>
and a checkbox with which I would like to toggle the looping behaviour of
said object:
<label for="chloop">Loop:</label><input type="checkbox" id="chloop"
onclick="toggleloop(this);" class="zm" checked>
However, the sound keeps looping whatever I put in the toggle function:
function toggleloop(el){
document.getElementById('snd').PlayCount=el.checke d?99:1;
document.getElementById('snd').PlayCount=el.checke d?0:1;
document.getElementById('snd').loop=el.checked?99: 1;
document.getElementById('snd').loop=el.checked?0:1 ;
document.embeds.embsnd.loop=el.checked?99:1;
document.embeds.embsnd.loop=el.checked;
...??
}
Resources on the web speak of embedding sounds into webpages in many ways,
but none I have found that discuss this particular issue. I hope someone
easily
spots my error.
--
Ivo. 2 2535
Ivo,
I'd recommend inserting the object mid/wav etc. code dynamically into a div on
the web page, depending on the user's initial choice of "to loop" or "not to
loop".
If the user clicks "loop" then write the code to include the param loop="true"
or just the opposite.
It looks like your code utilizes msoft active-x technology for use of windows
media; i know there are a ton of other ways to do this using that technology;
the downside is that it targets one application and operating system versus a
generic code that plays on the user's default player.
You might combine an o/s sniffer with other player options, and when the user
clicks loop/no-loop, insert code for the operating system's standard default
player (what is it, winmedia for windows and quicktime for apple?). With the
ubiquity of flash, you might also consider importing your sounds to flash and
just using flash objects.
Hope this helps,
Jim
"JimMenees" wrote
<setting an embedded sound to loop or not> I'd recommend inserting the object mid/wav etc. code dynamically into a
div on the web page, depending on the user's initial choice of "to loop" or "not
to loop".
If the user clicks "loop" then write the code to include the param
loop="true" or just the opposite.
Thanks for your thoughts. The 'solution' I now have does that more or less:
there are two of those objects, one set to loop and visible, the other
non-looping and invisible. I toggle which sound is visible and hearable with
the checkbox.
But it 's not a solution at all: the whole idea behind this application is
that users can toggle the looping behaviour *while the sound is playing*,
and that it *keeps playing* at least till the end of the current round!
Obviously, with your suggestion and my solution, the moment the checkbox is
clicked, the current sound stops and the other one starts playing. And
detecting with javascript when a sound file reaches the end also seems
impossible...
It looks like your code utilizes msoft active-x technology for use of
windows media; i know there are a ton of other ways to do this using that
technology;
I was hoping the same thing, I started with just an embed tag, then added
the object hoping it would listen to my script, but alas!
--
Ivo This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bruce Bon |
last post by:
The class below is intended to play a Sun audio file (.au) in the
background while the main thread, which is servicing a GUI, continues
without impact. It doesn't work. For a sound file that...
|
by: laredotornado |
last post by:
Hello, I want to play an audio file embedded on my page by clicking on
an audio image and the page change to a new page. Is there a
cross-browser Javascript way to do this? Right now the code I...
|
by: laredotornado |
last post by:
Hello, I want to play an audio file by clicking on an audio icon and
not having the page switch out underneath. Right now the code I have
is ...
<html>
<head>
<title>Dictionary:...
|
by: Shelly |
last post by:
I had a problem with uploading images in that some files did not have a type
of "image/something" from the
$_FILES which I used for my verification.
Someone (THANK YOU) suggested using...
|
by: Gary Morrison |
last post by:
I need to create a lot of fairly-short audio files from the
concatenation of a lot of even shorter audio files. I'd like to control
that from a Perl script. The audio files would presumably be...
|
by: abrtlt |
last post by:
I would like to have a web page in which, when the user clicks on any
of several specific elements, a specific audio file is played, without
reloading the page.
The specific audio file name is...
|
by: Quentin |
last post by:
Hi,
I want to save an audio stream into a circular file so that I only keep say
the last hour's audio.
Can anybody help?
Cheers,
Quentin
|
by: anil.rita |
last post by:
When the user chooses an AV file to play, based upon the type of file,
I want to use the default installed media player to play it.
I am wondering if this is a good way - any alternatives,...
|
by: =?Utf-8?B?Qm9iQWNoZ2lsbA==?= |
last post by:
I am using Windows Media Player to play my half second audio files one after
the other using the code below...
My problem comes when I play a second audio file immediately after the first
one...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |