dascritch / cpu-audio

An audio WebComponent to provide timecoded links and other features to an audio tag
https://dascritch.github.io/cpu-audio/
GNU Lesser General Public License v3.0
24 stars 2 forks source link

Create persistent cpu-controller #87

Closed dascritch closed 3 years ago

dascritch commented 4 years ago

We have a player <cpu-audio> and a global controller <cpu-controller> webcomponents. Both works perfectly on static pages. But in a Single Page Application where we would browse among pages while listening to a sound, we may lose everything into the articles (so the players) and the <cpu-controller> will have nothing.

So we should modify internals so that i f a page has a <cpu-controller> :

Perhaps we should create a new webcomponent, a <cpu-persistent> ? The main problem is that a third-part javascript will lose access to the playing <audio> tag's API.

What would be the best scenario ?

dascritch commented 4 years ago

Or may be using node cloning ? https://developer.mozilla.org/fr/docs/Web/API/Node/cloneNode

dascritch commented 3 years ago

May be we just need a new attribute on <cpu-controller> : <cpu-controller persistent> ... Or estimate this controller will always be persistent, instead of <cpu-audio> may be removed at any moment ?

dascritch commented 3 years ago

Make some room to addPlane() on <audio> even from <Cpu-controller>

dascritch commented 3 years ago

It WON'T be optional, but mandatory : simpler code, simpler handling for the integrator. I've got an idea the re-tweak switchControllerTo()

dascritch commented 3 years ago

Playlist system musty be reworked. Or may be create an add-on for persistent playlist, instead of dom based playlist

dascritch commented 3 years ago

Playlist should have another structure, more in a kind of history playlist. If cpu-audio with ID not anymore in the DOM, if globalController, create a new audio with stored data, but we will have lot of issues due to source/tracks features.

Let's rethink that before writing