Audio / media player (podcasts / audiobooks), subs support.
Give it local or remote media dir (does not download etc... other systems / scripts manage that).
Not one thing, an asortment of components like:
<kweb-graph />
<kweb-globe />
<kweb-timeline />
<kweb-... />
...listening to events triggered by /play "reading the subtitles".
Somehow open(podcastFileURL.mp3) got called... There is a
👤▶️ Hit play on a media / audio object... (/play is more of an action / function than a UI / app, once file found and loaded, the player can just have a pause / show button in a corner of the screen
▶️ check if subs exists (if not: send event / signal / que to generate STT)
▶️ check if a wikified / .md version exists... if not create it on the fly with 📖 wikify(subs)
▶️ trigger the appropriate events as the timestamp moves over the linked words.
<void-player src="https://podcast.com/s01e01.mp3"></void-player>
customElements.define('void-player', class extends HTMLElement {
connectedCallback() {
const src = this.getAttribute('src')
this.innerHTML = `<audio controls></audio>`
const audio = this.querySelector('audio')
audio.src = src
audio.addEventListener('error', () => {
const err = audio.error
if (err) {
console.error('Audio error', err)
if (err.code === 4) console.warn('404 or unsupported format')
this.innerHTML = `<p>⚠️ Failed to load audio.</p>`
}
})
// Optionally resume from leftOff
const leftOff = JSON.parse(localStorage.voidPlayerLeftOff || '{}')
if (leftOff[src]) {
audio.currentTime = leftOff[src]
}
// Save progress
audio.addEventListener('timeupdate', () => {
leftOff[src] = audio.currentTime
localStorage.voidPlayerLeftOff = JSON.stringify(leftOff)
})
}
})
It, void-player or the me-db has a memory map: { url: left-off-offset, url2: ... }