Newsgroup: it.comp.lang.javascript
Titolo: avviare un file .mid per la musica di sottofondo

Come faccio ad avviare la riproduzione di un file .mid come musica di
sottofondo?
Grazie
_____________________________________________
Paolo Fulgoni
E-mail => 
ful...@iol.it
ICQ => 13306365
Web => 
http://gg.freeweb.org
  Gigi, il tuo amico virtuale :-)

una possibilità è <EMBED src="file.mid"> pero' compaiono le rispettive
barre di comado dei plugin di explorer e netscape.
per explorer puoi usare <BGSOUND SRC="file.mid" loop="nvolte">
sorry ma per netscape nun ce lo so'!!!
ciao
golem


barre di comado dei plugin di explorer e netscape.
Basta aggiungere hidden all'interno del tag per non farle vedere.
ciao
gelty
--
visita 
http://www.sifor.it
elimina *toglimi.* per le risposte

Basta aggiungere hidden all'interno del tag per non farle vedere.
Ocio però, che quicktime è piuttosto carogna... se per caso si imposta Hidden=true, il midi non suona, e nemmeno se si
imposta width o height = 0.
Ho risolto mettendo width=2 e height=1...
Che tristezza :/
Jax
gare...@mindless.com
The SNest: 
http://members.xoom.com/jax76
  (Under construction)
** Member of ChronoITA
"Don't wake me up too soon... I don't want to see the world...
I need to be no one... all I want is just to be"
Elisa, Sleeping in your hand


Devi inserire il tag <embed src="file.mid" width=0 height=0
autostart=true>
Il display con i comandi non viene visualizzato e funziona sia con
explorer che con netscape

explorer che con netscape
Ma non esiste una istruzione in javascript, invece che un tag?
Perchè vorrei fare una cosa del tipo: tu premi un bottone e parte la musica,
tu lo premi di nuovo e la musica si blocca.
Grazie!!!!
Paolo

tu lo premi di nuovo e la musica si blocca.
Magari! Devi inserire, con EMBED o OBJECT il lettore di file midi, poi
creare delle funzioni che chiamino i "metodi" .play e .stop del player.
Naturalmente questo é praticamente impossibile, perché in netscape sono
.play e .stop, per l'ActiveMovie sono .run e .stop, per il Windows Media
Player sono di nuovo .play e .stop...
Ci ho rinunciato. Metto autostart=true e lascio andare la musica...
Ciao by Stefano from Italy
On the net: 
s.pe...@usa.net

sottofondo?
Devi utilizzare il tag EMBED. Eccoti le istruzioni per utilizzarlo, prese dalla
HTML Reference Library v4.0:
==================================
The <EMBED> element allows authors to embed objects directly into an HTML page 
The basic syntax is: 
<EMBED SRC="_URL_">
<NOEMBED>Alternative content</NOEMBED>
</EMBED> 
where "_URL_" represents the URL of the object that is to be embedded. See below
for a description of the <NOEMBED> element. 
The <EMBED> element will allow you to embed documents, or objects of any type.
Your user only needs to have an application which can view the data installed
correctly on their machine, or have a plug-in (for Netscape and Internet
Explorer) that can manipulate the embedded file format. 
The <EMBED> element can be used more or less the same as the <IMG> element and
so accepts typical image embedding attributes such as ALIGN, ALT, BORDER, WIDTH,
HEIGHT, HSPACE, VSPACE and NAME (for referencing the embedded object in a script
function). Note that multiple <EMBED> elements can be grouped together with the
same NAME attribute value, to provide multiple separate controls for a single
embedded sound file). 
Plug-ins Netscape plug-ins make use of the <EMBED> element. Essentially,
plug-ins are dynamic code modules which are associated with a MIME data type
that the Netscape client has no native support for. When Netscape encounters an
unknown data type from a server, it will search for a plug-in that is associated
with that MIME type and load it, enabling viewing/transforming of the data
object. There are many attributes to the <EMBED> element that are plug-in
specific (for these, see the relevant plug-in documentation), but as well as the
attributes above, the <EMBED> element accepts the following attributes as
standard across all embedded data types. 
CLASS="Style Sheet class"
The CLASS attribute is used to specify the <EMBED> element as using a particular
style sheet class. See the Style Sheets topic for details. 
HIDDEN="true|false"
Setting this attribute specified whether the plug-in is visible or not. Some
plug-ins (like the LiveAudio plug-in) can control the embedded data type without
being visible. The default value is "false", which causes the plug-in controls
to be displayed. 
ID="Unique identifier"
The ID attribute can be used to either reference a unique style sheet
identifier, or to provide a unique name for the <EMBED> element for scripting
purposes. Any <EMBED> element with an ID attribute can be directly manipulated
in script by referencing its ID attribute, rather than working through the All
collection to determine the element. See the Scripting introduction topic for
more information. 
PALETTE="foreground|background"
For users browsing in 256 colours, some embedded objects could cause what is
known as 'palette flash', where palette differences between the embedded object
and the browser/system cause the incorrect colours to be displayed. To avoid
this, embedded objects can have their palettes expressly defined as either
foreground or background (the default). 'Foreground' causes the embedded object
to use the foreground palette and 'background' forces it to use the background
palette (the colours not reserved by the browser/system). Note that this
attribute only has effect on the Windows platforms. 
PLUGINSPACE="_URL_"
If the user doesn't have a plug-in installed to handle the defined object data
type (determined from the SRC attribute, or TYPE attribute value), then it is
possible to guide the user to a different URL (the value of the PLUGINSPACE
attribute) to provide instructions on installing the necessary plug-in module.
Generally, this should be the plug-in vendors installation instructions
document. 
STYLE="Styling"
As well as using previously defined style sheet settings, the <EMBED> element
can have in-line stylings attached to it. See the Style Sheets topic for
details. 
TITLE="Informational ToolTip"
The Internet Explorer 4.0 (and above) specific TITLE attribute is used for
informational purposes. If present, the value of the TITLE attribute is
presented as a ToolTip when the users mouse hovers over the <EMBED> section,
when the embedded object doesn't provide ToolTips of its own.. 
TYPE="MIME type"
Either this, or the SRC attribute is necessary when inserting embedded objects
into HTML documents, in order for Netscape to be able to determining a suitable
plug-in module to use to handle the data type. The TYPE attribute accepts any
valid MIME type, to describe the type of object being inserted. 
For more information about plug-ins, see the Netscape web site.
http://home.netscape.com/
. Lots of plug-in modules are available, the additional
attributes for which are beyond the scope of this document. The documentation
with the plug-in should be consulted for useable HTML element attributes. 
NOTE : Microsoft's Internet Explorer (from version 3.0 beta 2) fully supports
Netscape plug-ins. When Internet Explorer loads a page designed to use a
(Netscape) plug-in module, it will use either the correct plug-in, or a
pre-installed ActiveX control to display the content as authored. Microsoft
recently released the ActiveVRML and ActiveMovie add-ons for Internet Explorer
which can handle VRML worlds, AVI, QuickTime, MPEG video/audio, WAV, Sun AU and
AIFF sound files respectively, either using the respective ActiveX <OBJECT>
code, or <EMBED> code as used by popular Netscape plug-ins. 
Examples
Below is an embedded MIDI file. Use the control panel to play it. The code used
to embed it is: 
<EMBED SRC="clouds.mid" WIDTH="145" HEIGHT="61"> 
 
NOTE : Internet Explorer will use the Netscape 'LiveAudio' plug-in (if Netscape
3.0 is installed, the LiveAudio plug-in distributed with Netscape Communicator
will not function inside Internet Explorer)), or any installed ActiveX control
for manipulation of the above MIDI file) 
Below is an embedded VRML world. Use the Live3D control panel to manipulate it.
The code used to embed it is: 
<EMBED SRC="../img/example.wrl" WIDTH="200" HEIGHT="150"> 
 
