Add Array.from to lock in audio players list.
This commit is contained in:
parent
296cf5550a
commit
fe1d3b3d9b
1 changed files with 1 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ function give_event(player, index)
|
||||||
players[index].addEventListener("ended", function(){ console.log(next); players[next].play(); });
|
players[index].addEventListener("ended", function(){ console.log(next); players[next].play(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
players = document.getElementsByTagName("audio");
|
players = Array.from(document.getElementsByTagName("audio"));
|
||||||
/*length - 1 because the final player doesn't need an event, only the second-last.*/
|
/*length - 1 because the final player doesn't need an event, only the second-last.*/
|
||||||
for (var index = 0; index < players.length - 1; index += 1)
|
for (var index = 0; index < players.length - 1; index += 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue