Search code examples
javascripthtmlaframe

On click image change (pause and play button)


I'm setting up a 3d audio player in A-Frame and am having trouble with The pause and play button images changing depending on if the audio is playing or not

Here is a link to my code in action.


Solution

  • When changing attributes od DOM elements, use

    el.setAttribute('src', newSrc)
    

    instead of

    el.src = newSrc
    

    working glitch here.