NOTE : Internet Explorer will use the ActiveVRML add-in (if installed), or
whatever Netscape plug-in is used within Netscape to handle the above Virtual
world. It will display the 'broken object' symbol if no suitable plug-in, or
ActiveX control is installed. 
<NOEMBED>
Much like the <NOFRAMES> element, <NOEMBED> can be used to provide alternative
content for older browsers that don't understand the <EMBED> element. Older
browsers will ignore the <EMBED> element (and the <NOEMBED> element to be
exact), but will render any HTML content they find in between the <EMBED> and
</EMBED> elements. Browsers that do understand the <EMBED> element will not
render any content between the <EMBED> and </EMBED> elements. For example : 
<EMBED SRC="MyWorld.wrl" WIDTH="200" HEIGHT="150">
<NOEMBED>You need Netscape or Internet Explorer to see this</NOEMBED>
</EMBED> 
Netscape (from version 2.0) and Internet Explorer (from version 3.0) would embed
the VRML world "MyWorld.wrl" (providing there is a suitable plug-in/ActiveX
control installed), while older browsers would display the message 'You need
Netscape or Internet Explorer to see this' 
--------------------------------------------------------------------------------
Every <EMBED> element in a document is an object that can be manipulated through
scripting. Note that most of the scripting of the <EMBED> element/object is only
supported by Internet Explorer 4.0 in its Dynamic HTML object model. Netscape
supports some <EMBED> related scripting through the Plug-ins array and Embeds
array, but that supported by Internet Explorer is far more versatile. 
<EMBED...> Properties
The <EMBED...> element/object supports all of the standard Dynamic HTML
properties (i.e. className, document, id, innerHTML, innerText, isTextEdit,
lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth,
outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName
and title). Details of these can be found in the standard Dynamic HTML
properties topics.
The <EMBED> element also supports the following properties:
align, alt, border, hidden, height, hspace, vspace, palette, pluginspace and
type
They all directly reflect their attribute settings (if any). See the particular
attribute for details. 
<EMBED...> Methods
The <EMBED...> element/object supports all of the standard Dynamic HTML methods
(i.e. click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText,
removeAttribute, scrollIntoView and setAttribute). Details of these can be found
in the standard Dynamic HTML Methods topics.
Also, the <EMBED> element supports the following methods: 
blur
The blur method can be used to force the embedded object to lose the users
focus. This then fires the onblur event (see below). 
focus
The focus method can be used to force the embedded object to gain the users
focus. This then fires the onfocus event (see below). 
<EMBED...> Events
The <EMBED...> element/object supports all of the standard Dynamic HTML events
(i.e. onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown,
onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover,
onmouseup and onselectstart). Details of these can be found in the standard
Dynamic HTML events topics.
Also, the <EMBED> element supports the following events: 
onblur
onblur is fired whenever the users focus moves away from the embedded object
(either by them clicking on another part of the document, or by 'tabbing' away
from the contents of the <EMBED> element, or by using the blur method (see
above). 
onfocus
The onfocus event is fired whenever the user passes the focus to the embedded
object - by clicking on it, tabbing to it, or by a script function using the
focus method (see above).
~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~
Gabriele Bertolucci - NT4WKSITA+SP3 - VB5PROITA+SP3
pbe...@bigfoot.com
http://www.bigfoot.com/~pberto/
~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~

...


...






 
Prova a vedere la mia home-page all'indirizzo
 
http://members.it.tripod.de/~cjsxg/
e clicca sulla scelta musicale.
NB: il codice è differente per IE e NS (mc on NS 4 non mi funziona
correttamente mentre con la versione 3 è tutto OK)
Ciao
Giorgio

autostart altrimenti una blank page:)
Un po scomodo, ma credo sia la soluzione migliore...
Ciao e grazie
Paolo