Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to Play a series of .mid files as background

Reply
Thread Tools

How to Play a series of .mid files as background

 
 
Jack Sirulnikoff
Guest
Posts: n/a
 
      03-03-2004
Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when
the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true" ></embed></noscript>
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether
better way of doing this, I would appreciate hearing about that as well.

Thanks,

Jack






 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      03-03-2004
Jack Sirulnikoff wrote:
> Hi,
>
> I'm trying to write some javascript to set up a series of MIDI files as
> background using <EMBED>. I can get it to work in general, but the main
> problem I have is:
>
> what coding can be used so that each subsequent selection only starts when
> the previous selection has finished.
>
> an additional problem will be:
>
> how to clear the control panel from the display after the selection has
> finished.
>
> The coding I'm trying to use is something like this in the <BODY>:
>
> <SCRIPT>
> var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";
>
> for (var counter = 0; counter < 3; counter++) {
> // something in here to determine when the next piece can start, and to
> clear the Console
> var sounds = soundFile.split(",");soundFile = sounds[counter];
> document.write('<embed src="'+soundFile+'" autostart="true"
> controls="Console" width=144 height=60></embed>');
> }
> </SCRIPT>
>
> <noscript><embed src="jsrgo1gm.mid" autostart="true" ></embed></noscript>
> <noembed><bgsound src="jsrgo1gm.mid" ></noembed>
>
> I would appreciate any help you can provide, and if there is an altogether
> better way of doing this, I would appreciate hearing about that as well.
>



Embed an .m3u file and let the default application handle it. An .m3u
file is nothing more than a "playlist" of files. The URLs in an .m3u
file *must* be absolute URLs.


--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
 
Reply With Quote
 
 
 
 
Jack Sirulnikoff
Guest
Posts: n/a
 
      03-04-2004
Thanks for your help. I set up an .m3u, and it worked perfectly from the
test directory on my hard drive. Since all my files are in one directory, it
worked both with just the filename, and using the absolute URL. However,
neither way worked when I tried to run it from my website. I suspect the
problem still has to do with that, but I'm not sure what the answer is.

Jack

"Randy Webb" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Jack Sirulnikoff wrote:
> > Hi,
> >
> > I'm trying to write some javascript to set up a series of MIDI files as
> > background using <EMBED>. I can get it to work in general, but the main
> > problem I have is:
> >
> > what coding can be used so that each subsequent selection only starts

when
> > the previous selection has finished.
> >
> > an additional problem will be:
> >
> > how to clear the control panel from the display after the selection has
> > finished.
> >
> > The coding I'm trying to use is something like this in the <BODY>:
> >
> > <SCRIPT>
> > var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";
> >
> > for (var counter = 0; counter < 3; counter++) {
> > // something in here to determine when the next piece can start, and to
> > clear the Console
> > var sounds = soundFile.split(",");soundFile = sounds[counter];
> > document.write('<embed src="'+soundFile+'" autostart="true"
> > controls="Console" width=144 height=60></embed>');
> > }
> > </SCRIPT>
> >
> > <noscript><embed src="jsrgo1gm.mid" autostart="true"

></embed></noscript>
> > <noembed><bgsound src="jsrgo1gm.mid" ></noembed>
> >
> > I would appreciate any help you can provide, and if there is an

altogether
> > better way of doing this, I would appreciate hearing about that as well.
> >

>
>
> Embed an .m3u file and let the default application handle it. An .m3u
> file is nothing more than a "playlist" of files. The URLs in an .m3u
> file *must* be absolute URLs.
>
>
> --
> Randy
> Chance Favors The Prepared Mind
> comp.lang.javascript FAQ - http://jibbering.com/faq/



 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
To play or not to play bhuckle@bigpond.net.au DVD Video 1 08-01-2007 07:18 AM
PLAY MORE VIDEO GAMES WITH GOTTA PLAY Paul Heslop Digital Photography 0 05-21-2007 11:40 AM
What is the difference between A Series, G Series and S series of Canon Cameras zxcvar Digital Photography 3 09-09-2003 01:30 AM



Advertisments