Ambient K-Web

Automatic mapping – The thing that I want the most.

Todo

  1. ▶️ An Can play media with subs from my Media server.
  2. 📖 wikify(text)
    1. Use DBPedia's docker container.
  3. 🌐 "K-Web Player"
    1. Feed it a wikified script & it render graph, globe & timeline (etc).

▶️ /play on (PWA)

Audio / media player (podcasts / audiobooks), subs support.
Give it local or remote media dir (does not download etc... other systems / scripts manage that).

📖 wikify(text)

🌐 "K-Web Player"

Not one thing, an asortment of components like:

<kweb-graph />  
<kweb-globe />  
<kweb-timeline />  
<kweb-... />  

...listening to events triggered by /play "reading the subtitles".

Flow example / User Experience / Use case

Somehow open(podcastFileURL.mp3) got called... There is a on the page that picks it up...
👤▶️ 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.

Pseudo code time!

<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: ... }