pivid icon indicating copy to clipboard operation
pivid copied to clipboard

Support for changes on a single layer

Open pinballpower opened this issue 2 years ago • 4 comments

As far as I understand the current API only allows to replace the whole play script, but not a single layer while leaving the other layers intact.

For my applicatons, it's necessary to only change a single layer on the fly. I would propose the following functionality:

  1. Assign an ID to each layer
  2. Add an API endpoint that allows to only replace the part of the script for this layer - ideally seamless.

From my understanding of the architecture this means controlling a single "frame loader" which seems to be possible internally already.

I'm also happy to help with this when the basics of my external code are ready (first need to make sure Pivid works in general for my application).

pinballpower avatar May 22 '22 05:05 pinballpower

Is it difficult to just re-send the entire script (with the one layer changed)? Unless you have many hundreds of layers (in which case you'll have other problems!), parsing and replacing the script is very fast.

egnor avatar May 22 '22 05:05 egnor

I'm not sure how this will impact the running players. Would a looping video player just go on or would it start from the beginning of the file again? The idea is basically, to replace a single video without impacting the running playback of other layers.

pinballpower avatar May 22 '22 05:05 pinballpower

If the layer definition is the same, there should be zero impact, it should continue seamlessly without restarting or glitching. That's why everything uses absolute timestamps (possibly annoying as that is). That's the whole design, to be able to "slipstream" arbitrary changes in while media is playing.

egnor avatar May 22 '22 05:05 egnor

Ok, good to know. I'll try this first. I didn't yet dig into the timestamping stuff at all and didn't even check what's the meaning of all the parameters of a layer.

pinballpower avatar May 22 '22 05:05 pinballpower