Copy link to clipboard
Copied
I have some questions about this code in javascript.
window.onload = init;
function init(){
var audio = new Audio(),
i = 0;
var playlist = new Array('mp3.mp3', 'mp4.mp3');
audio.addEventListener('ended', function () {
i = ++i < playlist.length ? i : 0;
console.log(i)
audio.src = playlist;
audio.play();
}, true);
audio.volume = 0.3;
audio.loop = false;
audio.src = playlist[0];
audio.play();
}
It is running around now and I want it to stay after two mp3 songs. How do I do that? The second that I want to fade in when it starts. This code doesn't work in Chrome but works in the Microsoft Edge browser. What could it be?
Copy link to clipboard
Copied
Just to be sure, have you tested on other browsers such as Firefox and Safari? Can you let us know your observations?
Copy link to clipboard
Copied
No I haven't Firefox or Safari and so no observations. Can you help to solve how I can stop loop efter two mp3 songs. Now so loop running around. Can help me solve this for me with modify the code.
Copy link to clipboard
Copied
I am not sure. Am asking around for assistance. Stay tuned.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now