Riff / Built on the open web / Platform

Web Storage

Carries the queue and position to the next page, and remembers the volume.

A post with its tracks listed, and the player bar along the bottom of the screen
The bar came with the listener from the previous page: the queue and position were read back from storage.

How Riff uses it

The queue, order, position, mode, repeat, shuffle, current time and playing flag are written to sessionStorage on every track load, every five seconds, and on pagehide. The next page in the same tab reads it back and reloads the same track at the same time. The volume goes to localStorage so it survives across tabs.

Why

This is what lets a link to another page keep playing and a reload pick up paused where it left off.

Without it

Every read and write is wrapped in try/catch, so in private mode or over quota the player works without remembering.

Where

Links open the source at the commit this page was published from.

Reference: Web Storage on MDN.