salut � tous,
je d�sire inserer du son dans ma page qui serai jou� lors de plusieurs evenement diff�rents, sachant que mes sons sont des mp3 comment je pourrai faire ceci??
merci pr votre aide![]()
salut � tous,
je d�sire inserer du son dans ma page qui serai jou� lors de plusieurs evenement diff�rents, sachant que mes sons sont des mp3 comment je pourrai faire ceci??
merci pr votre aide![]()
Euh, un embed ? un object ? un bgSound ?
En tout cas il n'y a pas de fonction pr�programm�e "playSound" en JS...
dommage qu'il n'existe un truc pr�programm� pr sa, sinon s'il ya une methode simple pour �a je veux bien la connaitre...
En survolant le web, j'ai trouv� ceci :Je n'ai h�las pas pu tester...
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 <script LANGUAGE="JavaScript"> <!-- var aySound = new Array(); aySound[0] = "mon_son.wav"; document.write('<BGSOUND id="auIEContainer">') IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0; NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0; ver4 = IE||NS? 1:0; onload=auPreload; function auPreload() { if (!ver4) return; if (NS) auEmb = new Layer(0,window); else { Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>"; document.body.insertAdjacentHTML("BeforeEnd",Str); } var Str = ''; for (i=0;i<aySound.length;i++) Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>" if (IE) auEmb.innerHTML = Str; else { auEmb.document.open(); auEmb.document.write(Str); auEmb.document.close(); } auCon = IE? document.all.auIEContainer:auEmb; auCon.control = auCtrl; } function auCtrl(whSound,play) { if (IE) this.src = play? aySound[whSound]:''; else eval("this.document.embeds[whSound]." + (play? "play()":"stop()")) } function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); } function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); } //--> </script>
super! merci bcp Fremy!!![]()
Partager