javascript - Reset the src of <audio> on Edge -




i'm having issues audio tag on edge browser.

i'm trying clear source of audio tag use play recorded sound input device. can choose if want send or not audio, optional, i'm trying give option of deleting source of audio when user click trash button, want clear input , preview audio tag. works fine in other browsers on edge when clean audio source of preview audio tag shows message of "this type of audio file not supported" instead of restarting time 0 or disable when starts.

anyone have idea of how can achieve that?

var source = "http://d.mimp3.eu/i/ms6mfogoji8nmnkoba6zg653/system-of-a-down-lonely-day.mp3";    audio = document.getelementbyid('audiotochange');    function addsource(){    	audio.setattribute("src", source );    }    function removesource(){    	audio.removeattribute("src");    }    function clearsource () {  	audio.setattribute("src", "" );  }    function clearandremove () {    	audio.setattribute("src", "" );    	audio.removeattribute("src");    }
<audio id="audiotochange" controls src=""></audio>  <br />  <input type="button" onclick="addsource()" value="add source" />  <br />  <br />  <input type="button" onclick="removesource()" value="remove source" />  <input type="button" onclick="clearsource()" value="clear source" />  <input type="button" onclick="clearandremove()" value="clear & remove source" />

i let simple example show i'm trying explain.

example fiddle

thanks in advance.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -