javascript - Changing src attribute of HTML5 audio element -



javascript - Changing src attribute of HTML5 audio element -

i trying utilize js playback sounds. want have piece of music playing after time replace sound file. thought effective way reuse same sound object, seems not kill original sound gets messy. best way this?

my code below, im doing passing in new source @ time

function ingamesndcreate(src) { ingamesnd = new audio(src) ingamesnd.loop = true; ingamesnd.play(); }

thanks in advance

i expect you'll need alter source in dom using javascript. next should work.

document.getelementbyid('audio_id').src = 'different_file.wav';

javascript audio html5

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -