javascript - Audio src saved on cookie but not playing -


i have 5 songs in playlist , when click on next song see current src has saved on cookie when reload browser current src not auto playing.in browser console network tab - initiator i've found other .

var song = document.getelementsbytagname('audio')[0]; var played = false; var runsrc = $.cookie("savesrc"); function update() {     if(!played){          if(runsrc){            song.addeventlistener("canplay",function(){runsrc&&(song.src=runsrc,runsrc=null);             });             song.play();             played = true;             }        else {             song.play();             played = true;             }         }         else {         $.cookie('savesrc', song.src);         }       }   setinterval(update,0); 


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -