KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this audio tag playing in the background, and I'm able to store the progress in seconds to a cookie. But in no way I'm able to start the audio from that cookie. (for continuing on other pages) $("p#sound audio").currentTime = $.cookie("audioTime"); <audio autoplay="autoplay" loop="loop" ontimeupdate="document.getElementById('tracktime').innerHTML = Math.floor(this.currentTime); $.cookie('audioTime', Math.floor(this.currentTime));"> <source src="audio/song.ogg" type="audio/ogg" /> <source src="audio/song.mp3" type="audio/mp3" /> Your browser does not support the audio tag. </audio> <span id="tracktime">0</span> Does this have to do with the song being loaded again from start? Thanks! EDIT: $("p#sound audio").get[0].currentTime With .get[0], it doesn't work either. Can someone please clear things up for me? Greatly appreciated!
Tags (comma-separated)
Save Edits
Cancel