Problême avec lecteur MP3

Homan89 Messages postés 5 Date d'inscription samedi 6 décembre 2008 Statut Membre Dernière intervention 15 avril 2010 - 7 avril 2010 à 02:53
Homan89 Messages postés 5 Date d'inscription samedi 6 décembre 2008 Statut Membre Dernière intervention 15 avril 2010 - 15 avril 2010 à 11:02
Bonjour

voilà j'ai un petit problême, pour mon site j'ai pris un flash lecteur de mp3 sur le site à l'adresse suivante : http://www.flashkod.com/codes/LECTEUR-MP3-AVEC-BARRE-PROGRESSION-VERSION_20729.aspx

Je l'ai un peu modifier, et je l'ai mis sur mon site, mais voilà mon problême.

J'aimerais que quand le site apparait, la musique démarre automatiquement, et aussi que les musiques s'enchainent, car pour l'instant lorsqu'un morceau s'arrête, il n'y a plus rien et on est obligé de soit même cliquer sur la chanson suivante.
et une fois hébergé sur le net, lorsque je clique sur un morceau, le mp3 se lance tout en se chargeant, mais une fois le mp3 chargé, au lieu que le morceau continue sa lecture, il redemarre.

quelqu'un pourrait m'aider svp ?

voici le code principale du lecteur :

var temps = 0;
var total = 0;
var resultat = 0;
// Gestion du XML
playlist_xml = new XML();
playlist_xml.ignoreWhite = true;
playlist_xml.onLoad = function(ok) {
if (ok = true) {
playliste = this.firstChild.childNodes;
premiere = this.firstChild.firstChild;
enCours = premiere;
for (i = 0; i < playliste.length; i++) {
// trace ("num="+enCours.attributes.num+", nom="+enCours.attributes.nom+", fichier="+enCours.attributes.fichier+".");
liste.addItem(enCours.attributes.num + ": " + enCours.attributes.nom, enCours.attributes.fichier);
enCours = enCours.nextSibling;
}
}
};
playlist_xml.load("playlist.xml");
//
// Gestion du chargement des mp3s
//
chanson = new Sound();
chanson.onLoad = function(ok) {
if (ok = true) {
chanson.start();
_root.roue.gotoAndStop (2);

_root.ecranTitre = liste.getSelectedItem().data;
titrejoue = liste.getSelectedItem().data;
timer.onLoad = function () {
volumechanger.setVolume(_root.volume);
}
timer.onEnterFrame = function () {
volumechanger.setVolume(_root.volume );
temps = chanson.position;
total = chanson.duration;
resultat = Math.floor((temps/total)*100);
volumechanger.setVolume(_root.volume );
timesec = Math.floor(temps/1000)-60*tpsmin; // temps en secondes
if(timesec<10){ // ajout du 0
tpssec = "0"+timesec;
}else if(timesec>10){
tpssec = timesec;
}
timetotsec =Math.floor(total/1000)-60*totmin;
if(timetotsec<10){ // ajout du 0
totsec = "0"+timetotsec;
}else if(timetotsec>10){
totsec = timetotsec;
}
timetpsmilli = temps-Math.floor(temps/1000)*1000;// en millisecondes
if(timetpsmilli<100){ // ajout du 0
tpsmilli = "0"+timetpsmilli;
}else if(timetpsmilli>100){
tpsmilli = timetpsmilli;
}
timetotmilli = total-Math.floor(total/1000)*1000;
if(timetotmilli<10){ // ajout du 0
totmilli = "00"+timetotmilli;
}else if(timetotmilli>10 && timetotmilli<100){
totmilli = "0"+timetotmilli;
}else{
totmilli = timetotmilli;
}
timetpsmin = Math.floor(temps/1000/60); // en minutes
if(timetpsmin<10){ // ajout du 0
tpsmin = "0"+timetpsmin;
}else if(timetpsmin>10){
tpsmin = timetpsmin;
}
timetotmin = Math.floor(total/1000/60);
if(timetotmin<10){ // ajout du 0
totmin = "0"+timetotmin;
}else if(timetotmin>10){
totmin =timetotmin ;
}
}
} else {
_root.ecranTitre = "...Problème au chargement...";
deselection();
}
};
_root.chanson.onSoundComplete = function() {
_root.ecranTitre = "...Chanson terminée...";
_root.roue.gotoAndStop (1);
fichiersuivant = fichierEnCours.getSelectedIndex();
fichier = new String(liste.getSelectedItem().label);
numerofichier = fichier.slice(0,2);
numsuiv =new Number(numerofichier)+1;
fichiersuivant = new String (numsuiv+":");
trace(fichiersuivant);
//if (fichiersuivant = "undefined"){
//fichiersuivant = new String(1:);
//}else{
//_root.chanson.loadSound(fichierEnCours, true);
//}
};
//
// Gestion du clic dans la liste
//
_root.liste.setSelectMultiple(false);
_root.liste.setChangeHandler("userClic");
function userClic() {
fichierEnCours = liste.getSelectedItem().data;
_root.chanson.loadSound(fichierEnCours, true);
}
function deselection() {
_root.liste.setSelectedIndices(null);
}

// gestion des boutons
test = 0;
_root.arret.onPress = function() {
_root.roue.gotoAndStop (1);
stopAllSounds();

_root.ecranTitre = "...Arret exécuté...";
test = 0;
duree = 0;
}

_root.lancement.onPress = function() {
if (test = 1) {
_root.roue.gotoAndStop (2);
chanson.start(duree,0);

_root.ecranTitre = titrejoue
test = 0;
}else{
chanson.start();
_root.ecranTitre = titrejoue;
resultat = 0;
}
}
_root.pose.onPress = function() {
_root.roue.gotoAndStop (1);
chanson.stop();

duree = chanson.position/1000;
test = 1;
_root.ecranTitre = "...Mise en pause...";
}

_root.retour.onPress = function() {
_root.roue.gotoAndPlay(20);
duree = Math.round(chanson.position/1000);
chanson.stop();
_root.ecranTitre = "...Retour de 15 secondes...";
}
_root.retour.onRelease = function() {
chanson.start(duree-15,0);
_root.ecranTitre = titrejoue;
}

_root.avance.onPress = function() {
_root.roue.gotoAndPlay (3);
duree = Math.round(chanson.position/1000);
chanson.stop();
_root.ecranTitre = "...Avance de 15 secondes...";
}
_root.avance.onRelease = function() {
chanson.start(duree+15,0);
_root.ecranTitre = titrejoue;
}

// gestion du volume

increment = 4;
level1 = 0;
volume = 50;

slider.onPress = function() {
if (Key.isDown(Key.getCode(18))) {
autoPan = true;
} else {
autoPan = false;
start = _root._xmouse;
newStart = slider._rotation;
dragging = true;
}
};
slider.onRelease = function() {
dragging = false;
};
slider.onReleaseOutside = function() {
dragging = false;
};
//
this.onEnterFrame = function() {
if (dragging) {
pivot = (_root._xmouse-start)*2+newStart;
slider._rotation = pivot;
if (pivot<-135) {
slider._rotation = -135;
}
if (pivot>135) {
slider._rotation = 135;
}
if (volume<=8 && volume != 0){
couleur8._alpha = 100
}
_root.level1 = Math.round(slider._rotation/2.7);
_root.volume = Math.round(level1+50);
} else {
if (autoPan) {
_root.textInput.value.selectable = false;
level1 += increment;
_root.volume = Math.round(level1+50);
if (level1>49 || level1<-49) {
increment *= -1;
}
} else {
_root.textInput.value.selectable = true;
}
if (level1>50) {
level1 = 50;
_root.volume = Math.round(level1+50);
} else if (level<-50) {
level1 = -50;
_root.volume = Math.round(level1+50);
} else if (level1<=50 && level1>=-50) {
_root.slider._rotation = level1*2.7;
_root.volume = Math.round(level1+50);
}
}
_root.volumechanger.setVolume(volume);
};


merci d'avance pour votre aide !

6 réponses

Homan89 Messages postés 5 Date d'inscription samedi 6 décembre 2008 Statut Membre Dernière intervention 15 avril 2010
7 avril 2010 à 02:54
arf j'ai pas trouvé de bouton edit, mais si ça peut vous aider pour voir le lecteur, il est à cette adresse : www.homan.fr
0
BBFUNK01 Messages postés 1310 Date d'inscription jeudi 16 juillet 2009 Statut Membre Dernière intervention 20 juin 2014 6
7 avril 2010 à 11:42
Hello,

j'ai regardé ton code vite fait et y ai rajouté 2 lignes, essaie ça pour voir :
var temps = 0; 
var total = 0; 
var resultat = 0; 
// Gestion du XML 
playlist_xml = new XML(); 
playlist_xml.ignoreWhite = true; 
playlist_xml.onLoad = function(ok) { 
if (ok = true) { 
playliste = this.firstChild.childNodes; 
premiere = this.firstChild.firstChild; 
enCours = premiere; 
for (i = 0; i < playliste.length; i++) { 
// trace ("num="+enCours.attributes.num+", nom="+enCours.attributes.nom+", fichier="+enCours.attributes.fichier+"."); 
liste.addItem(enCours.attributes.num + ": " + enCours.attributes.nom, enCours.attributes.fichier); 
enCours = enCours.nextSibling; 
} 
} 
}; 
playlist_xml.load("playlist.xml"); 
// 
// Gestion du chargement des mp3s 
// 
chanson = new Sound(); 
chanson.onLoad = function(ok) { 
if (ok = true) { 
chanson.start(); 
_root.roue.gotoAndStop (2); 

_root.ecranTitre = liste.getSelectedItem().data; 
titrejoue = liste.getSelectedItem().data; 
timer.onLoad = function () { 
volumechanger.setVolume(_root.volume); 
} 
timer.onEnterFrame = function () { 
volumechanger.setVolume(_root.volume ); 
temps = chanson.position; 
total = chanson.duration; 
resultat = Math.floor((temps/total)*100); 
volumechanger.setVolume(_root.volume ); 
timesec = Math.floor(temps/1000)-60*tpsmin; // temps en secondes 
if(timesec<10){ // ajout du 0 
tpssec = "0"+timesec; 
}else if(timesec>10){ 
tpssec = timesec; 
} 
timetotsec =Math.floor(total/1000)-60*totmin; 
if(timetotsec<10){ // ajout du 0 
totsec = "0"+timetotsec; 
}else if(timetotsec>10){ 
totsec = timetotsec; 
} 
timetpsmilli = temps-Math.floor(temps/1000)*1000;// en millisecondes 
if(timetpsmilli<100){ // ajout du 0 
tpsmilli = "0"+timetpsmilli; 
}else if(timetpsmilli>100){ 
tpsmilli = timetpsmilli; 
} 
timetotmilli = total-Math.floor(total/1000)*1000; 
if(timetotmilli<10){ // ajout du 0 
totmilli = "00"+timetotmilli; 
}else if(timetotmilli>10 && timetotmilli<100){ 
totmilli = "0"+timetotmilli; 
}else{ 
totmilli = timetotmilli; 
} 
timetpsmin = Math.floor(temps/1000/60); // en minutes 
if(timetpsmin<10){ // ajout du 0 
tpsmin = "0"+timetpsmin; 
}else if(timetpsmin>10){ 
tpsmin = timetpsmin; 
} 
timetotmin = Math.floor(total/1000/60); 
if(timetotmin<10){ // ajout du 0 
totmin = "0"+timetotmin; 
}else if(timetotmin>10){ 
totmin =timetotmin ; 
} 
} 
} else { 
_root.ecranTitre = "...Problème au chargement..."; 
deselection(); 
} 
}; 
_root.chanson.onSoundComplete = function() { 
_root.ecranTitre = "...Chanson terminée..."; 
_root.roue.gotoAndStop (1); 
fichiersuivant = fichierEnCours.getSelectedIndex(); 
fichier = new String(liste.getSelectedItem().label); 
numerofichier = fichier.slice(0,2); 
numsuiv =new Number(numerofichier)+1; 
fichiersuivant = new String (numsuiv+":"); 
trace(fichiersuivant);
_root.chanson.loadSound(fichiersuivant, true);
//if (fichiersuivant = "undefined"){ 
//fichiersuivant = new String(1:); 
//}else{ 
//_root.chanson.loadSound(fichierEnCours, true); 
//} 
}; 

chanson.loadSound(premiere, true);

// 
// Gestion du clic dans la liste 
// 
_root.liste.setSelectMultiple(false); 
_root.liste.setChangeHandler("userClic"); 
function userClic() { 
fichierEnCours = liste.getSelectedItem().data; 
_root.chanson.loadSound(fichierEnCours, true); 
} 
function deselection() { 
_root.liste.setSelectedIndices(null); 
} 

// gestion des boutons 
test = 0; 
_root.arret.onPress = function() { 
_root.roue.gotoAndStop (1); 
stopAllSounds(); 

_root.ecranTitre = "...Arret exécuté..."; 
test = 0; 
duree = 0; 
} 

_root.lancement.onPress = function() { 
if (test = 1) { 
_root.roue.gotoAndStop (2); 
chanson.start(duree,0); 

_root.ecranTitre = titrejoue 
test = 0; 
}else{ 
chanson.start(); 
_root.ecranTitre = titrejoue; 
resultat = 0; 
} 
} 
_root.pose.onPress = function() { 
_root.roue.gotoAndStop (1); 
chanson.stop(); 

duree = chanson.position/1000; 
test = 1; 
_root.ecranTitre = "...Mise en pause..."; 
} 

