Log 23 - 14/04/2022
Over the first week of the Easter break I spent way too much time trying to move the responsive grid system from the isolated vanilla JS application to React. I’ve run into so many issues with states and references trying to add the streams to the grid, should I use the native DOM elements created by the RTCMultiConnection lib, or create my own React video element and add my own video src? This means I need to store the streams as a stateful array as well as an array of refs, there’s probably a better approach to this but Ive spent too much time on this now (enough that I nearly considered ditching React and using vanilla JS a few times) and it works so it’s time to move on. I also as issues with reading and updating the cols and rows state values within the same useEffect hook, but I solved it by copying the state values to temp variables within the hook and only updating the sate if they differ to avoid recursion to maximum depth, but it was a pain to get working.
Prev | Next |