A voir également:
- Cherche code pour musique HTML
- Code ascii - Guide
- Télécharger musique gratuitement sur pc - Télécharger - Conversion & Extraction
- Je cherche une musique - Guide
- Musique audio - Télécharger - Lecture & Playlists
- Code puk bloqué - Guide
1 réponse
Bonsoir,
Ce sujet a été traité sur ce forum :
https://forums.commentcamarche.net/forum/affich-34359151-une-solution-pour-des-musiques-aleatoires-mp3-sur-une-page-web
Il faut juste modifier le script pour utiliser la balise <audio> en HTML5 :
Ce sujet a été traité sur ce forum :
https://forums.commentcamarche.net/forum/affich-34359151-une-solution-pour-des-musiques-aleatoires-mp3-sur-une-page-web
Il faut juste modifier le script pour utiliser la balise <audio> en HTML5 :
<script type="text/javascript">
var sound1="audio/fichier1.ogg"
var sound2="audio/fichier2.ogg"
var sound3="audio/fichier3.ogg"
var sound4="audio/fichier4.ogg"
var sound5="audio/fichier5.ogg"
var sound6="audio/fichier6.ogg"
var sound7="audio/fichier7.ogg"
var x=Math.round(Math.random()*7)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==5) x=sound5
else if (x==6) x=sound6
else x=sound7
document.write("<audio controls autoplay width='140' height='60'> <source src='"+x+""+"' type='audio/ogg' /></audio>")
</script>