cketti / jitsi-hacks

Jitsi Hacks – Extending Jitsi Meet using injected scripts
https://jitsi-hacks.cketti.eu
Apache License 2.0
34 stars 4 forks source link

Reording video doesn't appear to modify the DOM? #8

Closed jacksongoode closed 3 years ago

jacksongoode commented 3 years ago

I was curious about implementing this script within a custom Meet instance. However, it seems that the script doesn't modify the order of the video objects. Is this the intended effect? I saw on the dragula site that it actually does seem to rearrange the DOM.

cketti commented 3 years ago

I hope the code makes it pretty obvious that keeping the DOM order was very much intended. I'm guessing you're more interested in the "why". One thing I remember is that video tiles for new participants are added before the local video tile (your video tile) in the DOM. That's not a great user experience if you are changing the DOM order and you have reordered your video tile to not be at the end. There might have been some other UI issues when changing the DOM order. I probably should have written this down :disappointed:

jacksongoode commented 3 years ago

Sorry, yes the "why". I have a listener to find the index of each participant's video to do some manipulation with the audio. Do you think it would be fine in removing the function to retain the old order in your script?

cketti commented 3 years ago

Just try it. I didn't like the user experience, but maybe it's fine for you. You could also change your code to either not use an index, but participant IDs, or to transform the display index to a DOM index (or vice versa). See https://github.com/cketti/jitsi-hacks/blob/412b49a038753752cc9d1773949657b68a65892b/docs/reorder.js#L53-L54