Getting audio players to play their respective streams out of their element

speaker should be hidden.

And it shouldn’t flip back to initial.

only the svg should change back.

Things now work when going from the first button playing to playing the second one.

It’s time to get things working when going from the second button playing, to playing the first one.

The showPlayButton() function currently only hides the pause image.
Instead of that, it needs to use the hideAllButtons() function instead.

Don’t forget to pass button as the argument to the hideAllButtons() function.

  function showPlayButton(button) {
    var play = getPlay(button);
    var pause = getPause(button);
    hideAllButtons(button);
    show(play);

  }
1 Like

You haven’t supplied a link yet after doing the update.

Does it work?

  function showPlayButton(button) {
    var play = getPlay(button);
    hideAllButtons(button);
    show(play);

  }

The code A showPlayButton() function hasn’t yet been updated. Do that.

Add the hideAllButtons() function to the first set of code. Just below the hide() function is a good place for that.

ReferenceError: hideAllButtons is not defined
[Learn More]
_display:198:5
TypeError: button is undefined
[Learn More]
_display:283:5

Read my previous post.

this is wrong?


  function hide(el) {
    el.classList.add("hidea");
    hideAllButtons();
  }

Don’t change the hide() function.

You need to add the hideAllButtons() function from the second set of code, to the first set of code.

  function show(el) {
   el.classList.remove("hidea");
    el.classList.remove("hideb");
     hideAllButtons();
  }

Don’t change the hide() function. Put it back to what it was before.

You need to add the hideAllButtons() function from the second set of code, to the first set of code.

You need to add the hideAllButtons() function from the second set of code, to the first set of code.

Where???

Below the existing hide() function is a good place to put the hideAllButtons() function. Also move it in the second set of code so that it’s just below the hide function there too.