Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jacksongoode opened this issue Apr 14, 2021 · 3 comments
Closed

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

jacksongoode opened this issue Apr 14, 2021 · 3 comments

Comments

@jacksongoode
Copy link

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
Copy link
Owner

cketti commented Apr 14, 2021

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 😞

@jacksongoode
Copy link
Author

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
Copy link
Owner

cketti commented Apr 14, 2021

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

// Sort video tile elements by display order (CSS 'order' property)
const sortedTiles = videoTiles.slice().sort((a,b) => parseInt(a.style.order, 10) - parseInt(b.style.order, 10));

@cketti cketti closed this as completed Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants