Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Code works in chrome but not in Microsoft Edge

Participant ,
Nov 28, 2018 Nov 28, 2018

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?

753
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 29, 2018 Nov 29, 2018

Just to be sure, have you tested on other browsers such as Firefox and Safari? Can you let us know your observations?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 30, 2018 Nov 30, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 03, 2018 Dec 03, 2018
LATEST

I am not sure. Am asking around for assistance. Stay tuned.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines