Scroll to top

20/12/2023


2023/12/20#p1

0 comments: click to leave a comment

I woke the other morning with a song lodged in my head. Not unusual per se but this was Wizard's "I Wish it Could be Christmas Every Day" to the the tune of The Wexford Carol. Not only that but my had brain had adjusted the lyrics so they actually scanned correctly. I'm not made right!

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



2023/12/20#p2

0 comments: click to leave a comment

I realised there was a fundamental flaw with my podcasts view for /reader: tracking progress.

If I were to close the browser or refresh the page each audio tag would reset to 0 and I'd have to seek through until I found where I was.

Not any more...

Various attributes of the audio tag are accessible via script including, importantly, currentTime.

The page, like /reader itself, is public so I run a check to see if I'm logged in. If so, a script will periodically (every 10 seconds) check the value of currentTime and, if it has changed, write that to the database entry for that item.

Likewise, if logged in, I check against the database for the last recorded time and set that on page load. This means I will only ever be a maximum of 10 seconds out should I accidentally close the browser or navigate away.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



Close