_root.retour.onPress = function() { 
_root.roue.gotoAndPlay(20); 
duree = Math.round(chanson.position/1000); 
chanson.stop(); 
_root.ecranTitre = "...Retour de 15 secondes..."; 
} 
_root.retour.onRelease = function() { 
chanson.start(duree-15,0); 
_root.ecranTitre = titrejoue; 
} 

_root.avance.onPress = function() { 
_root.roue.gotoAndPlay (3); 
duree = Math.round(chanson.position/1000); 
chanson.stop(); 
_root.ecranTitre = "...Avance de 15 secondes..."; 
} 
_root.avance.onRelease = function() { 
chanson.start(duree+15,0); 
_root.ecranTitre = titrejoue; 
} 

// gestion du volume 

increment = 4; 
level1 = 0; 
volume = 50; 

slider.onPress = function() { 
if (Key.isDown(Key.getCode(18))) { 
autoPan = true; 
} else { 
autoPan = false; 
start = _root._xmouse; 
newStart = slider._rotation; 
dragging = true; 
} 
}; 
slider.onRelease = function() { 
dragging = false; 
}; 
slider.onReleaseOutside = function() { 
dragging = false; 
}; 
// 
this.onEnterFrame = function() { 
if (dragging) { 
pivot = (_root._xmouse-start)*2+newStart; 
slider._rotation = pivot; 
if (pivot<-135) { 
slider._rotation = -135; 
} 
if (pivot>135) { 
slider._rotation = 135; 
} 
if (volume<=8 && volume != 0){ 
couleur8._alpha = 100 
} 
_root.level1 = Math.round(slider._rotation/2.7); 
_root.volume = Math.round(level1+50); 
} else { 
if (autoPan) { 
_root.textInput.value.selectable = false; 
level1 += increment; 
_root.volume = Math.round(level1+50); 
if (level1>49 || level1<-49) { 
increment *= -1; 
} 
} else { 
_root.textInput.value.selectable = true; 
} 
if (level1>50) { 
level1 = 50; 
_root.volume = Math.round(level1+50); 
} else if (level<-50) { 
level1 = -50; 
_root.volume = Math.round(level1+50); 
} else if (level1<=50 && level1>=-50) { 
_root.slider._rotation = level1*2.7; 
_root.volume = Math.round(level1+50); 
} 
} 
_root.volumechanger.setVolume(volume); 
};


Sinon sympa tes ziks, tu bosses avec quel(s) logiciel(s) ? Moi je suis sur Mac et je fais mes enregistrements avec Garage Band et Logic Pro :)

A plus,

BBFUNK01
0
Homan89 Messages postés 5 Date d'inscription samedi 6 décembre 2008 Statut Membre Dernière intervention 15 avril 2010
7 avril 2010 à 11:48
warf merci !!! enfin faut que j'essaye déjà, mais j'espère que ça marchera.
Sinon pour la zik, je bosse sur PC, avec Guitar pro (pour programmer en midi les instruments que je ne joue pas en réel), après j'exporte le tout dans cubase, pour transformer les sons midi avec des VSTi en sons potable (le clavier et la batterie) et après j'exporte le tout en wav puis après je met tout dans Kristal, et après j'enregistre les parties guitares et à la fin la voix.

Donc j'utilise, pour récapituler :
Guitar Pro
Cubase LE (avec des vsti tel que Emulator X et Dimension LE)
et enfin Kristal, un multipiste gratos qui gère assez bien les vst. (le cubase LE déconne dès que je veux faire du multipiste)*
0
Homan89 Messages postés 5 Date d'inscription samedi 6 décembre 2008 Statut Membre Dernière intervention 15 avril 2010
7 avril 2010 à 11:55
arf, je viens d'effectuer les changements, et en faites, ça démarre le roulement de l'animation, mais pas de musique par contre qui démarre, puis j'ai essayé de voir si les musiques s'enchainaient et ça ne le fait pas non plus. enfin c'est pas super urgent, mais si tu pouvais ou quelqu'un d'autre regarder ça, ce serait cool :)
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
BBFUNK01 Messages postés 1310 Date d'inscription jeudi 16 juillet 2009 Statut Membre Dernière intervention 20 juin 2014 6
7 avril 2010 à 12:11
Re, bon et bien un coup dans l'eau comme on dit :)
Là je vais aller bosser donc je n'aurais pas le temps de regarder avant ce soir.

A plus,

BBFUNK01
0
Homan89 Messages postés 5 Date d'inscription samedi 6 décembre 2008 Statut Membre Dernière intervention 15 avril 2010
15 avril 2010 à 11:02
UP SVP :)
0
Rejoignez-nous