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

Global parameters inserted via a tag in head host document #185

Closed dascritch closed 1 year ago

dascritch commented 1 year ago

To resolve some situations as changing default_document_cpu_parameters.js values or issue #181 , perhaps we may pass some parameters in the :host head , may be as a <script type="...json" data-related="cpu-audio"> ?

It may avoid some overheads and would be ideal for global parameters without having to mess directly in JS.

It can be done even for release 7.1

dascritch commented 1 year ago

It seems that the best way, according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script and https://html.spec.whatwg.org/multipage/scripting.html#the-script-element must be to declare it as a script JSON, and use something as data-cpu-audio to indicate that we use it.

The declaration should be :

<script type="application/json" data-cpu-audio>

I think I will work on it

dascritch commented 1 year ago

As it's done, now we can resolve :