change <audio> src with javascript

后端 未结 6 1589
离开以前
离开以前 2020-11-27 04:52

I have multiple audio files that I want to stream based on the user selects. How do I do that? This is what I have so far and it doesn\'t seem to work.

*UPDATE: Mad

6条回答
  •  情歌与酒
    2020-11-27 05:30

    change this

    audio.src='audio/ogg/' + document.getElementById(song1.ogg);
    

    to

    audio.src='audio/ogg/' + document.getElementById('song1');
    

提交回复
热议问题